VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Geovis
vtkCompassRepresentation.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkCompassRepresentation.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
16
/*-------------------------------------------------------------------------
17
Copyright 2008 Sandia Corporation.
18
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19
the U.S. Government retains certain rights in this software.
20
-------------------------------------------------------------------------*/
21
28
#ifndef __vtkCompassRepresentation_h
29
#define __vtkCompassRepresentation_h
30
31
#include "
vtkContinuousValueWidgetRepresentation.h
"
32
#include "
vtkCoordinate.h
"
// For vtkViewportCoordinateMacro
33
#include "
vtkCenteredSliderRepresentation.h
"
// to use in a SP
34
#include "
vtkSmartPointer.h
"
// used for SmartPointers
35
36
class
vtkActor2D
;
37
class
vtkPoints
;
38
class
vtkCellArray
;
39
class
vtkPolyData
;
40
class
vtkPolyDataMapper2D
;
41
class
vtkCoordinate
;
42
class
vtkProperty2D
;
43
class
vtkPropCollection
;
44
class
vtkWindow
;
45
class
vtkViewport
;
46
class
vtkTransform
;
47
class
vtkTransformPolyDataFilter
;
48
class
vtkTextProperty
;
49
class
vtkTextActor
;
50
51
52
class
VTK_GEOVIS_EXPORT
vtkCompassRepresentation
:
53
public
vtkContinuousValueWidgetRepresentation
54
{
55
public
:
57
static
vtkCompassRepresentation
*
New
();
58
60
61
vtkTypeMacro(
vtkCompassRepresentation
,
62
vtkContinuousValueWidgetRepresentation
);
63
void
PrintSelf
(ostream& os,
vtkIndent
indent);
65
72
vtkCoordinate
*GetPoint1Coordinate();
73
80
vtkCoordinate
*GetPoint2Coordinate();
81
83
85
vtkGetObjectMacro(RingProperty,
vtkProperty2D
);
87
89
91
vtkGetObjectMacro(SelectedProperty,
vtkProperty2D
);
93
95
96
vtkGetObjectMacro(LabelProperty,
vtkTextProperty
);
98
100
103
virtual
void
PlaceWidget
(
double
bounds[6]);
104
virtual
void
BuildRepresentation
();
105
virtual
void
StartWidgetInteraction
(
double
eventPos[2]);
106
virtual
void
WidgetInteraction
(
double
eventPos[2]);
107
virtual
void
TiltWidgetInteraction(
double
eventPos[2]);
108
virtual
void
DistanceWidgetInteraction(
double
eventPos[2]);
109
virtual
int
ComputeInteractionState
(
int
X,
int
Y,
int
modify=0);
110
virtual
void
Highlight
(
int
);
112
114
115
virtual
void
GetActors
(
vtkPropCollection
*);
116
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*);
117
virtual
int
RenderOverlay
(
vtkViewport
*);
118
virtual
int
RenderOpaqueGeometry
(
vtkViewport
*);
120
121
virtual
void
SetHeading(
double
value
);
122
virtual
double
GetHeading();
123
virtual
void
SetTilt(
double
value
);
124
virtual
double
GetTilt();
125
virtual
void
UpdateTilt(
double
time
);
126
virtual
void
EndTilt();
127
virtual
void
SetDistance(
double
value
);
128
virtual
double
GetDistance();
129
virtual
void
UpdateDistance(
double
time
);
130
virtual
void
EndDistance();
131
virtual
void
SetRenderer
(
vtkRenderer
*ren);
132
133
//BTX
134
// Enums are used to describe what is selected
135
enum
_InteractionState
136
{
137
Outside=0,
138
Inside
,
139
Adjusting
,
140
TiltDown
,
141
TiltUp
,
142
TiltAdjusting
,
143
DistanceOut
,
144
DistanceIn
,
145
DistanceAdjusting
146
};
147
//ETX
148
149
protected
:
150
vtkCompassRepresentation
();
151
~
vtkCompassRepresentation
();
152
153
// Positioning the widget
154
vtkCoordinate
*
Point1Coordinate
;
155
vtkCoordinate
*
Point2Coordinate
;
156
157
// radius values
158
double
InnerRadius
;
159
double
OuterRadius
;
160
161
// tilt and distance rep
162
//BTX
163
vtkSmartPointer<vtkCenteredSliderRepresentation>
TiltRepresentation
;
164
vtkSmartPointer<vtkCenteredSliderRepresentation>
DistanceRepresentation
;
165
//ETX
166
167
// Define the geometry. It is constructed in canaonical position
168
// along the x-axis and then rotated into position.
169
vtkTransform
*
XForm
;
170
vtkPoints
*
Points
;
171
172
vtkPolyData
*
Ring
;
173
vtkTransformPolyDataFilter
*
RingXForm
;
174
vtkPolyDataMapper2D
*
RingMapper
;
175
vtkActor2D
*
RingActor
;
176
vtkProperty2D
*
RingProperty
;
177
178
vtkPolyDataMapper2D
*
BackdropMapper
;
179
vtkActor2D
*
Backdrop
;
180
181
vtkTextProperty
*
LabelProperty
;
182
vtkTextActor
*
LabelActor
;
183
vtkTextProperty
*
StatusProperty
;
184
vtkTextActor
*
StatusActor
;
185
186
vtkProperty2D
*
SelectedProperty
;
187
188
// build the tube geometry
189
void
BuildRing();
190
void
BuildBackdrop();
191
192
// used for positioning etc
193
void
GetCenterAndUnitRadius(
int
center
[2],
double
&
radius
);
194
195
int
HighlightState
;
196
197
double
Heading
;
198
double
Tilt
;
199
double
Distance
;
200
201
private
:
202
vtkCompassRepresentation
(
const
vtkCompassRepresentation
&);
//Not implemented
203
void
operator=(
const
vtkCompassRepresentation
&);
//Not implemented
204
};
205
206
#endif
Generated on Fri Aug 2 2013 12:19:48 for VTK by
1.8.4