VTK  9.2.20230606
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 =========================================================================*/
30 #ifndef vtkAngleRepresentation_h
31 #define vtkAngleRepresentation_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
38 
39 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleRepresentation : public vtkWidgetRepresentation
40 {
41 public:
43 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
54  virtual double GetAngle() = 0;
55 
57 
62  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
63  virtual void GetCenterWorldPosition(double pos[3]) = 0;
64  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
65  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
66  virtual void SetCenterDisplayPosition(double pos[3]) = 0;
67  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
68  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
69  virtual void GetCenterDisplayPosition(double pos[3]) = 0;
70  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
72 
74 
87 
89 
92  vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
93  vtkGetObjectMacro(CenterRepresentation, vtkHandleRepresentation);
94  vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
96 
98 
103  vtkSetClampMacro(Tolerance, int, 1, 100);
104  vtkGetMacro(Tolerance, int);
106 
108 
113  vtkSetStringMacro(LabelFormat);
114  vtkGetStringMacro(LabelFormat);
116 
118 
122  vtkSetMacro(Scale, double);
123  vtkGetMacro(Scale, double);
125 
127 
131  vtkSetMacro(Ray1Visibility, vtkTypeBool);
132  vtkGetMacro(Ray1Visibility, vtkTypeBool);
133  vtkBooleanMacro(Ray1Visibility, vtkTypeBool);
134  vtkSetMacro(Ray2Visibility, vtkTypeBool);
135  vtkGetMacro(Ray2Visibility, vtkTypeBool);
136  vtkBooleanMacro(Ray2Visibility, vtkTypeBool);
137  vtkSetMacro(ArcVisibility, vtkTypeBool);
138  vtkGetMacro(ArcVisibility, vtkTypeBool);
139  vtkBooleanMacro(ArcVisibility, vtkTypeBool);
141 
142  // Used to communicate about the state of the representation
143  enum
144  {
145  Outside = 0,
148  NearP2
149  };
150 
152 
155  void BuildRepresentation() override;
156  int ComputeInteractionState(int X, int Y, int modify = 0) override;
157  void StartWidgetInteraction(double e[2]) override;
158  virtual void CenterWidgetInteraction(double e[2]);
159  void WidgetInteraction(double e[2]) override;
160  void SetRenderer(vtkRenderer* ren) override;
162 
163 protected:
166 
167  // The handle and the rep used to close the handles
172 
173  // Selection tolerance for the handles
174  int Tolerance = 5;
175 
176  // Visibility of the various pieces of the representation
180 
181  // Format for the label
182  char* LabelFormat;
183 
184  // Scale to change from degrees to the desired unit system (radians, fractions of pi) for
185  // displaying the angle
186  double Scale = 1.0;
187 
188 private:
190  void operator=(const vtkAngleRepresentation&) = delete;
191 };
192 
193 VTK_ABI_NAMESPACE_END
194 #endif
represent the vtkAngleWidget
vtkHandleRepresentation * Point1Representation
virtual double GetAngle()=0
This representation and all subclasses must keep an angle (in degrees) consistent with the state of t...
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkHandleRepresentation * HandleRepresentation
vtkHandleRepresentation * CenterRepresentation
void SetRenderer(vtkRenderer *ren) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void GetPoint2WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
virtual void GetPoint2DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
virtual void GetCenterDisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
virtual void GetPoint1DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
virtual void CenterWidgetInteraction(double e[2])
These are methods that satisfy vtkWidgetRepresentation's API.
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetCenterDisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the three internal vtkHan...
void WidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
void InstantiateHandleRepresentation()
This method is used to specify the type of handle representation to use for the three internal vtkHan...
~vtkAngleRepresentation() override
virtual void SetPoint1DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
virtual void GetCenterWorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
void StartWidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetPoint2DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
vtkHandleRepresentation * Point2Representation
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual void GetPoint1WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the three points defining this representation.
abstract class for representing widget handles
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract specification for renderers
Definition: vtkRenderer.h:183
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:71