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