VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkAngleRepresentation.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00029 #ifndef __vtkAngleRepresentation_h 00030 #define __vtkAngleRepresentation_h 00031 00032 #include "vtkWidgetRepresentation.h" 00033 00034 class vtkHandleRepresentation; 00035 00036 00037 class VTK_WIDGETS_EXPORT vtkAngleRepresentation : public vtkWidgetRepresentation 00038 { 00039 public: 00041 00042 vtkTypeMacro(vtkAngleRepresentation,vtkWidgetRepresentation); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00045 00048 virtual double GetAngle() = 0; 00049 00051 00054 virtual void GetPoint1WorldPosition(double pos[3]) = 0; 00055 virtual void GetCenterWorldPosition(double pos[3]) = 0; 00056 virtual void GetPoint2WorldPosition(double pos[3]) = 0; 00057 virtual void SetPoint1DisplayPosition(double pos[3]) = 0; 00058 virtual void SetCenterDisplayPosition(double pos[3]) = 0; 00059 virtual void SetPoint2DisplayPosition(double pos[3]) = 0; 00060 virtual void GetPoint1DisplayPosition(double pos[3]) = 0; 00061 virtual void GetCenterDisplayPosition(double pos[3]) = 0; 00062 virtual void GetPoint2DisplayPosition(double pos[3]) = 0; 00064 00066 00075 void SetHandleRepresentation(vtkHandleRepresentation *handle); 00076 void InstantiateHandleRepresentation(); 00078 00080 00082 vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation); 00083 vtkGetObjectMacro(CenterRepresentation,vtkHandleRepresentation); 00084 vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation); 00086 00088 00091 vtkSetClampMacro(Tolerance,int,1,100); 00092 vtkGetMacro(Tolerance,int); 00094 00096 00099 vtkSetStringMacro(LabelFormat); 00100 vtkGetStringMacro(LabelFormat); 00102 00104 00106 vtkSetMacro(Ray1Visibility,int); 00107 vtkGetMacro(Ray1Visibility,int); 00108 vtkBooleanMacro(Ray1Visibility,int); 00109 vtkSetMacro(Ray2Visibility,int); 00110 vtkGetMacro(Ray2Visibility,int); 00111 vtkBooleanMacro(Ray2Visibility,int); 00112 vtkSetMacro(ArcVisibility,int); 00113 vtkGetMacro(ArcVisibility,int); 00114 vtkBooleanMacro(ArcVisibility,int); 00116 00117 //BTX -- used to communicate about the state of the representation 00118 enum {Outside=0,NearP1,NearCenter,NearP2}; 00119 //ETX 00120 00122 00123 virtual void BuildRepresentation(); 00124 virtual int ComputeInteractionState(int X, int Y, int modify=0); 00125 virtual void StartWidgetInteraction(double e[2]); 00126 virtual void CenterWidgetInteraction(double e[2]); 00127 virtual void WidgetInteraction(double e[2]); 00129 00130 protected: 00131 vtkAngleRepresentation(); 00132 ~vtkAngleRepresentation(); 00133 00134 // The handle and the rep used to close the handles 00135 vtkHandleRepresentation *HandleRepresentation; 00136 vtkHandleRepresentation *Point1Representation; 00137 vtkHandleRepresentation *CenterRepresentation; 00138 vtkHandleRepresentation *Point2Representation; 00139 00140 // Selection tolerance for the handles 00141 int Tolerance; 00142 00143 // Visibility of the various pieces of the representation 00144 int Ray1Visibility; 00145 int Ray2Visibility; 00146 int ArcVisibility; 00147 00148 // Format for the label 00149 char *LabelFormat; 00150 00151 private: 00152 vtkAngleRepresentation(const vtkAngleRepresentation&); //Not implemented 00153 void operator=(const vtkAngleRepresentation&); //Not implemented 00154 }; 00155 00156 #endif