VTK  9.2.6
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=========================================================================*/
31
32#ifndef vtkSliderRepresentation3D_h
33#define vtkSliderRepresentation3D_h
34
35#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
36#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
37#include "vtkInteractionWidgetsModule.h" // For export macro
39
40class vtkActor;
42class vtkSphereSource;
43class vtkCellPicker;
44class vtkProperty;
46class vtkVectorText;
47class vtkAssembly;
48class vtkTransform;
50class vtkMatrix4x4;
51
52class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
53{
54public:
59
61
65 void PrintSelf(ostream& os, vtkIndent indent) override;
67
69
78 void SetPoint1InWorldCoordinates(double x, double y, double z);
80
82
91 void SetPoint2InWorldCoordinates(double x, double y, double z);
93
95
99 void SetTitleText(const char*) override;
100 const char* GetTitleText() override;
102
104
108 vtkSetClampMacro(SliderShape, int, SphereShape, CylinderShape);
109 vtkGetMacro(SliderShape, int);
113
115
120 vtkSetMacro(Rotation, double);
121 vtkGetMacro(Rotation, double);
123
125
129 vtkGetObjectMacro(SliderProperty, vtkProperty);
131
133
136 vtkGetObjectMacro(TubeProperty, vtkProperty);
137 vtkGetObjectMacro(CapProperty, vtkProperty);
139
141
145 vtkGetObjectMacro(SelectedProperty, vtkProperty);
147
149
152 void PlaceWidget(double bounds[6]) override;
153 void BuildRepresentation() override;
154 void StartWidgetInteraction(double eventPos[2]) override;
155 void WidgetInteraction(double newEventPos[2]) override;
156 void Highlight(int) override;
158
160
163 double* GetBounds() VTK_SIZEHINT(6) override;
170
175
176 /*
177 * Register internal Pickers within PickingManager
178 */
179 void RegisterPickers() override;
180
181protected:
184
185 // Positioning the widget
188 double Length;
189
190 // These are the slider end points taking into account the thickness
191 // of the slider
192 double SP1[3];
193 double SP2[3];
194
195 // More ivars controlling the appearance of the widget
196 double Rotation;
198
199 // Do the picking
201
202 // Determine the parameter t along the slider
203 virtual double ComputePickPosition(double eventPos[2]);
204
205 // The widget consists of several actors, all grouped
206 // together using an assembly. This makes it easier to
207 // perform the final transformation into
209
210 // Cylinder used by other objects
213
214 // The tube
218
219 // The slider
225
226 // The left cap
230
231 // The right cap
234
235 // The text. There is an extra transform used to rotate
236 // both the title and label
240
244
245 // Transform used during slider motion
248
249 // Manage the state of the widget
255#if !defined(VTK_LEGACY_REMOVE)
256 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
258#endif
259
260private:
262 void operator=(const vtkSliderRepresentation3D&) = delete;
263};
264
265#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:52
create hierarchies of vtkProp3Ds (transformable props)
Definition vtkAssembly.h:73
ray-cast cell picker for all kinds of Prop3Ds
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
generate a polygonal cylinder centered at the origin
a simple class to control print indentation
Definition vtkIndent.h:40
represent and manipulate 4x4 transformation matrices
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
Definition vtkProperty.h:68
vtkMTimeType GetMTime() override
Override GetMTime to include point coordinates.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Methods supporting the rendering process.
void SetPoint2InWorldCoordinates(double x, double y, double z)
Position the second end point of the slider.
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
void Highlight(int) override
Methods to interface with the vtkSliderWidget.
virtual void SetSliderShape(int)
Specify whether to use a sphere or cylinder slider shape.
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
const char * GetTitleText() override
Specify the title text for this widget.
void WidgetInteraction(double newEventPos[2]) override
Methods to interface with the vtkSliderWidget.
virtual double ComputePickPosition(double eventPos[2])
double * GetBounds() override
Methods supporting the rendering process.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void SetSliderShapeToCylinder()
Specify whether to use a sphere or cylinder slider shape.
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
void GetActors(vtkPropCollection *) override
Methods supporting the rendering process.
vtkTransformPolyDataFilter * Cylinder
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
void SetTitleText(const char *) override
Specify the title text for this widget.
static vtkSliderRepresentation3D * New()
Instantiate the class.
void SetPoint1InWorldCoordinates(double x, double y, double z)
Position the first end point of the slider.
void SetSliderShapeToSphere()
Specify whether to use a sphere or cylinder slider shape.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods supporting the rendering process.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
create a polygonal sphere centered at the origin
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
create polygonal text
abstract specification for Viewports
Definition vtkViewport.h:56
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_SIZEHINT(...)