VTK
vtkSliderRepresentation3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSliderRepresentation3D.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 __vtkSliderRepresentation3D_h
35 #define __vtkSliderRepresentation3D_h
36 
38 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
39 
40 class vtkActor;
41 class vtkPolyDataMapper;
42 class vtkSphereSource;
43 class vtkCellPicker;
44 class vtkProperty;
45 class vtkCylinderSource;
46 class vtkVectorText;
47 class vtkAssembly;
48 class vtkTransform;
50 class vtkMatrix4x4;
51 
52 
54 {
55 public:
58 
60 
62  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
72  vtkCoordinate *GetPoint1Coordinate();
73  void SetPoint1InWorldCoordinates(double x, double y, double z);
75 
77 
83  vtkCoordinate *GetPoint2Coordinate();
84  void SetPoint2InWorldCoordinates(double x, double y, double z);
86 
88 
90  virtual void SetTitleText(const char*);
91  virtual const char* GetTitleText();
93 
95 
97  vtkSetClampMacro(SliderShape,int,SphereShape,CylinderShape);
98  vtkGetMacro(SliderShape, int);
99  void SetSliderShapeToSphere() { this->SetSliderShape(SphereShape); }
100  void SetSliderShapeToCylinder() { this->SetSliderShape(CylinderShape); }
102 
104 
107  vtkSetMacro(Rotation,double);
108  vtkGetMacro(Rotation,double);
110 
112 
114  vtkGetObjectMacro(SliderProperty,vtkProperty);
116 
118 
119  vtkGetObjectMacro(TubeProperty,vtkProperty);
120  vtkGetObjectMacro(CapProperty,vtkProperty);
122 
124 
126  vtkGetObjectMacro(SelectedProperty,vtkProperty);
128 
130 
131  virtual void PlaceWidget(double bounds[6]);
132  virtual void BuildRepresentation();
133  virtual void StartWidgetInteraction(double eventPos[2]);
134  virtual void WidgetInteraction(double newEventPos[2]);
135  virtual void Highlight(int);
137 
139 
140  virtual double *GetBounds();
141  virtual void GetActors(vtkPropCollection*);
142  virtual void ReleaseGraphicsResources(vtkWindow*);
143  virtual int RenderOpaqueGeometry(vtkViewport*);
145  virtual int HasTranslucentPolygonalGeometry();
147 
149  virtual unsigned long GetMTime();
150 
151 protected:
154 
155  // Positioning the widget
158  double Length;
159 
160  // These are the slider end points taking into account the thickness
161  // of the slider
162  double SP1[3];
163  double SP2[3];
164 
165  // More ivars controlling the appearance of the widget
166  double Rotation;
168 
169  // Do the picking
171 
172  // Determine the parameter t along the slider
173  virtual double ComputePickPosition(double eventPos[2]);
174 
175  // The widget consists of several actors, all grouped
176  // together using an assembly. This makes it easier to
177  // perform the final transformation into
179 
180  // Cylinder used by other objects
183 
184  // The tube
188 
189  // The slider
195 
196  // The left cap
200 
201  // The right cap
204 
205  // The text. There is an extra transform used to rotate
206  // both the title and label
210 
214 
215  // Transform used during slider motion
218 
219 //BTX - manage the state of the widget
220  enum _SliderShape {
222  CylinderShape
223  };
224 
225 //ETX
226 
227 
228 private:
229  vtkSliderRepresentation3D(const vtkSliderRepresentation3D&); //Not implemented
230  void operator=(const vtkSliderRepresentation3D&); //Not implemented
231 };
232 
233 #endif
vtkTransformPolyDataFilter * Cylinder
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:37
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:45
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual void StartWidgetInteraction(double eventPos[2])
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
virtual void SetTitleText(const char *)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
create a polygonal sphere centered at the origin
virtual int HasTranslucentPolygonalGeometry()
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:37
provide the representation for a vtkSliderWidget with a 3D skin
virtual void WidgetInteraction(double newEventPos[2])
#define VTK_WIDGETS_EXPORT
virtual void GetActors(vtkPropCollection *)
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
abstract class defines the representation for a vtkSliderWidget
create hierarchies of vtkProp3Ds (transformable props)
Definition: vtkAssembly.h:73
map vtkPolyData to graphics primitives
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:66
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual const char * GetTitleText()
static vtkObject * New()
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
void PrintSelf(ostream &os, vtkIndent indent)
create polygonal text
Definition: vtkVectorText.h:45