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 
29 FunctionRep1 ( FunctionBase * function, DataRep * rep )
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 
40 FunctionRep1 ( const FunctionRep1 & rep )
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 }

Generated for HippoDraw Class Library by doxygen