VTK
vtkDistanceRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDistanceRepresentation.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 =========================================================================*/
27 #ifndef vtkDistanceRepresentation_h
28 #define vtkDistanceRepresentation_h
29 
30 #include "vtkInteractionWidgetsModule.h" // For export macro
32 
34 
35 
36 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation : public vtkWidgetRepresentation
37 {
38 public:
40 
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
46 
51  virtual double GetDistance() = 0;
52 
54 
59  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
60  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
61  virtual double* GetPoint1WorldPosition() = 0;
62  virtual double* GetPoint2WorldPosition() = 0;
63  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
64  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
65  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
66  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
67  virtual void SetPoint1WorldPosition(double pos[3])=0;
68  virtual void SetPoint2WorldPosition(double pos[3])=0;
70 
72 
82  void SetHandleRepresentation(vtkHandleRepresentation *handle);
83  void InstantiateHandleRepresentation();
85 
87 
92  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
93  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
95 
97 
102  vtkSetClampMacro(Tolerance,int,1,100);
103  vtkGetMacro(Tolerance,int);
105 
107 
112  vtkSetStringMacro(LabelFormat);
113  vtkGetStringMacro(LabelFormat);
115 
117 
125  vtkSetMacro(Scale,double);
126  vtkGetMacro(Scale,double);
128 
130 
135  vtkSetMacro(RulerMode,int);
136  vtkGetMacro(RulerMode,int);
137  vtkBooleanMacro(RulerMode,int);
139 
141 
145  vtkSetClampMacro(RulerDistance,double,0,VTK_FLOAT_MAX);
146  vtkGetMacro(RulerDistance,double);
148 
150 
157  vtkSetClampMacro(NumberOfRulerTicks,int,1,VTK_INT_MAX);
158  vtkGetMacro(NumberOfRulerTicks,int);
160 
161  // Used to communicate about the state of the representation
162  enum {Outside=0,NearP1,NearP2};
163 
165 
168  void BuildRepresentation() VTK_OVERRIDE;
169  int ComputeInteractionState(int X, int Y, int modify=0) VTK_OVERRIDE;
170  void StartWidgetInteraction(double e[2]) VTK_OVERRIDE;
171  void WidgetInteraction(double e[2]) VTK_OVERRIDE;
174  vtkAbstractWidget *widget,
175  unsigned long event, void *calldata) VTK_OVERRIDE;
176  void ComplexInteraction(
178  vtkAbstractWidget *widget,
179  unsigned long event, void *calldata) VTK_OVERRIDE;
182  vtkAbstractWidget *widget,
183  unsigned long event, void *calldata, int modify = 0) VTK_OVERRIDE;
185 
186 protected:
188  ~vtkDistanceRepresentation() VTK_OVERRIDE;
189 
190  // The handle and the rep used to close the handles
194 
195  // Selection tolerance for the handles
197 
198  // Format for printing the distance
199  char *LabelFormat;
200 
201  // Scale to change from the VTK world coordinates to the desired coordinate
202  // system.
203  double Scale;
204 
205  // Ruler related stuff
209 
210 private:
211  vtkDistanceRepresentation(const vtkDistanceRepresentation&) VTK_DELETE_FUNCTION;
212  void operator=(const vtkDistanceRepresentation&) VTK_DELETE_FUNCTION;
213 };
214 
215 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
represent the vtkDistanceWidget
virtual void StartWidgetInteraction(double eventPos[2])
#define VTK_INT_MAX
Definition: vtkType.h:157
virtual int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *callData, int modify=0)
virtual void ComplexInteraction(vtkRenderWindowInteractor *, vtkAbstractWidget *, unsigned long, void *)
virtual void StartComplexInteraction(vtkRenderWindowInteractor *, vtkAbstractWidget *, unsigned long, void *)
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkHandleRepresentation * HandleRepresentation
platform-independent render window interaction including picking and frame rate control.
#define VTK_FLOAT_MAX
Definition: vtkType.h:165
vtkHandleRepresentation * Point1Representation
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void WidgetInteraction(double newEventPos[2])
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
define the API for widget / widget representation
vtkHandleRepresentation * Point2Representation
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.