VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Charts
vtkPlot.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkPlot.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
32
#ifndef __vtkPlot_h
33
#define __vtkPlot_h
34
35
#include "
vtkContextItem.h
"
36
#include "
vtkStdString.h
"
// Needed to hold TooltipLabelFormat ivar
37
#include "
vtkSmartPointer.h
"
// Needed to hold SP ivars
38
39
class
vtkVariant
;
40
class
vtkTable
;
41
class
vtkIdTypeArray
;
42
class
vtkContextMapper2D
;
43
class
vtkPen
;
44
class
vtkBrush
;
45
class
vtkAxis
;
46
class
vtkVector2f
;
47
class
vtkRectf
;
48
class
vtkStringArray
;
49
50
class
VTK_CHARTS_EXPORT
vtkPlot
:
public
vtkContextItem
51
{
52
public
:
53
vtkTypeMacro(
vtkPlot
,
vtkContextItem
);
54
virtual
void
PrintSelf
(ostream &os,
vtkIndent
indent);
55
57
62
virtual
bool
PaintLegend(
vtkContext2D
*painter,
const
vtkRectf
& rect,
63
int
legendIndex);
65
67
75
virtual
void
SetTooltipLabelFormat(
const
vtkStdString
&label);
76
virtual
vtkStdString
GetTooltipLabelFormat();
78
79
//BTX
81
83
virtual
vtkStdString
GetTooltipLabel(
const
vtkVector2f
&plotPos,
84
vtkIdType
seriesIndex,
85
vtkIdType
segmentIndex);
87
89
92
virtual
vtkIdType
GetNearestPoint(
const
vtkVector2f
&
point
,
93
const
vtkVector2f
& tolerance,
94
vtkVector2f
*
location
);
96
98
99
virtual
bool
SelectPoints(
const
vtkVector2f
& min,
const
vtkVector2f
&
max
);
100
//ETX
102
104
105
virtual
void
SetColor(
unsigned
char
r,
unsigned
char
g,
unsigned
char
b,
106
unsigned
char
a);
107
virtual
void
SetColor(
double
r,
double
g,
double
b);
108
virtual
void
GetColor(
double
rgb[3]);
109
void
GetColor(
unsigned
char
rgb[3]);
111
113
virtual
void
SetWidth(
float
width);
114
116
virtual
float
GetWidth();
117
119
121
vtkGetObjectMacro(Pen,
vtkPen
);
123
125
127
vtkGetObjectMacro(Brush,
vtkBrush
);
129
131
virtual
void
SetLabel(
const
vtkStdString
&label);
132
134
virtual
vtkStdString
GetLabel();
135
138
virtual
void
SetLabels(
vtkStringArray
*labels);
139
143
virtual
vtkStringArray
*GetLabels();
144
146
virtual
int
GetNumberOfLabels();
147
149
vtkStdString
GetLabel(
vtkIdType
index
);
150
155
void
SetIndexedLabels(
vtkStringArray
*labels);
156
158
virtual
vtkStringArray
*GetIndexedLabels();
159
161
162
vtkGetObjectMacro(Data,
vtkContextMapper2D
);
164
166
169
vtkGetMacro(UseIndexForXSeries,
bool
);
171
173
176
vtkSetMacro(UseIndexForXSeries,
bool
);
178
180
182
virtual
void
SetInput(
vtkTable
*table);
183
virtual
void
SetInput(
vtkTable
*table,
const
vtkStdString
&xColumn,
184
const
vtkStdString
&yColumn);
185
void
SetInput(
vtkTable
*table,
vtkIdType
xColumn,
vtkIdType
yColumn);
187
189
virtual
vtkTable
* GetInput();
190
194
virtual
void
SetInputArray(
int
index
,
const
vtkStdString
&
name
);
195
196
virtual
void
SetSelection(
vtkIdTypeArray
*
id
);
197
vtkGetObjectMacro(Selection,
vtkIdTypeArray
);
198
200
201
vtkGetObjectMacro(XAxis,
vtkAxis
);
202
virtual
void
SetXAxis(
vtkAxis
* axis);
204
206
207
vtkGetObjectMacro(YAxis,
vtkAxis
);
208
virtual
void
SetYAxis(
vtkAxis
* axis);
210
212
213
virtual
void
GetBounds
(
double
bounds[4])
214
{ bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; }
216
217
//BTX
219
221
virtual
void
SetProperty(
const
vtkStdString
&property,
const
vtkVariant
&var);
222
virtual
vtkVariant
GetProperty(
const
vtkStdString
&property);
223
//ETX
225
226
//BTX
227
protected
:
228
vtkPlot
();
229
~
vtkPlot
();
230
232
vtkStdString
GetNumber(
double
position
,
vtkAxis
*axis);
233
235
vtkPen
*
Pen
;
236
238
vtkBrush
*
Brush
;
239
241
vtkSmartPointer<vtkStringArray>
Labels
;
242
244
vtkSmartPointer<vtkStringArray>
AutoLabels
;
245
247
vtkSmartPointer<vtkStringArray>
IndexedLabels
;
248
252
bool
UseIndexForXSeries
;
253
256
vtkContextMapper2D
*
Data
;
257
259
vtkIdTypeArray
*
Selection
;
260
262
vtkAxis
*
XAxis
;
263
265
vtkAxis
*
YAxis
;
266
269
vtkStdString
TooltipLabelFormat
;
270
273
vtkStdString
TooltipDefaultLabelFormat
;
274
275
private
:
276
vtkPlot
(
const
vtkPlot
&);
// Not implemented.
277
void
operator=(
const
vtkPlot
&);
// Not implemented.
278
279
//ETX
280
};
281
282
#endif //__vtkPlot_h
Generated on Fri Aug 2 2013 12:19:46 for VTK by
1.8.4