FreeMat: vtkCellLocator

FreeMat

- Main Page
- Related Pages

vtkCellLocator

Section: Visualization Toolkit Filtering Classes

# Usage

vtkCellLocator is a spatial search object to quickly locate cells in 3D. vtkCellLocator uses a uniform-level octree subdivision, where each octant (an octant is also referred to as a bucket) carries an indication of whether it is empty or not, and each leaf octant carries a list of the cells inside of it. (An octant is not empty if it has one or more cells inside of it.) Typical operations are intersection with a line to return candidate cells, or intersection with another vtkCellLocator to return candidate cells.

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

      obj = vtkCellLocator

# Methods

The class vtkCellLocator 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 vtkCellLocator class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkCellLocator = obj.NewInstance ()`
- `vtkCellLocator = obj.SafeDownCast (vtkObject o)`
- `obj.SetNumberOfCellsPerBucket (int N)` - Specify the average number of cells in each octant.
- `int = obj.GetNumberOfCellsPerBucket ()` - reimplemented from vtkAbstractCellLocator to support bad compilers
- `int = obj.IntersectWithLine (double a0[3], double a1[3], vtkPoints points, vtkIdList cellIds)` - Return intersection point (if any) AND the cell which was intersected by the finite line. The cell is returned as a cell id and as a generic cell. For other IntersectWithLine signatures, see vtkAbstractCellLocator
- `vtkIdList = obj.GetCells (int bucket)` - Get the cells in a particular bucket.
- `int = obj.GetNumberOfBuckets (void )` - Return number of buckets available. Insure that the locator has been built before attempting to access buckets (octants).
- `vtkIdType = obj.FindCell (double x[3])` - Find the cell containing a given point. returns -1 if no cell found the cell parameters are copied into the supplied variables, a cell must be provided to store the information.
- `vtkIdType = obj.FindCell (double x[3], double tol2, vtkGenericCell GenCell, double pcoords[3], double weights)` - Find the cell containing a given point. returns -1 if no cell found the cell parameters are copied into the supplied variables, a cell must be provided to store the information.
- `obj.FindCellsWithinBounds (double bbox, vtkIdList cells)` - Return a list of unique cell ids inside of a given bounding box. The user must provide the vtkIdList to populate. This method returns data only after the locator has been built.
- `obj.FindCellsAlongLine (double p1[3], double p2[3], double tolerance, vtkIdList cells)` - Given a finite line defined by the two points (p1,p2), return the list of unique cell ids in the buckets containing the line. It is possible that an empty cell list is returned. The user must provide the vtkIdList to populate. This method returns data only after the locator has been built.
- `obj.FreeSearchStructure ()` - Satisfy vtkLocator abstract interface.
- `obj.BuildLocator ()` - Satisfy vtkLocator abstract interface.
- `obj.BuildLocatorIfNeeded ()` - Satisfy vtkLocator abstract interface.
- `obj.ForceBuildLocator ()` - Satisfy vtkLocator abstract interface.
- `obj.BuildLocatorInternal ()` - Satisfy vtkLocator abstract interface.
- `obj.GenerateRepresentation (int level, vtkPolyData pd)` - Satisfy vtkLocator abstract interface.