PlotterBase.cxx
Go to the documentation of this file.
1 
12 // for truncation warning in debug mode
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "PlotterBase.h"
18 #include "PlotterException.h"
19 
20 #include "axes/AxisTick.h"
21 #include "datareps/DataRep.h"
23 #include "pattern/string_convert.h"
24 
25 using namespace hippodraw;
26 
27 using std::string;
28 using std::vector;
29 
31 
34  : m_aspect_ratio ( 0.0 ),
35  m_name ( "" ),
36  m_title( "%t" ),
37  m_crossX ( 0 ),
38  m_crossY ( 0 ),
39  m_parent_plotter( 0 ),
40  m_parent_datarep_index( -1 )
41 
42 {
43  current_range_saved = false;
44  setPlotterId();
45 }
46 
48 PlotterBase ( const std::string & name )
49  : m_aspect_ratio ( 0.0 ),
50  m_name ( name ),
51  m_title( "%t" ),
52  m_crossX ( 0 ),
53  m_crossY ( 0 ),
54  m_parent_plotter( 0 ),
55  m_parent_datarep_index( -1 )
56 
57 {
58  current_range_saved = false;
59  setPlotterId();
60 }
61 
63  : Observer (),
64  Observable (),
65  m_aspect_ratio ( plotter.m_aspect_ratio ),
66  m_name ( plotter.m_name ),
67  m_title( plotter.m_title ),
68  m_parent_plotter( plotter.m_parent_plotter ),
69  m_parent_datarep_index( plotter.m_parent_datarep_index ),
70  m_views( plotter.m_views ),
71  m_currentView( plotter.m_currentView )
72 
73 {
74  current_range_saved = false;
75  setPlotterId();
76 }
77 
79 {
81 }
82 
83 const string & PlotterBase::name () const
84 {
85  return m_name;
86 }
87 
88 /* virtual */
90 {
91  notifyObservers ();
92 }
93 
94 void
97 {
98  // does nothing
99 }
100 
101 bool
104 {
105  return false;
106 }
107 
108 bool
110 hasZoomY ( ) const
111 {
112  return true;
113 }
114 
115 
119 {
120  return 0;
121 }
122 
124 {
125 }
126 
128 {
129  return 0;
130 }
131 
133 {
134  return false;
135 }
136 
138 {
139  return 0;
140 }
141 
144 getProjector ( int ) const
145 {
146  return 0;
147 }
148 
150 {
151  return 0;
152 }
153 
154 DataRep *
156 getDataRep ( int ) const
157 {
158  return 0;
159 }
160 
162 {
163  return 0;
164 }
165 
166 void
169 {
170 }
171 
172 void
174 setActivePlot ( int, bool )
175 {
176  // Only CompositePlotter responds to this.
177 }
178 
180 {
181  return 0;
182 }
183 
185 {
186  // Only the composite plotters respond.
187 }
188 
189 const BinToColor *
191 getValueRep () const
192 {
193  return 0;
194 }
195 
196 void
199 {
200  // do nothing
201 }
202 
203 void
205 setAutoRanging ( const std::string & axis, bool flag )
206 {
207  Axes::Type at = Axes::convert ( axis );
208  setAutoRanging ( at, flag );
209 
210  autoScale ();
211 }
212 
213 /* @bug @@@ When the histogram weight is set using the Inspector, this
214  assert fails and the program crashes.
215 
216  @request @@@ Could we change all asserts of this to type (I count
217  about 80 of them throughout the code) to tests which throw a
218  run-time error exception instead?
219 */
220 void
223 {
224 }
225 
226 /* virtual dummy holder for non-composite displays */
227 void
230 {
231 }
232 
233 bool
236 {
237  return false;
238 }
239 
240 void
242 setReverse ( bool )
243 {
244 }
245 
246 bool
248 isReverse ( ) const
249 {
250  return false;
251 }
252 
253 void PlotterBase::setTitle( const std::string & title )
254 {
255  if ( title != "%t" ) {
256  m_title = title;
257  } else {
258  int index = activePlotIndex ();
259  if ( index > -1 ) {
260  if ( index == -1 ) index = 0;
261  DataRep * rep = getDataRep ( index );
262  // could be zero during initialization from document file
263  if ( rep != 0 ) rep -> setTitle ( title );
264  }
265  }
266 
267  notifyObservers ();
268 }
269 
270 const string & PlotterBase::getTitle() const
271 {
272  if ( m_title != "%t" ) {
273  return m_title;
274  }
275  int index = activePlotIndex ();
276  if ( index < 0 ) index = 0;
277  const DataRep * rep = getDataRep ( index );
278 
279  return rep -> getTitle ();
280 }
281 
282 void PlotterBase::setLabel ( const std::string & axis,
283  const std::string & label )
284 {
285  Axes::Type type = Axes::convert ( axis );
286  setLabel ( type, label );
287 
288  notifyObservers ();
289 }
290 
291 void
293 setLabel ( hippodraw::Axes::Type, const std::string & )
294 {
295 }
296 
297 const string &
300 {
301  static string s;
302 
303  return s;
304 }
305 
306 const string &
309 {
310  return m_title;
311 }
312 
313 const string &
316 {
317  static string s;
318 
319  return s;
320 }
321 
323 {
324 // do nothing
325 }
326 
327 void
329 setRange ( const std::string & axis, double low, double high )
330 {
331  Axes::Type type = Axes::convert ( axis );
332  const Range range ( low, high );
333 
334  setRange ( type, range, true, true );
335 }
336 
337 void
340  bool, bool )
341 {
342 }
343 
345  int, bool )
346 {
347 
348 }
349 
351  int, bool )
352 {
353 }
354 
357 const Range &
360 {
361  static Range range;
362 
363  return range;
364 }
365 
366 void
369 {
370  // does nothing
371 }
372 
373 void
376 {
377  // does nothing
378 }
379 
380 void
382 setBinWidth ( Axes::Type axis, int parm, bool dragging )
383 {
384  int index = activePlotIndex ();
385  index = std::max ( 0, index );
386 
387  ProjectorBase * projector = getProjector ( index );
388  const Range & range = projector -> setBinWidth ( axis, parm, dragging );
389 
390  setRange ( axis, range, false );
391 }
392 
393 void
396 {
397  // does nothing
398 }
399 
400 void
402 setBinWidth ( const std::string & axis, double width )
403 {
404  Axes::Type at = Axes::convert ( axis );
405  setBinWidth ( at, width );
406 }
407 
408 void
410 setOffset ( const std::string & axis, double offset )
411 {
412  Axes::Type at = Axes::convert ( axis );
413  setOffset ( at, offset );
414 }
415 
416 void
418 setNumberOfBins ( const std::string & axis, unsigned int number )
419 {
420  Axes::Type at = Axes::convert ( axis );
421  setNumberOfBins ( at, number );
422 }
423 
424 void
426 reset ( )
427 {
428  // does nothing
429 }
430 
431 const Rect &
433 getUserRect() const
434 {
435  return m_user_rect;
436 }
437 
438 const Rect &
440 getRawRect() const
441 {
442  return m_raw_rect;
443 }
444 
445 void
448 {
449 }
450 
451 void
454 {
455 }
456 
457 double
459 getBinWidth ( const std::string & axis ) const
460 {
461  Axes::Type type = Axes::convert ( axis );
462 
463  return getBinWidth ( type );
464 }
465 
466 double
469 {
470  return 1.0;
471 }
472 
473 double
476 {
477  return 1.0;
478 }
479 
480 double
482 getOffset ( const std::string & axis ) const
483 {
484  Axes::Type type = Axes::convert ( axis );
485 
486  return getOffset ( type );
487 }
488 
489 int
492 {
493  return 0;
494 }
495 
496 int
499 {
500  return getNumberOfEntries ();
501 }
502 
504 {
505 // do nothing
506 }
507 
508 double
511 {
512  return DBL_EPSILON;
513 }
514 
515 double PlotterBase::getZValue ( double , double , bool ) const
516 {
517  return 0.0;
518 }
519 
520 void PlotterBase::setCrossX ( double val )
521 {
522  m_crossX = val;
523 }
524 
525 void PlotterBase::setCrossY ( double val )
526 {
527  m_crossY = val;
528 }
529 
530 void
533 {
534  // does nothing
535 }
536 
537 void
539 addValues ( const std::vector < double > & )
540 {
541  // do nothing
542 }
543 
544 double
547 {
548  return m_aspect_ratio;
549 }
550 
551 void
553 setAspectRatio ( double ratio )
554 {
555  m_aspect_ratio = ratio;
556  notifyObservers ();
557 }
558 
559 bool
561 wantsPixmap ( ) const
562 {
563  return false;
564 }
565 
566 NTuple *
569 {
570  return 0;
571 }
572 
573 void
575 fillPickedPointFrom ( double, double,
576  std::vector < double > & ) const
577 {
578 }
579 
580 void PlotterBase::setOffsets( double xoffset, double yoffset )
581 {
582  setOffset ( Axes::X, xoffset );
583  setOffset ( Axes::Y, yoffset );
584 }
585 
587 {
588  return m_parent_datarep_index;
589 }
590 
592 {
594 }
595 
597 {
598  return m_parent_plotter;
599 }
600 
602 {
603  m_parent_plotter = plotter;
604 }
605 
606 void
608 setEnableZ ( bool )
609 {
610  // do nothing
611 }
612 
613 void
616 {
617  // do nothing
618 }
619 
620 void
622 setTicks ( hippodraw::Axes::Type, const std::vector < AxisTick > & )
623 {
624 }
625 
626 void
629 {
630  setAutoTicks ( Axes::X, yes );
631 }
632 
633 void
635 setAutoTicks ( const std::string & axis, bool yes )
636 {
637  Axes::Type type = Axes::convert ( axis );
638  setAutoTicks ( type, yes );
639 }
640 
641 void
643 setTicksOnX ( const std::vector < double > & values,
644  const std::vector < std::string > & labels )
645 {
646  unsigned int size = values.size ();
647  vector < AxisTick > ticks ( size );
648 
649  for ( unsigned int i = 0; i < size; i++ ) {
650  ticks[i].setValue ( values[i] );
651  ticks[i].setContent ( labels[i] );
652  }
653 
654  setTicks ( Axes::X, ticks );
655 }
656 
657 void
659 setTicks ( const std::string & axis,
660  const std::vector < double > & values,
661  const std::vector < std::string > & labels )
662 {
663  unsigned int size = values.size ();
664  vector < AxisTick > ticks ( size );
665 
666  for ( unsigned int i = 0; i < size; i++ ) {
667  ticks[i].setValue ( values[i] );
668  ticks[i].setContent ( labels[i] );
669  }
670  Axes::Type type = Axes::convert ( axis );
671 
672  setTicks ( type, ticks );
673 }
674 
675 double
678 {
679  const Range & range = getRange ( Axes::X, true ); // scaled range
680 
681  return range.low ();
682 }
683 
684 double
687 {
688  const Range & range = getRange ( Axes::X, true ); // scaled range
689 
690  return range.high ();
691 }
692 
693 void
696 {
697  // do nothing
698 }
699 
700 bool
702 isTargetable () const
703 {
704  return false;
705 }
706 
707 DataRep *
709 getTarget () const
710 {
711  return 0;
712 }
713 
714 int
716 indexOf ( const DataRep * ) const
717 {
718  return -1;
719 }
720 
721 void
724 {
725  int to_select = 0;
726  int number = getNumDataReps ();
727 
728  if ( number > 1 ) {
729  to_select = activePlotIndex ();
730  to_select++;
731 
732  if ( to_select == number ) {
733  to_select = -1;
734  }
735  setActivePlot ( to_select, true );
736  }
737 }
738 
739 void
742 {
744  s_plotters++;
745 }
746 
747 int
749 plotterId () const
750 {
751  return m_plotterId;
752 }
753 
754 int
756 saveView ( const std::vector<double> & range_values )
757 {
758  if (range_values.size() != 4) {
759  throw PlotterException("PlotterBase::saveView: "
760  "Invalid number of range values.");
761  }
762  m_views.push_back(range_values);
763 
764  m_currentView = static_cast<int>(m_views.size() - 1);
765 
766  return m_currentView;
767 }
768 
769 int
771 saveViewAtIndex ( const std::vector<double> & range_values , unsigned int i )
772 {
773  if ( i > m_views.size() ) {
774  i = 0;
775  }
776 
777  if (range_values.size() != 4) {
778  throw PlotterException("PlotterBase::saveView: "
779  "Invalid number of range values.");
780  }
781  vector < vector < double > > :: iterator iter = m_views.begin ();
782  advance ( iter, i );
783  m_views.insert( iter , range_values);
784 
785  for ( unsigned int k = m_views.size() - 1 ; k>i; k--) {
786  m_views.pop_back();
787  }
788  m_currentView = static_cast<int>( i );
789 
790  return m_currentView;
791 }
792 
793 
794 int
796 nextView ( bool stepForward )
797 {
798  if (m_views.size() == 0) {
799  return -1;
800  }
801  if (stepForward) {
802  m_currentView += 1;
803  if (m_currentView >= static_cast<int>(m_views.size())) {
804  m_currentView = 0;
805  }
806  } else {
807  m_currentView -= 1;
808  if (m_currentView <= -1) {
809  m_currentView = m_views.size() - 1;
810  }
811  }
813  return m_currentView;
814 }
815 
816 
817 
818 void
820 setView ( int index )
821 {
822  if ( m_views.size() == 0 || index < 0 ||
823  index >= static_cast<int>(m_views.size()) ) {
824  string what ( "PlotterBase::setView: Invalid plot view index " );
825  what += String::convert ( index );
826  what += ".";
827  throw PlotterException ( what );
828  }
829  setRange("x", m_views[index][0], m_views[index][1]);
830  setRange("y", m_views[index][2], m_views[index][3]);
832 }
833 
834 int
836 numViews () const
837 {
838  return static_cast<int>(m_views.size());
839 }
840 
841 void
844 {
845  std::vector< std::vector<double> > views;
846  for (unsigned int i = 0; i < m_views.size(); i++) {
847  if (static_cast<int>(i) != index) {
848  views.push_back(m_views[i]);
849  }
850  }
851  m_views = views;
852  index--;
853  if (index > 0 && m_views.size() > 0) {
854  setView(index);
855  }
856 }
857 
858 int
860 currentView () const
861 {
862  return m_currentView;
863 }
864 
865 void
867 fillCutList ( std::vector < const TupleCut * > & ) const
868 {
869  // do nothing.
870 }
871 
872 void
874 setCutRangeAt ( const Range &, unsigned int )
875 {
876  // do nothing
877 }
878 
879 void
882 {
883  current_range_saved = flag;
884 }
885 
886 bool
889 {
890  return current_range_saved ;
891 }
892 
893 Range
896 {
897  ProjectorBase * proj = activeProjector ();
898  Range r = proj -> dataRangeOn ( axis );
899  return r;
900 }
901 
902 const std::vector <double> &
905 {
906  ProjectorBase * proj = activeProjector ();
907  return ( proj -> getZValues () );
908 }
909 
910 const std::vector <unsigned int> &
913 {
914  ProjectorBase * proj = activeProjector();
915  return ( proj -> getShape() );
916 }
917 
918 void
920 setShowGrid( bool flag )
921 {
922 
923 }
924 
925 void
927 setBoxEdge( bool flag )
928 {
929 }
930 
931 bool
934 {
935  return false;
936 }
937 
938 bool
941 {
942  return false;
943 }
944 
945 void
947 setFitsTransform ( const std::string & transform )
948 {
949 }
950 
954 {
955  return 0;
956 }
957 
958 void
960 setMinEntries(int entries)
961 {
962 }
963 
964 int
967 {
968  return -1;
969 }
970 
971 const FontBase *
973 titleFont( ) const
974 {
975  return NULL;
976 }
977 
978 FontBase*
981 {
982  return NULL;
983 }
984 
985 bool
988 {
989  return false;
990 }
991 
992 bool
995 {
996  return false;
997 }
998 
999 
1000 double
1003 {
1004  return 0.0;
1005 }
1006 
1007 double
1010 {
1011  return 0.0;
1012 }
1013 
1014 double
1017 {
1018  return 0.0;
1019 }
1020 
1021 double
1024 {
1025  return 0.0;
1026 }
1027 
1028 void
1030 setTopMargin( double top )
1031 {
1032  // Do nothing
1033 }
1034 
1035 void
1037 setZMargin( double z )
1038 {
1039  // Do nothing
1040 }
1041 
1042 void
1044 setBottomMargin( double bottom )
1045 {
1046  // Do nothing
1047 }
1048 
1049 void
1051 setLeftMargin( double left )
1052 {
1053  // Do nothing
1054 }
1055 
1056 void
1058 setNeedUpdate(bool isChanged)
1059 {
1060  // Do nothing
1061 }
1062 
1063 double
1066 {
1067  return 1.0;
1068 }
1069 
1070 bool
1073 {
1074  return false;
1075 }
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
Definition: Observable.h:39
unsigned int i
virtual void setFitsTransform(const std::string &)
Set the fits transform object.
bool current_range_saved
Returns true if the current range on the axes have been saved.
Definition: PlotterBase.h:124
int getNumOfEntries() const
Returns the number of entries in the contained DataRep.
virtual void prepareToDraw()
Prepare the plotter for drawing.
Definition: PlotterBase.cxx:96
const Rect & getRawRect() const
Returns the raw rectangle before transform.
double high() const
Returns the maximum of the range object.
Definition: Range.cxx:100
void toggleActivePlot()
Toggles the active DataRep, if 2 or more are contained by the plotter.
virtual void notifyObservers() const
Notifies Observer objects of a change.
Definition: Observable.cxx:93
virtual double getTopMargin()
virtual Range getDataRange(Axes::Type axis)
Return the range of the raw data on the specified axis.
virtual int plotterId() const
The unique ID number of this plotter.
PlotterBase * m_parent_plotter
Parent plotter.
Definition: PlotterBase.h:105
virtual void setOffset(Axes::Type axis, double offset)
Sets the offset.
virtual void update()=0
Updates the plotter.
virtual bool isImageConvertable() const
Returns true if contents of the plotter is convertable to an image.
virtual const BinToColor * getValueRep() const
Returns the value to color representation.
std::string m_name
The name of the type of plotter.
Definition: PlotterBase.h:78
virtual void setLowRange(Axes::Type axis, int parm, bool dragging)
Sets the low end of the Range of data displayed.
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
virtual const std::vector< double > & getZValues()
Returns all Z values.
The base class for the value to the color transformation.
Definition: BinToColor.h:30
virtual double getZValue(double x, double y, bool scaled=true) const
Get the z value at the specified point (x,y).
virtual void setNeedUpdate(bool isChanged)
Set the m_need_update flag, called by inspector.
virtual FontBase * labelFont(Axes::Type axes) const
What font is being used to override the default while drawing axis label.
virtual void setAutoTicksOnX(bool yes)
Sets automatic generation of axis ticks on X axis.
Rect m_raw_rect
The raw rectangle before transform.
Definition: PlotterBase.h:102
virtual double getOffset(Axes::Type axis) const
Returns the offset on designated axis, similarly to getBinWidth.
virtual bool getShowGrid()
Gets the show-grid status to update the inspector.
virtual int activePlotIndex() const
Returns the index of the active plotter.
const Rect & getUserRect() const
Returns the data space rectangle.
virtual void setScaling(Axes::Type axis, bool on=true)
Sets the scaling attribute of the AxisModelBase object.
int nextView(bool stepForward=true)
Cycle through each set of plot ranges, thereby changing the view with each call.
void setTitle(const std::string &title)
Sets the title to be displayed.
virtual void setValueRep(BinToColor *rep)
Sets the object that will do the value to color transform, if any.
hippodraw::DataRep class interface.
virtual void setScaleFactor(Axes::Type axis, double factor)
Sets the scale factor on the specified axis.
void setView(int index)
Set the view by index.
virtual const std::vector< unsigned int > & getShape()
virtual bool isAxisScaled(Axes::Type axis) const
Returns false.
int m_parent_datarep_index
Parent DataRep index.
Definition: PlotterBase.h:108
virtual void setParentDataRepIndex(int index)
Sets the index of the parent DataRep.
virtual void willDelete(const Observable *)
Notifies this Observer object that one of its Observable objects is about to be deleted.
Definition: Observer.cxx:25
void setCrossY(double val)
Set the crossY value.
virtual void fillCutList(std::vector< const TupleCut * > &cuts) const
Fills the cuts vector with the TupleCut objects contained by the DataRep objects, if any...
virtual void setHighRange(Axes::Type axis, int parm, bool dragging)
Sets the high end of the Range of data displayed.
virtual bool hasZoomY() const
Returns true if the plotter has zoom feature on the Y axis, otherwise returns false.
virtual const std::string & getLabel(Axes::Type) const
Returns the label for the specified axis.
virtual bool isTargetable() const
Returns true if receiving object is target-able.
virtual void matrixTranspose(bool yes)
Transpose the X and Y axis of matrix representation.
return rep
Definition: Inspector.cxx:3843
virtual const std::string & getInternalTitle() const
Returns the internal title.
virtual NTuple * createPickTuple()
Creates a DataSource for a PickTable.
virtual void autoScale()
Auto scales the Range of the axes using preferred Range from the points plotters. ...
virtual double getBinWidth(Axes::Type axis) const
Returns the bin width.
int numViews() const
Return the number of stored views.
The namespace for conversion to string.
int currentView() const
Return the current view index.
const std::string & getTitle() const
Gets the title to be displayed.
virtual void removeDataRep(DataRep *)
Removes the DataRep from the plot.
return yes
Definition: CanvasView.cxx:883
virtual void setTicks(Axes::Type axis, const std::vector< AxisTick > &ticks)
Sets the ticks for the specified axis.
A abstract base class for font handling.
Definition: FontBase.h:32
virtual ProjectorBase * getProjector(int i) const
Returns the projector at index i.
virtual double getHighRangeOnX() const
Returns the high end of the X axis range.
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
virtual ProjectorBase * activeProjector() const
Returns the active projector.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained in the plot.
virtual void setNumberOfBins(const std::string &axis, unsigned int number)
Sets the number of bins.
virtual double getScaleFactor(Axes::Type axis) const
Returns 1.0.
virtual void setOffsets(double xoffset, double yoffset)
Sets the offsets on the x and y axis.
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
The base class for data representations.
Definition: DataRep.h:68
virtual int getParentDataRepIndex() const
Returns the index of the parent DataRep.
virtual TransformBase * getFitsTransform() const
Returns the fits transform object.
virtual void checkAxisScaling()
Check if Axis needs to be scaled or not.
virtual double getBottomMargin()
virtual void setActivePlot(int index, bool redraw)
Sets the active plot.
virtual void addDataRep(DataRep *rep)
Adds a DataRep object to the plotter.
virtual double getZMargin()
virtual void fillPickedPointFrom(double mx, double my, std::vector< double > &picked) const
Fills the picked data point.
virtual void setBinWidth(Axes::Type axis, double width)
Sets the bin width.
int saveViewAtIndex(const std::vector< double > &range_values, unsigned int i)
Save the current set of plot ranges which define a &quot;view&quot; for this plot.at the position i...
virtual void reset()
Resets the bins.
bool hasAutoScaled() const
Returns true if the axes have already been auto-scaled.
virtual void setBottomMargin(double bottom)
virtual int indexOf(const DataRep *rep) const
Returns the index of the DataRep.
intp size(numeric::array arr)
Definition: num_util.cpp:296
virtual void setCurrentRangeSaved(bool flag)
Sets current_range_saved member to flag.
string convert(int i)
Converts an integer to a string.
The AxisModelBase class maintains the Range and scaling of an axis.
Definition: AxisModelBase.h:33
virtual bool getBoxEdge()
Get the box-edge status to update the inspector.
virtual bool isTextPlotter() const
Return true if it&#39;s a text plotter.
void setCrossX(double val)
Set the crossX value.
static int s_plotters
Reference count for creating plotter ids.
Definition: PlotterBase.h:139
Class representing a rectangle.
Definition: Rectangle.h:34
virtual const FontBase * titleFont() const
What font is being used to override the default while drawing title of plot.
hippodraw::ProjectorBase class interface.
void deleteView(int index)
Delete a view by index.
std::string m_title
The main label; the title of the plot.
Definition: PlotterBase.h:86
const std::string & name() const
Returns the name of the plotter.
Definition: PlotterBase.cxx:83
double m_crossX
The x position of the cross hair.
Definition: PlotterBase.h:89
int saveView(const std::vector< double > &range_values)
Save the current set of plot ranges which define a &quot;view&quot; for this plot.
virtual void setLabel(const std::string &axis, const std::string &label)
Sets the label of specified axis to label.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
Definition: Observer.h:34
PlotterException class interface.
virtual int getNumberOfEntries() const
Returns the number of entries in the contained DataRep.
Rect m_user_rect
The abstract data space.
Definition: PlotterBase.h:98
virtual void setShowGrid(bool flag)
Sets the show-grid status to flag.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn&#39;t exits.
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
virtual double getAspectRatio() const
Returns the aspect ratio.
The abstract base class for views.
Definition: ViewBase.h:62
virtual PlotterBase * getParentPlotter() const
Returns the parent plotter.
double m_aspect_ratio
The aspect ratio.
Definition: PlotterBase.h:74
virtual double getLeftMargin()
virtual bool getCurrentRangeSaved()
Returns current_range_saved member t.
virtual void addValues(const std::vector< double > &v)
Adds data values to the plot.
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
std::vector< std::vector< double > > m_views
A vector of x and y ranges to be used as a circular buffer allowing one to cycle through the saved pl...
Definition: PlotterBase.h:133
virtual bool wantsPixmap() const
Informs caller if the plotter prefers to use a pixmap or not.
virtual TransformBase * getTransform() const
Returns the transform object used by the plotter.
An exception class that is thrown when attempting an illegal operation on a PlotterBase object...
double low() const
Returns the minimum of the range object.
Definition: Range.cxx:87
virtual void setTopMargin(double top)
Set and get additional margin on top,bottom,left of the plotter.
virtual void setLeftMargin(double left)
PlotterBase()
Default constructor needed to ensure m_plotterId is set.
Definition: PlotterBase.cxx:33
double m_crossY
The y position of the cross hair.
Definition: PlotterBase.h:92
virtual bool hasAxis(Axes::Type axis) const
Returns true if the plotter has an axis of specified type.
Expresses a range of values.
Definition: Range.h:33
return index
Definition: PickTable.cxx:182
virtual void setBoxEdge(bool flag)
Set the box-edge status to flag.
virtual void setParentPlotter(PlotterBase *plotter)
Sets the parent plotter.
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
virtual bool isReverse() const
Return true if reverse is enabled, otherwise returns false.
virtual double getLowRangeOnX() const
Returns the low end of the X axis range.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Returns the AxisModelBase derived class for the specified axis.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
Definition: AxesType.cxx:32
virtual void setCutRangeAt(const Range &range, unsigned int i)
Sets the Range of a TupleCut object.
int m_currentView
Index of the current view.
Definition: PlotterBase.h:136
virtual int getMinEntries()
Get the minimum entries/bin.
virtual void setEnableZ(bool yes=true)
Enables the Z axis, if plotter has one.
virtual DataRep * getTarget() const
Returns the target DataRep contained by the plotter.
virtual void setTicksOnX(const std::vector< double > &values, const std::vector< std::string > &labels)
Sets the ticks for the X axis.
void setAspectRatio(double ratio)
Sets the aspect ratio.
virtual ~PlotterBase()
The virtual destructor.
Definition: PlotterBase.cxx:78
virtual void setAutoRanging(const std::string &axis, bool flag)
Sets the auto-ranging.
virtual void setAutoTicks(Axes::Type axis, bool yes)
Sets automatic generation of axis ticks.
virtual const std::string & getInternalLabel(Axes::Type axis) const
Returns the internal label.
virtual DataRep * selectedDataRep() const
Returns the selected DataRep.
virtual void setMinEntries(int entries)
Set the minimum entries/bin.
virtual void setTransform(TransformBase *)
Sets the transform object.
Type
Axes constants.
Definition: AxesType.h:31
virtual void drawCrossHairs(ViewBase *view)
Draws cross-hairs.
virtual void setReverse(bool flag)
Set the reverse status to flag.
int m_plotterId
A unique plotter id.
Definition: PlotterBase.h:128
hippodraw::PlotterBase class interface.
virtual void setZMargin(double z)
virtual bool isAutoRanging(Axes::Type axis) const
Returns true if auto-ranging is enabled, otherwise returns false.
virtual double getPosRange(Axes::Type axis) const
Returns the smallest positive number from the data.
AxisTick class interface.

Generated for HippoDraw Class Library by doxygen