VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Widgets
vtkDistanceRepresentation3D.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkDistanceRepresentation3D.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
=========================================================================*/
31
#ifndef __vtkDistanceRepresentation3D_h
32
#define __vtkDistanceRepresentation3D_h
33
34
#include "
vtkDistanceRepresentation.h
"
35
36
class
vtkPoints
;
37
class
vtkPolyData
;
38
class
vtkPolyDataMapper
;
39
class
vtkActor
;
40
class
vtkVectorText
;
41
class
vtkFollower
;
42
class
vtkBox
;
43
class
vtkCylinderSource
;
44
class
vtkGlyph3D
;
45
class
vtkDoubleArray
;
46
class
vtkTransformPolyDataFilter
;
47
class
vtkProperty
;
48
49
50
class
VTK_WIDGETS_EXPORT
vtkDistanceRepresentation3D
:
public
vtkDistanceRepresentation
51
{
52
public
:
54
static
vtkDistanceRepresentation3D
*
New
();
55
57
58
vtkTypeMacro(
vtkDistanceRepresentation3D
,
vtkDistanceRepresentation
);
59
void
PrintSelf
(ostream& os,
vtkIndent
indent);
61
63
64
virtual
double
GetDistance
()
65
{
return
this->Distance;}
67
69
71
void
SetGlyphScale(
double
scale
);
72
vtkGetMacro(GlyphScale,
double
);
74
76
virtual
vtkProperty
*GetLineProperty();
77
79
81
void
SetLabelPosition(
double
labelPosition);
82
vtkGetMacro(LabelPosition,
double
);
84
86
87
vtkSetClampMacro(MaximumNumberOfRulerTicks,
int
, 1,
VTK_LARGE_INTEGER
);
88
vtkGetMacro(MaximumNumberOfRulerTicks,
int
);
90
92
94
vtkGetObjectMacro(GlyphActor,
vtkActor
);
96
98
100
vtkGetObjectMacro(LabelActor,
vtkFollower
);
102
104
107
double
*
GetPoint1WorldPosition
();
108
double
*
GetPoint2WorldPosition
();
109
void
GetPoint1WorldPosition
(
double
pos[3]);
110
void
GetPoint2WorldPosition
(
double
pos[3]);
111
void
SetPoint1WorldPosition
(
double
pos[3]);
112
void
SetPoint2WorldPosition
(
double
pos[3]);
114
115
void
SetPoint1DisplayPosition
(
double
pos[3]);
116
void
SetPoint2DisplayPosition
(
double
pos[3]);
117
void
GetPoint1DisplayPosition
(
double
pos[3]);
118
void
GetPoint2DisplayPosition
(
double
pos[3]);
119
121
122
virtual
void
BuildRepresentation
();
123
virtual
double
*
GetBounds
();
125
127
128
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*w);
129
virtual
int
RenderOpaqueGeometry
(
vtkViewport
*viewport);
130
virtual
int
RenderTranslucentPolygonalGeometry
(
vtkViewport
*viewport);
132
134
136
void
SetLabelScale(
double
x,
double
y,
double
z)
137
{
138
double
scale
[3];
139
scale[0] = x;
140
scale[1] = y;
141
scale[2] = z;
142
this->SetLabelScale(scale);
143
}
144
virtual
void
SetLabelScale(
double
scale
[3] );
145
virtual
double
* GetLabelScale();
147
149
virtual
vtkProperty
*GetLabelProperty();
150
151
protected
:
152
vtkDistanceRepresentation3D
();
153
~
vtkDistanceRepresentation3D
();
154
155
// The line
156
vtkPoints
*
LinePoints
;
157
vtkPolyData
*
LinePolyData
;
158
vtkPolyDataMapper
*
LineMapper
;
159
vtkActor
*
LineActor
;
160
161
// The distance label
162
vtkVectorText
*
LabelText
;
163
vtkPolyDataMapper
*
LabelMapper
;
164
vtkFollower
*
LabelActor
;
165
166
// Support internal operations
167
bool
LabelScaleSpecified
;
168
169
// The 3D disk tick marks
170
vtkPoints
*
GlyphPoints
;
171
vtkDoubleArray
*
GlyphVectors
;
172
vtkPolyData
*
GlyphPolyData
;
173
vtkCylinderSource
*
GlyphCylinder
;
174
vtkTransformPolyDataFilter
*
GlyphXForm
;
175
vtkGlyph3D
*
Glyph3D
;
176
vtkPolyDataMapper
*
GlyphMapper
;
177
vtkActor
*
GlyphActor
;
178
179
// Glyph3D scale
180
double
GlyphScale
;
181
bool
GlyphScaleSpecified
;
182
183
// The distance between the two points
184
double
Distance
;
185
186
// Support GetBounds() method
187
vtkBox
*
BoundingBox
;
188
189
// Maximum number of ticks on the 3d ruler
190
int
MaximumNumberOfRulerTicks
;
191
192
// Label title position
193
double
LabelPosition
;
194
195
private
:
196
vtkDistanceRepresentation3D
(
const
vtkDistanceRepresentation3D
&);
//Not implemented
197
void
operator=(
const
vtkDistanceRepresentation3D
&);
//Not implemented
198
199
// Internal method to update the position of the label.
200
void
UpdateLabelPosition();
201
};
202
203
#endif
Generated on Wed May 30 2012 13:22:26 for VTK by
1.8.1