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 //BTX -- used to communicate about the state of the representation
119  enum {Outside=0,NearP1,NearCenter,NearP2};
120 //ETX
121 
123 
124  virtual void BuildRepresentation();
125  virtual int ComputeInteractionState(int X, int Y, int modify=0);
126  virtual void StartWidgetInteraction(double e[2]);
127  virtual void CenterWidgetInteraction(double e[2]);
128  virtual void WidgetInteraction(double e[2]);
130 
131 protected:
134 
135  // The handle and the rep used to close the handles
140 
141  // Selection tolerance for the handles
143 
144  // Visibility of the various pieces of the representation
148 
149  // Format for the label
150  char *LabelFormat;
151 
152 private:
153  vtkAngleRepresentation(const vtkAngleRepresentation&); //Not implemented
154  void operator=(const vtkAngleRepresentation&); //Not implemented
155 };
156 
157 #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