VTK  9.4.2
vtk3DCursorRepresentation.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
23#ifndef vtk3DCursorRepresentation_h
24#define vtk3DCursorRepresentation_h
25
26#include "vtkActor.h" // For vtkActor
27#include "vtkDeprecation.h" // For deprecation macros
28#include "vtkHardwarePicker.h" // For vtkHardwarePicker
29#include "vtkInteractionWidgetsModule.h" // For export macro
30#include "vtkNew.h" // For vtkNew
31#include "vtkSmartPointer.h" // For vtkSmartPointer
33#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
34
35#include <memory> // for unique_ptr
36
37VTK_ABI_NAMESPACE_BEGIN
38
39class vtkViewport;
40
41class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtk3DCursorRepresentation
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
53 void BuildRepresentation() override;
54
58 void WidgetInteraction(double newEventPos[2]) override;
59
61
65 int RenderOpaqueGeometry(vtkViewport* viewport) override;
67
69 {
70 CROSS_SHAPE = 0,
71 SPHERE_SHAPE = 1,
72 CUSTOM_SHAPE = 2
73 };
74
76
82 void SetCursorShape(int shape);
83 vtkGetMacro(Shape, int);
85
87
91 void SetCustomCursor(vtkActor* customCursor);
92 vtkGetSmartPointerMacro(CustomCursor, vtkActor);
94
96
100 VTK_DEPRECATED_IN_9_3_0("Please use SetCursorShape and SetCustomCursor instead.")
101 virtual void SetCursor(vtkActor* cursor);
102 VTK_DEPRECATED_IN_9_3_0("Please use GetCustomCursor instead.")
103 virtual vtkActor* GetCursor();
105
106protected:
109
110private:
112 void operator=(const vtk3DCursorRepresentation&) = delete;
113
114 struct vtkInternals;
115 std::unique_ptr<vtkInternals> Internals;
116
117 vtkSmartPointer<vtkActor> CustomCursor;
118 int Shape = CROSS_SHAPE;
119};
120
121VTK_ABI_NAMESPACE_END
122#endif
Representation of the vtk3DCursorWidget.
void BuildRepresentation() override
Update the cursor size (in world coordinates) to always keep the same size in display coordinates.
void SetCustomCursor(vtkActor *customCursor)
Set / Get an actor to use as custom cursor.
void WidgetInteraction(double newEventPos[2]) override
Position the cursor in the scene using the vtkHardwarePicker.
void SetCursorShape(int shape)
Set / Get the shape of the cursor.
static vtk3DCursorRepresentation * New()
int RenderOpaqueGeometry(vtkViewport *viewport) override
These methods are reimplemented to make this class behave as a vtkProp.
void ReleaseGraphicsResources(vtkWindow *) override
These methods are reimplemented to make this class behave as a vtkProp.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
a simple class to control print indentation
Definition vtkIndent.h:108
Hold a reference to a vtkObjectBase instance.
abstract specification for Viewports
Definition vtkViewport.h:65
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_DEPRECATED_IN_9_3_0(reason)
#define VTK_MARSHALAUTO