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 =========================================================================*/
26 #ifndef vtkDistanceRepresentation_h
27 #define vtkDistanceRepresentation_h
28 
29 #include "vtkInteractionWidgetsModule.h" // For export macro
31 
33 
34 
36 {
37 public:
39 
41  void PrintSelf(ostream& os, vtkIndent indent);
43 
46  virtual double GetDistance() = 0;
47 
49 
52  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
53  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
54  virtual double* GetPoint1WorldPosition() = 0;
55  virtual double* GetPoint2WorldPosition() = 0;
56  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
57  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
58  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
59  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
60  virtual void SetPoint1WorldPosition(double pos[3])=0;
61  virtual void SetPoint2WorldPosition(double pos[3])=0;
63 
65 
74  void SetHandleRepresentation(vtkHandleRepresentation *handle);
75  void InstantiateHandleRepresentation();
77 
79 
82  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
83  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
85 
87 
90  vtkSetClampMacro(Tolerance,int,1,100);
91  vtkGetMacro(Tolerance,int);
93 
95 
98  vtkSetStringMacro(LabelFormat);
99  vtkGetStringMacro(LabelFormat);
101 
103 
107  vtkSetMacro(RulerMode,int);
108  vtkGetMacro(RulerMode,int);
109  vtkBooleanMacro(RulerMode,int);
111 
113 
115  vtkSetClampMacro(RulerDistance,double,0,VTK_FLOAT_MAX);
116  vtkGetMacro(RulerDistance,double);
118 
120 
125  vtkSetClampMacro(NumberOfRulerTicks,int,1,VTK_INT_MAX);
126  vtkGetMacro(NumberOfRulerTicks,int);
128 
129 //BTX -- used to communicate about the state of the representation
130  enum {Outside=0,NearP1,NearP2};
131 //ETX
132 
134 
135  virtual void BuildRepresentation();
136  virtual int ComputeInteractionState(int X, int Y, int modify=0);
137  virtual void StartWidgetInteraction(double e[2]);
138  virtual void WidgetInteraction(double e[2]);
140 
141 protected:
144 
145  // The handle and the rep used to close the handles
149 
150  // Selection tolerance for the handles
152 
153  // Format for printing the distance
154  char *LabelFormat;
155 
156  // Ruler related stuff
160 
161 private:
162  vtkDistanceRepresentation(const vtkDistanceRepresentation&); //Not implemented
163  void operator=(const vtkDistanceRepresentation&); //Not implemented
164 };
165 
166 #endif
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:132
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
vtkHandleRepresentation * HandleRepresentation
#define VTKINTERACTIONWIDGETS_EXPORT
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkHandleRepresentation * Point1Representation
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void WidgetInteraction(double newEventPos[2])
vtkHandleRepresentation * Point2Representation
void PrintSelf(ostream &os, vtkIndent indent)