VTK
vtkHandleRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHandleRepresentation.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 =========================================================================*/
47 #ifndef vtkHandleRepresentation_h
48 #define vtkHandleRepresentation_h
49 
50 #include "vtkInteractionWidgetsModule.h" // For export macro
52 
53 class vtkCoordinate;
54 class vtkRenderer;
55 class vtkPointPlacer;
56 
58 {
59 public:
61 
63  void PrintSelf(ostream& os, vtkIndent indent);
65 
67 
73  virtual void SetDisplayPosition(double pos[3]);
74  virtual void GetDisplayPosition(double pos[3]);
75  virtual double* GetDisplayPosition();
76  virtual void SetWorldPosition(double pos[3]);
77  virtual void GetWorldPosition(double pos[3]);
78  virtual double* GetWorldPosition();
80 
82 
85  vtkSetClampMacro(Tolerance,int,1,100);
86  vtkGetMacro(Tolerance,int);
88 
90 
94  vtkSetMacro(ActiveRepresentation,int);
95  vtkGetMacro(ActiveRepresentation,int);
96  vtkBooleanMacro(ActiveRepresentation,int);
98 
99 //BTX
100  // Enums define the state of the representation relative to the mouse pointer
101  // position. Used by ComputeInteractionState() to communicate with the
102  // widget. Note that ComputeInteractionState() and several other methods
103  // must be implemented by subclasses.
104  enum _InteractionState { Outside=0, Nearby, Selecting, Translating, Scaling };
105 //ETX
106 
108 
115  vtkSetClampMacro(InteractionState,int,Outside,Scaling);
117 
119 
122  vtkSetMacro(Constrained,int);
123  vtkGetMacro(Constrained,int);
124  vtkBooleanMacro(Constrained,int);
126 
131  virtual int CheckConstraint(vtkRenderer *renderer, double pos[2]);
132 
134 
136  virtual void ShallowCopy(vtkProp *prop);
137  virtual void DeepCopy(vtkProp *prop);
138  virtual void SetRenderer(vtkRenderer *ren);
140 
143  virtual unsigned long GetMTime();
144 
146 
153  virtual void SetPointPlacer ( vtkPointPlacer * );
154  vtkGetObjectMacro( PointPlacer, vtkPointPlacer );
156 
157 protected:
160 
164 
165  // Two vtkCoordinates are available to subclasses, one in display
166  // coordinates and the other in world coordinates. These facilitate
167  // the conversion between these two systems. Note that the WorldPosition
168  // is the ultimate maintainer of position.
171 
172  // Keep track of when coordinates were changed
175 
176  // Constrain the placement of handles.
178 
179 private:
180  vtkHandleRepresentation(const vtkHandleRepresentation&); //Not implemented
181  void operator=(const vtkHandleRepresentation&); //Not implemented
182 };
183 
184 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
abstract class for representing widget handles
virtual void ShallowCopy(vtkProp *prop)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual void SetRenderer(vtkRenderer *ren)
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
abstract specification for renderers
Definition: vtkRenderer.h:63
abstract class defines interface between the widget and widget representation classes ...
#define VTKINTERACTIONWIDGETS_EXPORT
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
Abstract interface to translate 2D display positions to world coordinates.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
void PrintSelf(ostream &os, vtkIndent indent)