Documentation for vtkPicker

vtkPicker - select an actor by shooting a ray into a graphics window

Super Class: vtkObject

Description:

vtkPicker is used to select actors by shooting a ray into a graphics window and intersecting with the actor's bounding box. The ray is defined from a point defined in window (or pixel) coordinates, and a point located from the camera's position. vtkPicker may return more than one actor, since more than one bounding box may be intersected. vtkPicker returns the list of actors that were hit, the pick coordinates in world and untransformed mapper space, and the actor and mapper that are "closest" to the camera. The closest actor is the one whose center point (i.e., center of bounding box) projected on the ray is closest to the camera. vtkPicker has hooks for methods to call during the picking process. These methods are StartPickMethod(), PickMethod(), and EndPickMethod() which are invoked prior to picking, when something is picked, and after all picking candidates have been tested. Note that during the pick process the PickAction of vtkProp (and its subclasses such as vtkActor) is called prior to the pick action of vtkPicker.

 

Caveats:

vtkPicker and its subclasses will not pick actors that are "unpickable" (see vtkActor) or are fully transparent.

 

See Also:

vtkPicker is used for quick picking. If you desire to pick points or cells, use the subclass vtkPointPicker or vtkCellPicker, respectively.

 

Methods:

void vtkPicker ()
void vtkPicker ()
static vtkPicker *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
vtkRenderer *GetRenderer ()
float *GetSelectionPoint ()
void SetTolerance (float )
float GetTolerance ()
float *GetPickPosition ()
float *GetMapperPosition ()
vtkActor *GetAssembly ()
vtkActor *GetActor ()
vtkMapper *GetMapper ()
vtkDataSet *GetDataSet ()
vtkActorCollection *GetActors ()
vtkPoints *GetPickedPositions ()
int Pick (float ,float ,float ,vtkRenderer *)
int Pick (float ,vtkRenderer *)
void SetStartPickMethod (const )
void SetPickMethod (const )
void SetEndPickMethod (const )
void SetStartPickMethodArgDelete (const )
void SetPickMethodArgDelete (const )
void SetEndPickMethodArgDelete (const )
void SetPickFromList (int )
int GetPickFromList ()
void PickFromListOn ()
void PickFromListOff ()
void InitializePickList ()
void AddPickList (vtkActor *)
void DeletePickList (vtkActor *)
vtkActorCollection *GetPickList ()
void MarkPicked (vtkActor * ,vtkActor * ,vtkMapper * ,float ,float )
float IntersectWithLine (float ,float ,float ,vtkActor * ,vtkActor * ,vtkMapper *)
void Initialize ()

 

Detailed Method Descriptions:

Get the renderer in which pick event occurred.

vtkRenderer *GetRenderer ()

Get the selection point in screen (pixel) coordinates. The third value is related to z-buffer depth. (Normally should be =0.)

float *GetSelectionPoint ()

Specify tolerance for performing pick operation. Tolerance is specified as fraction of rendering window size. (Rendering window size is measured across diagonal.)

void SetTolerance (float )
float GetTolerance ()

Return position in global coordinates of pick point.

float *GetPickPosition ()

Return position in mapper (i.e., non-transformed) coordinates of pick point.

float *GetMapperPosition ()

Return assembly that was picked. The assembly may be the same as the actor.

vtkActor *GetAssembly ()

Return actor that was picked.

vtkActor *GetActor ()

Return mapper that was picked.

vtkMapper *GetMapper ()

Get a pointer to the dataset that was picked. If nothing was picked then NULL is returned.

vtkDataSet *GetDataSet ()

Return a collection of all the actors that were intersected. This collection is not sorted.

vtkActorCollection *GetActors ()

Return a list of the points the the actors returned by GetActors were intersected at. The order of this list will match the order of GetActors.

vtkPoints *GetPickedPositions ()

Perform pick operation with selection point provided. Normally the first two values for the selection point are x-y pixel coordinate, and the third value is =0. Return non-zero if something was successfully picked.

int Pick (float ,float ,float ,vtkRenderer *)

provided. Normally the first two values for the selection point are x-y pixel coordinate, and the third value is =0. Return non-zero if something was successfully picked.

int Pick (float ,vtkRenderer *)

begins.

void SetStartPickMethod (const )

Specify function to be called when something is picked.

void SetPickMethod (const )

Specify function to be called after all picking operations have been performed.

void SetEndPickMethod (const )

Set a method to delete user arguments for StartPickMethod.

void SetStartPickMethodArgDelete (const )

Set a method to delete user arguments for PickMethod.

void SetPickMethodArgDelete (const )

Set a method to delete user arguments for EndPickMethod.

void SetEndPickMethodArgDelete (const )

Use these methods to control whether to limit the picking to this list (rather than renderer's actors). Make sure that the pick list contains actors that refered to by the picker's renderer.

void SetPickFromList (int )
int GetPickFromList ()
void PickFromListOn ()
void PickFromListOff ()

Initialize list of actors in pick list.

void InitializePickList ()

Add an actor to the pick list.

void AddPickList (vtkActor *)

Delete an actor from the pick list.

void DeletePickList (vtkActor *)