XyPlotter.h
Go to the documentation of this file.
1 /* -*- mode: c++; -*- */
2 
14 #ifndef _XyPlotter_H_
15 #define _XyPlotter_H_
16 
17 #include "PlotterBase.h"
18 
19 namespace hippodraw {
20 
21 class AxisRepBase;
22 class CompositePlotter;
23 
45 {
46 private:
47 
49  double m_margin_top;
51  double m_margin_left;
52  double m_margin_z;
53 
54 
58  typedef std::vector < CompositePlotter * > PlotterList_t;
59 
64 
68 
72 
76  std::vector < unsigned int > m_hammer_shape;
77  std::vector < unsigned int > m_lambert_shape;
78 
82  void checkAutoScale ();
83 
87  void prepareToDraw ();
88 
93 
94 
95 protected:
96 
100 
105 
108  double m_z_ratio;
109 
112  TupleCut * getCutAt ( unsigned int i );
113 
114 public:
115 
117  XyPlotter ( const std::string & name = "XyPlotter" );
118 
120  XyPlotter ( const XyPlotter & plotter );
121 
123  virtual ~XyPlotter ();
124 
127  PlotterBase * clone();
128 
129 
132  virtual void setEnableZ ( bool yes = true );
133 
134  virtual void drawIn ( ViewBase * view );
135 
140  virtual void drawCrossHairs ( ViewBase * view );
141 
142  virtual NTuple * createNTuple () const;
143 
146  virtual bool wantsPixmap ( ) const;
147 
151  void setLabelFont( FontBase* font, Axes::Type axes );
152 
157  virtual FontBase* labelFont ( Axes::Type axes ) const;
158 
160  void setTitleFont( FontBase* font );
161 
165  virtual const FontBase * titleFont ( ) const;
166 
173  virtual void setActivePlot ( int index, bool redraw );
174 
177  virtual int activePlotIndex () const;
178 
182  virtual void addDataRep ( DataRep * rep );
183 
188  virtual void addDataRepStacked ( DataRep * rep );
189 
192  virtual void removeDataRep ( DataRep * rep );
193 
199  virtual void autoScale ( );
200 
205  virtual void setValueRep ( BinToColor * rep );
206 
210  virtual void setAutoRanging ( bool flag );
211 
216  virtual void setAutoRanging ( Axes::Type axis, bool flag );
217 
220  virtual void setReverse ( bool flag );
221 
224  virtual void setShowGrid ( bool flag );
225 
228  virtual bool getShowGrid ();
229 
232  virtual void setBoxEdge(bool flag);
233 
236  virtual bool getBoxEdge();
237 
240  virtual void setTransform ( TransformBase * );
241 
244  virtual void setFitsTransform ( const std::string & );
245 
258  virtual NTuple * createPickTuple ();
259 
274  virtual void fillPickedPointFrom ( double mx, double my,
275  std::vector < double > & picked ) const;
276 
279  virtual void setLowRange ( Axes::Type axis, int parm,
280  bool dragging );
281 
284  virtual void setHighRange ( Axes::Type axis, int parm,
285  bool dragging );
286 
289  virtual void setScaling ( Axes::Type axis, bool on = true );
290 
297  virtual double getAspectRatio () const;
298 
299  virtual void update ();
300 
304  virtual void setRepresentation ( RepBase * pointrep );
305 
308  virtual RepBase * representation ( ) const;
309 
313  virtual AxisModelBase * getAxisModel ( Axes::Type axis ) const;
314 
318  virtual void setAxisModel ( AxisModelBase * , Axes::Type );
319 
322  virtual void setErrorDisplay ( Axes::Type axis, bool );
323 
326  virtual bool errorDisplay ( Axes::Type axis ) const;
327 
330  virtual void setRepColor ( const Color & );
331 
334  virtual const Color & repColor () const;
335 
341  virtual void drawProjValues ( ViewBase * view );
342 
345  bool hasAutoScaled () const;
346 
350  virtual bool hasNTupleBindings () const;
351 
355  virtual bool hasZoomY () const;
356 
359  virtual void checkAxisScaling ();
360 
363  virtual ProjectorBase * getProjector ( int i ) const;
364 
367  virtual ProjectorBase * activeProjector () const;
368 
371  virtual DataRep * getDataRep ( int index ) const;
372 
375  virtual DataRep * getTarget ( ) const;
376 
379  bool isTargetable () const;
380 
384  virtual int getNumDataReps () const;
385 
388  virtual int indexOf ( const DataRep * ) const;
389 
392  virtual double getBinWidth ( Axes::Type ) const;
393 
398  virtual void setBinWidth ( Axes::Type axis, double width );
399 
401  virtual void reset ( );
402 
407  virtual const Range & getRange ( Axes::Type axis,
408  bool scaled ) const;
409 
412  virtual double getPosRange ( Axes::Type axis ) const;
413 
417  virtual double getOffset (Axes::Type axis) const;
418 
421  virtual TransformBase * getTransform () const;
422 
425  virtual TransformBase * getFitsTransform () const;
426 
432  virtual void addValues ( const std::vector < double > & v );
433 
434  virtual const std::string &
435  getInternalLabel ( Axes::Type axis ) const;
436 
439  virtual const std::string & getLabel ( Axes::Type ) const;
440 
443  virtual void setLabel ( Axes::Type, const std::string & value );
444 
447  virtual int getNumberOfEntries () const;
448 
451  virtual bool hasAxis ( Axes::Type axis ) const;
452 
457  virtual const BinToColor * getValueRep () const;
458 
462  virtual bool isAutoRanging ( Axes::Type axis ) const;
463 
466  virtual bool isReverse ( ) const;
467 
472  virtual void matrixTranspose ( bool yes );
473 
477  virtual DataRep * selectedDataRep () const;
478 
481  virtual void setAutoTicks ( Axes::Type axis, bool yes );
482 
485  virtual void setTicks ( Axes::Type axis,
486  const std::vector < AxisTick > & ticks );
487 
492  virtual void setNumberOfBins ( Axes::Type axis,
493  unsigned int number );
494 
499  virtual void setOffset ( Axes::Type axis, double offset );
500 
511  virtual void setRange ( Axes::Type axis, const Range & range,
512  bool scaled = false, bool adjust_width = true );
513 
517  void fillCutList ( std::vector < const TupleCut * > & cuts ) const;
518 
521  virtual void setCutRangeAt ( const Range & range, unsigned int i );
522 
526  virtual Range getCutRange ();
527 
530  virtual void setCutInverted ( unsigned int i, bool yes = true );
531 
534  virtual void setCutEnabled ( unsigned int i, bool yes = true );
535 
536 
537  const std::vector <double> & getZValues();
538  const std::vector <unsigned int> & getShape();
539 
541  virtual bool getCutInversion ();
542 
545  virtual void setMinEntries( int entries );
546 
549  virtual int getMinEntries ();
550 
553  virtual void setNeedUpdate(bool isChanged);
554 
559  virtual bool isImageConvertable () const;
560 
562  virtual void setTopMargin( double top );
563  virtual void setBottomMargin( double bottom );
564  virtual void setLeftMargin( double left );
565  virtual void setZMargin( double z );
566 
567  virtual double getTopMargin();
568  virtual double getBottomMargin();
569  virtual double getLeftMargin();
570  virtual double getZMargin();
571 
574  virtual void setScaleFactor ( Axes::Type axis, double factor );
575 
578  virtual double getScaleFactor ( Axes::Type axis ) const;
579 
582  virtual bool isAxisScaled ( Axes::Type axis ) const;
583 
584 };
585 
586 } // namespace hippodraw
587 
588 #endif // _XyPlotter_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
unsigned int i
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
Definition: XyPlotter.h:44
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
The base class for the value to the color transformation.
Definition: BinToColor.h:30
double m_margin_bottom
Definition: XyPlotter.h:50
AxisRepBase * m_axis_rep
The axes model graphical representation.
Definition: XyPlotter.h:104
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43
return rep
Definition: Inspector.cxx:3843
std::vector< CompositePlotter * > PlotterList_t
The type of standard C++ container to hold CompositePlotter objects.
Definition: XyPlotter.h:58
std::vector< unsigned int > m_hammer_shape
Default shape for XyPlotter is 360*180 or 256*256.
Definition: XyPlotter.h:76
std::vector< unsigned int > m_lambert_shape
Definition: XyPlotter.h:77
double m_margin_top
Additional margin set by user in the plotter.
Definition: XyPlotter.h:49
bool m_need_update
Flag to indicat that the drawrect and marginrect need to be updated.
Definition: XyPlotter.h:92
return yes
Definition: CanvasView.cxx:883
A abstract base class for font handling.
Definition: FontBase.h:32
A Color class for creating the color object following the standard RGB color space.
Definition: Color.h:37
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
The base class for data representations.
Definition: DataRep.h:68
CompositePlotter * m_plotter
The currently active plotter that draws the data points.
Definition: XyPlotter.h:99
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
ViewBase * v
Definition: PlotTable.cxx:104
The AxisModelBase class maintains the Range and scaling of an axis.
Definition: AxisModelBase.h:33
The base class for the axis representation hierarchy.
Definition: AxisRepBase.h:49
A DataSource class implemented with std::vector&lt;double&gt; to store the column data. ...
Definition: NTuple.h:33
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
The abstract base class for views.
Definition: ViewBase.h:62
bool view_change_allowed
Flag to indicate if the view size of the plot can be changed.
Definition: XyPlotter.h:71
int m_active_index
Index to the active plotter.
Definition: XyPlotter.h:67
Expresses a range of values.
Definition: Range.h:33
return index
Definition: PickTable.cxx:182
PlotterList_t m_plotters
The list of CompositePlotter objects contained by this plotter.
Definition: XyPlotter.h:63
Type
Axes constants.
Definition: AxesType.h:31
The base class for the point representation hierarchy.
Definition: RepBase.h:45
double m_z_ratio
The conversion ratio from the user coordinate system to the view&#39;s coordinate system along the color ...
Definition: XyPlotter.h:108
hippodraw::PlotterBase class interface.
A class for containing one or more DataRep objects in a single composite plot.

Generated for HippoDraw Class Library by doxygen