FreeMat

- Main Page
- Related Pages

vtkScenePicker

Section: Visualization Toolkit Rendering Classes

# Usage

The Scene picker, unline conventional pickers picks an entire viewport at one shot and caches the result, which can be retrieved later. The utility of the class arises during Actor Selection. Let's say you have a couple of polygonal objects in your scene and you wish to have a status bar that indicates the object your mouse is over. Picking repeatedly every time your mouse moves would be very slow. The scene picker automatically picks your viewport every time the camera is changed and caches the information. Additionally, it observes the vtkRenderWindowInteractor to avoid picking during interaction, so that you still maintain your interactivity. In effect, the picker does an additional pick-render of your scene every time you stop interacting with your scene. As an example, see Rendering/TestScenePicker.

To create an instance of class vtkScenePicker, simply invoke its constructor as follows

      obj = vtkScenePicker

# Methods

The class vtkScenePicker has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkScenePicker class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkScenePicker = obj.NewInstance ()`
- `vtkScenePicker = obj.SafeDownCast (vtkObject o)`
- `obj.SetRenderer (vtkRenderer )` - Set the renderer. Scene picks are restricted to the viewport.
- `vtkRenderer = obj.GetRenderer ()` - Set the renderer. Scene picks are restricted to the viewport.
- `vtkIdType = obj.GetCellId (int displayPos[2])` - Get cell id at the pick position. Returns -1 if no cell was picked. Makes sense only after Pick has been called.
- `vtkIdType = obj.GetVertexId (int displayPos[2])` - Get cell id at the pick position. Returns -1 if no cell was picked. Makes sense only after Pick has been called.
- `vtkProp = obj.GetViewProp (int displayPos[2])` - Get actor at the pick position. Returns NULL if none. Makes sense only after Pick has been called.
- `obj.SetEnableVertexPicking (int )` - Vertex picking (using the method GetVertexId()), required additional resources and can slow down still render time by 5-10%. Enabled by default.
- `int = obj.GetEnableVertexPicking ()` - Vertex picking (using the method GetVertexId()), required additional resources and can slow down still render time by 5-10%. Enabled by default.
- `obj.EnableVertexPickingOn ()` - Vertex picking (using the method GetVertexId()), required additional resources and can slow down still render time by 5-10%. Enabled by default.
- `obj.EnableVertexPickingOff ()` - Vertex picking (using the method GetVertexId()), required additional resources and can slow down still render time by 5-10%. Enabled by default.