VTK
vtkAngleRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAngleRepresentation.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 =========================================================================*/
29 #ifndef vtkAngleRepresentation_h
30 #define vtkAngleRepresentation_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
36 
37 
39 {
40 public:
42 
44  void PrintSelf(ostream& os, vtkIndent indent);
46 
49  virtual double GetAngle() = 0;
50 
52 
55  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
56  virtual void GetCenterWorldPosition(double pos[3]) = 0;
57  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
58  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
59  virtual void SetCenterDisplayPosition(double pos[3]) = 0;
60  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
61  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
62  virtual void GetCenterDisplayPosition(double pos[3]) = 0;
63  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
65 
67 
76  void SetHandleRepresentation(vtkHandleRepresentation *handle);
77  void InstantiateHandleRepresentation();
79 
81 
83  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
84  vtkGetObjectMacro(CenterRepresentation,vtkHandleRepresentation);
85  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
87 
89 
92  vtkSetClampMacro(Tolerance,int,1,100);
93  vtkGetMacro(Tolerance,int);
95 
97 
100  vtkSetStringMacro(LabelFormat);
101  vtkGetStringMacro(LabelFormat);
103 
105 
107  vtkSetMacro(Ray1Visibility,int);
108  vtkGetMacro(Ray1Visibility,int);
109  vtkBooleanMacro(Ray1Visibility,int);
110  vtkSetMacro(Ray2Visibility,int);
111  vtkGetMacro(Ray2Visibility,int);
112  vtkBooleanMacro(Ray2Visibility,int);
113  vtkSetMacro(ArcVisibility,int);
114  vtkGetMacro(ArcVisibility,int);
115  vtkBooleanMacro(ArcVisibility,int);
117 
118  // Used to communicate about the state of the representation
119  enum {Outside=0,NearP1,NearCenter,NearP2};
120 
122 
123  virtual void BuildRepresentation();
124  virtual int ComputeInteractionState(int X, int Y, int modify=0);
125  virtual void StartWidgetInteraction(double e[2]);
126  virtual void CenterWidgetInteraction(double e[2]);
127  virtual void WidgetInteraction(double e[2]);
129 
130 protected:
133 
134  // The handle and the rep used to close the handles
139 
140  // Selection tolerance for the handles
142 
143  // Visibility of the various pieces of the representation
147 
148  // Format for the label
149  char *LabelFormat;
150 
151 private:
152  vtkAngleRepresentation(const vtkAngleRepresentation&); //Not implemented
153  void operator=(const vtkAngleRepresentation&); //Not implemented
154 };
155 
156 #endif
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
virtual void StartWidgetInteraction(double eventPos[2])
vtkHandleRepresentation * HandleRepresentation
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
represent the vtkAngleWidget
virtual void WidgetInteraction(double newEventPos[2])
vtkHandleRepresentation * CenterRepresentation
vtkHandleRepresentation * Point1Representation
void PrintSelf(ostream &os, vtkIndent indent)
vtkHandleRepresentation * Point2Representation