Section: Visualization Toolkit Rendering Classes
Limitations: Antialiasing will break this class. If your graphics card settings force their use this class will return invalid results.
Currently only cells from PolyDataMappers can be selected from. When vtkRenderer::Selector is non-null vtkPainterPolyDataMapper uses the vtkHardwareSelectionPolyDataPainter which make appropriate calls to BeginRenderProp(), EndRenderProp(), RenderAttributeId() to render colors correctly. Until alternatives to vtkHardwareSelectionPolyDataPainter exist that can do a similar coloration of other vtkDataSet types, only polygonal data can be selected. If you need to select other data types, consider using vtkDataSetMapper and turning on it's PassThroughCellIds feature, or using vtkFrustumExtractor.
Only Opaque geometry in Actors is selected from. Assemblies and LODMappers are not currently supported.
During selection, visible datasets that can not be selected from are temporarily hidden so as not to produce invalid indices from their colors.
To create an instance of class vtkHardwareSelector, simply invoke its constructor as follows
obj = vtkHardwareSelector
obj
is an instance of the vtkHardwareSelector class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkHardwareSelector = obj.NewInstance ()
vtkHardwareSelector = obj.SafeDownCast (vtkObject o)
obj.SetRenderer (vtkRenderer )
- Get/Set the renderer to perform the selection on.
vtkRenderer = obj.GetRenderer ()
- Get/Set the renderer to perform the selection on.
obj.SetArea (int , int , int , int )
- Get/Set the area to select as (xmin, ymin, xmax, ymax).
obj.SetArea (int a[4])
- Get/Set the area to select as (xmin, ymin, xmax, ymax).
int = obj. GetArea ()
- Get/Set the area to select as (xmin, ymin, xmax, ymax).
obj.SetFieldAssociation (int )
- Set the field type to select. Valid values are
\li vtkDataObject::FIELD_ASSOCIATION_POINTS
\li vtkDataObject::FIELD_ASSOCIATION_CELLS
\li vtkDataObject::FIELD_ASSOCIATION_VERTICES
\li vtkDataObject::FIELD_ASSOCIATION_EDGES
\li vtkDataObject::FIELD_ASSOCIATION_ROWS
Currently only FIELD_ASSOCIATION_POINTS and FIELD_ASSOCIATION_CELLS are
supported.
int = obj.GetFieldAssociation ()
- Set the field type to select. Valid values are
\li vtkDataObject::FIELD_ASSOCIATION_POINTS
\li vtkDataObject::FIELD_ASSOCIATION_CELLS
\li vtkDataObject::FIELD_ASSOCIATION_VERTICES
\li vtkDataObject::FIELD_ASSOCIATION_EDGES
\li vtkDataObject::FIELD_ASSOCIATION_ROWS
Currently only FIELD_ASSOCIATION_POINTS and FIELD_ASSOCIATION_CELLS are
supported.
vtkSelection = obj.Select ()
- Perform the selection. Returns a new instance of vtkSelection containing
the selection on success.
bool = obj.CaptureBuffers ()
- It is possible to use the vtkHardwareSelector for a custom picking. (Look
at vtkScenePicker). In that case instead of Select() on can use
CaptureBuffers() to render the selection buffers and then get information
about pixel locations suing GetPixelInformation(). Use ClearBuffers() to
clear buffers after one's done with the scene.
The optional final parameter maxDist will look for a cell within the specified
number of pixels from display_position.
obj.ClearBuffers ()
- Called by any vtkMapper or vtkProp subclass to render an attribute's id.
obj.RenderAttributeId (vtkIdType attribid)
- Called by any vtkMapper or vtkProp subclass to render an attribute's id.
obj.BeginRenderProp ()
- Called by the mapper (vtkHardwareSelectionPolyDataPainter) before and after
rendering each prop.
obj.EndRenderProp ()
- Called by the mapper (vtkHardwareSelectionPolyDataPainter) before and after
rendering each prop.
obj.SetProcessID (int )
- Get/Set the process id. If process id < 0 (default -1), then the
PROCESS_PASS is not rendered.
int = obj.GetProcessID ()
- Get/Set the process id. If process id < 0 (default -1), then the
PROCESS_PASS is not rendered.
int = obj.GetCurrentPass ()
- Get the current pass number.
vtkSelection = obj.GenerateSelection ()
- Generates the vtkSelection from pixel buffers.
Requires that CaptureBuffers() has already been called.
Optionally you may pass a screen region (xmin, ymin, xmax, ymax)
to generate a selection from. The region must be a subregion
of the region specified by SetArea(), otherwise it will be
clipped to that region.
vtkSelection = obj.GenerateSelection (int r[4])
- Generates the vtkSelection from pixel buffers.
Requires that CaptureBuffers() has already been called.
Optionally you may pass a screen region (xmin, ymin, xmax, ymax)
to generate a selection from. The region must be a subregion
of the region specified by SetArea(), otherwise it will be
clipped to that region.
vtkSelection = obj.GenerateSelection (int x1, int y1, int x2, int y2)
- Generates the vtkSelection from pixel buffers.
Requires that CaptureBuffers() has already been called.
Optionally you may pass a screen region (xmin, ymin, xmax, ymax)
to generate a selection from. The region must be a subregion
of the region specified by SetArea(), otherwise it will be
clipped to that region.