VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
34 #ifndef __vtkSliderRepresentation2D_h
35 #define __vtkSliderRepresentation2D_h
36 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
40 
41 class vtkPoints;
42 class vtkCellArray;
43 class vtkPolyData;
44 class vtkPolyDataMapper2D;
45 class vtkActor2D;
46 class vtkCoordinate;
47 class vtkProperty2D;
48 class vtkPropCollection;
49 class vtkWindow;
50 class vtkViewport;
51 class vtkTransform;
53 class vtkTextProperty;
54 class vtkTextMapper;
55 class vtkTextActor;
56 
57 
58 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation2D : public vtkSliderRepresentation
59 {
60 public:
62  static vtkSliderRepresentation2D *New();
63 
65 
67  void PrintSelf(ostream& os, vtkIndent indent);
69 
76  vtkCoordinate *GetPoint1Coordinate();
77 
84  vtkCoordinate *GetPoint2Coordinate();
85 
87 
89  virtual void SetTitleText(const char*);
90  virtual const char* GetTitleText();
92 
94 
96  vtkGetObjectMacro(SliderProperty,vtkProperty2D);
98 
100 
101  vtkGetObjectMacro(TubeProperty,vtkProperty2D);
102  vtkGetObjectMacro(CapProperty,vtkProperty2D);
104 
106 
108  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
110 
112 
113  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
114  vtkGetObjectMacro(TitleProperty,vtkTextProperty);
116 
118 
121  virtual void PlaceWidget(double bounds[6]);
122  virtual void BuildRepresentation();
123  virtual void StartWidgetInteraction(double eventPos[2]);
124  virtual void WidgetInteraction(double newEventPos[2]);
125  virtual void Highlight(int);
127 
129 
130  virtual void GetActors2D(vtkPropCollection*);
131  virtual void ReleaseGraphicsResources(vtkWindow*);
132  virtual int RenderOverlay(vtkViewport*);
133  virtual int RenderOpaqueGeometry(vtkViewport*);
135 
136 protected:
139 
140  // Positioning the widget
141  vtkCoordinate *Point1Coordinate;
142  vtkCoordinate *Point2Coordinate;
143 
144  // Determine the parameter t along the slider
145  virtual double ComputePickPosition(double eventPos[2]);
146 
147  // Define the geometry. It is constructed in canaonical position
148  // along the x-axis and then rotated into position.
150  vtkPoints *Points;
151 
155  vtkPolyDataMapper2D *SliderMapper;
156  vtkActor2D *SliderActor;
157  vtkProperty2D *SliderProperty;
158 
162  vtkPolyDataMapper2D *TubeMapper;
163  vtkActor2D *TubeActor;
164  vtkProperty2D *TubeProperty;
165 
169  vtkPolyDataMapper2D *CapMapper;
170  vtkActor2D *CapActor;
171  vtkProperty2D *CapProperty;
172 
173  vtkTextProperty *LabelProperty;
174  vtkTextMapper *LabelMapper;
175  vtkActor2D *LabelActor;
176 
177  vtkTextProperty *TitleProperty;
178  vtkTextMapper *TitleMapper;
179  vtkActor2D *TitleActor;
180 
181  vtkProperty2D *SelectedProperty;
182 
183  // internal variables used for computation
184  double X;
185 
186 private:
187  vtkSliderRepresentation2D(const vtkSliderRepresentation2D&); //Not implemented
188  void operator=(const vtkSliderRepresentation2D&); //Not implemented
189 };
190 
191 #endif
provide the representation for a vtkSliderWidget with a 3D skin
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual void StartWidgetInteraction(double eventPos[2])
vtkTransformPolyDataFilter * CapXForm
vtkTransformPolyDataFilter * TubeXForm
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:82
virtual void SetTitleText(const char *)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
vtkTransformPolyDataFilter * SliderXForm
virtual void WidgetInteraction(double newEventPos[2])
abstract class defines the representation for a vtkSliderWidget
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void GetActors2D(vtkPropCollection *)
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual const char * GetTitleText()
void PrintSelf(ostream &os, vtkIndent indent)