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 
81  void SetPoint1InWorldCoordinates(double x, double y, double z);
83 
85 
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*);
173 
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
create hierarchies of vtkProp3Ds (transformable props)
Definition: vtkAssembly.h:76
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:70
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
generate a cylinder centered at origin
a simple class to control print indentation
Definition: vtkIndent.h:40
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
map vtkPolyData to graphics primitives
a list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:65
provide the representation for a vtkSliderWidget with a 3D skin
virtual void PlaceWidget(double bounds[6])
Methods to interface with the vtkSliderWidget.
virtual void BuildRepresentation()
void SetPoint2InWorldCoordinates(double x, double y, double z)
virtual void WidgetInteraction(double newEventPos[2])
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
virtual void StartWidgetInteraction(double eventPos[2])
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
virtual const char * GetTitleText()
virtual double ComputePickPosition(double eventPos[2])
virtual void Highlight(int)
static vtkSliderRepresentation3D * New()
Instantiate the class.
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
virtual vtkMTimeType GetMTime()
Override GetMTime to include point coordinates.
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkTransformPolyDataFilter * Cylinder
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetTitleText(const char *)
Specify the title text for this widget.
virtual double * GetBounds()
Methods supporting the rendering process.
void SetPoint1InWorldCoordinates(double x, double y, double z)
abstract class defines the representation for a vtkSliderWidget
create a polygonal sphere centered at the origin
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
create polygonal text
Definition: vtkVectorText.h:48
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248