VTK  9.5.2
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
25VTK_ABI_NAMESPACE_BEGIN
26class vtkCursor3D;
27class vtkProperty;
28class vtkActor;
30class vtkCellPicker;
31
32class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation3D : public vtkHandleRepresentation
33{
34public:
39
41
45 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
51
58 void SetWorldPosition(double p[3]) override;
59 void SetDisplayPosition(double p[3]) override;
61
65 void SetOutline(int o) { this->Cursor3D->SetOutline(o); }
66 int GetOutline() { return this->Cursor3D->GetOutline(); }
67 void OutlineOn() { this->Cursor3D->OutlineOn(); }
68 void OutlineOff() { this->Cursor3D->OutlineOff(); }
69
73 void SetXShadows(int o) { this->Cursor3D->SetXShadows(o); }
74 int GetXShadows() { return this->Cursor3D->GetXShadows(); }
75 void XShadowsOn() { this->Cursor3D->XShadowsOn(); }
76 void XShadowsOff() { this->Cursor3D->XShadowsOff(); }
77
81 void SetYShadows(int o) { this->Cursor3D->SetYShadows(o); }
82 int GetYShadows() { return this->Cursor3D->GetYShadows(); }
83 void YShadowsOn() { this->Cursor3D->YShadowsOn(); }
84 void YShadowsOff() { this->Cursor3D->YShadowsOff(); }
85
89 void SetZShadows(int o) { this->Cursor3D->SetZShadows(o); }
90 int GetZShadows() { return this->Cursor3D->GetZShadows(); }
91 void ZShadowsOn() { this->Cursor3D->ZShadowsOn(); }
92 void ZShadowsOff() { this->Cursor3D->ZShadowsOff(); }
93
95
108 vtkBooleanMacro(TranslationMode, vtkTypeBool);
110
112
115 void AllOn()
116 {
117 this->OutlineOn();
118 this->XShadowsOn();
119 this->YShadowsOn();
120 this->ZShadowsOn();
121 }
122 void AllOff()
123 {
124 this->OutlineOff();
125 this->XShadowsOff();
126 this->YShadowsOff();
127 this->ZShadowsOff();
128 }
129
130
132
137 vtkGetObjectMacro(Property, vtkProperty);
138 vtkGetObjectMacro(SelectedProperty, vtkProperty);
140
142
145 void SetInteractionColor(double, double, double);
146 void SetInteractionColor(double c[3]) { this->SetInteractionColor(c[0], c[1], c[2]); }
147 void SetForegroundColor(double, double, double);
148 void SetForegroundColor(double c[3]) { this->SetForegroundColor(c[0], c[1], c[2]); }
150
152
158 vtkSetClampMacro(HotSpotSize, double, 0.0, 1.0);
159 vtkGetMacro(HotSpotSize, double);
161
165 void SetHandleSize(double size) override;
166
168
171 double* GetBounds() VTK_SIZEHINT(6) override;
172 void BuildRepresentation() override;
173 void StartWidgetInteraction(double eventPos[2]) override;
174 void WidgetInteraction(double eventPos[2]) override;
175 int ComputeInteractionState(int X, int Y, int modify = 0) override;
176 void PlaceWidget(double bounds[6]) override;
178 unsigned long event, void* calldata) override;
180 unsigned long event, void* calldata) override;
182 unsigned long event, void* calldata, int modify = 0) override;
184
186
189 void ShallowCopy(vtkProp* prop) override;
190 void DeepCopy(vtkProp* prop) override;
193 int RenderOpaqueGeometry(vtkViewport* viewport) override;
197
198 void Highlight(int highlight) override;
199
201
214 vtkBooleanMacro(SmoothMotion, vtkTypeBool);
216
217 /*
218 * Register internal Pickers within PickingManager
219 */
220 void RegisterPickers() override;
221
228 void SetVisibility(vtkTypeBool visible) override;
229
230protected:
233
234 // the cursor3D
238
239 // Do the picking
243
244 // Methods to manipulate the cursor
246 void Translate(const double* p1, const double* p2) override;
247 void Scale(const double* p1, const double* p2, const double eventPos[2]);
248 void MoveFocus(const double* p1, const double* p2);
250
263 const double* p1, const double* p2, const double currPos[2], double center[3]);
264
265 // Properties used to control the appearance of selected objects and
266 // the manipulator in general.
270
271 // The size of the hot spot.
273 int DetermineConstraintAxis(int constraint, double* x, double* startPoint);
276
277 // Current handle sized (may reflect scaling)
279
280 // Control how translation works
282
284
285private:
287 void operator=(const vtkPointHandleRepresentation3D&) = delete;
288};
289
290VTK_ABI_NAMESPACE_END
291#endif
define the API for widget / widget representation
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
ray-cast cell picker for all kinds of Prop3Ds
generate a 3D cursor representation
Definition vtkCursor3D.h:29
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:29
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.