Cut1DPlotter.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 "Cut1DPlotter.h"
18 
19 #include "datareps/DataRep.h"
20 #include "datasrcs/TupleCut.h"
21 
22 #include "reps/CutRangeRep.h"
23 #include <cassert>
24 
25 using std::vector;
26 
27 using namespace hippodraw;
28 
30  : CutPlotter ( "Cut1DPlotter" )
31 {
32 }
33 
35  : CutPlotter ( plotter )
36 {
37 }
38 
40 {
41 }
42 
44 {
45  return new Cut1DPlotter ( *this );
46 }
47 
48 void
51 {
52  m_datarep=rep;
53  m_datarep -> addCut ( TupleCut () );
54 }
55 
56 
57 void
60 {
61  XyPlotter::addDataRep ( rep );
62 }
63 
64 void
66 setAxisBinding ( const std::vector < std::string > & bindings )
67 {
68  assert ( bindings.size () == 1 );
69 
70  CutPlotter::setAxisBinding ( bindings );
71 }
72 
74 {
75  const Range & range = getRange ( Axes::X, false );
76  m_datarep -> setCutRangeAt ( range, 0 );
77 
78  updateTargets ();
79 }
80 
81 void
84 {
85  m_datarep -> toggleInverted ( 0 );
86 
87  updateTargets ();
88 }
89 
90 const std::string &
92 getCutLabel () const
93 {
94  const vector < TupleCut > & cuts = m_datarep -> getCuts ();
95  const TupleCut & cut = cuts[0]; // so Doxygen sees it.
96 
97  return cut.getLabel ();
98 }
Cut1DPlotter()
This default constructor.
hippodraw::DataRep * m_datarep
A pointer to the data representation that holds the cuts.
Definition: CutPlotter.h:62
A Plotter class that plots one-dimensional TupleCut values.
Definition: Cut1DPlotter.h:34
PlotterBase * clone()
This clone function returns an object of its own kind which is a copy of this object at this moment...
hippodraw::TupleCut class interface
Expresses a range of values.
Definition: Range.h:33
const std::vector< TupleCut > & getCuts() const
Returns the list of TupleCut objects used by this plotter.
Definition: CutPlotter.cxx:191
Cut1DPlotter class interface.
virtual void setAxisBinding(const std::vector< std::string > &bindings)
Sets the axis binding of both the Cut and its DataRep.
Definition: CutPlotter.cxx:72
virtual void toggleInverted()
Reverse the meaning of the cut Range.
virtual void addTupleCut(hippodraw::DataRep *rep)
Adds tuple cut after adding a data representation.
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43
const std::string & getLabel() const
Returns the label for the cut.
Definition: TupleCut.cxx:110
hippodraw::DataRep class interface.
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
Definition: XyPlotter.cxx:768
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
The base class for data representations.
Definition: DataRep.h:68
virtual const std::string & getCutLabel() const
Returns the label for the Cut.
virtual void addDataRep(DataRep *rep)
Adds the DataRep object to the plotter.
Definition: XyPlotter.cxx:310
CutRangeRep class interface.
void updateTargets()
Update the target DataRep when a change has been made in the TupleCut.
Definition: CutPlotter.cxx:168
virtual ~Cut1DPlotter()
The destructor.
virtual void setCutRangeAt(const Range &range, unsigned int index)
Sets the Range of the cut.
Definition: CutPlotter.cxx:100
A PlotterBase derived class that serves a base class for cut plotters.
Definition: CutPlotter.h:43
virtual void addDataRep(hippodraw::DataRep *rep)
Adds a data representation.
virtual void setAxisBinding(const std::vector< std::string > &bindings)
Sets the axis binding of both the Cut and its DataRep.
void setCutRangeFull()
Sets the cut Range to include the full range of data.

Generated for HippoDraw Class Library by doxygen