VTK  9.3.1
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 
36 VTK_ABI_NAMESPACE_BEGIN
37 
38 class vtkViewport;
39 
40 class VTKINTERACTIONWIDGETS_EXPORT vtk3DCursorRepresentation : public vtkWidgetRepresentation
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
51  void BuildRepresentation() override;
52 
56  void WidgetInteraction(double newEventPos[2]) override;
57 
59 
62  void ReleaseGraphicsResources(vtkWindow*) override;
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);
90  vtkGetSmartPointerMacro(CustomCursor, vtkActor);
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 
104 protected:
106  ~vtk3DCursorRepresentation() override;
107 
108 private:
109  vtk3DCursorRepresentation(const vtk3DCursorRepresentation&) = delete;
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 
119 VTK_ABI_NAMESPACE_END
120 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
abstract specification for Viewports
Definition: vtkViewport.h:44
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
#define VTK_DEPRECATED_IN_9_3_0(reason)
Representation of the vtk3DCursorWidget.
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...