VTK
vtkScenePicker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScenePicker.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 =========================================================================*/
46 #ifndef vtkScenePicker_h
47 #define vtkScenePicker_h
48 
49 #include "vtkRenderingCoreModule.h" // For export macro
50 #include "vtkObject.h"
51 
52 class vtkRenderer;
53 class vtkProp;
56 class vtkScenePickerSelectionRenderCommand;
57 
58 class VTKRENDERINGCORE_EXPORT vtkScenePicker : public vtkObject
59 {
60 
61  friend class vtkRenderer;
62  friend class vtkScenePickerSelectionRenderCommand;
63 
64 public:
65  static vtkScenePicker* New();
66  vtkTypeMacro(vtkScenePicker, vtkObject);
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
73  virtual void SetRenderer(vtkRenderer*);
74  vtkGetObjectMacro(Renderer, vtkRenderer);
76 
82  vtkIdType GetCellId(int displayPos[2]);
83 
89  vtkIdType GetVertexId(int displayPos[2]);
90 
96  vtkProp* GetViewProp(int displayPos[2]);
97 
99 
104  vtkSetMacro(EnableVertexPicking, int);
105  vtkGetMacro(EnableVertexPicking, int);
106  vtkBooleanMacro(EnableVertexPicking, int);
108 
109 protected:
110  vtkScenePicker();
111  ~vtkScenePicker();
112 
113  // Pick render entire viewport
114  // Automatically invoked from vtkRenderer at the end of a still render.
115  void PickRender();
116 
117  // Pick render a region of the renderwindow
118  void PickRender(int x0, int y0, int x1, int y1);
119 
120  // Internal update method retrieves info from the Selector
121  void Update(int displayPos[2]);
122 
123  // The RenderWindowInteractor must be set, so that avoid scene picks (which
124  // involve extra renders) during interaction. This is done by observing the
125  // RenderWindowInteractor for start and end interaction events.
126  void SetInteractor(vtkRenderWindowInteractor *);
127 
136  int LastQueriedDisplayPos[2];
137  vtkScenePickerSelectionRenderCommand* SelectionRenderCommand;
138 
140 private:
141  vtkScenePicker(const vtkScenePicker&) VTK_DELETE_FUNCTION;
142  void operator=(const vtkScenePicker&) VTK_DELETE_FUNCTION;
143 };
144 
145 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkIdType CellId
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderer * Renderer
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkTimeStamp PickRenderTime
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkIdType VertId
virtual void Update()
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
vtkRenderWindowInteractor * Interactor
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkHardwareSelector * Selector
manager for OpenGL-based selection.
Picks an entire viewport at one shot.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkScenePickerSelectionRenderCommand * SelectionRenderCommand