VTK  9.5.20251121
vtkPointHandleRepresentation3D.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
17
18#ifndef vtkPointHandleRepresentation3D_h
19#define vtkPointHandleRepresentation3D_h
20
21#include "vtkCursor3D.h" // Needed for delegation to cursor3D
23#include "vtkInteractionWidgetsModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkCursor3D;
28class vtkProperty;
29class vtkActor;
31class vtkCellPicker;
32
33class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkPointHandleRepresentation3D
35{
36public:
41
43
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
53
60 void SetWorldPosition(double p[3]) override;
61 void SetDisplayPosition(double p[3]) override;
63
67 void SetOutline(int o) { this->Cursor3D->SetOutline(o); }
68 int GetOutline() { return this->Cursor3D->GetOutline(); }
69 void OutlineOn() { this->Cursor3D->OutlineOn(); }
70 void OutlineOff() { this->Cursor3D->OutlineOff(); }
71
75 void SetXShadows(int o) { this->Cursor3D->SetXShadows(o); }
76 int GetXShadows() { return this->Cursor3D->GetXShadows(); }
77 void XShadowsOn() { this->Cursor3D->XShadowsOn(); }
78 void XShadowsOff() { this->Cursor3D->XShadowsOff(); }
79
83 void SetYShadows(int o) { this->Cursor3D->SetYShadows(o); }
84 int GetYShadows() { return this->Cursor3D->GetYShadows(); }
85 void YShadowsOn() { this->Cursor3D->YShadowsOn(); }
86 void YShadowsOff() { this->Cursor3D->YShadowsOff(); }
87
91 void SetZShadows(int o) { this->Cursor3D->SetZShadows(o); }
92 int GetZShadows() { return this->Cursor3D->GetZShadows(); }
93 void ZShadowsOn() { this->Cursor3D->ZShadowsOn(); }
94 void ZShadowsOff() { this->Cursor3D->ZShadowsOff(); }
95
97
110 vtkBooleanMacro(TranslationMode, vtkTypeBool);
112
114
117 void AllOn()
118 {
119 this->OutlineOn();
120 this->XShadowsOn();
121 this->YShadowsOn();
122 this->ZShadowsOn();
123 }
124 void AllOff()
125 {
126 this->OutlineOff();
127 this->XShadowsOff();
128 this->YShadowsOff();
129 this->ZShadowsOff();
130 }
131
132
134
139 vtkGetObjectMacro(Property, vtkProperty);
140 vtkGetObjectMacro(SelectedProperty, vtkProperty);
142
144
147 void SetInteractionColor(double, double, double);
148 void SetInteractionColor(double c[3]) { this->SetInteractionColor(c[0], c[1], c[2]); }
149 void SetForegroundColor(double, double, double);
150 void SetForegroundColor(double c[3]) { this->SetForegroundColor(c[0], c[1], c[2]); }
152
154
160 vtkSetClampMacro(HotSpotSize, double, 0.0, 1.0);
161 vtkGetMacro(HotSpotSize, double);
163
167 void SetHandleSize(double size) override;
168
170
173 double* GetBounds() VTK_SIZEHINT(6) override;
174 void BuildRepresentation() override;
175 void StartWidgetInteraction(double eventPos[2]) override;
176 void WidgetInteraction(double eventPos[2]) override;
177 int ComputeInteractionState(int X, int Y, int modify = 0) override;
178 void PlaceWidget(double bounds[6]) override;
180 unsigned long event, void* calldata) override;
182 unsigned long event, void* calldata) override;
184 unsigned long event, void* calldata, int modify = 0) override;
186
188
191 void ShallowCopy(vtkProp* prop) override;
192 void DeepCopy(vtkProp* prop) override;
195 int RenderOpaqueGeometry(vtkViewport* viewport) override;
199
200 void Highlight(int highlight) override;
201
203
216 vtkBooleanMacro(SmoothMotion, vtkTypeBool);
218
219 /*
220 * Register internal Pickers within PickingManager
221 */
222 void RegisterPickers() override;
223
230 void SetVisibility(vtkTypeBool visible) override;
231
232protected:
235
236 // the cursor3D
240
241 // Do the picking
245
246 // Methods to manipulate the cursor
248 void Translate(const double* p1, const double* p2) override;
249 void Scale(const double* p1, const double* p2, const double eventPos[2]);
250 void MoveFocus(const double* p1, const double* p2);
252
265 const double* p1, const double* p2, const double currPos[2], double center[3]);
266
267 // Properties used to control the appearance of selected objects and
268 // the manipulator in general.
272
273 // The size of the hot spot.
275 int DetermineConstraintAxis(int constraint, double* x, double* startPoint);
278
279 // Current handle sized (may reflect scaling)
281
282 // Control how translation works
284
286
287private:
289 void operator=(const vtkPointHandleRepresentation3D&) = delete;
290};
291
292VTK_ABI_NAMESPACE_END
293#endif
define the API for widget / widget representation
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
ray-cast cell picker for all kinds of Prop3Ds
generate a 3D cursor representation
Definition vtkCursor3D.h:48
virtual void Translate(const double *p1, const double *p2)
Translates world position by vector p1p2 projected on the constraint axis if any.
a simple class to control print indentation
Definition vtkIndent.h:108
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void AllOn()
Convenience methods to turn outline and shadows on and off.
void SetHandleSize(double size) override
Overload the superclasses SetHandleSize() method to update internal variables.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void MoveFocusRequest(const double *p1, const double *p2, const double currPos[2], double center[3])
Given a motion vector defined by p1 --> p2 (p1 and p2 are in world coordinates), the new display posi...
int DetermineConstraintAxis(int constraint, double *x, double *startPoint)
void AllOff()
Convenience methods to turn outline and shadows on and off.
void PlaceWidget(double bounds[6]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void SetYShadows(int o)
Turn on/off the wireframe y-shadows.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
void Scale(const double *p1, const double *p2, const double eventPos[2])
void SetInteractionColor(double, double, double)
Set the widget color, and the color of interactive handles.
void ComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
Methods to make this class properly act like a vtkWidgetRepresentation.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void SetForegroundColor(double, double, double)
Set the widget color, and the color of interactive handles.
void SetOutline(int o)
Turn on/off the wireframe bounding box.
void SetInteractionColor(double c[3])
Set the widget color, and the color of interactive handles.
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
void StartComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void SetZShadows(int o)
Turn on/off the wireframe z-shadows.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void ShallowCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void SetXShadows(int o)
Turn on/off the wireframe x-shadows.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void Highlight(int highlight) override
void SetVisibility(vtkTypeBool visible) override
Override to ensure that the internal actor's visibility is consistent with this representation's visi...
void StartWidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void WidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void DeepCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void SetTranslationMode(vtkTypeBool mode)
If translation mode is on, as the widget is moved the bounding box, shadows, and cursor are all trans...
void SetSelectedProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
void MoveFocus(const double *p1, const double *p2)
void SetDisplayPosition(double p[3]) override
Set the position of the point in world and display coordinates.
void SetForegroundColor(double c[3])
Set the widget color, and the color of interactive handles.
int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata, int modify=0) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void BuildRepresentation() override
Methods to make this class properly act like a vtkWidgetRepresentation.
void Translate(const double *p1, const double *p2) override
Translates world position by vector p1p2 projected on the constraint axis if any.
static vtkPointHandleRepresentation3D * New()
Instantiate this class.
double * GetBounds() override
Methods to make this class properly act like a vtkWidgetRepresentation.
void SetWorldPosition(double p[3]) override
Set the position of the point in world and display coordinates.
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
platform-independent render window interaction including picking and frame rate control.
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO