VTK: Interaction/Widgets/vtkBiDimensionalRepresentation.h Source File

| VTK 9.3.1

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
35 #include "vtkWidgetRepresentation.h"
36
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkHandleRepresentation;
39
40 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation : public vtkWidgetRepresentation
41 {
42 public:
44
47 vtkTypeMacro(vtkBiDimensionalRepresentation, vtkWidgetRepresentation);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
57 virtual void SetPoint1WorldPosition(double pos[3]);
58 virtual void SetPoint2WorldPosition(double pos[3]);
59 virtual void SetPoint3WorldPosition(double pos[3]);
60 virtual void SetPoint4WorldPosition(double pos[3]);
61 virtual void GetPoint1WorldPosition(double pos[3]);
62 virtual void GetPoint2WorldPosition(double pos[3]);
63 virtual void GetPoint3WorldPosition(double pos[3]);
64 virtual void GetPoint4WorldPosition(double pos[3]);
65 virtual void SetPoint1DisplayPosition(double pos[3]);
66 virtual void SetPoint2DisplayPosition(double pos[3]);
67 virtual void SetPoint3DisplayPosition(double pos[3]);
68 virtual void SetPoint4DisplayPosition(double pos[3]);
69 virtual void GetPoint1DisplayPosition(double pos[3]);
70 virtual void GetPoint2DisplayPosition(double pos[3]);
71 virtual void GetPoint3DisplayPosition(double pos[3]);
72 virtual void GetPoint4DisplayPosition(double pos[3]);
74
76
82 vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
83 vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
84 vtkGetObjectMacro(Point3Representation, vtkHandleRepresentation);
85 vtkGetObjectMacro(Point4Representation, vtkHandleRepresentation);
87
89
95 vtkSetMacro(Line1Visibility, vtkTypeBool);
96 vtkGetMacro(Line1Visibility, vtkTypeBool);
97 vtkBooleanMacro(Line1Visibility, vtkTypeBool);
98 vtkSetMacro(Line2Visibility, vtkTypeBool);
99 vtkGetMacro(Line2Visibility, vtkTypeBool);
100 vtkBooleanMacro(Line2Visibility, vtkTypeBool);
102
104
115 void SetHandleRepresentation(vtkHandleRepresentation* handle);
116 virtual void InstantiateHandleRepresentation();
118
120
125 vtkSetClampMacro(Tolerance, int, 1, 100);
126 vtkGetMacro(Tolerance, int);
128
133 virtual double GetLength1();
134
139 virtual double GetLength2();
140
142
147 vtkSetStringMacro(LabelFormat);
148 vtkGetStringMacro(LabelFormat);
150
151 // Used to communicate about the state of the representation
152 enum
153 {
154 Outside = 0,
155 NearP1,
156 NearP2,
157 NearP3,
158 NearP4,
159 OnL1Inner,
160 OnL1Outer,
161 OnL2Inner,
162 OnL2Outer,
163 OnCenter
164 };
165
167
171 vtkSetMacro(ShowLabelAboveWidget, vtkTypeBool);
172 vtkGetMacro(ShowLabelAboveWidget, vtkTypeBool);
173 vtkBooleanMacro(ShowLabelAboveWidget, vtkTypeBool);
175
177
180 void SetID(vtkIdType id);
181 vtkGetMacro(ID, vtkIdType);
183
187 virtual char* GetLabelText() = 0;
188
190
193 virtual double* GetLabelPosition() = 0;
194 virtual void GetLabelPosition(double pos[3]) = 0;
195 virtual void GetWorldLabelPosition(double pos[3]) = 0;
197
199
202 virtual void StartWidgetDefinition(double e[2]) = 0;
203 virtual void Point2WidgetInteraction(double e[2]) = 0;
204 virtual void Point3WidgetInteraction(double e[2]) = 0;
205 virtual void StartWidgetManipulation(double e[2]) = 0;
207
208 protected:
209 vtkBiDimensionalRepresentation();
210 ~vtkBiDimensionalRepresentation() override;
211
212 // Keep track if modifier is set
213 int Modifier;
214
215 // The handle and the rep used to close the handles
216 vtkHandleRepresentation* HandleRepresentation;
217 vtkHandleRepresentation* Point1Representation;
218 vtkHandleRepresentation* Point2Representation;
219 vtkHandleRepresentation* Point3Representation;
220 vtkHandleRepresentation* Point4Representation;
221
222 // Selection tolerance for the handles
223 int Tolerance;
224
225 // Visibility of the lines
226 vtkTypeBool Line1Visibility;
227 vtkTypeBool Line2Visibility;
228
229 vtkIdType ID;
230 int IDInitialized;
231
232 // Internal variables
233 double P1World[3];
234 double P2World[3];
235 double P3World[3];
236 double P4World[3];
237 double P21World[3];
238 double P43World[3];
239 double T21;
240 double T43;
241 double CenterWorld[3];
242 double StartEventPositionWorld[4];
243
244 // Format for printing the distance
245 char* LabelFormat;
246
247 // toggle to determine whether to place text above or below widget
248 vtkTypeBool ShowLabelAboveWidget;
249
250 private:
251 vtkBiDimensionalRepresentation(const vtkBiDimensionalRepresentation&) = delete;
252 void operator=(const vtkBiDimensionalRepresentation&) = delete;
253 };
254
255 VTK_ABI_NAMESPACE_END
256 #endif
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:41
vtkBiDimensionalRepresentation::T21
double T21
Definition: vtkBiDimensionalRepresentation.h:239
vtkBiDimensionalRepresentation::Point1Representation
vtkHandleRepresentation * Point1Representation
Definition: vtkBiDimensionalRepresentation.h:217
vtkBiDimensionalRepresentation::Modifier
int Modifier
Definition: vtkBiDimensionalRepresentation.h:213
vtkBiDimensionalRepresentation::GetPoint2DisplayPosition
virtual void GetPoint2DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetPoint1DisplayPosition
virtual void SetPoint1DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::GetLength2
virtual double GetLength2()
Return the length of the line defined by (Point3,Point4).
vtkBiDimensionalRepresentation::GetPoint1WorldPosition
virtual void GetPoint1WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::LabelFormat
char * LabelFormat
Definition: vtkBiDimensionalRepresentation.h:245
vtkBiDimensionalRepresentation::StartWidgetManipulation
virtual void StartWidgetManipulation(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::GetLabelText
virtual char * GetLabelText()=0
Get the text shown in the widget's label.
vtkBiDimensionalRepresentation::Point2WidgetInteraction
virtual void Point2WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkBiDimensionalRepresentation.h:216
vtkBiDimensionalRepresentation::SetHandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the four internal vtkHand...
vtkBiDimensionalRepresentation::Point3Representation
vtkHandleRepresentation * Point3Representation
Definition: vtkBiDimensionalRepresentation.h:219
vtkBiDimensionalRepresentation::SetPoint3DisplayPosition
virtual void SetPoint3DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetPoint2WorldPosition
virtual void SetPoint2WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::Tolerance
int Tolerance
Definition: vtkBiDimensionalRepresentation.h:223
vtkBiDimensionalRepresentation::T43
double T43
Definition: vtkBiDimensionalRepresentation.h:240
vtkBiDimensionalRepresentation::Point4Representation
vtkHandleRepresentation * Point4Representation
Definition: vtkBiDimensionalRepresentation.h:220
vtkBiDimensionalRepresentation::ShowLabelAboveWidget
vtkTypeBool ShowLabelAboveWidget
Definition: vtkBiDimensionalRepresentation.h:248
vtkBiDimensionalRepresentation::GetPoint4DisplayPosition
virtual void GetPoint4DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::Point3WidgetInteraction
virtual void Point3WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::Point2Representation
vtkHandleRepresentation * Point2Representation
Definition: vtkBiDimensionalRepresentation.h:218
vtkBiDimensionalRepresentation::IDInitialized
int IDInitialized
Definition: vtkBiDimensionalRepresentation.h:230
vtkBiDimensionalRepresentation::OnL2Inner
@ OnL2Inner
Definition: vtkBiDimensionalRepresentation.h:161
vtkBiDimensionalRepresentation::OnL1Inner
@ OnL1Inner
Definition: vtkBiDimensionalRepresentation.h:159
vtkBiDimensionalRepresentation::NearP1
@ NearP1
Definition: vtkBiDimensionalRepresentation.h:155
vtkBiDimensionalRepresentation::NearP4
@ NearP4
Definition: vtkBiDimensionalRepresentation.h:158
vtkBiDimensionalRepresentation::NearP3
@ NearP3
Definition: vtkBiDimensionalRepresentation.h:157
vtkBiDimensionalRepresentation::NearP2
@ NearP2
Definition: vtkBiDimensionalRepresentation.h:156
vtkBiDimensionalRepresentation::OnL1Outer
@ OnL1Outer
Definition: vtkBiDimensionalRepresentation.h:160
vtkBiDimensionalRepresentation::OnL2Outer
@ OnL2Outer
Definition: vtkBiDimensionalRepresentation.h:162
vtkBiDimensionalRepresentation::~vtkBiDimensionalRepresentation
~vtkBiDimensionalRepresentation() override
vtkBiDimensionalRepresentation::GetPoint2WorldPosition
virtual void GetPoint2WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetPoint1WorldPosition
virtual void SetPoint1WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::GetLabelPosition
virtual double * GetLabelPosition()=0
Get the position of the widget's label in display coordinates.
vtkBiDimensionalRepresentation::Line1Visibility
vtkTypeBool Line1Visibility
Definition: vtkBiDimensionalRepresentation.h:226
vtkBiDimensionalRepresentation::Line2Visibility
vtkTypeBool Line2Visibility
Definition: vtkBiDimensionalRepresentation.h:227
vtkBiDimensionalRepresentation::GetPoint4WorldPosition
virtual void GetPoint4WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::StartWidgetDefinition
virtual void StartWidgetDefinition(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::SetPoint4DisplayPosition
virtual void SetPoint4DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetPoint2DisplayPosition
virtual void SetPoint2DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetID
void SetID(vtkIdType id)
Set/get the id to display in the label.
vtkBiDimensionalRepresentation::SetPoint3WorldPosition
virtual void SetPoint3WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::vtkBiDimensionalRepresentation
vtkBiDimensionalRepresentation()
vtkBiDimensionalRepresentation::GetPoint1DisplayPosition
virtual void GetPoint1DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::GetWorldLabelPosition
virtual void GetWorldLabelPosition(double pos[3])=0
Get the position of the widget's label in display coordinates.
vtkBiDimensionalRepresentation::GetPoint3WorldPosition
virtual void GetPoint3WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::SetPoint4WorldPosition
virtual void SetPoint4WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::GetPoint3DisplayPosition
virtual void GetPoint3DisplayPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
vtkBiDimensionalRepresentation::GetLabelPosition
virtual void GetLabelPosition(double pos[3])=0
Get the position of the widget's label in display coordinates.
vtkBiDimensionalRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
vtkBiDimensionalRepresentation::GetLength1
virtual double GetLength1()
Return the length of the line defined by (Point1,Point2).
vtkBiDimensionalRepresentation::InstantiateHandleRepresentation
virtual void InstantiateHandleRepresentation()
This method is used to specify the type of handle representation to use for the four internal vtkHand...
vtkBiDimensionalRepresentation::ID
vtkIdType ID
Definition: vtkBiDimensionalRepresentation.h:229
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:65
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkWidgetRepresentation.h