FunctionRep1.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 "FunctionRep1.h"
18 
19 #include "functions/FunctionBase.h"
21 
22 #include "reps/LineFunctionRep.h"
23 
24 #include <cassert>
25 
26 using namespace hippodraw;
27 
30  : FunctionRep ( function, rep )
31 {
32  m_rep = new LineFunctionRep();
33  // The above deleted in ~DataRep()
34 
35  const Color red ( Color::red );
36  m_rep->setColor ( red );
37 }
38 
41  : FunctionRep ( rep )
42 {
43 }
44 
47 {
48 }
49 
51 {
52  return new FunctionRep1 ( *this );
53 }
54 
55 bool
58 {
59  return axis == Axes::X || axis == Axes::Y;
60 }
61 
62 void
65  ViewBase * view )
66 {
67  drawCuts ( transform, view );
68 
69  const Range & range = m_projector -> getRange ( Axes::X );
70  FunctionBase * function = getFunction ();
71  LineFunctionRep * rep = dynamic_cast < LineFunctionRep * > ( m_rep );
72  assert ( rep != 0 );
73 
74  rep -> drawProjectedValues ( range, function, transform, view );
75 
76  setDirty ( false );
77 }
A LinePointRep class that draws a function by trying to make a smooth line after the transform to the...
FunctionBase * getFunction() const
Returns the actual function, a FunctionBase derived class.
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
virtual bool hasAxis(hippodraw::Axes::Type) const
Returns true if the data representation has specified axis type axis.
virtual void drawProjectedValues(TransformBase *transform, ViewBase *view)
Draws the projected values.
virtual ~FunctionRep1()
The virtual destructor.
A derived class of DataRep which is a base class for displaying a function.
Definition: FunctionRep.h:34
return rep
Definition: Inspector.cxx:3843
RepBase * m_rep
The representation used for drawing each data point in the view.
Definition: DataRep.h:94
A Color class for creating the color object following the standard RGB color space.
Definition: Color.h:37
FunctionRep1(const FunctionRep1 &)
The copy constructor.
The base class for data representations.
Definition: DataRep.h:68
LineFunctionRep class interface.
void drawCuts(TransformBase *transform, ViewBase *view)
Draws the cuts.
Definition: DataRep.cxx:290
virtual void setColor(const Color &)
Sets the color of the representation.
Definition: RepBase.cxx:53
hippodraw::ProjectorBase class interface.
The abstract base class for views.
Definition: ViewBase.h:62
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
Definition: DataRep.h:90
virtual void setDirty(bool yes=true)
Sets the dirty flag.
Definition: DataRep.cxx:133
Expresses a range of values.
Definition: Range.h:33
hippodraw::FunctionBase class interface
FunctionRep1 class interface.
Type
Axes constants.
Definition: AxesType.h:31
A derived class of FunctionRep that handles functions with only 1 coordinate.
Definition: FunctionRep1.h:26

Generated for HippoDraw Class Library by doxygen