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 
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:
127  vtkScenePicker(const vtkScenePicker&); // Not implemented.
128  void operator=(const vtkScenePicker&); // Not implemented.
129 };
130 
131 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkIdType CellId
vtkRenderer * Renderer
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkTimeStamp PickRenderTime
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkIdType VertId
virtual void Update()
int vtkIdType
Definition: vtkType.h:275
vtkRenderWindowInteractor * Interactor
platform-independent render window interaction including picking and frame rate control.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkHardwareSelector * Selector
#define VTKRENDERINGCORE_EXPORT
manager for OpenGL-based selection.
Picks an entire viewport at one shot.
static vtkObject * New()
vtkScenePickerSelectionRenderCommand * SelectionRenderCommand