Cut2DPlotter.cxx
Go to the documentation of this file.
1 
12 // for truncation warning
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "Cut2DPlotter.h"
18 
19 #include "datareps/DataRep.h"
20 #include "datasrcs/TupleCut.h"
21 #include "reps/CutRangeRep.h"
22 
23 #include <cassert>
24 
25 using std::vector;
26 
27 namespace hippodraw {
28 
31  : CutPlotter ( "Cut2DPlotter" )
32 {
33  setEnableZ ( true );
34 }
35 
37  : CutPlotter ( plotter )
38 {
39  setEnableZ ( true );
40 }
41 
43 {
44 }
45 
47 {
48  return new Cut2DPlotter ( *this );
49 }
50 
51 void
54 {
55  m_datarep = rep;
56  m_datarep -> addCut ( TupleCut () );
57  m_datarep -> addCut ( TupleCut () );
58 }
59 
60 
61 void
64 {
65  XyPlotter::addDataRep ( rep );
66 }
67 
68 void
70 setAxisBinding ( const std::vector < std::string > & bindings )
71 {
72  assert ( bindings.size () == 2 );
73 
74  CutPlotter::setAxisBinding ( bindings );
75 }
76 
78 {
79  const Range & rangeX = getRange ( Axes::X, false );
80  m_datarep -> setCutRangeAt (rangeX, 0 );
81 
82  const Range & rangeY = getRange ( Axes::Y, false );
83  m_datarep -> setCutRangeAt ( rangeY, 1 );
84 
85  updateTargets ();
86 }
87 
89 {
90  m_datarep -> toggleInverted ( 0 );
91  m_datarep -> toggleInverted ( 1 );
92 
93  updateTargets ();
94 }
95 
97 {
98  TupleCut * cut = getCutAt ( 1 );
99  Range range = cut -> getRange ();
100 
101  return range;
102 }
103 
104 } // namespace hippodraw
void setCutRangeFull()
Sets the cut Range to include the full range of data.
virtual void addDataRep(DataRep *rep)
Adds the DataRep object to the plotter.
Definition: XyPlotter.cxx:310
virtual void setCutRangeAt(const Range &range, unsigned int index)
Sets the Range of the cut.
Definition: CutPlotter.cxx:100
A Plotter class that plots one-dimensional TupleCut values.
Definition: Cut2DPlotter.h:40
hippodraw::DataRep * m_datarep
A pointer to the data representation that holds the cuts.
Definition: CutPlotter.h:62
hippodraw::DataRep class interface.
virtual void setAxisBinding(const std::vector< std::string > &bindings)
Sets the axis binding of both the Cut and its DataRep.
Namespace for HippoDraw.
Definition: AxesType.cxx:21
The base class for data representations.
Definition: DataRep.h:68
virtual void addTupleCut(hippodraw::DataRep *rep)
Adds tuple cut after adding a data representation.
virtual void setEnableZ(bool yes=true)
Sets the display of the Z axis on.
Definition: XyPlotter.cxx:220
hippodraw::TupleCut class interface
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
Expresses a range of values.
Definition: Range.h:33
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
Definition: XyPlotter.cxx:768
A PlotterBase derived class that serves a base class for cut plotters.
Definition: CutPlotter.h:43
virtual void setAxisBinding(const std::vector< std::string > &bindings)
Sets the axis binding of both the Cut and its DataRep.
Definition: CutPlotter.cxx:72
CutRangeRep class interface.
Range getCutRangeY()
Cut the range of the cut at Y axis.
PlotterBase * clone()
This clone function returns an object of its own kind which is a copy of this object at this moment...
void updateTargets()
Update the target DataRep when a change has been made in the TupleCut.
Definition: CutPlotter.cxx:168
TupleCut * getCutAt(unsigned int i)
Returns the TupleCut object at position i.
Definition: XyPlotter.cxx:930
hippodraw::Cut2DPlotter class interface
virtual ~Cut2DPlotter()
The destructor.
virtual void toggleInverted()
Reverse the meaning of the cut Range on the give axis.
virtual void addDataRep(hippodraw::DataRep *rep)
Adds a data representation.
Cut2DPlotter()
This default constructor.
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43

Generated for HippoDraw Class Library by doxygen