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 =========================================================================*/
45 #ifndef vtkHandleRepresentation_h
46 #define vtkHandleRepresentation_h
47 
48 #include "vtkInteractionWidgetsModule.h" // For export macro
50 
51 class vtkCoordinate;
52 class vtkRenderer;
53 class vtkPointPlacer;
54 
55 class VTKINTERACTIONWIDGETS_EXPORT vtkHandleRepresentation : public vtkWidgetRepresentation
56 {
57 public:
59 
63  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
65 
67 
75  virtual void SetDisplayPosition(double pos[3]);
76  virtual void GetDisplayPosition(double pos[3]);
77  virtual double* GetDisplayPosition();
78  virtual void SetWorldPosition(double pos[3]);
79  virtual void GetWorldPosition(double pos[3]);
80  virtual double* GetWorldPosition();
82 
84 
89  vtkSetClampMacro(Tolerance,int,1,100);
90  vtkGetMacro(Tolerance,int);
92 
94 
99  vtkSetMacro(ActiveRepresentation,int);
100  vtkGetMacro(ActiveRepresentation,int);
101  vtkBooleanMacro(ActiveRepresentation,int);
103 
104  // Enums define the state of the representation relative to the mouse pointer
105  // position. Used by ComputeInteractionState() to communicate with the
106  // widget. Note that ComputeInteractionState() and several other methods
107  // must be implemented by subclasses.
108  enum _InteractionState { Outside=0, Nearby, Selecting, Translating, Scaling };
109 
111 
120  vtkSetClampMacro(InteractionState,int,Outside,Scaling);
122 
124 
129  vtkSetMacro(Constrained,int);
130  vtkGetMacro(Constrained,int);
131  vtkBooleanMacro(Constrained,int);
133 
141  virtual int CheckConstraint(vtkRenderer *renderer, double pos[2]);
142 
144 
147  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
148  virtual void DeepCopy(vtkProp *prop);
149  void SetRenderer(vtkRenderer *ren) VTK_OVERRIDE;
151 
156  vtkMTimeType GetMTime() VTK_OVERRIDE;
157 
159 
167  virtual void SetPointPlacer ( vtkPointPlacer * );
168  vtkGetObjectMacro( PointPlacer, vtkPointPlacer );
170 
171 protected:
173  ~vtkHandleRepresentation() VTK_OVERRIDE;
174 
178 
179  // Two vtkCoordinates are available to subclasses, one in display
180  // coordinates and the other in world coordinates. These facilitate
181  // the conversion between these two systems. Note that the WorldPosition
182  // is the ultimate maintainer of position.
185 
186  // Keep track of when coordinates were changed
189 
190  // Constrain the placement of handles.
192 
193 private:
194  vtkHandleRepresentation(const vtkHandleRepresentation&) VTK_DELETE_FUNCTION;
195  void operator=(const vtkHandleRepresentation&) VTK_DELETE_FUNCTION;
196 };
197 
198 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
abstract class for representing widget handles
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkProp.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
record modification and/or execution time
Definition: vtkTimeStamp.h:32
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
abstract specification for renderers
Definition: vtkRenderer.h:57
abstract class defines interface between the widget and widget representation classes ...
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
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:72
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.