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 
30 
32 
33 
35 {
36 public:
38 
40  void PrintSelf(ostream& os, vtkIndent indent);
42 
45  virtual double GetDistance() = 0;
46 
48 
51  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
52  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
53  virtual double* GetPoint1WorldPosition() = 0;
54  virtual double* GetPoint2WorldPosition() = 0;
55  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
56  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
57  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
58  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
59  virtual void SetPoint1WorldPosition(double pos[3])=0;
60  virtual void SetPoint2WorldPosition(double pos[3])=0;
62 
64 
73  void SetHandleRepresentation(vtkHandleRepresentation *handle);
74  void InstantiateHandleRepresentation();
76 
78 
81  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
82  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
84 
86 
89  vtkSetClampMacro(Tolerance,int,1,100);
90  vtkGetMacro(Tolerance,int);
92 
94 
97  vtkSetStringMacro(LabelFormat);
98  vtkGetStringMacro(LabelFormat);
100 
102 
106  vtkSetMacro(RulerMode,int);
107  vtkGetMacro(RulerMode,int);
108  vtkBooleanMacro(RulerMode,int);
110 
112 
114  vtkSetClampMacro(RulerDistance,double,0,VTK_LARGE_FLOAT);
115  vtkGetMacro(RulerDistance,double);
117 
119 
124  vtkSetClampMacro(NumberOfRulerTicks,int,1,VTK_LARGE_INTEGER);
125  vtkGetMacro(NumberOfRulerTicks,int);
127 
128 //BTX -- used to communicate about the state of the representation
129  enum {Outside=0,NearP1,NearP2};
130 //ETX
131 
133 
134  virtual void BuildRepresentation();
135  virtual int ComputeInteractionState(int X, int Y, int modify=0);
136  virtual void StartWidgetInteraction(double e[2]);
137  virtual void WidgetInteraction(double e[2]);
139 
140 protected:
143 
144  // The handle and the rep used to close the handles
148 
149  // Selection tolerance for the handles
151 
152  // Format for printing the distance
153  char *LabelFormat;
154 
155  // Ruler related stuff
159 
160 private:
161  vtkDistanceRepresentation(const vtkDistanceRepresentation&); //Not implemented
162  void operator=(const vtkDistanceRepresentation&); //Not implemented
163 };
164 
165 #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])
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
vtkHandleRepresentation * HandleRepresentation
vtkHandleRepresentation * Point1Representation
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void WidgetInteraction(double newEventPos[2])
#define VTK_WIDGETS_EXPORT
#define VTK_LARGE_FLOAT
Definition: vtkType.h:149
vtkHandleRepresentation * Point2Representation
#define VTK_LARGE_INTEGER
Definition: vtkType.h:148
void PrintSelf(ostream &os, vtkIndent indent)