VTK  9.3.20240328
vtkCenteredSliderRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4 
19 #ifndef vtkCenteredSliderRepresentation_h
20 #define vtkCenteredSliderRepresentation_h
21 
22 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
23 #include "vtkInteractionWidgetsModule.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkPoints;
28 class vtkCellArray;
29 class vtkPolyData;
31 class vtkActor2D;
32 class vtkCoordinate;
33 class vtkProperty2D;
34 class vtkPropCollection;
35 class vtkWindow;
36 class vtkViewport;
37 class vtkTransform;
39 class vtkTextProperty;
40 class vtkTextMapper;
41 class vtkTextActor;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderRepresentation : public vtkSliderRepresentation
44 {
45 public:
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
68 
78 
80 
84  void SetTitleText(const char*) override;
85  const char* GetTitleText() override;
87 
89 
92  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
93  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
95 
97 
101  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
103 
105 
108  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
110 
112 
117  void PlaceWidget(double bounds[6]) override;
118  void BuildRepresentation() override;
119  void StartWidgetInteraction(double eventPos[2]) override;
120  int ComputeInteractionState(int X, int Y, int modify = 0) override;
121  void WidgetInteraction(double eventPos[2]) override;
122  void Highlight(int) override;
124 
126 
129  void GetActors(vtkPropCollection* propCollections) override;
130  void ReleaseGraphicsResources(vtkWindow* window) override;
131  int RenderOverlay(vtkViewport*) override;
134 
135 protected:
138 
139  // Positioning the widget
142 
143  // Determine the parameter t along the slider
144  virtual double ComputePickPosition(double x, double y);
145 
146  // Define the geometry. It is constructed in canaonical position
147  // along the x-axis and then rotated into position.
150 
157 
164 
167 
170 
171  // build the tube geometry
172  void BuildTube();
173 
174 private:
175  // how many points along the tube
176  int ArcCount;
177  double ArcStart;
178  double ArcEnd;
179  double ButtonSize;
180  double TubeSize;
181 
183  void operator=(const vtkCenteredSliderRepresentation&) = delete;
184 };
185 
186 VTK_ABI_NAMESPACE_END
187 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:144
object to represent cell connectivity
Definition: vtkCellArray.h:285
provide the representation for a vtkCenteredSliderWidget
void WidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
void ReleaseGraphicsResources(vtkWindow *window) override
Methods supporting the rendering process.
int RenderOverlay(vtkViewport *) override
Methods supporting the rendering process.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
void Highlight(int) override
Methods to interface with the vtkSliderWidget.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
virtual double ComputePickPosition(double x, double y)
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
const char * GetTitleText() override
Specify the label text for this widget.
static vtkCenteredSliderRepresentation * New()
Instantiate the class.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
void GetActors(vtkPropCollection *propCollections) override
Methods supporting the rendering process.
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkSliderWidget.
void SetTitleText(const char *) override
Specify the label text for this widget.
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:138
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
an ordered list of Props
represent surface properties of a 2D image
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:159
abstract specification for Viewports
Definition: vtkViewport.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47