TextDataRep.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 "TextDataRep.h"
18 
20 #include "reps/TextRepBase.h"
21 
22 #include <cassert>
23 
24 using namespace hippodraw;
25 
27  : DataRep()
28 {
29  m_name = "TextDataRep";
30  m_rep = rep;
31 }
32 
34  : DataRep()
35 {
36  m_name = "TextDataRep";
37  m_rep = 0;
38 }
39 
42  : DataRep ( rep )
43 {
44 }
45 
47 {
48  return new TextDataRep ( *this );
49 }
50 
52 {
53  return false;
54 }
55 
59 {
60  ProjectorBase * projector = 0;
61  DataRep * target = getParentDataRep();
62 
63  if ( target != 0 ) {
64  projector = target -> getProjector ();
65  }
66 
67  return projector;
68 }
69 
70 void
73 {
74  assert ( m_rep );
75  TextRepBase * t_rep = dynamic_cast < TextRepBase * > ( m_rep );
76  assert ( t_rep != 0 );
77 
78  ProjectorBase * projector = getTargetProjector ();
79  if ( projector != 0 ) {
80  t_rep -> drawProjectedValues ( *projector, *view );
81  }
82  else {
83  t_rep -> displayError ( *view );
84  }
85 }
86 
87 bool
89 isTargetable () const
90 {
91  return false;
92 }
93 
94 using namespace hippodraw;
95 
96 bool
99 {
100  return false;
101 }
std::string m_name
The name of the display as it might be displayed in a GUI.
Definition: DataRep.h:76
virtual DataRep * getParentDataRep() const
Gets the parent DataRep.
Definition: DataRep.cxx:78
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
Definition: TextDataRep.cxx:46
virtual ProjectorBase * getTargetProjector() const
Returns the ProjectorBase object from the target DataRep.
Definition: TextDataRep.cxx:58
virtual void drawProjectedValues(TransformBase *transform, ViewBase *view)
Overrides the base class implementation to draw the values based on the target DataRep.
Definition: TextDataRep.cxx:72
hippodraw::TextDataRep class interface
A base class for representations that draws a value as text.
Definition: TextRepBase.h:27
return rep
Definition: Inspector.cxx:3843
RepBase * m_rep
The representation used for drawing each data point in the view.
Definition: DataRep.h:94
virtual bool hasNTupleBindings() const
Returns false as this class does not have DataSource bindings.
Definition: TextDataRep.cxx:51
The base class for data representations.
Definition: DataRep.h:68
hippodraw::TextRepBase class interface
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
The abstract base class for views.
Definition: ViewBase.h:62
hippodraw::Map1Projector class interface
virtual bool hasAxis(hippodraw::Axes::Type) const
Returns true if the data representation has specified axis type axis.
Definition: TextDataRep.cxx:98
virtual bool isTargetable() const
Returns false.
Definition: TextDataRep.cxx:89
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
Definition: DataRep.cxx:138
Displays data in textual representation.
Definition: TextDataRep.h:32
Type
Axes constants.
Definition: AxesType.h:31
The base class for the point representation hierarchy.
Definition: RepBase.h:45
TextDataRep()
The default constructor.
Definition: TextDataRep.cxx:33

Generated for HippoDraw Class Library by doxygen