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 =========================================================================*/
35 #ifndef vtkSliderRepresentation2D_h
36 #define vtkSliderRepresentation2D_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
40 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
41 
42 class vtkPoints;
43 class vtkCellArray;
44 class vtkPolyData;
46 class vtkActor2D;
47 class vtkCoordinate;
48 class vtkProperty2D;
49 class vtkPropCollection;
50 class vtkWindow;
51 class vtkViewport;
52 class vtkTransform;
54 class vtkTextProperty;
55 class vtkTextMapper;
56 class vtkTextActor;
57 
58 
59 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
60 {
61 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
74 
83  vtkCoordinate *GetPoint1Coordinate();
84 
93  vtkCoordinate *GetPoint2Coordinate();
94 
96 
100  void SetTitleText(const char*) VTK_OVERRIDE;
101  const char* GetTitleText() VTK_OVERRIDE;
103 
105 
109  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
111 
113 
116  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
117  vtkGetObjectMacro(CapProperty,vtkProperty2D);
119 
121 
125  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
127 
129 
132  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
133  vtkGetObjectMacro(TitleProperty,vtkTextProperty);
135 
137 
142  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
143  void BuildRepresentation() VTK_OVERRIDE;
144  void StartWidgetInteraction(double eventPos[2]) VTK_OVERRIDE;
145  void WidgetInteraction(double newEventPos[2]) VTK_OVERRIDE;
146  void Highlight(int) VTK_OVERRIDE;
148 
150 
153  void GetActors2D(vtkPropCollection*) VTK_OVERRIDE;
154  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
155  int RenderOverlay(vtkViewport*) VTK_OVERRIDE;
156  int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
158 
159 protected:
161  ~vtkSliderRepresentation2D() VTK_OVERRIDE;
162 
163  // Positioning the widget
164  vtkCoordinate *Point1Coordinate;
165  vtkCoordinate *Point2Coordinate;
166 
167  // Determine the parameter t along the slider
168  virtual double ComputePickPosition(double eventPos[2]);
169 
170  // Define the geometry. It is constructed in canaonical position
171  // along the x-axis and then rotated into position.
172  vtkTransform *XForm;
173  vtkPoints *Points;
174 
175  vtkCellArray *SliderCells;
176  vtkPolyData *Slider;
178  vtkPolyDataMapper2D *SliderMapper;
179  vtkActor2D *SliderActor;
180  vtkProperty2D *SliderProperty;
181 
182  vtkCellArray *TubeCells;
183  vtkPolyData *Tube;
185  vtkPolyDataMapper2D *TubeMapper;
186  vtkActor2D *TubeActor;
187  vtkProperty2D *TubeProperty;
188 
189  vtkCellArray *CapCells;
193  vtkActor2D *CapActor;
194  vtkProperty2D *CapProperty;
195 
196  vtkTextProperty *LabelProperty;
197  vtkTextMapper *LabelMapper;
198  vtkActor2D *LabelActor;
199 
200  vtkTextProperty *TitleProperty;
201  vtkTextMapper *TitleMapper;
202  vtkActor2D *TitleActor;
203 
204  vtkProperty2D *SelectedProperty;
205 
206  // internal variables used for computation
207  double X;
208 
209 private:
210  vtkSliderRepresentation2D(const vtkSliderRepresentation2D&) VTK_DELETE_FUNCTION;
211  void operator=(const vtkSliderRepresentation2D&) VTK_DELETE_FUNCTION;
212 };
213 
214 #endif
provide the representation for a vtkSliderWidget with a 3D skin
abstract specification for Viewports
Definition: vtkViewport.h:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
virtual void SetTitleText(const char *)
Specify the label text for this widget.
2D text annotation
Definition: vtkTextMapper.h:53
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
An actor that displays text.
Definition: vtkTextActor.h:56
a simple class to control print indentation
Definition: vtkIndent.h:39
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:78
abstract class defines the representation for a vtkSliderWidget
object to represent cell connectivity
Definition: vtkCellArray.h:50
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
virtual const char * GetTitleText()
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
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:39