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 =========================================================================*/
45 #ifndef __vtkScenePicker_h
46 #define __vtkScenePicker_h
47 
48 #include "vtkRenderingCoreModule.h" // For export macro
49 #include "vtkObject.h"
50 
51 class vtkRenderer;
52 class vtkProp;
55 class vtkScenePickerSelectionRenderCommand;
56 
57 class VTKRENDERINGCORE_EXPORT vtkScenePicker : public vtkObject
58 {
59  //BTX
60  friend class vtkRenderer;
61  friend class vtkScenePickerSelectionRenderCommand;
62  //ETX
63 public:
64  static vtkScenePicker * New();
65  vtkTypeMacro(vtkScenePicker,vtkObject);
66  void PrintSelf(ostream& os, vtkIndent indent);
67 
69 
70  virtual void SetRenderer( vtkRenderer* );
71  vtkGetObjectMacro(Renderer,vtkRenderer);
73 
76  vtkIdType GetCellId( int displayPos[2] );
77 
80  vtkIdType GetVertexId( int displayPos[2] );
81 
84  vtkProp * GetViewProp( int displayPos[2] );
85 
87 
90  vtkSetMacro( EnableVertexPicking, int );
91  vtkGetMacro( EnableVertexPicking, int );
92  vtkBooleanMacro( EnableVertexPicking, int );
94 
95 protected:
97  ~vtkScenePicker();
98 
99  // Pick render entire viewport
100  // Automatically invoked from vtkRenderer at the end of a still render.
101  void PickRender();
102 
103  // Pick render a region of the renderwindow
104  void PickRender( int x0, int y0, int x1, int y1 );
105 
106  // Internal update method retrieves info from the Selector
107  void Update( int displayPos[2] );
108 
109  // The RenderWindowInteractor must be set, so that avoid scene picks (which
110  // involve extra renders) during interaction. This is done by observing the
111  // RenderWindowInteractor for start and end interaction events.
112  void SetInteractor( vtkRenderWindowInteractor * );
113 
122  int LastQueriedDisplayPos[2];
123  vtkScenePickerSelectionRenderCommand * SelectionRenderCommand;
124 
126 private:
128  const vtkScenePicker&); // Not implemented.
129  void operator=(const vtkScenePicker&); // Not implemented.
130 };
131 
132 #endif
133