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 =========================================================================*/
35 #ifndef vtkSliderRepresentation3D_h
36 #define vtkSliderRepresentation3D_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
40 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
41 
42 class vtkActor;
43 class vtkPolyDataMapper;
44 class vtkSphereSource;
45 class vtkCellPicker;
46 class vtkProperty;
47 class vtkCylinderSource;
48 class vtkVectorText;
49 class vtkAssembly;
50 class vtkTransform;
52 class vtkMatrix4x4;
53 
54 
55 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
56 {
57 public:
62 
64 
68  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
80  vtkCoordinate *GetPoint1Coordinate();
81  void SetPoint1InWorldCoordinates(double x, double y, double z);
83 
85 
93  vtkCoordinate *GetPoint2Coordinate();
94  void SetPoint2InWorldCoordinates(double x, double y, double z);
96 
98 
102  virtual void SetTitleText(const char*);
103  virtual const char* GetTitleText();
105 
107 
111  vtkSetClampMacro(SliderShape,int,SphereShape,CylinderShape);
112  vtkGetMacro(SliderShape, int);
113  void SetSliderShapeToSphere() { this->SetSliderShape(SphereShape); }
114  void SetSliderShapeToCylinder() { this->SetSliderShape(CylinderShape); }
116 
118 
123  vtkSetMacro(Rotation,double);
124  vtkGetMacro(Rotation,double);
126 
128 
132  vtkGetObjectMacro(SliderProperty,vtkProperty);
134 
136 
139  vtkGetObjectMacro(TubeProperty,vtkProperty);
140  vtkGetObjectMacro(CapProperty,vtkProperty);
142 
144 
148  vtkGetObjectMacro(SelectedProperty,vtkProperty);
150 
152 
155  virtual void PlaceWidget(double bounds[6]);
156  virtual void BuildRepresentation();
157  virtual void StartWidgetInteraction(double eventPos[2]);
158  virtual void WidgetInteraction(double newEventPos[2]);
159  virtual void Highlight(int);
161 
163 
166  virtual double *GetBounds();
167  virtual void GetActors(vtkPropCollection*);
168  virtual void ReleaseGraphicsResources(vtkWindow*);
169  virtual int RenderOpaqueGeometry(vtkViewport*);
171  virtual int HasTranslucentPolygonalGeometry();
173 
177  virtual vtkMTimeType GetMTime();
178 
179 protected:
182 
183  // Positioning the widget
186  double Length;
187 
188  // These are the slider end points taking into account the thickness
189  // of the slider
190  double SP1[3];
191  double SP2[3];
192 
193  // More ivars controlling the appearance of the widget
194  double Rotation;
196 
197  // Do the picking
199 
200  // Register internal Pickers within PickingManager
201  virtual void RegisterPickers();
202 
203  // Determine the parameter t along the slider
204  virtual double ComputePickPosition(double eventPos[2]);
205 
206  // The widget consists of several actors, all grouped
207  // together using an assembly. This makes it easier to
208  // perform the final transformation into
210 
211  // Cylinder used by other objects
214 
215  // The tube
219 
220  // The slider
226 
227  // The left cap
231 
232  // The right cap
235 
236  // The text. There is an extra transform used to rotate
237  // both the title and label
241 
245 
246  // Transform used during slider motion
249 
250  // Manage the state of the widget
253  CylinderShape
254  };
255 
256 
257 
258 private:
259  vtkSliderRepresentation3D(const vtkSliderRepresentation3D&) VTK_DELETE_FUNCTION;
260  void operator=(const vtkSliderRepresentation3D&) VTK_DELETE_FUNCTION;
261 };
262 
263 #endif
vtkTransformPolyDataFilter * Cylinder
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
generate a cylinder centered at origin
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:64
virtual void StartWidgetInteraction(double eventPos[2])
void SetSliderShapeToCylinder()
Specify whether to use a sphere or cylinder slider shape.
void SetSliderShapeToSphere()
Specify whether to use a sphere or cylinder slider shape.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
virtual void SetTitleText(const char *)
Specify the label text for this widget.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
create a polygonal sphere centered at the origin
virtual double * GetBounds()
Methods to make this class behave as a vtkProp.
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
provide the representation for a vtkSliderWidget with a 3D skin
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void WidgetInteraction(double newEventPos[2])
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:70
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
abstract class defines the representation for a vtkSliderWidget
create hierarchies of vtkProp3Ds (transformable props)
Definition: vtkAssembly.h:75
map vtkPolyData to graphics primitives
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual const char * GetTitleText()
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
void PrintSelf(ostream &os, vtkIndent indent)
Standard methods for the class.
create polygonal text
Definition: vtkVectorText.h:47