VTK  9.5.20251120
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
48
49#ifndef vtkSliderRepresentation3D_h
50#define vtkSliderRepresentation3D_h
51
52#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
53#include "vtkInteractionWidgetsModule.h" // For export macro
55
56VTK_ABI_NAMESPACE_BEGIN
57class vtkActor;
59class vtkSphereSource;
60class vtkCellPicker;
61class vtkProperty;
63class vtkVectorText;
64class vtkAssembly;
65class vtkTransform;
67class vtkMatrix4x4;
68
69class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
70{
71public:
76
78
82 void PrintSelf(ostream& os, vtkIndent indent) override;
84
86
95 void SetPoint1InWorldCoordinates(double x, double y, double z);
97
99
108 void SetPoint2InWorldCoordinates(double x, double y, double z);
110
112
116 void SetTitleText(const char*) override;
117 const char* GetTitleText() override;
119
121
125 vtkSetClampMacro(SliderShape, int, SphereShape, CylinderShape);
126 vtkGetMacro(SliderShape, int);
130
132
137 vtkSetMacro(Rotation, double);
138 vtkGetMacro(Rotation, double);
140
142
146 vtkGetObjectMacro(SliderProperty, vtkProperty);
148
150
153 vtkGetObjectMacro(TubeProperty, vtkProperty);
154 vtkGetObjectMacro(CapProperty, vtkProperty);
156
158
162 vtkGetObjectMacro(SelectedProperty, vtkProperty);
164
166
169 void PlaceWidget(double bounds[6]) override;
170 void BuildRepresentation() override;
171 void StartWidgetInteraction(double eventPos[2]) override;
172 void WidgetInteraction(double newEventPos[2]) override;
173 void Highlight(int) override;
175
177
180 double* GetBounds() VTK_SIZEHINT(6) override;
181 void GetActors(vtkPropCollection* propCollection) override;
182 void ReleaseGraphicsResources(vtkWindow* window) override;
183 int RenderOpaqueGeometry(vtkViewport* viewport) override;
187
192
193 /*
194 * Register internal Pickers within PickingManager
195 */
196 void RegisterPickers() override;
197
198protected:
201
202 // Positioning the widget
205 double Length;
206
207 // These are the slider end points taking into account the thickness
208 // of the slider
209 double SP1[3];
210 double SP2[3];
211
212 // More ivars controlling the appearance of the widget
213 double Rotation;
215
216 // Do the picking
218
219 // Determine the parameter t along the slider
220 virtual double ComputePickPosition(double eventPos[2]);
221
222 // The widget consists of several actors, all grouped
223 // together using an assembly. This makes it easier to
224 // perform the final transformation into
226
227 // Cylinder used by other objects
230
231 // The tube
235
236 // The slider
242
243 // The left cap
247
248 // The right cap
251
252 // The text. There is an extra transform used to rotate
253 // both the title and label
257
261
262 // Transform used during slider motion
265
266 // Manage the state of the widget
272
273private:
275 void operator=(const vtkSliderRepresentation3D&) = delete;
276};
277
278VTK_ABI_NAMESPACE_END
279#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
create hierarchies of vtkProp3Ds (transformable props)
Definition vtkAssembly.h:91
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:108
represent and manipulate 4x4 transformation matrices
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
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:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_SIZEHINT(...)