NAME
vtkPicker - select an actor by shooting a ray into a graphics window
SYNOPSIS
#include "/opt/vtk-c++/graphics/vtkPicker.h"
class VTK_EXPORT vtkPicker : public vtkObject
vtkPicker();
static vtkPicker *New() {return new vtkPicker;};
const char *GetClassName() {return "vtkPicker";};
void PrintSelf(ostream& os, vtkIndent indent);
vtkRenderer *GetRenderer();
float *GetSelectionPoint();
void GetSelectionPoint(float data[3]);
void SetTolerance(float);
float GetTolerance();
float *GetPickPosition();
void GetPickPosition(float data[3]);
float *GetMapperPosition();
void GetMapperPosition(float data[3]);
vtkActor *GetAssembly();
vtkActor *GetActor();
vtkMapper *GetMapper();
vtkDataSet *GetDataSet();
vtkActorCollection *GetActors();
virtual int Pick(float selectionX, float selectionY, float selectionZ,
vtkRenderer *renderer);
int Pick(float selectionPt[3], vtkRenderer *renderer);
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.
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.
SUMMARY
vtkRenderer *GetRenderer()
Get the renderer in which pick event occurred.
float *GetSelectionPoint()
void GetSelectionPoint(float data[3])
Get the selection point in screen (pixel) coordinates. The third value is related to z-buffer depth. (Normally should be =0.)
void SetTolerance(float)
Specify tolerance for performing pick operation. Tolerance is specified as fraction of rendering window size. (Rendering window size is measured across diagonal.)
float *GetPickPosition()
void GetPickPosition(float data[3])
Return position in global coordinates of pick point.
float *GetMapperPosition()
void GetMapperPosition(float data[3])
Return position in mapper (i.e., non-transformed) coordinates of pick point.
vtkActor *GetAssembly()
Return assembly that was picked. The assembly may be the same as the actor.
vtkActor *GetActor()
Return actor that was picked.
vtkMapper *GetMapper()
Return mapper that was picked.
vtkDataSet *GetDataSet()
Get a pointer to the dataset that was picked. If nothing was picked then NULL is returned.
vtkPicker()
Construct object with initial tolerance of 1/40th of window.
int Pick(float selectionX, float selectionY, float selectionZ, vtkRenderer *renderer)
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.