VTK  9.7.20260918
vtkPickingManager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
3// SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0
40
41#ifndef vtkPickingManager_h
42#define vtkPickingManager_h
43
44#include "vtkObject.h"
45#include "vtkRenderingCoreModule.h" // For export macro
46#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
47
48VTK_ABI_NAMESPACE_BEGIN
51class vtkAssemblyPath;
52class vtkRenderer;
54
55class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkPickingManager : public vtkObject
56{
57public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
63
68 vtkBooleanMacro(Enabled, bool);
69 vtkSetMacro(Enabled, bool);
70 vtkGetMacro(Enabled, bool);
72
74
83 void SetOptimizeOnInteractorEvents(bool optimize);
84 vtkGetMacro(OptimizeOnInteractorEvents, bool);
86
88
94
102 void AddPicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
103
108 void RemovePicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
109
115 void RemoveObject(vtkObject* object);
116
123 bool Pick(vtkAbstractPicker* picker, vtkObject* object);
124
130 bool Pick(vtkObject* object);
131
137 bool Pick(vtkAbstractPicker* picker);
138
146 vtkAssemblyPath* GetAssemblyPath(double X, double Y, double Z, vtkAbstractPropPicker* picker,
147 vtkRenderer* renderer, vtkObject* obj);
148
155
161
162protected:
165
166 // Used to associate the manager with the interactor
170
171private:
172 vtkPickingManager(const vtkPickingManager&) = delete;
173 void operator=(const vtkPickingManager&) = delete;
174
175 class vtkInternal;
176 vtkInternal* Internal;
177};
178
179VTK_ABI_NAMESPACE_END
180#endif
define API for picking subclasses
abstract API for pickers that can pick an instance of vtkProp
a list of nodes that form an assembly path
a simple class to control print indentation
Definition vtkIndent.h:108
vtkRenderWindowInteractor * Interactor
bool Pick(vtkAbstractPicker *picker)
Run the picking selection process and return if picker is the one selected.
void AddPicker(vtkAbstractPicker *picker, vtkObject *object=nullptr)
Register a picker into the picking manager.
void RemoveObject(vtkObject *object)
Remove all occurrence of the object from the registered list.
bool Pick(vtkAbstractPicker *picker, vtkObject *object)
Run the picking selection process and return true if the object is associated with the given picker i...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RemovePicker(vtkAbstractPicker *picker, vtkObject *object=nullptr)
Unregister the picker from the picking manager.
bool Pick(vtkObject *object)
Run the picking selection process and return true if the object is associated with the best picker.
int GetNumberOfObjectsLinked(vtkAbstractPicker *picker)
Return the number of objects linked with a given picker.
void SetInteractor(vtkRenderWindowInteractor *iren)
Set the window interactor associated with the manager.
static vtkPickingManager * New()
~vtkPickingManager() override
int GetNumberOfPickers()
Return the number of pickers registered.
vtkAssemblyPath * GetAssemblyPath(double X, double Y, double Z, vtkAbstractPropPicker *picker, vtkRenderer *renderer, vtkObject *obj)
If the picking manager is enabled, it runs the picking selection process and return the assembly path...
void SetOptimizeOnInteractorEvents(bool optimize)
Enable/Disable optimization depending on the renderWindowInteractor events.
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
#define VTK_MARSHALAUTO