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 void SetPoint1DisplayPosition(double pos[3]) = 0;
00054 virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
00055 virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
00056 virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
00058
00060
00069 void SetHandleRepresentation(vtkHandleRepresentation *handle);
00070 void InstantiateHandleRepresentation();
00072
00074
00077 vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
00078 vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
00080
00082
00085 vtkSetClampMacro(Tolerance,int,1,100);
00086 vtkGetMacro(Tolerance,int);
00088
00090
00093 vtkSetStringMacro(LabelFormat);
00094 vtkGetStringMacro(LabelFormat);
00096
00097
00098 enum {Outside=0,NearP1,NearP2};
00099
00100
00102
00103 virtual void BuildRepresentation();
00104 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00105 virtual void StartWidgetInteraction(double e[2]);
00106 virtual void WidgetInteraction(double e[2]);
00108
00109 protected:
00110 vtkDistanceRepresentation();
00111 ~vtkDistanceRepresentation();
00112
00113
00114 vtkHandleRepresentation *HandleRepresentation;
00115 vtkHandleRepresentation *Point1Representation;
00116 vtkHandleRepresentation *Point2Representation;
00117
00118
00119 int Tolerance;
00120
00121
00122 char *LabelFormat;
00123
00124 private:
00125 vtkDistanceRepresentation(const vtkDistanceRepresentation&);
00126 void operator=(const vtkDistanceRepresentation&);
00127 };
00128
00129 #endif