14 #include "msdevstudio/MSconfig.h"
32 using namespace hippodraw;
38 m_parent_datarep ( 0 ),
46 m_name ( rep.m_name ),
47 m_title ( rep.m_title ),
103 const std::string & label )
190 m_rep -> setErrorOn ( axis, flag );
221 bool yes_x =
m_rep -> xError ();
222 bool yes_y =
m_rep -> yError ();
223 color =
m_rep -> getColor ();
226 rep -> setErrorOn (
Axes::X, yes_x );
227 rep -> setErrorOn (
Axes::Y, yes_y );
230 m_rep -> setColor ( color );
243 const Color color ( value );
244 m_rep -> setColor ( color );
338 std::vector<double> & columnData)
const {
348 return m_projector -> createNTupleWith ( cut_list );
491 const string & label = projector -> getXLabel ();
494 int index = projector -> indexOf ( label );
497 const Range & range = projector -> getRange (
Axes::X );
503 const vector < TupleCut > &
523 string what (
"DataRep::setCutRange: index out of range." );
524 throw std::out_of_range ( what );
void setTitle(const std::string &title)
Sets the title.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual NTuple * getNTupleAfterCuts() const
Template for projectors that can return subsets of the NTuple used by the DataRep.
const std::vector< TupleCut > & getCuts() const
Returns a reference to the cut list.
void setRepSize(double size)
Sets the size of the representation.
std::string m_name
The name of the display as it might be displayed in a GUI.
const Color & getRepColor() const
Returns the color used for the representation.
DataRep()
The default constructor.
virtual bool isTargetable() const
Returns true if the receiving object is target-able.
virtual void setAxisBinding(const std::string &axis, const std::string &label)
Sets the axis binding.
DataRep * m_parent_datarep
There are times when a given DataRep results from some operations performed on some other DataRep...
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual bool needsMatrixSet() const
Returns true if this data representation needs an XY matrix parameters to be set in order to display ...
virtual DataRep * getParentDataRep() const
Gets the parent DataRep.
void setEnabled(unsigned int i, bool yes=true)
Sets the TupleCut indexed by i to be enabled or not.
virtual void update()
Updates the data representation.
A transform that transforms coordinates from one coordinate system to another.
A derived class of PointRepBase class that draws a representation of a cut range. ...
virtual RepBase * clone()=0
Returns a copy of the object.
virtual void setAxisBindings(const std::vector< std::string > &bindings)
Sets the axis bindings.
const std::string & name() const
Returns the name of the display.
double getPosRange(Axes::Type axis)
Returns the smallest positive number from in the range of the data.
NTuple * createNTupleUnderRegion() const
Returns a NTuple that is a copy of the projector's DataSource with rows not passing region cuts remov...
RepBase * getCutRep()
Returns the point representation that draws the cuts.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
virtual void setPointRep(RepBase *pointrep)
Sets the representation of the data points.
int getNumberOfEntries() const
Returns the number of entries used for the DataRep object.
void setErrorDisplay(Axes::Type axis, bool)
Sets the display of error bar, if applicable, on the specified axis.
virtual NTuple * getNTupleAfterCuts() const
Returns the full NTuple but with the current set of cuts applied.
void setRange(const Range &range)
Sets the range of the cut.
virtual bool isEmpty() const =0
Returns true if the data source used by this projector is empty.
hippodraw::DataRep class interface.
virtual void setSelected(bool yes=true)
Sets the representation to be selected if yes is true, otherwise set it to be deselected.
column
The column indices for 2 dimension data point tuple.
virtual void addValues(const std::vector< double > &v)
Add the data values to the DataRep.
virtual void setSelected(bool yes=true)
Sets the data representation as selected.
virtual void willDelete(const Observable *)
Notifies this Observer object that one of its Observable objects is about to be deleted.
virtual ~DataRep()
The destructor.
bool isDirty() const
Returns true if the projector has been marked dirty.
void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
bool isErrorDisplayed(Axes::Type) const
Returns true if the error bars are being displayed.
The class expresses a cut on a DataSource, i.e.
Value
A few common colors.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
RepBase * m_rep
The representation used for drawing each data point in the view.
virtual void setRange(Axes::Type axis, bool const_width=true)
Sets the range of the selected axis.
void throwRangeException()
Throws exception with message saying argument is out of range.
virtual bool needColorRep() const
Determines if extra space is needed for a color rep.
NTuple * createNTuple() const
Returns a new NTuple representation of the receiving object.
virtual bool yError() const
Returns true if the point representation displays error on the Y axis.
A Color class for creating the color object following the standard RGB color space.
void setRepStyle(int style)
Sets the style type of the point representation.
hippodraw::NTuple class interface.
virtual const DataSource * getProjectedValues() const
Returns an DataSource representation of the projected data.
bool isDirty() const
Return true if the data representation has changed is some way and it needs to be re-drawn...
virtual void setStyle(unsigned int style)
Sets the symbol of the representation.
virtual bool hasErrorDisplay() const
Returns true if the data representation is capable of error display on the data values.
PyArray_TYPES type(numeric::array arr)
The base class for data representations.
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
void toggleInverted(unsigned int i)
Changes state of inversion flag to be the opposite of its current state.
std::string m_title
The title of the object.
virtual bool isSelected() const
Returns true if data representation is in selected state.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the data representation has specified axis type axis.
virtual double getMean(const std::string &axis)
Returns the mean.
intp size(numeric::array arr)
virtual void normalizeTo(const DataRep *target)
Normalizes the receiving object to the target one.
CutRangeRep * m_cut_rep
The representation of the cut or highlighted range.
virtual ProjectorBase * clone()=0
The clone function returns an object of its own kind which is a copy of this object at this moment...
void setCutRangeAt(const Range &range, unsigned int i)
Sets the Range of the TupleCut index by i.
virtual void setSize(float value)
Sets the size of the representation.
const std::string & getTitle() const
Returns the the current title of the object.
virtual const Color & color() const
Returns the representation's color.
The AxisModelBase class maintains the Range and scaling of an axis.
bool hasCut() const
Returns true if the receiving object has one or more regional cuts.
void drawCuts(TransformBase *transform, ViewBase *view)
Draws the cuts.
virtual bool hasNTupleBindings() const
Returns true if the DataRep's projector can bind to DataSource.
virtual DataRep * clone()=0
The clone function returns an object of its own kind which is a copy of this object.
virtual void setColor(const Color &)
Sets the color of the representation.
hippodraw::ProjectorBase class interface.
const Range & setBinWidth(Axes::Type axis, double width)
Sets the bin width, if binned, on specified axis to width.
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 bool acceptFunction(int number)
Returns true if the DataRep accepts functions on number variables.
A DataSource class implemented with std::vector<double> to store the column data. ...
The base class for the Projector hierarchy.
The abstract base class for views.
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
hippodraw::TupleCut class interface
virtual void fillColumnAfterCuts(const std::string &column, std::vector< double > &columnData) const
Fills a vector with named column data with the current set of cuts applied.
Range preferredRange(Axes::Type axis) const
Returns the preferred range to display the data.
virtual void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
void removeCut()
Remove a region cut on the data representation.
virtual void drawProjectedValues(TransformBase *transform, ViewBase *view)
Draws the projected values.
void setRepColor(const Color &)
Sets the color of the data representation.
virtual bool isSelected() const
Returns true if representation is in selected state, otherwise returns false.
virtual bool hasZeroRows()
Returns true if this DataRep has zero rows in its DataSource.
virtual bool hasZoomY() const
Returns true if this DataRep has zoom feature on the Y axis.
void addCut()
Adds a cut to the data representation.
virtual void setDirty(bool yes=true)
Sets the dirty flag.
Expresses a range of values.
virtual bool isImageConvertable() const
Returns true if the receiving object can be converted to an image.
virtual bool xError() const
Returns true if the point representation displays error on the X axis.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
virtual double getRMS(const std::string &axis)
Returns the RMS.
bool isAxisBinned(Axes::Type axis) const
Returns true if the specified axis is binned, otherwise returns false.
void setLabel(const std::string &label)
Sets the label for the cut.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
virtual void matrixTranspose(bool yes)
Transposes the X and Y axis.
virtual double getPosOn(Axes::Type) const =0
Returns the minimum positive value.
The base class for the point representation hierarchy.
void set(Color::Value value)
Sets the Color of the PointRepBase object.
RepBase * getRepresentation() const
Returns the representation used to draw the data points.
CutRangeRep class interface.
virtual void setParentDataRep(DataRep *parent_datarep)
Sets the parent DataRep.
void setColumn(unsigned int col)
Sets the column in the DataSource to be used.
Base class for DataSource.
void setRange(Axes::Type axis, bool const_width=true)
Sets the range of the axis.