VTK  9.3.20240423
vtkBiDimensionalRepresentation.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
31#ifndef vtkBiDimensionalRepresentation_h
32#define vtkBiDimensionalRepresentation_h
33
34#include "vtkInteractionWidgetsModule.h" // For export macro
36#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
37
38VTK_ABI_NAMESPACE_BEGIN
40
41class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBiDimensionalRepresentation
43{
44public:
46
50 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
59 virtual void SetPoint1WorldPosition(double pos[3]);
60 virtual void SetPoint2WorldPosition(double pos[3]);
61 virtual void SetPoint3WorldPosition(double pos[3]);
62 virtual void SetPoint4WorldPosition(double pos[3]);
63 virtual void GetPoint1WorldPosition(double pos[3]);
64 virtual void GetPoint2WorldPosition(double pos[3]);
65 virtual void GetPoint3WorldPosition(double pos[3]);
66 virtual void GetPoint4WorldPosition(double pos[3]);
67 virtual void SetPoint1DisplayPosition(double pos[3]);
68 virtual void SetPoint2DisplayPosition(double pos[3]);
69 virtual void SetPoint3DisplayPosition(double pos[3]);
70 virtual void SetPoint4DisplayPosition(double pos[3]);
71 virtual void GetPoint1DisplayPosition(double pos[3]);
72 virtual void GetPoint2DisplayPosition(double pos[3]);
73 virtual void GetPoint3DisplayPosition(double pos[3]);
74 virtual void GetPoint4DisplayPosition(double pos[3]);
76
78
84 vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
85 vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
86 vtkGetObjectMacro(Point3Representation, vtkHandleRepresentation);
87 vtkGetObjectMacro(Point4Representation, vtkHandleRepresentation);
89
91
97 vtkSetMacro(Line1Visibility, vtkTypeBool);
98 vtkGetMacro(Line1Visibility, vtkTypeBool);
99 vtkBooleanMacro(Line1Visibility, vtkTypeBool);
100 vtkSetMacro(Line2Visibility, vtkTypeBool);
101 vtkGetMacro(Line2Visibility, vtkTypeBool);
102 vtkBooleanMacro(Line2Visibility, vtkTypeBool);
104
106
120
122
127 vtkSetClampMacro(Tolerance, int, 1, 100);
128 vtkGetMacro(Tolerance, int);
130
135 virtual double GetLength1();
136
141 virtual double GetLength2();
142
144
149 vtkSetStringMacro(LabelFormat);
150 vtkGetStringMacro(LabelFormat);
152
153 // Used to communicate about the state of the representation
154 enum
155 {
156 Outside = 0,
165 OnCenter
166 };
167
169
173 vtkSetMacro(ShowLabelAboveWidget, vtkTypeBool);
174 vtkGetMacro(ShowLabelAboveWidget, vtkTypeBool);
175 vtkBooleanMacro(ShowLabelAboveWidget, vtkTypeBool);
177
179
182 void SetID(vtkIdType id);
183 vtkGetMacro(ID, vtkIdType);
185
189 virtual char* GetLabelText() = 0;
190
192
195 virtual double* GetLabelPosition() = 0;
196 virtual void GetLabelPosition(double pos[3]) = 0;
197 virtual void GetWorldLabelPosition(double pos[3]) = 0;
199
201
204 virtual void StartWidgetDefinition(double e[2]) = 0;
205 virtual void Point2WidgetInteraction(double e[2]) = 0;
206 virtual void Point3WidgetInteraction(double e[2]) = 0;
207 virtual void StartWidgetManipulation(double e[2]) = 0;
209
210protected:
213
214 // Keep track if modifier is set
216
217 // The handle and the rep used to close the handles
223
224 // Selection tolerance for the handles
226
227 // Visibility of the lines
230
233
234 // Internal variables
235 double P1World[3];
236 double P2World[3];
237 double P3World[3];
238 double P4World[3];
239 double P21World[3];
240 double P43World[3];
241 double T21;
242 double T43;
243 double CenterWorld[3];
244 double StartEventPositionWorld[4];
245
246 // Format for printing the distance
248
249 // toggle to determine whether to place text above or below widget
251
252private:
254 void operator=(const vtkBiDimensionalRepresentation&) = delete;
255};
256
257VTK_ABI_NAMESPACE_END
258#endif
represent the vtkBiDimensionalWidget
virtual void GetPoint2DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void SetPoint1DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual double GetLength2()
Return the length of the line defined by (Point3,Point4).
virtual char * GetLabelText()=0
Get the text shown in the widget's label.
virtual void GetPoint1WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void StartWidgetManipulation(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void Point2WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the four internal vtkHand...
virtual void SetPoint3DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void SetPoint2WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetPoint4DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual double * GetLabelPosition()=0
Get the position of the widget's label in display coordinates.
virtual void Point3WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
~vtkBiDimensionalRepresentation() override
virtual void GetPoint2WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void SetPoint1WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetPoint4WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void StartWidgetDefinition(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetPoint4DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void SetPoint2DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
void SetID(vtkIdType id)
Set/get the id to display in the label.
virtual void SetPoint3WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetPoint1DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetWorldLabelPosition(double pos[3])=0
Get the position of the widget's label in display coordinates.
virtual void GetPoint3WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void SetPoint4WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetPoint3DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetLabelPosition(double pos[3])=0
Get the position of the widget's label in display coordinates.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual double GetLength1()
Return the length of the line defined by (Point1,Point2).
virtual void InstantiateHandleRepresentation()
This method is used to specify the type of handle representation to use for the four internal vtkHand...
abstract class for representing widget handles
a simple class to control print indentation
Definition vtkIndent.h:108
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
#define VTK_MARSHALAUTO