VTK  9.1.0
vtkSliderRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSliderRepresentation2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkSliderRepresentation2D_h
30 #define vtkSliderRepresentation2D_h
31 
32 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 class vtkPoints;
37 class vtkCellArray;
38 class vtkPolyData;
40 class vtkActor2D;
41 class vtkCoordinate;
42 class vtkProperty2D;
43 class vtkPropCollection;
44 class vtkWindow;
45 class vtkViewport;
46 class vtkTransform;
48 class vtkTextProperty;
49 class vtkTextMapper;
50 class vtkTextActor;
51 
52 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
53 {
54 public:
59 
61 
65  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
77 
87 
89 
93  void SetTitleText(const char*) override;
94  const char* GetTitleText() override;
96 
98 
102  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
104 
106 
109  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
110  vtkGetObjectMacro(CapProperty, vtkProperty2D);
112 
114 
118  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
120 
122 
125  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
126  vtkGetObjectMacro(TitleProperty, vtkTextProperty);
128 
130 
135  void PlaceWidget(double bounds[6]) override;
136  void BuildRepresentation() override;
137  void StartWidgetInteraction(double eventPos[2]) override;
138  void WidgetInteraction(double newEventPos[2]) override;
139  void Highlight(int) override;
141 
143 
148  int RenderOverlay(vtkViewport*) override;
151 
152 protected:
155 
156  // Positioning the widget
159 
160  // Determine the parameter t along the slider
161  virtual double ComputePickPosition(double eventPos[2]);
162 
163  // Define the geometry. It is constructed in canaonical position
164  // along the x-axis and then rotated into position.
167 
174 
181 
188 
192 
196 
198 
199  // internal variables used for computation
200  double X;
201 
202 private:
204  void operator=(const vtkSliderRepresentation2D&) = delete;
205 };
206 
207 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
object to represent cell connectivity
Definition: vtkCellArray.h:181
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
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.
static vtkSliderRepresentation2D * New()
Instantiate the class.
int RenderOverlay(vtkViewport *) override
Methods supporting the rendering process.
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.
void GetActors2D(vtkPropCollection *) override
Methods supporting the rendering process.
vtkTransformPolyDataFilter * CapXForm
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
void ReleaseGraphicsResources(vtkWindow *) 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:51
2D text annotation
Definition: vtkTextMapper.h:48
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39