VTK  9.3.0
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
34#include <memory> // for unique_ptr
35
36VTK_ABI_NAMESPACE_BEGIN
37
38class vtkViewport;
39
40class VTKINTERACTIONWIDGETS_EXPORT vtk3DCursorRepresentation : public vtkWidgetRepresentation
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
51 void BuildRepresentation() override;
52
56 void WidgetInteraction(double newEventPos[2]) override;
57
59
63 int RenderOpaqueGeometry(vtkViewport* viewport) override;
65
67 {
68 CROSS_SHAPE = 0,
69 SPHERE_SHAPE = 1,
70 CUSTOM_SHAPE = 2
71 };
72
74
80 void SetCursorShape(int shape);
81 vtkGetMacro(Shape, int);
83
85
89 void SetCustomCursor(vtkActor* customCursor);
92
94
98 VTK_DEPRECATED_IN_9_3_0("Please use SetCursorShape and SetCustomCursor instead.")
99 virtual void SetCursor(vtkActor* cursor);
100 VTK_DEPRECATED_IN_9_3_0("Please use GetCustomCursor instead.")
101 virtual vtkActor* GetCursor();
103
104protected:
107
108private:
110 void operator=(const vtk3DCursorRepresentation&) = delete;
111
112 struct vtkInternals;
113 std::unique_ptr<vtkInternals> Internals;
114
115 vtkSmartPointer<vtkActor> CustomCursor;
116 int Shape = CROSS_SHAPE;
117};
118
119VTK_ABI_NAMESPACE_END
120#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.
vtkGetSmartPointerMacro(CustomCursor, vtkActor)
Set / Get an actor to use as custom cursor.
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:41
a simple class to control print indentation
Definition vtkIndent.h:29
Hold a reference to a vtkObjectBase instance.
abstract specification for Viewports
Definition vtkViewport.h:45
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
#define VTK_DEPRECATED_IN_9_3_0(reason)