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 is put into a SelectMode, it temporarily swaps in a new vtkIdentColoredPainter to do the color index rendering of each cell in each vtkProp that it renders. Until alternatives to vtkIdentColoredPainter 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 vtkVisibleCellSelector, simply invoke its constructor as follows
obj = vtkVisibleCellSelector
obj
is an instance of the vtkVisibleCellSelector class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkVisibleCellSelector = obj.NewInstance ()
vtkVisibleCellSelector = obj.SafeDownCast (vtkObject o)
obj.SetRenderer (vtkRenderer )
- Call to let this know where to select within.
obj.SetArea (int x0, int y0, int x1, int y1)
- Call to set the selection area region.
This crops the selected area to the renderers pixel limits.
obj.SetProcessorId (int pid)
- Call to let this know what processor number to render as in the processor
select pass. Internally this adds 1 to pid because 0 is reserved for miss.
int = obj.GetProcessorId ()
- Call to let this know what processor number to render as in the processor
select pass. Internally this adds 1 to pid because 0 is reserved for miss.
obj.SetRenderPasses (int DoProcessor, int DoActor, int DoCellIdHi, int DoCellIdMid, int DoCellIdLo, int DoVertexId)
- Call to let this know what selection render passes to do.
If you have only one processor or one actor, you can leave DoProcessor
and DoActor as false (the default). If you have less than 2^48 cells in
any actor, you do not need the CellIdHi pass, or similarly if you have
less than 2^24 cells, you do not need DoCellIdMid.
The DoPointId will enable another render pass for determining visible
vertices.
obj.Select ()
- Execute the selection algorithm.
obj.GetSelectedIds (vtkIdTypeArray ToCopyInto)
- After Select(), this will return the list of selected Ids.
The ProcessorId and Actor Id are returned in the first two components.
The CellId is returned in the last two components (only 64 bits total).
obj.GetSelectedIds (vtkSelection ToCopyInto)
- After Select(), this will return the list of selected Ids.
obj.GetSelectedVertices (vtkIdTypeArray VertexPointers, vtkIdTypeArray VertexIds)
- After Select(), (assuming DoVertexId is on), the will return arrays that
describe which cell vertices are visible.
The VertexPointers array contains one index into the VertexIds array for
every visible cell. Any index may be -1 in which case no vertices were
visible for that cell. The VertexIds array contains a set of integers for
each cell that has visible vertices. The first entry in the set is
the number of visible vertices. The rest are visible vertex ranks.
A set such at 2,0,4, means that a particular polygon's first and fifth
vertices were visible.
vtkProp = obj.GetActorFromId (vtkIdType id)
- After a select, this will return a pointer to the actor corresponding to
a particular id. This will return NULL if id is out of range.
obj.PrintSelectedIds (vtkIdTypeArray IdsToPrint)
- For debugging - prints out the list of selected ids.