VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Widgets
vtkSliderRepresentation3D.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkSliderRepresentation3D.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
=========================================================================*/
34
#ifndef __vtkSliderRepresentation3D_h
35
#define __vtkSliderRepresentation3D_h
36
37
#include "
vtkSliderRepresentation.h
"
38
#include "
vtkCoordinate.h
"
// For vtkViewportCoordinateMacro
39
40
class
vtkActor
;
41
class
vtkPolyDataMapper
;
42
class
vtkSphereSource
;
43
class
vtkCellPicker
;
44
class
vtkProperty
;
45
class
vtkCylinderSource
;
46
class
vtkVectorText
;
47
class
vtkAssembly
;
48
class
vtkTransform
;
49
class
vtkTransformPolyDataFilter
;
50
class
vtkMatrix4x4
;
51
52
53
class
VTK_WIDGETS_EXPORT
vtkSliderRepresentation3D
:
public
vtkSliderRepresentation
54
{
55
public
:
57
static
vtkSliderRepresentation3D
*
New
();
58
60
61
vtkTypeMacro(
vtkSliderRepresentation3D
,
vtkSliderRepresentation
);
62
void
PrintSelf
(ostream& os,
vtkIndent
indent);
64
66
72
vtkCoordinate
*GetPoint1Coordinate();
73
void
SetPoint1InWorldCoordinates(
double
x,
double
y,
double
z);
75
77
83
vtkCoordinate
*GetPoint2Coordinate();
84
void
SetPoint2InWorldCoordinates(
double
x,
double
y,
double
z);
86
88
90
virtual
void
SetTitleText
(
const
char
*);
91
virtual
const
char
*
GetTitleText
();
93
95
97
vtkSetClampMacro(SliderShape,
int
,SphereShape,CylinderShape);
98
vtkGetMacro(SliderShape,
int
);
99
void
SetSliderShapeToSphere
() { this->SetSliderShape(SphereShape); }
100
void
SetSliderShapeToCylinder
() { this->SetSliderShape(CylinderShape); }
102
104
107
vtkSetMacro(Rotation,
double
);
108
vtkGetMacro(Rotation,
double
);
110
112
114
vtkGetObjectMacro(SliderProperty,
vtkProperty
);
116
118
119
vtkGetObjectMacro(TubeProperty,
vtkProperty
);
120
vtkGetObjectMacro(CapProperty,
vtkProperty
);
122
124
126
vtkGetObjectMacro(SelectedProperty,
vtkProperty
);
128
130
131
virtual
void
PlaceWidget
(
double
bounds[6]);
132
virtual
void
BuildRepresentation
();
133
virtual
void
StartWidgetInteraction
(
double
eventPos[2]);
134
virtual
void
WidgetInteraction
(
double
newEventPos[2]);
135
virtual
void
Highlight
(
int
);
137
139
140
virtual
double
*
GetBounds
();
141
virtual
void
GetActors
(
vtkPropCollection
*);
142
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*);
143
virtual
int
RenderOpaqueGeometry
(
vtkViewport
*);
144
virtual
int
RenderTranslucentPolygonalGeometry
(
vtkViewport
*);
145
virtual
int
HasTranslucentPolygonalGeometry
();
147
149
virtual
unsigned
long
GetMTime
();
150
151
protected
:
152
vtkSliderRepresentation3D
();
153
~
vtkSliderRepresentation3D
();
154
155
// Positioning the widget
156
vtkCoordinate
*
Point1Coordinate
;
157
vtkCoordinate
*
Point2Coordinate
;
158
double
Length
;
159
160
// These are the slider end points taking into account the thickness
161
// of the slider
162
double
SP1[3];
163
double
SP2[3];
164
165
// More ivars controlling the appearance of the widget
166
double
Rotation
;
167
int
SliderShape
;
168
169
// Do the picking
170
vtkCellPicker
*
Picker
;
171
172
// Determine the parameter t along the slider
173
virtual
double
ComputePickPosition(
double
eventPos[2]);
174
175
// The widget consists of several actors, all grouped
176
// together using an assembly. This makes it easier to
177
// perform the final transformation into
178
vtkAssembly
*
WidgetAssembly
;
179
180
// Cylinder used by other objects
181
vtkCylinderSource
*
CylinderSource
;
182
vtkTransformPolyDataFilter
*
Cylinder
;
183
184
// The tube
185
vtkPolyDataMapper
*
TubeMapper
;
186
vtkActor
*
TubeActor
;
187
vtkProperty
*
TubeProperty
;
188
189
// The slider
190
vtkSphereSource
*
SliderSource
;
191
vtkPolyDataMapper
*
SliderMapper
;
192
vtkActor
*
SliderActor
;
193
vtkProperty
*
SliderProperty
;
194
vtkProperty
*
SelectedProperty
;
195
196
// The left cap
197
vtkPolyDataMapper
*
LeftCapMapper
;
198
vtkActor
*
LeftCapActor
;
199
vtkProperty
*
CapProperty
;
200
201
// The right cap
202
vtkPolyDataMapper
*
RightCapMapper
;
203
vtkActor
*
RightCapActor
;
204
205
// The text. There is an extra transform used to rotate
206
// both the title and label
207
vtkVectorText
*
LabelText
;
208
vtkPolyDataMapper
*
LabelMapper
;
209
vtkActor
*
LabelActor
;
210
211
vtkVectorText
*
TitleText
;
212
vtkPolyDataMapper
*
TitleMapper
;
213
vtkActor
*
TitleActor
;
214
215
// Transform used during slider motion
216
vtkMatrix4x4
*
Matrix
;
217
vtkTransform
*
Transform
;
218
219
//BTX - manage the state of the widget
220
enum
_SliderShape
{
221
SphereShape
,
222
CylinderShape
223
};
224
225
//ETX
226
227
228
private
:
229
vtkSliderRepresentation3D
(
const
vtkSliderRepresentation3D
&);
//Not implemented
230
void
operator=(
const
vtkSliderRepresentation3D
&);
//Not implemented
231
};
232
233
#endif
Generated on Wed May 30 2012 13:22:27 for VTK by
1.8.1