VTK
dox/Interaction/Widgets/vtkAngleRepresentation.h
Go to the documentation of this file.
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 "vtkInteractionWidgetsModule.h" // For export macro
00033 #include "vtkWidgetRepresentation.h"
00034 
00035 class vtkHandleRepresentation;
00036 
00037 
00038 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleRepresentation : public vtkWidgetRepresentation
00039 {
00040 public:
00042 
00043   vtkTypeMacro(vtkAngleRepresentation,vtkWidgetRepresentation);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00049   virtual double GetAngle() = 0;
00050 
00052 
00055   virtual void GetPoint1WorldPosition(double pos[3]) = 0;
00056   virtual void GetCenterWorldPosition(double pos[3]) = 0;
00057   virtual void GetPoint2WorldPosition(double pos[3]) = 0;
00058   virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
00059   virtual void SetCenterDisplayPosition(double pos[3]) = 0;
00060   virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
00061   virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
00062   virtual void GetCenterDisplayPosition(double pos[3]) = 0;
00063   virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
00065 
00067 
00076   void SetHandleRepresentation(vtkHandleRepresentation *handle);
00077   void InstantiateHandleRepresentation();
00079 
00081 
00083   vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
00084   vtkGetObjectMacro(CenterRepresentation,vtkHandleRepresentation);
00085   vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
00087 
00089 
00092   vtkSetClampMacro(Tolerance,int,1,100);
00093   vtkGetMacro(Tolerance,int);
00095 
00097 
00100   vtkSetStringMacro(LabelFormat);
00101   vtkGetStringMacro(LabelFormat);
00103 
00105 
00107   vtkSetMacro(Ray1Visibility,int);
00108   vtkGetMacro(Ray1Visibility,int);
00109   vtkBooleanMacro(Ray1Visibility,int);
00110   vtkSetMacro(Ray2Visibility,int);
00111   vtkGetMacro(Ray2Visibility,int);
00112   vtkBooleanMacro(Ray2Visibility,int);
00113   vtkSetMacro(ArcVisibility,int);
00114   vtkGetMacro(ArcVisibility,int);
00115   vtkBooleanMacro(ArcVisibility,int);
00117 
00118 //BTX -- used to communicate about the state of the representation
00119   enum {Outside=0,NearP1,NearCenter,NearP2};
00120 //ETX
00121 
00123 
00124   virtual void BuildRepresentation();
00125   virtual int ComputeInteractionState(int X, int Y, int modify=0);
00126   virtual void StartWidgetInteraction(double e[2]);
00127   virtual void CenterWidgetInteraction(double e[2]);
00128   virtual void WidgetInteraction(double e[2]);
00130 
00131 protected:
00132   vtkAngleRepresentation();
00133   ~vtkAngleRepresentation();
00134 
00135   // The handle and the rep used to close the handles
00136   vtkHandleRepresentation *HandleRepresentation;
00137   vtkHandleRepresentation *Point1Representation;
00138   vtkHandleRepresentation *CenterRepresentation;
00139   vtkHandleRepresentation *Point2Representation;
00140 
00141   // Selection tolerance for the handles
00142   int Tolerance;
00143 
00144   // Visibility of the various pieces of the representation
00145   int Ray1Visibility;
00146   int Ray2Visibility;
00147   int ArcVisibility;
00148 
00149   // Format for the label
00150   char *LabelFormat;
00151 
00152 private:
00153   vtkAngleRepresentation(const vtkAngleRepresentation&);  //Not implemented
00154   void operator=(const vtkAngleRepresentation&);  //Not implemented
00155 };
00156 
00157 #endif