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 
77 
79 
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
vtkWidgetRepresentation.h
vtkDistanceRepresentation::Tolerance
int Tolerance
Definition: vtkDistanceRepresentation.h:151
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkDistanceRepresentation::InstantiateHandleRepresentation
void InstantiateHandleRepresentation()
vtkDistanceRepresentation::SetHandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
vtkDistanceRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double e[2])
vtkDistanceRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkDistanceRepresentation::GetPoint1DisplayPosition
virtual void GetPoint1DisplayPosition(double pos[3])=0
vtkDistanceRepresentation::Point1Representation
vtkHandleRepresentation * Point1Representation
Definition: vtkDistanceRepresentation.h:147
vtkInteractionWidgetsModule.h
vtkDistanceRepresentation::~vtkDistanceRepresentation
~vtkDistanceRepresentation()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkDistanceRepresentation
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation.h:36
vtkDistanceRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkDistanceRepresentation::GetPoint1WorldPosition
virtual void GetPoint1WorldPosition(double pos[3])=0
vtkDistanceRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkDistanceRepresentation.h:146
vtkDistanceRepresentation::WidgetInteraction
virtual void WidgetInteraction(double e[2])
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDistanceRepresentation::GetDistance
virtual double GetDistance()=0
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkDistanceRepresentation::RulerDistance
double RulerDistance
Definition: vtkDistanceRepresentation.h:158
vtkDistanceRepresentation::SetPoint1WorldPosition
virtual void SetPoint1WorldPosition(double pos[3])=0
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkDistanceRepresentation::LabelFormat
char * LabelFormat
Definition: vtkDistanceRepresentation.h:154
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkDistanceRepresentation::GetPoint2WorldPosition
virtual double * GetPoint2WorldPosition()=0
vtkDistanceRepresentation::GetPoint1WorldPosition
virtual double * GetPoint1WorldPosition()=0
vtkDistanceRepresentation::SetPoint2WorldPosition
virtual void SetPoint2WorldPosition(double pos[3])=0
vtkDistanceRepresentation::GetPoint2WorldPosition
virtual void GetPoint2WorldPosition(double pos[3])=0
vtkDistanceRepresentation::NumberOfRulerTicks
int NumberOfRulerTicks
Definition: vtkDistanceRepresentation.h:159
vtkDistanceRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkDistanceRepresentation::Point2Representation
vtkHandleRepresentation * Point2Representation
Definition: vtkDistanceRepresentation.h:148
vtkDistanceRepresentation::RulerMode
int RulerMode
Definition: vtkDistanceRepresentation.h:157
vtkDistanceRepresentation::GetPoint2DisplayPosition
virtual void GetPoint2DisplayPosition(double pos[3])=0
vtkDistanceRepresentation::SetPoint2DisplayPosition
virtual void SetPoint2DisplayPosition(double pos[3])=0
vtkDistanceRepresentation::SetPoint1DisplayPosition
virtual void SetPoint1DisplayPosition(double pos[3])=0
vtkDistanceRepresentation::vtkDistanceRepresentation
vtkDistanceRepresentation()