VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Interaction
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 "vtkInteractionWidgetsModule.h"
// For export macro
38
#include "
vtkSliderRepresentation.h
"
39
#include "
vtkCoordinate.h
"
// For vtkViewportCoordinateMacro
40
41
class
vtkActor
;
42
class
vtkPolyDataMapper
;
43
class
vtkSphereSource
;
44
class
vtkCellPicker
;
45
class
vtkProperty
;
46
class
vtkCylinderSource
;
47
class
vtkVectorText
;
48
class
vtkAssembly
;
49
class
vtkTransform
;
50
class
vtkTransformPolyDataFilter
;
51
class
vtkMatrix4x4
;
52
53
54
class
VTKINTERACTIONWIDGETS_EXPORT
vtkSliderRepresentation3D
:
public
vtkSliderRepresentation
55
{
56
public
:
58
static
vtkSliderRepresentation3D
*
New
();
59
61
62
vtkTypeMacro(
vtkSliderRepresentation3D
,
vtkSliderRepresentation
);
63
void
PrintSelf
(ostream& os,
vtkIndent
indent);
65
67
73
vtkCoordinate
*GetPoint1Coordinate();
74
void
SetPoint1InWorldCoordinates(
double
x,
double
y,
double
z);
76
78
84
vtkCoordinate
*GetPoint2Coordinate();
85
void
SetPoint2InWorldCoordinates(
double
x,
double
y,
double
z);
87
89
91
virtual
void
SetTitleText
(
const
char
*);
92
virtual
const
char
*
GetTitleText
();
94
96
98
vtkSetClampMacro(SliderShape,
int
,SphereShape,CylinderShape);
99
vtkGetMacro(SliderShape,
int
);
100
void
SetSliderShapeToSphere
() { this->SetSliderShape(SphereShape); }
101
void
SetSliderShapeToCylinder
() { this->SetSliderShape(CylinderShape); }
103
105
108
vtkSetMacro(Rotation,
double
);
109
vtkGetMacro(Rotation,
double
);
111
113
115
vtkGetObjectMacro(SliderProperty,
vtkProperty
);
117
119
120
vtkGetObjectMacro(TubeProperty,
vtkProperty
);
121
vtkGetObjectMacro(CapProperty,
vtkProperty
);
123
125
127
vtkGetObjectMacro(SelectedProperty,
vtkProperty
);
129
131
132
virtual
void
PlaceWidget
(
double
bounds[6]);
133
virtual
void
BuildRepresentation
();
134
virtual
void
StartWidgetInteraction
(
double
eventPos[2]);
135
virtual
void
WidgetInteraction
(
double
newEventPos[2]);
136
virtual
void
Highlight
(
int
);
138
140
141
virtual
double
*
GetBounds
();
142
virtual
void
GetActors
(
vtkPropCollection
*);
143
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*);
144
virtual
int
RenderOpaqueGeometry
(
vtkViewport
*);
145
virtual
int
RenderTranslucentPolygonalGeometry
(
vtkViewport
*);
146
virtual
int
HasTranslucentPolygonalGeometry
();
148
150
virtual
unsigned
long
GetMTime
();
151
152
protected
:
153
vtkSliderRepresentation3D
();
154
~
vtkSliderRepresentation3D
();
155
156
// Positioning the widget
157
vtkCoordinate
*
Point1Coordinate
;
158
vtkCoordinate
*
Point2Coordinate
;
159
double
Length
;
160
161
// These are the slider end points taking into account the thickness
162
// of the slider
163
double
SP1[3];
164
double
SP2[3];
165
166
// More ivars controlling the appearance of the widget
167
double
Rotation
;
168
int
SliderShape
;
169
170
// Do the picking
171
vtkCellPicker
*
Picker
;
172
173
// Determine the parameter t along the slider
174
virtual
double
ComputePickPosition(
double
eventPos[2]);
175
176
// The widget consists of several actors, all grouped
177
// together using an assembly. This makes it easier to
178
// perform the final transformation into
179
vtkAssembly
*
WidgetAssembly
;
180
181
// Cylinder used by other objects
182
vtkCylinderSource
*
CylinderSource
;
183
vtkTransformPolyDataFilter
*
Cylinder
;
184
185
// The tube
186
vtkPolyDataMapper
*
TubeMapper
;
187
vtkActor
*
TubeActor
;
188
vtkProperty
*
TubeProperty
;
189
190
// The slider
191
vtkSphereSource
*
SliderSource
;
192
vtkPolyDataMapper
*
SliderMapper
;
193
vtkActor
*
SliderActor
;
194
vtkProperty
*
SliderProperty
;
195
vtkProperty
*
SelectedProperty
;
196
197
// The left cap
198
vtkPolyDataMapper
*
LeftCapMapper
;
199
vtkActor
*
LeftCapActor
;
200
vtkProperty
*
CapProperty
;
201
202
// The right cap
203
vtkPolyDataMapper
*
RightCapMapper
;
204
vtkActor
*
RightCapActor
;
205
206
// The text. There is an extra transform used to rotate
207
// both the title and label
208
vtkVectorText
*
LabelText
;
209
vtkPolyDataMapper
*
LabelMapper
;
210
vtkActor
*
LabelActor
;
211
212
vtkVectorText
*
TitleText
;
213
vtkPolyDataMapper
*
TitleMapper
;
214
vtkActor
*
TitleActor
;
215
216
// Transform used during slider motion
217
vtkMatrix4x4
*
Matrix
;
218
vtkTransform
*
Transform
;
219
220
//BTX - manage the state of the widget
221
enum
_SliderShape
{
222
SphereShape
,
223
CylinderShape
224
};
225
226
//ETX
227
228
229
private
:
230
vtkSliderRepresentation3D
(
const
vtkSliderRepresentation3D
&);
//Not implemented
231
void
operator=(
const
vtkSliderRepresentation3D
&);
//Not implemented
232
};
233
234
#endif
Generated on Thu May 24 2012 22:22:28 for VTK by
1.8.1