13 #include "msdevstudio/MSconfig.h"
28 #ifdef ITERATOR_MEMBER_DEFECT
37 using namespace hippodraw;
39 ProjectorBase::ProjectorBase ()
53 m_x_axis ( p.m_x_axis ),
54 m_y_axis ( p.m_y_axis ),
55 m_z_axis ( p.m_z_axis )
97 const vector < string > &
102 static vector < string > dummy;
167 if ( range.
length() == 0.0 ) {
169 double low = range.
low ();
177 range.
setLow ( 0.9 * low );
181 range.
setLow ( 1.1 * low );
236 static Range range ( 0., 1. );
350 std::vector<double> & columnData)
const {
421 const std::vector <double> &
426 const std::vector <double> & oldzval = ds->
getColumn (2);
429 unsigned int x = shape[0];
430 unsigned int y = shape[1];
433 m_zval.resize ( x*y, 0.0 );
435 for (
unsigned int yy = 0; yy<y; yy++ )
436 for (
unsigned int xx = 0; xx<x; xx++ )
437 m_zval[yy*x+xx] = oldzval[xx*y+yy];
442 const std::vector < unsigned int> &
454 const std::vector <double> &
464 if ( bt-> aspectRatio() == 1.0 )
466 for (
unsigned int j = 0; j < 256; j++ )
467 for (
unsigned int i = 0;
i < 256;
i++ )
469 double x= static_cast <
double > (
i)-128;
470 double y= static_cast <
double > (j)-128;
491 for (
unsigned int j = 0; j < 180; j++ )
492 for (
unsigned int i = 0;
i < 360;
i++ )
494 double x= static_cast <
double > (
i)-180;
495 double y= static_cast <
double > (j)-90;
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual void update(const Observable *)
Implements the Observer pattern.
virtual void setNumberOfBins(Axes::Type axis, unsigned int number)
Sets the number of bins.
virtual NTuple * getNTupleAfterCuts() const
Template for projectors that can return subsets of the NTuple used by the DataRep.
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
const std::vector< unsigned int > & getShape()
Get the shape of the projected values.
virtual bool isImageConvertable() const
Returns true if the projected values can converted to an image.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual void notifyObservers() const
Notifies Observer objects of a change.
const std::vector< double > & getZValues()
Return all Z values.
virtual const DataSource * createOldStyleNTuple() const
A transform that transforms coordinates from one coordinate system to another.
virtual bool hasDataSourceBindings() const
Returns true if projector has binding to a DataSource.
std::vector< double > m_zval
Sorted Z values in this projector.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
virtual NTuple * createNTupleWith(const std::vector< TupleCut > &cut_list) const
Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do...
virtual void setMinEntries(int entries)
Set the minimum entries/bin.
virtual void setOffset(const std::string &axis, int parm, bool dragging)
Sets the bin offset.
column
The column indices for 2 dimension data point tuple.
virtual bool isValueBinned() const
Returns true if the projected values are the result of binning.
virtual double stdCoord() const
Returns the standard deviation of the coordinates along the X axis in the data set.
virtual double getRMS(Axes::Type axis)
Returns the RMS.
bool isDirty() const
Returns true if the projector has been marked dirty.
virtual double getZValue(double x, double y) const
Get the z value at the specified point (x,y).
void setLow(double x)
Sets the minimum of the range object.
std::vector< intptr_t > shape(numeric::array arr)
virtual void checkScaling()
Checks for scaling the display of the axis range.
virtual int getMinEntries()
Get the minimum entries/bin.
virtual const std::vector< std::string > & getAxisBindings() const
Returns the axis bindings.
virtual void normalizeTo(const ProjectorBase *target)
Sets the target of normalization.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual void setRange(Axes::Type axis, bool const_width=true)
Sets the range of the selected axis.
bool m_isDirty
Marks the object as dirty.
virtual double getBinWidth(Axes::Type axis) const
Returns the bin width of the axis.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
virtual void matrixTranspose(bool yes)
Transposes the X and Y axis.
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
virtual const std::vector< double > & getColumn(const std::string &name) const
Returns the data in the column with label name.
hippodraw::DataSource class interface.
virtual int indexOf(const std::string &label) const
Returns the index of the label.
void setHigh(double x)
Sets the maximum of the range object.
virtual const std::vector< unsigned int > & getShape() const
Returns the shape of the data elements.
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
hippodraw::BinaryTransform class interface
virtual ~ProjectorBase()
The virtual destructor.
virtual bool inverseTransform(double &x, double &y) const =0
Transform the transformed coordinates on X and Y axis back to the original true data space...
virtual const std::string & getZLabel() const
Finds the Z axis label of the plot.
virtual void setNormalizing(bool on)
Sets the scaling number of entries on if on is true, otherwise turns if off.
virtual Range dataRangeOn(Axes::Type) const =0
Returns the range of the raw data.
The AxisModelBase class maintains the Range and scaling of an axis.
double length() const
Returns the length of the range object.
virtual const Range & setBinWidth(Axes::Type axis, double width)
Sets the bin width.
hippodraw::ProjectorBase class interface.
const std::vector< std::string > & getPointReps() const
Return the vector of Point Reps.
virtual void fillColumnAfterCuts(const std::string &column, std::vector< double > &columnData) const
Fill the vector with values from named column with the present set of cuts applied.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
virtual double getAverage(Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual void reset()
Resets the bins.
A DataSource class implemented with std::vector<double> to store the column data. ...
virtual void addValues(const std::vector< double > &v)
Add values to the projection.
The base class for the Projector hierarchy.
const std::vector< double > & getZAfterTransform(TransformBase *transform)
Return Z values after binary transform.
virtual bool wantsScaleFactor(const std::string &axis) const
Returns whether the projector wants scale factor.
hippodraw::AxisModelBase class interface
DataSource * m_proj_values
The NTuple representing the result of the projection.
A concreate implementation of the FunctionHelper class.
virtual void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
A transform that transforms coordinates from one 2D coordinate system to another. ...
virtual void setAxisBindings(const std::vector< std::string > &bindings)
Sets the axis binding.
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
virtual double getOffset(Axes::Type axis) const
Returns the offset of the axis.
double low() const
Returns the minimum of the range object.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Get the AxisModel for axis axis.
Expresses a range of values.
std::vector< std::string > m_pointreps
Vector of acceptable PointReps.
virtual int getNumberOfBins(Axes::Type) const
Returns the number of bins.
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
ProjectorBase()
The default constructor.
ProjectorHelper class interface.
virtual void setAxisBinding(const std::string &axis, const std::string &label)
Sets the axis binding.
std::string m_z_label
Dummy member so that getZLabel can return a reference.
Base class for DataSource.