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 setErrorDisplay(Axes::Type axis, bool)
Sets the display of error bar, if applicable, on the specified axis.
void setRepColor(const Color &)
Sets the color of the data representation.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
virtual DataRep * clone()=0
The clone function returns an object of its own kind which is a copy of this object.
void addCut()
Adds a cut to the data representation.
The abstract base class for views.
bool isDirty() const
Return true if the data representation has changed is some way and it needs to be re-drawn...
virtual bool isImageConvertable() const
Returns true if the receiving object can be converted to an image.
The base class for the Projector hierarchy.
virtual void setSelected(bool yes=true)
Sets the data representation as selected.
virtual bool acceptFunction(int number)
Returns true if the DataRep accepts functions on number variables.
hippodraw::TupleCut class interface
virtual ProjectorBase * clone()=0
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual NTuple * getNTupleAfterCuts() const
Template for projectors that can return subsets of the NTuple used by the DataRep.
bool isAxisBinned(Axes::Type axis) const
Returns true if the specified axis is binned, otherwise returns false.
bool isErrorDisplayed(Axes::Type) const
Returns true if the error bars are being displayed.
virtual void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
virtual bool isSelected() const
Returns true if data representation is in selected state.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
void setCutRangeAt(const Range &range, unsigned int i)
Sets the Range of the TupleCut index by i.
const std::string & getTitle() const
Returns the the current title of the object.
Expresses a range of values.
NTuple * createNTuple() const
Returns a new NTuple representation of the receiving object.
Base class for DataSource.
virtual bool hasZoomY() const
Returns true if this DataRep has zoom feature on the Y axis.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual void setStyle(unsigned int style)
Sets the symbol of the representation.
const std::vector< TupleCut > & getCuts() const
Returns a reference to the cut list.
void setRepSize(double size)
Sets the size of the representation.
void toggleInverted(unsigned int i)
Changes state of inversion flag to be the opposite of its current state.
virtual double getRMS(const std::string &axis)
Returns the RMS.
The base class for the point representation hierarchy.
virtual void setSelected(bool yes=true)
Sets the representation to be selected if yes is true, otherwise set it to be deselected.
Range preferredRange(Axes::Type axis) const
Returns the preferred range to display the data.
virtual void normalizeTo(const DataRep *target)
Normalizes the receiving object to the target one.
void setEnabled(unsigned int i, bool yes=true)
Sets the TupleCut indexed by i to be enabled or not.
void removeCut()
Remove a region cut on the data representation.
PyArray_TYPES type(numeric::array arr)
virtual const Color & color() const
Returns the representation's color.
void set(Color::Value value)
Sets the Color of the PointRepBase object.
void drawCuts(TransformBase *transform, ViewBase *view)
Draws the cuts.
virtual bool yError() const
Returns true if the point representation displays error on the Y axis.
virtual bool hasNTupleBindings() const
Returns true if the DataRep's projector can bind to DataSource.
virtual RepBase * clone()=0
Returns a copy of the object.
virtual bool hasZeroRows()
Returns true if this DataRep has zero rows in its DataSource.
void setRange(Axes::Type axis, bool const_width=true)
Sets the range of the axis.
void setTitle(const std::string &title)
Sets the title.
virtual void setDirty(bool yes=true)
Sets the dirty flag.
RepBase * getCutRep()
Returns the point representation that draws the cuts.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
void setRange(const Range &range)
Sets the range of the cut.
DataRep()
The default constructor.
virtual bool isTargetable() const
Returns true if the receiving object is target-able.
A DataSource class implemented with std::vector<double> to store the column data. ...
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
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.
void setLabel(const std::string &label)
Sets the label for the cut.
A derived class of PointRepBase class that draws a representation of a cut range. ...
virtual Range preferredRange(Axes::Type) const
Returns the preferred Range.
virtual void drawProjectedValues(TransformBase *transform, ViewBase *view)
Draws the projected values.
The class expresses a cut on a DataSource, i.e.
void setAxisModel(Axes::Type axis, AxisModelBase *)
Sets the AxisModel for axis axis.
virtual void willDelete(const Observable *)
Notifies this Observer object that one of its Observable objects is about to be deleted.
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...
Value
A few common colors.
hippodraw::DataRep class interface.
std::string m_name
The name of the display as it might be displayed in a GUI.
intp size(numeric::array arr)
virtual NTuple * getNTupleAfterCuts() const
Returns the full NTuple but with the current set of cuts applied.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
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.
void setRepStyle(int style)
Sets the style type of the point representation.
virtual double getPosOn(Axes::Type) const =0
Returns the minimum positive value.
DataRep * m_parent_datarep
There are times when a given DataRep results from some operations performed on some other DataRep...
virtual void matrixTranspose(bool yes)
Transposes the X and Y axis.
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 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.
The base class for data representations.
RepBase * getRepresentation() const
Returns the representation used to draw the data points.
virtual void setParentDataRep(DataRep *parent_datarep)
Sets the parent DataRep.
void setColumn(unsigned int col)
Sets the column in the DataSource to be used.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
virtual bool isSelected() const
Returns true if representation is in selected state, otherwise returns false.
std::string m_title
The title of the object.
A Color class for creating the color object following the standard RGB color space.
CutRangeRep class interface.
CutRangeRep * m_cut_rep
The representation of the cut or highlighted range.
virtual void setSize(float value)
Sets the size of the representation.
hippodraw::NTuple class interface.
RepBase * m_rep
The representation used for drawing each data point in the view.
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.
bool hasCut() const
Returns true if the receiving object has one or more regional cuts.
const Color & getRepColor() const
Returns the color used for the representation.
hippodraw::ProjectorBase class interface.
virtual void setAxisBinding(const std::string &axis, const std::string &label)
Sets the axis binding.
virtual void setColor(const Color &)
Sets the color of the representation.
const Range & setBinWidth(Axes::Type axis, double width)
Sets the bin width, if binned, on specified axis to width.
virtual const DataSource * getProjectedValues() const
Returns an DataSource representation of the projected data.
virtual void setRange(Axes::Type axis, bool const_width=true)
Sets the range of the selected axis.
virtual bool hasErrorDisplay() const
Returns true if the data representation is capable of error display on the data values.
virtual void update()
Updates the data representation.
virtual bool xError() const
Returns true if the point representation displays error on the X axis.
virtual ~DataRep()
The destructor.
bool isDirty() const
Returns true if the projector has been marked dirty.
A transform that transforms coordinates from one coordinate system to another.
virtual bool isEmpty() const =0
Returns true if the data source used by this projector is empty.
virtual void setAxisBindings(const std::vector< std::string > &bindings)
Sets the axis bindings.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the data representation has specified axis type axis.
The AxisModelBase class maintains the Range and scaling of an axis.
virtual double getMean(const std::string &axis)
Returns the mean.
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.