VTK  9.4.20251007
vtkSliderRepresentation3D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
19
20#ifndef vtkSliderRepresentation3D_h
21#define vtkSliderRepresentation3D_h
22
23#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
24#include "vtkInteractionWidgetsModule.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkActor;
30class vtkSphereSource;
31class vtkCellPicker;
32class vtkProperty;
34class vtkVectorText;
35class vtkAssembly;
36class vtkTransform;
38class vtkMatrix4x4;
39
40class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
41{
42public:
47
49
53 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
66 void SetPoint1InWorldCoordinates(double x, double y, double z);
68
70
79 void SetPoint2InWorldCoordinates(double x, double y, double z);
81
83
87 void SetTitleText(const char*) override;
88 const char* GetTitleText() override;
90
92
96 vtkSetClampMacro(SliderShape, int, SphereShape, CylinderShape);
97 vtkGetMacro(SliderShape, int);
101
103
108 vtkSetMacro(Rotation, double);
109 vtkGetMacro(Rotation, double);
111
113
117 vtkGetObjectMacro(SliderProperty, vtkProperty);
119
121
124 vtkGetObjectMacro(TubeProperty, vtkProperty);
125 vtkGetObjectMacro(CapProperty, vtkProperty);
127
129
133 vtkGetObjectMacro(SelectedProperty, vtkProperty);
135
137
140 void PlaceWidget(double bounds[6]) override;
141 void BuildRepresentation() override;
142 void StartWidgetInteraction(double eventPos[2]) override;
143 void WidgetInteraction(double newEventPos[2]) override;
144 void Highlight(int) override;
146
148
151 double* GetBounds() VTK_SIZEHINT(6) override;
152 void GetActors(vtkPropCollection* propCollection) override;
153 void ReleaseGraphicsResources(vtkWindow* window) override;
154 int RenderOpaqueGeometry(vtkViewport* viewport) override;
158
163
164 /*
165 * Register internal Pickers within PickingManager
166 */
167 void RegisterPickers() override;
168
169protected:
172
173 // Positioning the widget
176 double Length;
177
178 // These are the slider end points taking into account the thickness
179 // of the slider
180 double SP1[3];
181 double SP2[3];
182
183 // More ivars controlling the appearance of the widget
184 double Rotation;
186
187 // Do the picking
189
190 // Determine the parameter t along the slider
191 virtual double ComputePickPosition(double eventPos[2]);
192
193 // The widget consists of several actors, all grouped
194 // together using an assembly. This makes it easier to
195 // perform the final transformation into
197
198 // Cylinder used by other objects
201
202 // The tube
206
207 // The slider
213
214 // The left cap
218
219 // The right cap
222
223 // The text. There is an extra transform used to rotate
224 // both the title and label
228
232
233 // Transform used during slider motion
236
237 // Manage the state of the widget
243
244private:
246 void operator=(const vtkSliderRepresentation3D&) = delete;
247};
248
249VTK_ABI_NAMESPACE_END
250#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
create hierarchies of vtkProp3Ds (transformable props)
Definition vtkAssembly.h:62
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:29
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:60
provide the representation for a vtkSliderWidget with a 3D skin
vtkMTimeType GetMTime() override
Override GetMTime to include point coordinates.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods supporting the rendering process.
void SetPoint2InWorldCoordinates(double x, double y, double z)
Position the second end point of the slider.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods supporting the rendering process.
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.
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.
void GetActors(vtkPropCollection *propCollection) 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.
void ReleaseGraphicsResources(vtkWindow *window) 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:46
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_SIZEHINT(...)