VTK  9.2.6
vtkSphereHandleRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSphereHandleRepresentation.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 vtkSphereHandleRepresentation_h
28#define vtkSphereHandleRepresentation_h
29
31#include "vtkInteractionWidgetsModule.h" // For export macro
32#include "vtkSphereSource.h" // Needed for delegation to sphere
33
34class vtkSphereSource;
35class vtkProperty;
36class vtkActor;
38class vtkCellPicker;
39
40class VTKINTERACTIONWIDGETS_EXPORT vtkSphereHandleRepresentation : 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
71
81 vtkBooleanMacro(TranslationMode, vtkTypeBool);
83
84 void SetSphereRadius(double);
86
88
93 vtkGetObjectMacro(Property, vtkProperty);
94 vtkGetObjectMacro(SelectedProperty, vtkProperty);
96
98
104 vtkSetClampMacro(HotSpotSize, double, 0.0, 1.0);
105 vtkGetMacro(HotSpotSize, double);
107
112 void SetHandleSize(double size) override;
113
115
118 double* GetBounds() VTK_SIZEHINT(6) override;
119 void BuildRepresentation() override;
120 void StartWidgetInteraction(double eventPos[2]) override;
121 void WidgetInteraction(double eventPos[2]) override;
122 int ComputeInteractionState(int X, int Y, int modify = 0) override;
123 void PlaceWidget(double bounds[6]) override;
125
127
130 void ShallowCopy(vtkProp* prop) override;
131 void DeepCopy(vtkProp* prop) override;
134 int RenderOpaqueGeometry(vtkViewport* viewport) override;
138
139 void Highlight(int highlight) override;
140
141 /*
142 * Register internal Pickers within PickingManager
143 */
144 void RegisterPickers() override;
145
152 void SetVisibility(vtkTypeBool visible) override;
153
154protected:
157
158 // the cursor3D
162 // void Highlight(int highlight);
163
164 // Do the picking
168
169 // Methods to manipulate the cursor
171 void Translate(const double* p1, const double* p2) override;
172 void Scale(const double* p1, const double* p2, const double eventPos[2]);
173 void MoveFocus(const double* p1, const double* p2);
175
176 // Properties used to control the appearance of selected objects and
177 // the manipulator in general.
181
182 // The size of the hot spot.
186
187 // Current handle sized (may reflect scaling)
189
190 // Control how translation works
192
193private:
195 void operator=(const vtkSphereHandleRepresentation&) = delete;
196};
197
198#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
ray-cast cell picker for all kinds of Prop3Ds
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
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
Definition vtkProperty.h:62
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
int ComputeInteractionState(int X, int Y, int modify=0) 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 Highlight(int highlight) override
void SetDisplayPosition(double p[3]) override
Set the position of the point in world and display coordinates.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void PlaceWidget(double bounds[6]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
void SetVisibility(vtkTypeBool visible) override
Override to ensure that the internal actor's visibility is consistent with this representation's visi...
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.
void MoveFocus(const double *p1, const double *p2)
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
void DeepCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void SetSelectedProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
static vtkSphereHandleRepresentation * New()
Instantiate this class.
void ShallowCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void SetWorldPosition(double p[3]) override
Set the position of the point in world and display coordinates.
void StartWidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
double * GetBounds() override
Methods to make this class properly act like a vtkWidgetRepresentation.
void Scale(const double *p1, const double *p2, const double eventPos[2])
void SetHandleSize(double size) override
Overload the superclasses SetHandleSize() method to update internal variables.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
create a polygonal sphere centered at the origin
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(...)