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=========================================================================*/
29
30#ifndef vtkSphereHandleRepresentation_h
31#define vtkSphereHandleRepresentation_h
32
34#include "vtkInteractionWidgetsModule.h" // For export macro
35#include "vtkSphereSource.h" // Needed for delegation to sphere
36
37class vtkSphereSource;
38class vtkProperty;
39class vtkActor;
41class vtkCellPicker;
42
43class VTKINTERACTIONWIDGETS_EXPORT vtkSphereHandleRepresentation : public vtkHandleRepresentation
44{
45public:
50
52
56 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
62
69 void SetWorldPosition(double p[3]) override;
70 void SetDisplayPosition(double p[3]) override;
72
74
84 vtkBooleanMacro(TranslationMode, vtkTypeBool);
86
87 void SetSphereRadius(double);
89
91
96 vtkGetObjectMacro(Property, vtkProperty);
97 vtkGetObjectMacro(SelectedProperty, vtkProperty);
99
101
107 vtkSetClampMacro(HotSpotSize, double, 0.0, 1.0);
108 vtkGetMacro(HotSpotSize, double);
110
115 void SetHandleSize(double size) override;
116
118
121 double* GetBounds() VTK_SIZEHINT(6) override;
122 void BuildRepresentation() override;
123 void StartWidgetInteraction(double eventPos[2]) override;
124 void WidgetInteraction(double eventPos[2]) override;
125 int ComputeInteractionState(int X, int Y, int modify = 0) override;
126 void PlaceWidget(double bounds[6]) override;
128
130
133 void ShallowCopy(vtkProp* prop) override;
134 void DeepCopy(vtkProp* prop) override;
137 int RenderOpaqueGeometry(vtkViewport* viewport) override;
141
142 void Highlight(int highlight) override;
143
144 /*
145 * Register internal Pickers within PickingManager
146 */
147 void RegisterPickers() override;
148
155 void SetVisibility(vtkTypeBool visible) override;
156
157protected:
160
161 // the cursor3D
165 // void Highlight(int highlight);
166
167 // Do the picking
171
172 // Methods to manipulate the cursor
174 void Translate(const double* p1, const double* p2) override;
175 void Scale(const double* p1, const double* p2, const double eventPos[2]);
176 void MoveFocus(const double* p1, const double* p2);
178
179 // Properties used to control the appearance of selected objects and
180 // the manipulator in general.
184
185 // The size of the hot spot.
189
190 // Current handle sized (may reflect scaling)
192
193 // Control how translation works
195
196private:
198 void operator=(const vtkSphereHandleRepresentation&) = delete;
199};
200
201#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:52
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:40
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
Definition vtkProperty.h:68
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:56
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)