VTK  9.4.20250201
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
41#ifndef vtkPickingManager_h
42#define vtkPickingManager_h
43
44#include "vtkObject.h"
45#include "vtkRenderingCoreModule.h" // For export macro
46
47VTK_ABI_NAMESPACE_BEGIN
50class vtkAssemblyPath;
51class vtkRenderer;
53
54class VTKRENDERINGCORE_EXPORT vtkPickingManager : public vtkObject
55{
56public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
62
67 vtkBooleanMacro(Enabled, bool);
68 vtkSetMacro(Enabled, bool);
69 vtkGetMacro(Enabled, bool);
71
73
82 void SetOptimizeOnInteractorEvents(bool optimize);
83 vtkGetMacro(OptimizeOnInteractorEvents, bool);
85
87
91 vtkGetMacro(Interactor, vtkRenderWindowInteractor*);
93
101 void AddPicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
102
107 void RemovePicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
108
114 void RemoveObject(vtkObject* object);
115
122 bool Pick(vtkAbstractPicker* picker, vtkObject* object);
123
129 bool Pick(vtkObject* object);
130
136 bool Pick(vtkAbstractPicker* picker);
137
145 vtkAssemblyPath* GetAssemblyPath(double X, double Y, double Z, vtkAbstractPropPicker* picker,
146 vtkRenderer* renderer, vtkObject* obj);
147
154
160
161protected:
164
165 // Used to associate the manager with the interactor
169
170private:
171 vtkPickingManager(const vtkPickingManager&) = delete;
172 void operator=(const vtkPickingManager&) = delete;
173
174 class vtkInternal;
175 vtkInternal* Internal;
176};
177
178VTK_ABI_NAMESPACE_END
179#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
abstract base class for most VTK objects
Definition vtkObject.h:162
Class defines API to manage the picking process.
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