VTK  9.3.1
vtkAngleRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkAngleRepresentation_h
19 #define vtkAngleRepresentation_h
20 
21 #include "vtkInteractionWidgetsModule.h" // For export macro
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 
27 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleRepresentation : public vtkWidgetRepresentation
28 {
29 public:
31 
35  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
42  virtual double GetAngle() = 0;
43 
45 
50  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
51  virtual void GetCenterWorldPosition(double pos[3]) = 0;
52  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
53  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
54  virtual void SetCenterDisplayPosition(double pos[3]) = 0;
55  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
56  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
57  virtual void GetCenterDisplayPosition(double pos[3]) = 0;
58  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
60 
62 
72  void SetHandleRepresentation(vtkHandleRepresentation* handle);
73  void InstantiateHandleRepresentation();
75 
77 
80  vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
81  vtkGetObjectMacro(CenterRepresentation, vtkHandleRepresentation);
82  vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
84 
86 
91  vtkSetClampMacro(Tolerance, int, 1, 100);
92  vtkGetMacro(Tolerance, int);
94 
96 
101  vtkSetStringMacro(LabelFormat);
102  vtkGetStringMacro(LabelFormat);
104 
106 
110  vtkSetMacro(Scale, double);
111  vtkGetMacro(Scale, double);
113 
115 
119  vtkSetMacro(Ray1Visibility, vtkTypeBool);
120  vtkGetMacro(Ray1Visibility, vtkTypeBool);
121  vtkBooleanMacro(Ray1Visibility, vtkTypeBool);
122  vtkSetMacro(Ray2Visibility, vtkTypeBool);
123  vtkGetMacro(Ray2Visibility, vtkTypeBool);
124  vtkBooleanMacro(Ray2Visibility, vtkTypeBool);
125  vtkSetMacro(ArcVisibility, vtkTypeBool);
126  vtkGetMacro(ArcVisibility, vtkTypeBool);
127  vtkBooleanMacro(ArcVisibility, vtkTypeBool);
129 
130  // Used to communicate about the state of the representation
131  enum
132  {
133  Outside = 0,
136  NearP2
137  };
138 
140 
143  void BuildRepresentation() override;
144  int ComputeInteractionState(int X, int Y, int modify = 0) override;
145  void StartWidgetInteraction(double e[2]) override;
146  virtual void CenterWidgetInteraction(double e[2]);
147  void WidgetInteraction(double e[2]) override;
148  void SetRenderer(vtkRenderer* ren) override;
150 
151 protected:
153  ~vtkAngleRepresentation() override;
154 
155  // The handle and the rep used to close the handles
160 
161  // Selection tolerance for the handles
162  int Tolerance = 5;
163 
164  // Visibility of the various pieces of the representation
168 
169  // Format for the label
170  char* LabelFormat;
171 
172  // Scale to change from degrees to the desired unit system (radians, fractions of pi) for
173  // displaying the angle
174  double Scale = 1.0;
175 
176 private:
178  void operator=(const vtkAngleRepresentation&) = delete;
179 };
180 
181 VTK_ABI_NAMESPACE_END
182 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
virtual void StartWidgetInteraction(double eventPos[2])
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkHandleRepresentation * HandleRepresentation
abstract specification for renderers
Definition: vtkRenderer.h:61
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
represent the vtkAngleWidget
virtual void WidgetInteraction(double newEventPos[2])
vtkHandleRepresentation * CenterRepresentation
vtkHandleRepresentation * Point1Representation
vtkHandleRepresentation * Point2Representation