13 #include "msdevstudio/MSconfig.h"
35 #ifdef ITERATOR_MEMBER_DEFECT
45 XyPlotter::XyPlotter (
const std::string & name )
94 PlotterList_t ::iterator first =
m_plotters.begin();
115 for ( PlotterList_t::size_type i = 0; i <
size; i++ ) {
124 model -> setEmpty ();
125 for ( PlotterList_t::size_type i = 0; i <
size; i++ ) {
133 plotter -> setAutoScaled (
true );
146 for ( PlotterList_t::size_type i = 0; i <
size; i++ ) {
196 ntuple -> setLabelAt ( label_x, 0 );
199 ntuple -> setLabelAt ( label_y, 1 );
201 ntuple -> setLabelAt ( label_z, 2 );
205 const string & label_y = projector -> getYLabel (
true );
206 ntuple -> setLabelAt ( label_y, 1 );
277 PlotterList_t::iterator first =
m_plotters.begin();
351 PlotterList_t::iterator ip =
m_plotters.begin();
411 for ( PlotterList_t::size_type i = 0; i <
m_plotters.size(); i ++ ) {
425 string name (
"Pick table for " );
428 ntuple -> setName ( name );
437 std::vector < double > & picked )
const
439 m_plotter -> fillPickedPoint ( mx, my, picked );
445 int parm,
bool dragging )
454 int parm,
bool dragging )
474 if ( ratio == 0.0 ) {
475 for ( PlotterList_t::size_type i = 0; i <
size; i++ ) {
550 if ( index < 0 ) index = 0;
553 return rep -> getRepColor ();
560 PlotterList_t::iterator first =
m_plotters.begin();
583 for (
unsigned int i = 0; i <
m_plotters.size () ; i++ )
625 PlotterList_t::const_iterator first =
m_plotters.begin ();
649 PlotterList_t::const_iterator first =
m_plotters.begin();
653 for (
int i = 0; i < number; i++ ) {
660 if ( rep != 0 )
break;
672 PlotterList_t::const_iterator first =
m_plotters.begin();
695 PlotterList_t::const_iterator first =
m_plotters.begin();
699 for (
int i = 0; i < number; i++ ) {
715 PlotterList_t::const_iterator first =
m_plotters.begin ();
719 int i = plotter ->
indexOf ( rep );
744 PlotterList_t::iterator first =
m_plotters.begin ();
755 setRange ( axis, cur_range,
false,
false );
776 bool scaled,
bool adjust_width )
843 PlotterList_t::const_iterator first =
m_plotters.begin ();
847 yes |= plotter ->
hasAxis ( axis );
921 PlotterList_t::const_iterator first =
m_plotters.begin();
932 vector < const TupleCut * > cuts;
970 cut -> setInversion ( yes );
983 cut -> setEnabled ( yes );
991 const std::vector <double> &
1003 return ( proj -> getZAfterTransform (transform) );
1014 const std::vector < unsigned int > &
1025 if ( bt -> isPeriodic() )
1039 return cut-> getInversion ();
void fillCutList(std::vector< const TupleCut * > &cuts) const
Fills the cuts vector with the TupleCuts contained by the DataRep objects.
virtual void setHighRange(Axes::Type axis, int parm, bool dragging)
Sets the high end of the Range of data displayed.
virtual void setTopMargin(double top)
Set and get additional margin on top,bottom,left of the plotter.
bool view_change_allowed
Flag to indicate if the view size of the plot can be changed.
virtual bool hasZoomY() const
Returns true if the plotter has zoom feature on the Y axis otherwise it returns false.
The class for the 2D axes drawing with color.
virtual ProjectorBase * activeProjector() const
Returns the active projector.
The base class for the PlotterBase hierarchy.
const std::string & getTitle() const
Gets the title to be displayed.
virtual int activePlotIndex() const
Returns the index of the active DataRep object.
virtual bool getShowGrid()
Gets the show-grid flag to update Inspector.
virtual bool getCutInversion()
Get the inversion state of the cut.
virtual void setNeedUpdate(bool isChanged)
Set the m_need_update flag, called by inspector.
virtual void setCutEnabled(unsigned int i, bool yes=true)
Sets the TupleCut object index by i to be enabled.
virtual RepBase * representation() const
Returns the representation used by the plotter.
virtual NTuple * createNTuple() const
Creates an DataSource representation of the plotted data.
virtual void setTicks(Axes::Type axis, const std::vector< AxisTick > &ticks)
Sets the ticks for the specified axis.
virtual double getOffset(Axes::Type axis) const
Returns the offset on designated axis, similarly to getBinWidth.
The base class for the point representation hierarchy.
A class for containing one or more DataRep objects in a single composite plot.
virtual void setScaleFactor(Axes::Type axis, double factor)
Sets a scale factor on specified axis.
const std::vector< unsigned int > & getShape()
virtual double getZMargin()
hippodraw::ViewBase class interface
virtual void setAxisModel(AxisModelBase *, Axes::Type)
Sets the AxisModel on the specified axis.
hippodraw::CompositePlotter class interface
virtual void fillPickedPointFrom(double mx, double my, std::vector< double > &picked) const
Fills the picked data point.
hippodraw::RepBase class interface
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
void setTitleFont(FontBase *font)
Set the font to be used to override the default while drawing title.
virtual double getScaleFactor(Axes::Type axis) const
Returns the scale factor on the specified axis.
virtual void setCutInverted(unsigned int i, bool yes=true)
Sets the TupleCut object indexed by i to be inverted.
A abstract base class for font handling.
virtual void setActivePlot(int index, bool redraw)
Sets the active plot.
virtual void setBottomMargin(double bottom)
virtual void addDataRepStacked(DataRep *rep)
Adds the DataRep object to the plotter.
virtual double getAspectRatio() const
Returns the aspect ratio.
virtual bool getBoxEdge()
Gets the box edge status to update the inspector.
virtual bool isAutoRanging(Axes::Type axis) const
Returns true if auto-ranging is enabled, otherwise returns false.
virtual const std::string & getInternalLabel(Axes::Type axis) const
Returns the internal label.
virtual void setRepresentation(RepBase *pointrep)
Sets the representation.
hippodraw::AxisRepColor class interface
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
hippodraw::AxisModelBase class interface
virtual void setRepColor(const Color &)
Sets the representation's color.
virtual bool errorDisplay(Axes::Type axis) const
Returns the state of error bar display on specified axis.
virtual ProjectorBase * getProjector(int i) const
Returns the i-th projector.
TupleCut * getCutAt(unsigned int i)
Returns the TupleCut object at position i.
virtual const BinToColor * getValueRep() const
Returns the value to color representation.
virtual FontBase * labelFont(Axes::Type axes) const
What font is being used to override the default while drawing axis label.
The base class for the value to the color transformation.
virtual void reset()
Resets the bins.
virtual void drawCrossHairs(ViewBase *view)
Draws cross-hairs.
virtual void setTransform(TransformBase *)
Sets the transform object and redraws.
virtual void setScaling(Axes::Type axis, bool on=true)
Sets the scaling attribute of the AxisModelBase object.
hippodraw::XyPlotter class interface
virtual TransformBase * getFitsTransform() const
Returns the fits transform object.
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
virtual void matrixTranspose(bool yes)
Transpose the X and Y axis of matrix representation.
void setTitle(const std::string &title)
Sets the title to be displayed.
A transform that transforms coordinates from one coordinate system to another.
virtual void drawTitle(ViewBase &view, const std::string &title)
Draws the title.
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual DataRep * getDataRep(int index) const
Returns the DataRep object at index.
virtual void setNumberOfBins(Axes::Type axis, unsigned int number)
Sets the number of bins.
void checkAutoScale()
Checks if auto scaling is required and does an auto scale on contained plotters as needed...
virtual void setCutRangeAt(const Range &range, unsigned int i)
Sets the Range of the TupleCut object indexed by i.
virtual void setLowRange(Axes::Type axis, int parm, bool dragging)
Sets the low end of the Range of data displayed.
virtual void checkAxisScaling()
Check if Axis needs to be scaled or not.
virtual void setLeftMargin(double left)
void prepareToDraw()
Prepares for drawing.
virtual void setZMargin(double z)
virtual double getTopMargin()
A DataSource class implemented with std::vector to store the column data. ...
virtual TransformBase * getTransform() const
Returns the transform object used by the plotter.
virtual int indexOf(const DataRep *) const
Returns the index of the selected DataRep object.
intp size(numeric::array arr)
void setUnion(const Range &range)
Forms the union with the range range.
virtual void setBoxEdge(bool flag)
Sets the box-edge flag to flag.
virtual double aspectRatio() const
Returns the aspect ratio.
virtual void setLabel(Axes::Type, const std::string &value)
Sets the label of the specified axis to value.
int m_active_index
Index to the active plotter.
const std::vector< double > & getZValues()
Returns all Z values.
virtual void updateDrawRect()
Update the drawing Rectangle in the devices coordinate system.
virtual const std::string & getLabel(Axes::Type) const
Returns the label for the specified axis.
virtual void drawCrossHairs(double x, double y, TransformBase &transform, ViewBase &view)
Draws the cross hairs after transformation.
AxisRepBase * m_axis_rep
The axes model graphical representation.
virtual void setAutoTicks(Axes::Type axis, bool yes)
Sets automatic generation of axis ticks.
virtual ~XyPlotter()
The destructor.
virtual bool isAxisScaled(Axes::Type axis) const
Returns true if specified axis is being scaled.
A transform that transforms coordinates from one 2D coordinate system to another. ...
hippodraw::AxisRep2D class interface
hippodraw::NTuple class interface.
virtual void setShowGrid(bool flag)
Sets the show-grid flag to flag.
PyArray_TYPES type(numeric::array arr)
virtual void setReverse(bool flag)
Sets the reverse status for the X axis to flag.
virtual double getPosRange(Axes::Type axis) const
Returns the smallest positive number from the data.
const std::string & name() const
Returns the name of the plotter.
Rect m_raw_rect
The raw rectangle before transform.
std::vector< unsigned int > m_hammer_shape
Default shape for XyPlotter is 360*180 or 256*256.
A Color class for creating the color object following the standard RGB color space.
virtual void setBinWidth(Axes::Type axis, double width)
Sets the bin width.
virtual void drawIn(ViewBase *view)
Starts the drawing in view view.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the plotter has an axis of specified type.
virtual DataRep * getTarget() const
Returns the selected DataRep.
The class for the 2D axes drawing.
virtual void setMinEntries(int entries)
Set the minimum entries/bin.
virtual bool getBoxEdge()
Gets the box edge flag to update Inspector.
virtual void setErrorDisplay(Axes::Type axis, bool)
Sets the display of the error bars on or off.
void beginPlot(ViewBase &view)
Every class which draws has its beginPlot function.
void setLabelFont(FontBase *font, Axes::Type axes)
Set the font to be used to override the default while drawing axis label.
virtual void setEnableZ(bool yes=true)
Sets the display of the Z axis on.
virtual DataRep * selectedDataRep() const
Returns the selected DataRep.
double m_aspect_ratio
The aspect ratio.
PlotterBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual void removeDataRep(DataRep *rep)
Removes the DataRep object from the plotter.
virtual bool wantsPixmap() const
Returns true.
virtual NTuple * createPickTuple()
Creates a NTuple for a PickTable.
double m_margin_top
Additional margin set by user in the plotter.
virtual double getBottomMargin()
bool isTargetable() const
Returns true if receiving object is target-able.
virtual void setValueRep(BinToColor *rep)
Sets the object that will do the value to color transform, if any.
virtual void autoScale()
Sets the Range on each axis that has the auto range flag set to include all the data.
virtual bool isImageConvertable() const
Returns true if contents of the plotter is convertable to an image.
bool isPeriodic() const
Sets whether this transform is periodic.
virtual void addValues(const std::vector< double > &v)
Adds data values to the plot.
double m_crossX
The x position of the cross hair.
virtual const FontBase * titleFont() const
What font is being used to override the default while drawing title of plot.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained by the plotter.
Rect m_user_rect
The abstract data space.
The base class for data representations.
hippodraw::DataRep class interface.
void addObserver(Observer *)
Adds an Observer to the Observer list.
hippodraw::TupleCut class interface
virtual bool isReverse() const
Returns true if reverse is enabled, otherwise returns false.
virtual double getBinWidth(Axes::Type) const
Returns the bins with of the target DataRep object.
bool hasAutoScaled() const
Returns true if the axes have already been auto-scaled.
std::vector< unsigned int > m_lambert_shape
virtual bool hasNTupleBindings() const
Returns true if the selected DataRep object has bindings to a DataSource, otherwise returns false...
hippodraw::PeriodicBinaryTransform class interface
CompositePlotter * m_plotter
The currently active plotter that draws the data points.
The AxisModelBase class maintains the Range and scaling of an axis.
double m_crossY
The y position of the cross hair.
virtual double getLeftMargin()
virtual int getMinEntries()
Get the minimum entries/bin.
virtual void addDataRep(DataRep *rep)
Adds the DataRep object to the plotter.
virtual void update()
Updates the plotter.
virtual int getNumberOfEntries() const
Returns the number of entries in the contained DataRep.
virtual Range getCutRange()
Gets the object of current XyPlotter is a TupleCut object, get the range of it.
The class expresses a cut on a DataSource, i.e.
PlotterList_t m_plotters
The list of CompositePlotter objects contained by this plotter.
XyPlotter(const std::string &name="XyPlotter")
The default constructor.
virtual void setFitsTransform(const std::string &)
Sets the fits transform object.
bool m_need_update
Flag to indicat that the drawrect and marginrect need to be updated.
virtual void setAutoRanging(bool flag)
Sets the auto-ranging status for all axes to flag.
virtual const Color & repColor() const
Returns the color used for the representation.
virtual void drawProjValues(ViewBase *view)
Draws the projected values.
Expresses a range of values.
The base class for the Projector hierarchy.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Returns the AxisModelBase derived class for the specified axis.
std::string m_title
The main label; the title of the plot.
virtual void setOffset(Axes::Type axis, double offset)
Sets the offset.
hippodraw::ProjectorBase class interface.
The abstract base class for views.