00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkDistanceRepresentation_h
00027 #define __vtkDistanceRepresentation_h
00028
00029 #include "vtkWidgetRepresentation.h"
00030
00031 class vtkHandleRepresentation;
00032
00033
00034 class VTK_WIDGETS_EXPORT vtkDistanceRepresentation : public vtkWidgetRepresentation
00035 {
00036 public:
00038
00039 vtkTypeRevisionMacro(vtkDistanceRepresentation,vtkWidgetRepresentation);
00040 void PrintSelf(ostream& os, vtkIndent indent);
00042
00045 virtual double GetDistance() = 0;
00046
00048
00051 virtual void GetPoint1WorldPosition(double pos[3]) = 0;
00052 virtual void GetPoint2WorldPosition(double pos[3]) = 0;
00053 virtual double* GetPoint1WorldPosition() = 0;
00054 virtual double* GetPoint2WorldPosition() = 0;
00055 virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
00056 virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
00057 virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
00058 virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
00059 virtual void SetPoint1WorldPosition(double pos[3])=0;
00060 virtual void SetPoint2WorldPosition(double pos[3])=0;
00062
00064
00073 void SetHandleRepresentation(vtkHandleRepresentation *handle);
00074 void InstantiateHandleRepresentation();
00076
00078
00081 vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
00082 vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
00084
00086
00089 vtkSetClampMacro(Tolerance,int,1,100);
00090 vtkGetMacro(Tolerance,int);
00092
00094
00097 vtkSetStringMacro(LabelFormat);
00098 vtkGetStringMacro(LabelFormat);
00100
00101
00102 enum {Outside=0,NearP1,NearP2};
00103
00104
00106
00107 virtual void BuildRepresentation();
00108 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00109 virtual void StartWidgetInteraction(double e[2]);
00110 virtual void WidgetInteraction(double e[2]);
00112
00113 protected:
00114 vtkDistanceRepresentation();
00115 ~vtkDistanceRepresentation();
00116
00117
00118 vtkHandleRepresentation *HandleRepresentation;
00119 vtkHandleRepresentation *Point1Representation;
00120 vtkHandleRepresentation *Point2Representation;
00121
00122
00123 int Tolerance;
00124
00125
00126 char *LabelFormat;
00127
00128 private:
00129 vtkDistanceRepresentation(const vtkDistanceRepresentation&);
00130 void operator=(const vtkDistanceRepresentation&);
00131 };
00132
00133 #endif