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