Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
plotters
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
29
TextPlotter::TextPlotter
( )
30
:
PlotterBase
(
"TextPlotter"
)
31
{
32
m_datarep
=
new
TextDataRep
( 0 );
33
m_title
=
"none"
;
34
}
35
36
TextPlotter::TextPlotter
(
const
TextPlotter
& plotter )
37
:
PlotterBase
( plotter )
38
{
39
}
40
41
TextPlotter::~TextPlotter
()
42
{
43
if
(
m_datarep
!= 0 )
delete
m_datarep
;
44
}
45
46
PlotterBase
*
TextPlotter::clone
()
47
{
48
return
new
TextPlotter
( *
this
);
49
}
50
51
/* virtual */
52
void
TextPlotter::addDataRep
(
DataRep
* rep )
53
{
54
TextDataRep
* textrep = dynamic_cast <
TextDataRep
* > ( rep );
55
assert ( textrep != 0 );
56
57
m_datarep
= textrep;
58
}
59
60
int
TextPlotter::getNumDataReps
()
const
61
{
62
return
1;
63
}
64
65
DataRep
*
TextPlotter::getDataRep
(
int
)
const
66
{
67
return
m_datarep
;
68
}
69
70
void
TextPlotter::drawIn
(
ViewBase
* view )
71
{
72
m_datarep
->
drawProjectedValues
( 0, view );
73
}
74
75
bool
TextPlotter::hasNTupleBindings
()
const
76
{
77
return
false
;
78
}
79
80
void
TextPlotter::setRepresentation
(
RepBase
* rep )
81
{
82
m_datarep
->
setPointRep
( rep );
83
}
84
85
RepBase
*
TextPlotter::representation
()
const
86
{
87
return
m_datarep
->
getRepresentation
();
88
}
89
91
void
92
TextPlotter::
93
setErrorDisplay
(
hippodraw::Axes::Type
,
bool
)
94
{
95
assert (
false
);
96
}
97
99
bool
100
TextPlotter::
101
errorDisplay
(
hippodraw::Axes::Type
)
const
102
{
103
return
false
;
104
}
105
106
void
TextPlotter::setAxisModel
(
AxisModelBase
*,
hippodraw::Axes::Type
)
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
137
TextPlotter::
138
toUserXY
(
double
mx,
double
my,
bool
,
139
double
& ux,
double
& uy )
const
140
{
141
ux = mx;
142
uy = my;
143
}
144
145
const
DataRep
*
TextPlotter:: getParentDataRep
()
const
146
{
147
return
m_datarep
->
getParentDataRep
();
148
}
149
150
void
TextPlotter:: setParentDataRep
(
DataRep
* rep )
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 ){
160
m_datarep
->
setParentDataRep
( 0 );
161
}
162
}
163
164
TransformBase
*
TextPlotter::getTransform
()
165
{
166
return
0;
167
}
168
170
NTuple
*
171
TextPlotter::
172
createNTuple
()
const
173
{
174
return
0;
175
}
176
177
void
178
TextPlotter::
179
update
()
180
{
181
m_datarep
->
update
();
182
}
183
184
bool
185
TextPlotter::
186
isTextPlotter
()
const
187
{
188
return
true
;
189
}
Generated for HippoDraw Class Library by