VTK  9.4.20250211
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 "vtkHardwarePicker.h" // For vtkHardwarePicker
28#include "vtkInteractionWidgetsModule.h" // For export macro
29#include "vtkNew.h" // For vtkNew
30#include "vtkSmartPointer.h" // For vtkSmartPointer
32#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33
34#include <memory> // for unique_ptr
35
36VTK_ABI_NAMESPACE_BEGIN
37
38class vtkViewport;
39
40class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtk3DCursorRepresentation
42{
43public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
52 void BuildRepresentation() override;
53
57 void WidgetInteraction(double newEventPos[2]) override;
58
60
64 int RenderOpaqueGeometry(vtkViewport* viewport) override;
66
68 {
69 CROSS_SHAPE = 0,
70 SPHERE_SHAPE = 1,
71 CUSTOM_SHAPE = 2
72 };
73
75
81 void SetCursorShape(int shape);
82 vtkGetMacro(Shape, int);
84
86
90 void SetCustomCursor(vtkActor* customCursor);
91 vtkGetSmartPointerMacro(CustomCursor, vtkActor);
93
94protected:
97
98private:
100 void operator=(const vtk3DCursorRepresentation&) = delete;
101
102 struct vtkInternals;
103 std::unique_ptr<vtkInternals> Internals;
104
105 vtkSmartPointer<vtkActor> CustomCursor;
106 int Shape = CROSS_SHAPE;
107};
108
109VTK_ABI_NAMESPACE_END
110#endif
Representation of the vtk3DCursorWidget.
void BuildRepresentation() override
Update the cursor size (in world coordinates) to always keep the same size in display coordinates.
~vtk3DCursorRepresentation() override
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_MARSHALAUTO