VTK  9.2.6
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 =========================================================================*/
41 #ifndef vtkSliderRepresentation2D_h
42 #define vtkSliderRepresentation2D_h
43 
44 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
45 #include "vtkInteractionWidgetsModule.h" // For export macro
47 
48 class vtkPoints;
49 class vtkCellArray;
50 class vtkPolyData;
52 class vtkActor2D;
53 class vtkCoordinate;
54 class vtkProperty2D;
55 class vtkPropCollection;
56 class vtkWindow;
57 class vtkViewport;
58 class vtkTransform;
60 class vtkTextProperty;
61 class vtkTextMapper;
62 class vtkTextActor;
63 
64 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
65 {
66 public:
71 
73 
77  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
89 
99 
101 
105  void SetTitleText(const char*) override;
106  const char* GetTitleText() override;
108 
110 
114  vtkGetObjectMacro(SliderProperty, vtkProperty2D);
116 
118 
121  vtkGetObjectMacro(TubeProperty, vtkProperty2D);
122  vtkGetObjectMacro(CapProperty, vtkProperty2D);
124 
126 
130  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
132 
134 
137  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
138  vtkGetObjectMacro(TitleProperty, vtkTextProperty);
140 
142 
147  void PlaceWidget(double bounds[6]) override;
148  void BuildRepresentation() override;
149  void StartWidgetInteraction(double eventPos[2]) override;
150  void WidgetInteraction(double newEventPos[2]) override;
151  void Highlight(int) override;
153 
155 
160  int RenderOverlay(vtkViewport*) override;
163 
164 protected:
167 
168  // Positioning the widget
171 
172  // Determine the parameter t along the slider
173  virtual double ComputePickPosition(double eventPos[2]);
174 
175  // Define the geometry. It is constructed in canaonical position
176  // along the x-axis and then rotated into position.
179 
186 
193 
200 
204 
208 
210 
211  // internal variables used for computation
212  double X;
213 
214 private:
216  void operator=(const vtkSliderRepresentation2D&) = delete;
217 };
218 
219 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:55
object to represent cell connectivity
Definition: vtkCellArray.h:196
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:89
a simple class to control print indentation
Definition: vtkIndent.h:49
represent and manipulate 3D points
Definition: vtkPoints.h:49
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:50
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:66
2D text annotation
Definition: vtkTextMapper.h:60
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:70
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48