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
52class vtkRenderer;
53class vtkProp;
56class vtkScenePickerSelectionRenderCommand;
57
58class VTKRENDERINGCORE_EXPORT vtkScenePicker : public vtkObject
59{
60
61 friend class vtkRenderer;
62 friend class vtkScenePickerSelectionRenderCommand;
63
64public:
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
109protected:
112
113 // Pick render entire viewport
114 // Automatically invoked from vtkRenderer at the end of a still render.
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.
127
136 int LastQueriedDisplayPos[2];
137 vtkScenePickerSelectionRenderCommand* SelectionRenderCommand;
138
140private:
141 vtkScenePicker(const vtkScenePicker&) VTK_DELETE_FUNCTION;
142 void operator=(const vtkScenePicker&) VTK_DELETE_FUNCTION;
143};
144
145#endif
manager for OpenGL-based selection.
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
Definition: vtkRenderer.h:64
Picks an entire viewport at one shot.
virtual void SetRenderer(vtkRenderer *)
Set the renderer.
vtkRenderWindowInteractor * Interactor
void PickRender(int x0, int y0, int x1, int y1)
vtkRenderer * Renderer
void SetInteractor(vtkRenderWindowInteractor *)
vtkIdType GetCellId(int displayPos[2])
Get cell id at the pick position.
void Update(int displayPos[2])
vtkIdType VertId
vtkHardwareSelector * Selector
vtkScenePickerSelectionRenderCommand * SelectionRenderCommand
static vtkScenePicker * New()
vtkTimeStamp PickRenderTime
vtkIdType CellId
vtkProp * GetViewProp(int displayPos[2])
Get actor at the pick position.
vtkIdType GetVertexId(int displayPos[2])
Get cell id at the pick position.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287