LineDataRep.cxx
Go to the documentation of this file.
1 
12 #include "LineDataRep.h"
13 
15 #include "reps/LinePointRep.h"
16 
17 namespace hippodraw {
18 
20 LineDataRep ( hippodraw::Axes::Type axis, double value )
21 {
22  m_name = "Static Line";
23  m_projector = new LineProjector ( axis, value );
24  m_rep = new LinePointRep ( );
25  // The above deleted in ~DataRep()
26  const Color red ( Color::red );
27 
28  m_rep->setColor ( red );
29 }
30 
33 {
34  m_name = "Static Line";
35 }
36 
38 {
39  return new LineDataRep ( *this );
40 }
41 
42 /* virtual */
44 {
45  return false;
46 }
47 
48 void
50 setValue ( double value )
51 {
52  LineProjector * projector
53  = dynamic_cast < LineProjector * > ( m_projector );
54  projector -> setValue ( value );
55 }
56 
57 bool
60 {
61  return axis == Axes::X || axis == Axes::Y;
62 }
63 
64 } // namespace hippodraw
65 
std::string m_name
The name of the display as it might be displayed in a GUI.
Definition: DataRep.h:76
LineDataRep class interface.
virtual bool hasAxis(hippodraw::Axes::Type) const
Returns true if the data representation has specified axis type axis.
Definition: LineDataRep.cxx:59
virtual bool hasNTupleBindings() const
Returns false as this class does not have NTuple bindings.
Definition: LineDataRep.cxx:43
hippodraw::LineProjector class interface
RepBase * m_rep
The representation used for drawing each data point in the view.
Definition: DataRep.h:94
void setValue(double value)
Sets the value that will be displayed.
Definition: LineDataRep.cxx:50
A Color class for creating the color object following the standard RGB color space.
Definition: Color.h:37
LineDataRep()
The default constructor, should never be called.
Definition: LineDataRep.cxx:32
The base class for data representations.
Definition: DataRep.h:68
A projector that plots a value as a horizontal or vertical line.
Definition: LineProjector.h:27
virtual void setColor(const Color &)
Sets the color of the representation.
Definition: RepBase.cxx:53
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
Definition: DataRep.h:90
A PointRep class that draws a column to represent the value.
Definition: LinePointRep.h:34
Type
Axes constants.
Definition: AxesType.h:31
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Definition: LineDataRep.cxx:37
hippodraw::LinePointRep class interface

Generated for HippoDraw Class Library by doxygen