VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Widgets
vtkCenteredSliderRepresentation.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkCenteredSliderRepresentation.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
35
#ifndef __vtkCenteredSliderRepresentation_h
36
#define __vtkCenteredSliderRepresentation_h
37
38
#include "
vtkSliderRepresentation.h
"
39
#include "
vtkCoordinate.h
"
// For vtkViewportCoordinateMacro
40
41
class
vtkPoints
;
42
class
vtkCellArray
;
43
class
vtkPolyData
;
44
class
vtkPolyDataMapper2D
;
45
class
vtkActor2D
;
46
class
vtkCoordinate
;
47
class
vtkProperty2D
;
48
class
vtkPropCollection
;
49
class
vtkWindow
;
50
class
vtkViewport
;
51
class
vtkTransform
;
52
class
vtkTransformPolyDataFilter
;
53
class
vtkTextProperty
;
54
class
vtkTextMapper
;
55
class
vtkTextActor
;
56
57
58
class
VTK_WIDGETS_EXPORT
vtkCenteredSliderRepresentation
:
public
vtkSliderRepresentation
59
{
60
public
:
62
static
vtkCenteredSliderRepresentation
*
New
();
63
65
66
vtkTypeMacro(
vtkCenteredSliderRepresentation
,
67
vtkSliderRepresentation
);
68
void
PrintSelf
(ostream& os,
vtkIndent
indent);
70
77
vtkCoordinate
*GetPoint1Coordinate();
78
85
vtkCoordinate
*GetPoint2Coordinate();
86
88
90
virtual
void
SetTitleText
(
const
char
*);
91
virtual
const
char
*
GetTitleText
();
93
95
96
vtkGetObjectMacro(TubeProperty,
vtkProperty2D
);
97
vtkGetObjectMacro(SliderProperty,
vtkProperty2D
);
99
101
103
vtkGetObjectMacro(SelectedProperty,
vtkProperty2D
);
105
107
108
vtkGetObjectMacro(LabelProperty,
vtkTextProperty
);
110
112
115
virtual
void
PlaceWidget
(
double
bounds[6]);
116
virtual
void
BuildRepresentation
();
117
virtual
void
StartWidgetInteraction
(
double
eventPos[2]);
118
virtual
int
ComputeInteractionState
(
int
X,
int
Y,
int
modify=0);
119
virtual
void
WidgetInteraction
(
double
eventPos[2]);
120
virtual
void
Highlight
(
int
);
122
124
125
virtual
void
GetActors
(
vtkPropCollection
*);
126
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*);
127
virtual
int
RenderOverlay
(
vtkViewport
*);
128
virtual
int
RenderOpaqueGeometry
(
vtkViewport
*);
130
131
protected
:
132
vtkCenteredSliderRepresentation
();
133
~
vtkCenteredSliderRepresentation
();
134
135
// Positioning the widget
136
vtkCoordinate
*
Point1Coordinate
;
137
vtkCoordinate
*
Point2Coordinate
;
138
139
// Determine the parameter t along the slider
140
virtual
double
ComputePickPosition(
double
x,
double
y);
141
142
// Define the geometry. It is constructed in canaonical position
143
// along the x-axis and then rotated into position.
144
vtkTransform
*
XForm
;
145
vtkPoints
*
Points
;
146
147
vtkCellArray
*
SliderCells
;
148
vtkPolyData
*
Slider
;
149
vtkTransformPolyDataFilter
*
SliderXForm
;
150
vtkPolyDataMapper2D
*
SliderMapper
;
151
vtkActor2D
*
SliderActor
;
152
vtkProperty2D
*
SliderProperty
;
153
154
vtkCellArray
*
TubeCells
;
155
vtkPolyData
*
Tube
;
156
vtkTransformPolyDataFilter
*
TubeXForm
;
157
vtkPolyDataMapper2D
*
TubeMapper
;
158
vtkActor2D
*
TubeActor
;
159
vtkProperty2D
*
TubeProperty
;
160
161
vtkTextProperty
*
LabelProperty
;
162
vtkTextActor
*
LabelActor
;
163
164
vtkProperty2D
*
SelectedProperty
;
165
int
HighlightState
;
166
167
// build the tube geometry
168
void
BuildTube();
169
170
private
:
171
172
// how many points along the tube
173
int
ArcCount;
174
double
ArcStart;
175
double
ArcEnd;
176
double
ButtonSize;
177
double
TubeSize;
178
179
vtkCenteredSliderRepresentation
180
(
const
vtkCenteredSliderRepresentation
&);
// Not implemented
181
void
operator=(
const
vtkCenteredSliderRepresentation
&);
//Not implemented
182
};
183
184
#endif
Generated on Wed Nov 21 2012 21:34:08 for VTK by
1.8.2