TextPlotter.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 "TextPlotter.h"
18 
19 #include "datareps/TextDataRep.h"
20 
21 #include <cassert>
22 
23 using std::list;
24 using std::swap;
25 using std::string;
26 
27 using namespace hippodraw;
28 
30  : PlotterBase ( "TextPlotter" )
31 {
32  m_datarep = new TextDataRep ( 0 );
33  m_title = "none";
34 }
35 
37  : PlotterBase ( plotter )
38 {
39 }
40 
42 {
43  if ( m_datarep != 0 ) delete m_datarep;
44 }
45 
47 {
48  return new TextPlotter ( *this );
49 }
50 
51 /* virtual */
53 {
54  TextDataRep * textrep = dynamic_cast < TextDataRep * > ( rep );
55  assert ( textrep != 0 );
56 
57  m_datarep = textrep;
58 }
59 
61 {
62  return 1;
63 }
64 
66 {
67  return m_datarep;
68 }
69 
71 {
72  m_datarep->drawProjectedValues ( 0, view );
73 }
74 
76 {
77  return false;
78 }
79 
81 {
82  m_datarep->setPointRep ( rep );
83 }
84 
86 {
87  return m_datarep->getRepresentation ();
88 }
89 
91 void
94 {
95  assert ( false );
96 }
97 
99 bool
102 {
103  return false;
104 }
105 
107 {
108 }
109 
110 void TextPlotter::setRepColor ( const Color & color )
111 {
112  m_datarep->setRepColor ( color );
113  notifyObservers ();
114 }
115 
116 const Color & TextPlotter::repColor () const
117 {
118  return m_datarep->getRepColor();
119 }
120 
121 float TextPlotter::userToMarginX ( double x ) const
122 {
123  return x;
124 }
125 
126 float TextPlotter::userToMarginY ( double y ) const
127 {
128  return y;
129 }
130 
131 float TextPlotter::userToInvertedMarginY ( double y ) const
132 {
133  return y;
134 }
135 
136 void
138 toUserXY ( double mx, double my, bool,
139  double & ux, double & uy ) const
140 {
141  ux = mx;
142  uy = my;
143 }
144 
146 {
147  return m_datarep -> getParentDataRep ();
148 }
149 
151 {
152  m_datarep -> setParentDataRep ( rep );
153  rep -> addObserver ( this );
154 }
155 
156 void TextPlotter::willDelete ( const Observable * observable )
157 {
158  const DataRep * rep = dynamic_cast < const DataRep * > ( observable );
159  if ( getParentDataRep() == rep ){
161  }
162 }
163 
165 {
166  return 0;
167 }
168 
170 NTuple *
172 createNTuple () const
173 {
174  return 0;
175 }
176 
177 void
180 {
181  m_datarep -> update ();
182 }
183 
184 bool
187 {
188  return true;
189 }

Generated for HippoDraw Class Library by doxygen