VTK  9.3.1
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
20 #ifndef vtkSliderRepresentation2D_h
21 #define vtkSliderRepresentation2D_h
22 
23 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
24 #include "vtkInteractionWidgetsModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkPoints;
29 class vtkCellArray;
30 class vtkPolyData;
32 class vtkActor2D;
33 class vtkCoordinate;
34 class vtkProperty2D;
35 class vtkPropCollection;
36 class vtkWindow;
37 class vtkViewport;
38 class vtkTransform;
40 class vtkTextProperty;
41 class vtkTextMapper;
42 class vtkTextActor;
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
45 {
46 public:
51 
53 
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
68  vtkCoordinate* GetPoint1Coordinate();
69 
78  vtkCoordinate* GetPoint2Coordinate();
79 
81 
85  void SetTitleText(const char*) override;
86  const char* GetTitleText() override;
88 
90 
94  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
96 
98 
101  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
102  vtkGetObjectMacro(CapProperty, vtkProperty2D);
104 
106 
110  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
112 
114 
117  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
118  vtkGetObjectMacro(TitleProperty, vtkTextProperty);
120 
122 
127  void PlaceWidget(double bounds[6]) override;
128  void BuildRepresentation() override;
129  void StartWidgetInteraction(double eventPos[2]) override;
130  void WidgetInteraction(double newEventPos[2]) override;
131  void Highlight(int) override;
133 
135 
138  void GetActors2D(vtkPropCollection* propCollection) override;
139  void ReleaseGraphicsResources(vtkWindow* window) override;
140  int RenderOverlay(vtkViewport* viewport) override;
141  int RenderOpaqueGeometry(vtkViewport* viewport) override;
143 
144 protected:
146  ~vtkSliderRepresentation2D() override;
147 
148  // Positioning the widget
151 
152  // Determine the parameter t along the slider
153  virtual double ComputePickPosition(double eventPos[2]);
154 
155  // Define the geometry. It is constructed in canaonical position
156  // along the x-axis and then rotated into position.
159 
166 
173 
180 
184 
188 
190 
191  // internal variables used for computation
192  double X;
193 
194 private:
196  void operator=(const vtkSliderRepresentation2D&) = delete;
197 };
198 
199 VTK_ABI_NAMESPACE_END
200 #endif
provide the representation for a vtkSliderWidget with a 3D skin
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
abstract specification for Viewports
Definition: vtkViewport.h:44
void GetActors2D(vtkPropCollection *) override
virtual void StartWidgetInteraction(double eventPos[2])
vtkTransformPolyDataFilter * CapXForm
a actor that draws 2D data
Definition: vtkActor2D.h:34
vtkTransformPolyDataFilter * TubeXForm
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void SetTitleText(const char *)
Specify the label text for this widget.
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
2D text annotation
Definition: vtkTextMapper.h:39
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
An actor that displays text.
Definition: vtkTextActor.h:45
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkTransformPolyDataFilter * SliderXForm
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
abstract class defines the representation for a vtkSliderWidget
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:175
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual const char * GetTitleText()
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28