FunctionRep2.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 "FunctionRep2.h"
18 
19 #include "functions/FunctionBase.h"
21 
23 
24 #include <cassert>
25 
26 using namespace hippodraw;
27 
30  : FunctionRep ( function, rep )
31 {
32  m_rep = new ContourFunctionRep();
33  // The above deleted in ~DataRep()
34 }
35 
38  : FunctionRep ( rep )
39 {
40 }
41 
44 {
45 }
46 
48 {
49  return new FunctionRep2 ( *this );
50 }
51 
52 bool
55 {
56  return axis == Axes::X || axis == Axes::Y || axis == Axes::Z;
57 }
58 
59 void
62  ViewBase * view )
63 {
64  drawCuts ( transform, view );
65 
66  const Range & x_range = m_projector -> getRange ( Axes::X );
67  const Range & y_range = m_projector -> getRange ( Axes::Y );
68  FunctionBase * function = getFunction ();
69  ContourFunctionRep * rep = dynamic_cast < ContourFunctionRep * > ( m_rep );
70  assert ( rep != 0 );
71 
72  rep -> drawProjectedValues ( x_range, y_range, function, transform, view );
73 
74  setDirty ( false );
75 }
FunctionBase * getFunction() const
Returns the actual function, a FunctionBase derived class.
virtual void drawProjectedValues(TransformBase *transform, ViewBase *view)
Draws the projected values.
virtual bool hasAxis(hippodraw::Axes::Type) const
Returns true if the data representation has specified axis type axis.
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
A class that draws a function as contour lines.
FunctionRep2(const FunctionRep2 &)
The copy constructor.
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
The base class for data representations.
Definition: DataRep.h:68
void drawCuts(TransformBase *transform, ViewBase *view)
Draws the cuts.
Definition: DataRep.cxx:290
hippodraw::ProjectorBase class interface.
ContourFunctionRep 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
A derived class of FunctionRep that handles functions with 2 coordinates.
Definition: FunctionRep2.h:26
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
FunctionRep2 class interface.
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual ~FunctionRep2()
The virtual destructor.
Type
Axes constants.
Definition: AxesType.h:31

Generated for HippoDraw Class Library by doxygen