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 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
40 
41 class vtkActor;
42 class vtkPolyDataMapper;
43 class vtkSphereSource;
44 class vtkCellPicker;
45 class vtkProperty;
46 class vtkCylinderSource;
47 class vtkVectorText;
48 class vtkAssembly;
49 class vtkTransform;
51 class vtkMatrix4x4;
52 
53 
55 {
56 public:
59 
61 
63  void PrintSelf(ostream& os, vtkIndent indent);
65 
67 
73  vtkCoordinate *GetPoint1Coordinate();
74  void SetPoint1InWorldCoordinates(double x, double y, double z);
76 
78 
84  vtkCoordinate *GetPoint2Coordinate();
85  void SetPoint2InWorldCoordinates(double x, double y, double z);
87 
89 
91  virtual void SetTitleText(const char*);
92  virtual const char* GetTitleText();
94 
96 
98  vtkSetClampMacro(SliderShape,int,SphereShape,CylinderShape);
99  vtkGetMacro(SliderShape, int);
100  void SetSliderShapeToSphere() { this->SetSliderShape(SphereShape); }
101  void SetSliderShapeToCylinder() { this->SetSliderShape(CylinderShape); }
103 
105 
108  vtkSetMacro(Rotation,double);
109  vtkGetMacro(Rotation,double);
111 
113 
115  vtkGetObjectMacro(SliderProperty,vtkProperty);
117 
119 
120  vtkGetObjectMacro(TubeProperty,vtkProperty);
121  vtkGetObjectMacro(CapProperty,vtkProperty);
123 
125 
127  vtkGetObjectMacro(SelectedProperty,vtkProperty);
129 
131 
132  virtual void PlaceWidget(double bounds[6]);
133  virtual void BuildRepresentation();
134  virtual void StartWidgetInteraction(double eventPos[2]);
135  virtual void WidgetInteraction(double newEventPos[2]);
136  virtual void Highlight(int);
138 
140 
141  virtual double *GetBounds();
142  virtual void GetActors(vtkPropCollection*);
143  virtual void ReleaseGraphicsResources(vtkWindow*);
144  virtual int RenderOpaqueGeometry(vtkViewport*);
146  virtual int HasTranslucentPolygonalGeometry();
148 
150  virtual unsigned long GetMTime();
151 
152 protected:
155 
156  // Positioning the widget
159  double Length;
160 
161  // These are the slider end points taking into account the thickness
162  // of the slider
163  double SP1[3];
164  double SP2[3];
165 
166  // More ivars controlling the appearance of the widget
167  double Rotation;
169 
170  // Do the picking
172 
173  // Register internal Pickers within PickingManager
174  virtual void RegisterPickers();
175 
176  // Determine the parameter t along the slider
177  virtual double ComputePickPosition(double eventPos[2]);
178 
179  // The widget consists of several actors, all grouped
180  // together using an assembly. This makes it easier to
181  // perform the final transformation into
183 
184  // Cylinder used by other objects
187 
188  // The tube
192 
193  // The slider
199 
200  // The left cap
204 
205  // The right cap
208 
209  // The text. There is an extra transform used to rotate
210  // both the title and label
214 
218 
219  // Transform used during slider motion
222 
223 //BTX - manage the state of the widget
226  CylinderShape
227  };
228 
229 //ETX
230 
231 
232 private:
233  vtkSliderRepresentation3D(const vtkSliderRepresentation3D&); //Not implemented
234  void operator=(const vtkSliderRepresentation3D&); //Not implemented
235 };
236 
237 #endif
vtkTransformPolyDataFilter * Cylinder
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:46
represent surface properties of a geometric object
Definition: vtkProperty.h:63
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:59
virtual void SetTitleText(const char *)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
#define VTKINTERACTIONWIDGETS_EXPORT
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:38
virtual void RegisterPickers()
provide the representation for a vtkSliderWidget with a 3D skin
virtual void WidgetInteraction(double newEventPos[2])
virtual void GetActors(vtkPropCollection *)
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
abstract class defines the representation for a vtkSliderWidget
create hierarchies of vtkProp3Ds (transformable props)
Definition: vtkAssembly.h:74
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:68
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:46