VTK
vtkPickingManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPickingManager.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /*==============================================================================
17 
18  Library: MSVTK
19 
20  Copyright (c) Kitware Inc.
21 
22  Licensed under the Apache License, Version 2.0 (the "License");
23  you may not use this file except in compliance with the License.
24  You may obtain a copy of the License at
25 
26  http://www.apache.org/licenses/LICENSE-2.0.txt
27 
28  Unless required by applicable law or agreed to in writing, software
29  distributed under the License is distributed on an "AS IS" BASIS,
30  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  See the License for the specific language governing permissions and
32  limitations under the License.
33 
34 ==============================================================================*/
35 
70 #ifndef vtkPickingManager_h
71 #define vtkPickingManager_h
72 
73 #include "vtkObject.h"
74 #include "vtkRenderingCoreModule.h" // For export macro
75 
76 class vtkAbstractPicker;
78 class vtkAssemblyPath;
79 class vtkRenderer;
81 
82 class VTKRENDERINGCORE_EXPORT vtkPickingManager : public vtkObject
83 {
84 public:
85  static vtkPickingManager* New();
86  vtkTypeMacro(vtkPickingManager, vtkObject);
87  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
90 
95  vtkBooleanMacro(Enabled, bool);
96  vtkSetMacro(Enabled, bool);
97  vtkGetMacro(Enabled, bool);
99 
101 
110  void SetOptimizeOnInteractorEvents(bool optimize);
111  vtkGetMacro(OptimizeOnInteractorEvents, bool);
113 
115 
118  void SetInteractor(vtkRenderWindowInteractor* iren);
119  vtkGetMacro(Interactor, vtkRenderWindowInteractor*);
121 
129  void AddPicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
130 
135  void RemovePicker(vtkAbstractPicker* picker, vtkObject* object = nullptr);
136 
142  void RemoveObject(vtkObject* object);
143 
150  bool Pick(vtkAbstractPicker* picker, vtkObject* object);
151 
157  bool Pick(vtkObject* object);
158 
164  bool Pick(vtkAbstractPicker* picker);
165 
173  vtkAssemblyPath* GetAssemblyPath(double X, double Y, double Z, vtkAbstractPropPicker* picker,
174  vtkRenderer* renderer, vtkObject* obj);
175 
181  int GetNumberOfPickers();
182 
187  int GetNumberOfObjectsLinked(vtkAbstractPicker* picker);
188 
189 protected:
191  ~vtkPickingManager() override;
192 
193  // Used to associate the manager with the interactor
195  bool Enabled;
197 
198 private:
199  vtkPickingManager(const vtkPickingManager&) = delete;
200  void operator=(const vtkPickingManager&) = delete;
201 
202  class vtkInternal;
203  vtkInternal* Internal;
204 };
205 
206 #endif
vtkPickingManager::Enabled
bool Enabled
Definition: vtkPickingManager.h:195
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:68
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:41
vtkPickingManager::OptimizeOnInteractorEvents
bool OptimizeOnInteractorEvents
Definition: vtkPickingManager.h:196
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:72
vtkPickingManager::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkPickingManager.h:194
vtkAbstractPropPicker
abstract API for pickers that can pick an instance of vtkProp
Definition: vtkAbstractPropPicker.h:79
vtkObject.h
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:58
vtkPickingManager
Definition: vtkPickingManager.h:82