VTK
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 "vtkInteractionWidgetsModule.h" // For export macro
34 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
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 
53 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
54 {
55 public:
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
68 
77  vtkCoordinate *GetPoint1Coordinate();
78 
87  vtkCoordinate *GetPoint2Coordinate();
88 
90 
94  void SetTitleText(const char*) VTK_OVERRIDE;
95  const char* GetTitleText() VTK_OVERRIDE;
97 
99 
103  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
105 
107 
110  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
111  vtkGetObjectMacro(CapProperty,vtkProperty2D);
113 
115 
119  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
121 
123 
126  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
127  vtkGetObjectMacro(TitleProperty,vtkTextProperty);
129 
131 
136  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
137  void BuildRepresentation() VTK_OVERRIDE;
138  void StartWidgetInteraction(double eventPos[2]) VTK_OVERRIDE;
139  void WidgetInteraction(double newEventPos[2]) VTK_OVERRIDE;
140  void Highlight(int) VTK_OVERRIDE;
142 
144 
147  void GetActors2D(vtkPropCollection*) VTK_OVERRIDE;
148  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
149  int RenderOverlay(vtkViewport*) VTK_OVERRIDE;
150  int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
152 
153 protected:
155  ~vtkSliderRepresentation2D() VTK_OVERRIDE;
156 
157  // Positioning the widget
158  vtkCoordinate *Point1Coordinate;
159  vtkCoordinate *Point2Coordinate;
160 
161  // Determine the parameter t along the slider
162  virtual double ComputePickPosition(double eventPos[2]);
163 
164  // Define the geometry. It is constructed in canaonical position
165  // along the x-axis and then rotated into position.
166  vtkTransform *XForm;
167  vtkPoints *Points;
168 
169  vtkCellArray *SliderCells;
170  vtkPolyData *Slider;
172  vtkPolyDataMapper2D *SliderMapper;
173  vtkActor2D *SliderActor;
174  vtkProperty2D *SliderProperty;
175 
176  vtkCellArray *TubeCells;
177  vtkPolyData *Tube;
179  vtkPolyDataMapper2D *TubeMapper;
180  vtkActor2D *TubeActor;
181  vtkProperty2D *TubeProperty;
182 
183  vtkCellArray *CapCells;
187  vtkActor2D *CapActor;
188  vtkProperty2D *CapProperty;
189 
190  vtkTextProperty *LabelProperty;
191  vtkTextMapper *LabelMapper;
192  vtkActor2D *LabelActor;
193 
194  vtkTextProperty *TitleProperty;
195  vtkTextMapper *TitleMapper;
196  vtkActor2D *TitleActor;
197 
198  vtkProperty2D *SelectedProperty;
199 
200  // internal variables used for computation
201  double X;
202 
203 private:
204  vtkSliderRepresentation2D(const vtkSliderRepresentation2D&) VTK_DELETE_FUNCTION;
205  void operator=(const vtkSliderRepresentation2D&) VTK_DELETE_FUNCTION;
206 };
207 
208 #endif
provide the representation for a vtkSliderWidget with a 3D skin
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
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.
2D text annotation
Definition: vtkTextMapper.h:47
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
An actor that displays text.
Definition: vtkTextActor.h:50
a simple class to control print indentation
Definition: vtkIndent.h:33
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
abstract class defines the representation for a vtkSliderWidget
object to represent cell connectivity
Definition: vtkCellArray.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
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:33