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 
72 #ifndef vtkPickingManager_h
73 #define vtkPickingManager_h
74 
75 #include "vtkObject.h"
76 #include "vtkRenderingCoreModule.h" // For export macro
77 
78 class vtkAbstractPicker;
80 class vtkAssemblyPath;
81 class vtkRenderer;
83 
85 {
86 public:
87  static vtkPickingManager *New();
89  void PrintSelf(ostream& os, vtkIndent indent);
90 
92 
95  vtkBooleanMacro(Enabled, bool);
96  vtkSetMacro(Enabled, bool);
97  vtkGetMacro(Enabled, bool);
99 
101 
108  void SetOptimizeOnInteractorEvents(bool optimize);
109  vtkGetMacro(OptimizeOnInteractorEvents, bool);
111 
113 
114  void SetInteractor(vtkRenderWindowInteractor* iren);
115  vtkGetMacro(Interactor, vtkRenderWindowInteractor*);
117 
123  void AddPicker(vtkAbstractPicker* picker, vtkObject* object = 0);
124 
127  void RemovePicker(vtkAbstractPicker* picker, vtkObject* object = 0);
128 
132  void RemoveObject(vtkObject* object);
133 
138  bool Pick(vtkAbstractPicker* picker, vtkObject* object);
139 
142  bool Pick(vtkObject* object);
143 
146  bool Pick(vtkAbstractPicker* picker);
147 
149 
154  vtkAssemblyPath* GetAssemblyPath(double X, double Y, double Z,
155  vtkAbstractPropPicker* picker,
156  vtkRenderer* renderer,
157  vtkObject* obj);
159 
162  int GetNumberOfPickers();
163 
166  int GetNumberOfObjectsLinked(vtkAbstractPicker* picker);
167 
168 protected:
171 
172  // Used to associate the manager with the interactor
174  bool Enabled;
176 
177 private:
178  vtkPickingManager(const vtkPickingManager&); // Not implemented.
179  void operator=(const vtkPickingManager&); // Not implemented.
180 
181  class vtkInternal;
182  vtkInternal* Internal;
183 };
184 
185 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
abstract specification for renderers
Definition: vtkRenderer.h:63
platform-independent render window interaction including picking and frame rate control.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a list of nodes that form an assembly path
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkRenderWindowInteractor * Interactor
abstract API for pickers that can pick an instance of vtkProp
#define VTKRENDERINGCORE_EXPORT
define API for picking subclasses
static vtkObject * New()