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 
51 
52 class vtkCoordinate;
53 class vtkRenderer;
54 class vtkPointPlacer;
55 
57 {
58 public:
60 
62  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
72  virtual void SetDisplayPosition(double pos[3]);
73  virtual void GetDisplayPosition(double pos[3]);
74  virtual double* GetDisplayPosition();
75  virtual void SetWorldPosition(double pos[3]);
76  virtual void GetWorldPosition(double pos[3]);
77  virtual double* GetWorldPosition();
79 
81 
84  vtkSetClampMacro(Tolerance,int,1,100);
85  vtkGetMacro(Tolerance,int);
87 
89 
93  vtkSetMacro(ActiveRepresentation,int);
94  vtkGetMacro(ActiveRepresentation,int);
95  vtkBooleanMacro(ActiveRepresentation,int);
97 
98 //BTX
99  // Enums define the state of the representation relative to the mouse pointer
100  // position. Used by ComputeInteractionState() to communicate with the
101  // widget. Note that ComputeInteractionState() and several other methods
102  // must be implemented by subclasses.
103  enum _InteractionState { Outside=0, Nearby, Selecting, Translating, Scaling };
104 //ETX
105 
107 
114  vtkSetClampMacro(InteractionState,int,Outside,Scaling);
116 
118 
121  vtkSetMacro(Constrained,int);
122  vtkGetMacro(Constrained,int);
123  vtkBooleanMacro(Constrained,int);
125 
130  virtual int CheckConstraint(vtkRenderer *renderer, double pos[2]);
131 
133 
135  virtual void ShallowCopy(vtkProp *prop);
136  virtual void DeepCopy(vtkProp *prop);
137  virtual void SetRenderer(vtkRenderer *ren);
139 
142  virtual unsigned long GetMTime();
143 
145 
152  virtual void SetPointPlacer ( vtkPointPlacer * );
153  vtkGetObjectMacro( PointPlacer, vtkPointPlacer );
155 
156 protected:
159 
163 
164  // Two vtkCoordinates are available to subclasses, one in display
165  // coordinates and the other in world coordinates. These facilitate
166  // the conversion between these two systems. Note that the WorldPosition
167  // is the ultimate maintainer of position.
170 
171  // Keep track of when coordinates were changed
174 
175  // Constrain the placement of handles.
177 
178 private:
179  vtkHandleRepresentation(const vtkHandleRepresentation&); //Not implemented
180  void operator=(const vtkHandleRepresentation&); //Not implemented
181 };
182 
183 #endif