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=========================================================================*/
28
29#ifndef vtkSliderRepresentation3D_h
30#define vtkSliderRepresentation3D_h
31
32#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
33#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
34#include "vtkInteractionWidgetsModule.h" // For export macro
36
37class vtkActor;
39class vtkSphereSource;
40class vtkCellPicker;
41class vtkProperty;
43class vtkVectorText;
44class vtkAssembly;
45class vtkTransform;
47class vtkMatrix4x4;
48
49class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
50{
51public:
56
58
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
66
75 void SetPoint1InWorldCoordinates(double x, double y, double z);
77
79
88 void SetPoint2InWorldCoordinates(double x, double y, double z);
90
92
96 void SetTitleText(const char*) override;
97 const char* GetTitleText() override;
99
101
105 vtkSetClampMacro(SliderShape, int, SphereShape, CylinderShape);
106 vtkGetMacro(SliderShape, int);
110
112
117 vtkSetMacro(Rotation, double);
118 vtkGetMacro(Rotation, double);
120
122
126 vtkGetObjectMacro(SliderProperty, vtkProperty);
128
130
133 vtkGetObjectMacro(TubeProperty, vtkProperty);
134 vtkGetObjectMacro(CapProperty, vtkProperty);
136
138
142 vtkGetObjectMacro(SelectedProperty, vtkProperty);
144
146
149 void PlaceWidget(double bounds[6]) override;
150 void BuildRepresentation() override;
151 void StartWidgetInteraction(double eventPos[2]) override;
152 void WidgetInteraction(double newEventPos[2]) override;
153 void Highlight(int) override;
155
157
160 double* GetBounds() VTK_SIZEHINT(6) override;
167
172
173 /*
174 * Register internal Pickers within PickingManager
175 */
176 void RegisterPickers() override;
177
178protected:
181
182 // Positioning the widget
185 double Length;
186
187 // These are the slider end points taking into account the thickness
188 // of the slider
189 double SP1[3];
190 double SP2[3];
191
192 // More ivars controlling the appearance of the widget
193 double Rotation;
195
196 // Do the picking
198
199 // Determine the parameter t along the slider
200 virtual double ComputePickPosition(double eventPos[2]);
201
202 // The widget consists of several actors, all grouped
203 // together using an assembly. This makes it easier to
204 // perform the final transformation into
206
207 // Cylinder used by other objects
210
211 // The tube
215
216 // The slider
222
223 // The left cap
227
228 // The right cap
231
232 // The text. There is an extra transform used to rotate
233 // both the title and label
237
241
242 // Transform used during slider motion
245
246 // Manage the state of the widget
252#if !defined(VTK_LEGACY_REMOVE)
253 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
255#endif
256
257private:
259 void operator=(const vtkSliderRepresentation3D&) = delete;
260};
261
262#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
create hierarchies of vtkProp3Ds (transformable props)
Definition vtkAssembly.h:70
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:34
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:62
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:50
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(...)