VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24 
25 VTK_ABI_NAMESPACE_BEGIN
27 
28 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkAngleRepresentation
30 {
31 public:
33 
37  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
44  virtual double GetAngle() = 0;
45 
47 
52  virtual void GetPoint1WorldPosition(double pos[3]) VTK_FUTURE_CONST = 0;
53  virtual void GetCenterWorldPosition(double pos[3]) VTK_FUTURE_CONST = 0;
54  virtual void GetPoint2WorldPosition(double pos[3]) VTK_FUTURE_CONST = 0;
55  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
56  virtual void SetCenterDisplayPosition(double pos[3]) = 0;
57  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
58  virtual void GetPoint1DisplayPosition(double pos[3]) VTK_FUTURE_CONST = 0;
59  virtual void GetCenterDisplayPosition(double pos[3]) VTK_FUTURE_CONST = 0;
60  virtual void GetPoint2DisplayPosition(double pos[3]) VTK_FUTURE_CONST = 0;
62 
64 
74  void SetHandleRepresentation(vtkHandleRepresentation* handle);
75  void InstantiateHandleRepresentation();
77 
79 
82  vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
83  vtkGetObjectMacro(CenterRepresentation, vtkHandleRepresentation);
84  vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
86 
88 
93  vtkSetClampMacro(Tolerance, int, 1, 100);
94  vtkGetMacro(Tolerance, int);
96 
98 
103  vtkSetStringMacro(LabelFormat);
104  vtkGetStringMacro(LabelFormat);
106 
108 
112  vtkSetMacro(Scale, double);
113  vtkGetMacro(Scale, double);
115 
117 
121  vtkSetMacro(Ray1Visibility, vtkTypeBool);
122  vtkGetMacro(Ray1Visibility, vtkTypeBool);
123  vtkBooleanMacro(Ray1Visibility, vtkTypeBool);
124  vtkSetMacro(Ray2Visibility, vtkTypeBool);
125  vtkGetMacro(Ray2Visibility, vtkTypeBool);
126  vtkBooleanMacro(Ray2Visibility, vtkTypeBool);
127  vtkSetMacro(ArcVisibility, vtkTypeBool);
128  vtkGetMacro(ArcVisibility, vtkTypeBool);
129  vtkBooleanMacro(ArcVisibility, vtkTypeBool);
131 
132  // Used to communicate about the state of the representation
133  enum
134  {
135  Outside = 0,
138  NearP2
139  };
140 
142 
145  void BuildRepresentation() override;
146  int ComputeInteractionState(int X, int Y, int modify = 0) override;
147  void StartWidgetInteraction(double e[2]) override;
148  virtual void CenterWidgetInteraction(double e[2]);
149  void WidgetInteraction(double e[2]) override;
150  void SetRenderer(vtkRenderer* ren) override;
152 
153 protected:
155  ~vtkAngleRepresentation() override;
156 
157  // The handle and the rep used to close the handles
162 
163  // Selection tolerance for the handles
164  int Tolerance = 5;
165 
166  // Visibility of the various pieces of the representation
170 
171  // Format for the label
172  char* LabelFormat;
173 
174  // Scale to change from degrees to the desired unit system (radians, fractions of pi) for
175  // displaying the angle
176  double Scale = 1.0;
177 
178 private:
180  void operator=(const vtkAngleRepresentation&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #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:63
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
#define VTK_MARSHALAUTO
vtkHandleRepresentation * Point2Representation