VTK  9.3.20240419
vtkSliderRepresentation2D.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
129 #ifndef vtkSliderRepresentation2D_h
130 #define vtkSliderRepresentation2D_h
131 
132 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
133 #include "vtkInteractionWidgetsModule.h" // For export macro
134 #include "vtkSliderRepresentation.h"
135 
136 VTK_ABI_NAMESPACE_BEGIN
137 class vtkPoints;
138 class vtkCellArray;
139 class vtkPolyData;
140 class vtkPolyDataMapper2D;
141 class vtkActor2D;
142 class vtkCoordinate;
143 class vtkProperty2D;
144 class vtkPropCollection;
145 class vtkWindow;
146 class vtkViewport;
147 class vtkTransform;
149 class vtkTextProperty;
150 class vtkTextMapper;
151 class vtkTextActor;
152 
153 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
154 {
155 public:
160 
162 
166  void PrintSelf(ostream& os, vtkIndent indent) override;
168 
178 
188 
190 
194  void SetTitleText(const char*) override;
195  const char* GetTitleText() override;
197 
199 
203  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
205 
207 
210  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
211  vtkGetObjectMacro(CapProperty, vtkProperty2D);
213 
215 
219  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
221 
223 
226  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
227  vtkGetObjectMacro(TitleProperty, vtkTextProperty);
229 
231 
236  void PlaceWidget(double bounds[6]) override;
237  void BuildRepresentation() override;
238  void StartWidgetInteraction(double eventPos[2]) override;
239  void WidgetInteraction(double newEventPos[2]) override;
240  void Highlight(int) override;
242 
244 
247  void GetActors2D(vtkPropCollection* propCollection) override;
248  void ReleaseGraphicsResources(vtkWindow* window) override;
249  int RenderOverlay(vtkViewport* viewport) override;
250  int RenderOpaqueGeometry(vtkViewport* viewport) override;
252 
253 protected:
256 
257  // Positioning the widget
260 
261  // Determine the parameter t along the slider
262  virtual double ComputePickPosition(double eventPos[2]);
263 
264  // Define the geometry. It is constructed in canaonical position
265  // along the x-axis and then rotated into position.
268 
275 
282 
289 
293 
297 
299 
300  // internal variables used for computation
301  double X;
302 
303 private:
305  void operator=(const vtkSliderRepresentation2D&) = delete;
306 };
307 
308 VTK_ABI_NAMESPACE_END
309 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:145
object to represent cell connectivity
Definition: vtkCellArray.h:286
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 3D points
Definition: vtkPoints.h:139
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:181
an ordered list of Props
represent surface properties of a 2D image
provide the representation for a vtkSliderWidget with a 3D skin
void Highlight(int) override
Methods to interface with the vtkSliderWidget.
void WidgetInteraction(double newEventPos[2]) override
Methods to interface with the vtkSliderWidget.
int RenderOverlay(vtkViewport *viewport) override
Methods supporting the rendering process.
static vtkSliderRepresentation2D * New()
Instantiate the class.
void SetTitleText(const char *) override
Specify the label text for this widget.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
vtkTransformPolyDataFilter * TubeXForm
vtkTransformPolyDataFilter * SliderXForm
const char * GetTitleText() override
Specify the label text for this widget.
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkTransformPolyDataFilter * CapXForm
void ReleaseGraphicsResources(vtkWindow *window) override
Methods supporting the rendering process.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
void GetActors2D(vtkPropCollection *propCollection) override
Methods supporting the rendering process.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods supporting the rendering process.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
virtual double ComputePickPosition(double eventPos[2])
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
~vtkSliderRepresentation2D() override
abstract class defines the representation for a vtkSliderWidget
An actor that displays text.
Definition: vtkTextActor.h:155
2D text annotation
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:160
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48