VTK  9.2.6
vtkPointHandleRepresentation3D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPointHandleRepresentation3D.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=========================================================================*/
26
27#ifndef vtkPointHandleRepresentation3D_h
28#define vtkPointHandleRepresentation3D_h
29
30#include "vtkCursor3D.h" // Needed for delegation to cursor3D
32#include "vtkInteractionWidgetsModule.h" // For export macro
33
34class vtkCursor3D;
35class vtkProperty;
36class vtkActor;
38class vtkCellPicker;
39
40class VTKINTERACTIONWIDGETS_EXPORT vtkPointHandleRepresentation3D : public vtkHandleRepresentation
41{
42public:
47
49
53 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
59
66 void SetWorldPosition(double p[3]) override;
67 void SetDisplayPosition(double p[3]) override;
69
73 void SetOutline(int o) { this->Cursor3D->SetOutline(o); }
74 int GetOutline() { return this->Cursor3D->GetOutline(); }
75 void OutlineOn() { this->Cursor3D->OutlineOn(); }
76 void OutlineOff() { this->Cursor3D->OutlineOff(); }
77
81 void SetXShadows(int o) { this->Cursor3D->SetXShadows(o); }
82 int GetXShadows() { return this->Cursor3D->GetXShadows(); }
83 void XShadowsOn() { this->Cursor3D->XShadowsOn(); }
84 void XShadowsOff() { this->Cursor3D->XShadowsOff(); }
85
89 void SetYShadows(int o) { this->Cursor3D->SetYShadows(o); }
90 int GetYShadows() { return this->Cursor3D->GetYShadows(); }
91 void YShadowsOn() { this->Cursor3D->YShadowsOn(); }
92 void YShadowsOff() { this->Cursor3D->YShadowsOff(); }
93
97 void SetZShadows(int o) { this->Cursor3D->SetZShadows(o); }
98 int GetZShadows() { return this->Cursor3D->GetZShadows(); }
99 void ZShadowsOn() { this->Cursor3D->ZShadowsOn(); }
100 void ZShadowsOff() { this->Cursor3D->ZShadowsOff(); }
101
103
116 vtkBooleanMacro(TranslationMode, vtkTypeBool);
118
120
123 void AllOn()
124 {
125 this->OutlineOn();
126 this->XShadowsOn();
127 this->YShadowsOn();
128 this->ZShadowsOn();
129 }
130 void AllOff()
131 {
132 this->OutlineOff();
133 this->XShadowsOff();
134 this->YShadowsOff();
135 this->ZShadowsOff();
136 }
137
138
140
145 vtkGetObjectMacro(Property, vtkProperty);
146 vtkGetObjectMacro(SelectedProperty, vtkProperty);
148
150
156 vtkSetClampMacro(HotSpotSize, double, 0.0, 1.0);
157 vtkGetMacro(HotSpotSize, double);
159
163 void SetHandleSize(double size) override;
164
166
169 double* GetBounds() VTK_SIZEHINT(6) override;
170 void BuildRepresentation() override;
171 void StartWidgetInteraction(double eventPos[2]) override;
172 void WidgetInteraction(double eventPos[2]) override;
173 int ComputeInteractionState(int X, int Y, int modify = 0) override;
174 void PlaceWidget(double bounds[6]) override;
176 unsigned long event, void* calldata) override;
178 unsigned long event, void* calldata) override;
180 unsigned long event, void* calldata, int modify = 0) override;
182
184
187 void ShallowCopy(vtkProp* prop) override;
188 void DeepCopy(vtkProp* prop) override;
191 int RenderOpaqueGeometry(vtkViewport* viewport) override;
195
196 void Highlight(int highlight) override;
197
199
212 vtkBooleanMacro(SmoothMotion, vtkTypeBool);
214
215 /*
216 * Register internal Pickers within PickingManager
217 */
218 void RegisterPickers() override;
219
226 void SetVisibility(vtkTypeBool visible) override;
227
228protected:
231
232 // the cursor3D
236
237 // Do the picking
241
242 // Methods to manipulate the cursor
244 void Translate(const double* p1, const double* p2) override;
245 void Scale(const double* p1, const double* p2, const double eventPos[2]);
246 void MoveFocus(const double* p1, const double* p2);
248
261 const double* p1, const double* p2, const double currPos[2], double center[3]);
262
263 // Properties used to control the appearance of selected objects and
264 // the manipulator in general.
268
269 // The size of the hot spot.
271 int DetermineConstraintAxis(int constraint, double* x, double* startPoint);
274
275 // Current handle sized (may reflect scaling)
277
278 // Control how translation works
280
282
283private:
285 void operator=(const vtkPointHandleRepresentation3D&) = delete;
286};
287
288#endif
define the API for widget / widget representation
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
ray-cast cell picker for all kinds of Prop3Ds
generate a 3D cursor representation
Definition vtkCursor3D.h:37
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:34
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 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 SetOutline(int o)
Turn on/off the wireframe bounding box.
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.
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
Definition vtkProperty.h:62
platform-independent render window interaction including picking and frame rate control.
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)