FreeMat

- Main Page
- Related Pages

vtkOctreePointLocator

Section: Visualization Toolkit Filtering Classes

# Usage

Given a vtkDataSetxs, create an octree that is locally refined such that all leaf octants contain less than a certain amount of points. Note that there is no size constraint that a leaf octant in relation to any of its neighbors.

This class can also generate a PolyData representation of the boundaries of the spatial regions in the decomposition.

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

      obj = vtkOctreePointLocator

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkOctreePointLocator = obj.NewInstance ()`
- `vtkOctreePointLocator = obj.SafeDownCast (vtkObject o)`
- `obj.SetMaximumPointsPerRegion (int )` - Maximum number of points per spatial region. Default is 100.
- `int = obj.GetMaximumPointsPerRegion ()` - Maximum number of points per spatial region. Default is 100.
- `obj.SetCreateCubicOctants (int )` - Get/Set macro for CreateCubicOctants.
- `int = obj.GetCreateCubicOctants ()` - Get/Set macro for CreateCubicOctants.
- `double = obj.GetFudgeFactor ()` - Some algorithms on octrees require a value that is a very small distance relative to the diameter of the entire space divided by the octree. This factor is the maximum axis-aligned width of the space multipled by 10e-6.
- `obj.SetFudgeFactor (double )` - Some algorithms on octrees require a value that is a very small distance relative to the diameter of the entire space divided by the octree. This factor is the maximum axis-aligned width of the space multipled by 10e-6.
- `obj.GetBounds (double bounds)` - Get the spatial bounds of the entire octree space. Sets bounds array to xmin, xmax, ymin, ymax, zmin, zmax.
- `int = obj.GetNumberOfLeafNodes ()` - The number of leaf nodes of the tree, the spatial regions
- `obj.GetRegionBounds (int regionID, double bounds[6])` - Get the spatial bounds of octree region
- `obj.GetRegionDataBounds (int leafNodeID, double bounds[6])` - Get the bounds of the data within the leaf node
- `int = obj.GetRegionContainingPoint (double x, double y, double z)` - Get the id of the leaf region containing the specified location.
- `obj.BuildLocator ()` - Create the octree decomposition of the cells of the data set or data sets. Cells are assigned to octree spatial regions based on the location of their centroids.
- `vtkIdType = obj.FindClosestPoint (double x[3])` - Return the Id of the point that is closest to the given point. Set the square of the distance between the two points.
- `obj.FindPointsWithinRadius (double radius, double x[3], vtkIdList result)` - Find all points within a specified radius of position x. The result is not sorted in any specific manner.
- `obj.FindClosestNPoints (int N, double x[3], vtkIdList result)` - Find the closest N points to a position. This returns the closest N points to a position. A faster method could be created that returned N close points to a position, but not necessarily the exact N closest. The returned points are sorted from closest to farthest. These methods are thread safe if BuildLocator() is directly or indirectly called from a single thread first.
- `vtkIdTypeArray = obj.GetPointsInRegion (int leafNodeId)` - Get a list of the original IDs of all points in a leaf node.
- `obj.FreeSearchStructure ()` - Delete the octree data structure.
- `obj.GenerateRepresentation (int level, vtkPolyData pd)` - Create a polydata representation of the boundaries of the octree regions.
- `obj.FindPointsInArea (double area, vtkIdTypeArray ids, bool clearArraytrue)` - Fill ids with points found in area. The area is a 6-tuple containing (xmin, xmax, ymin, ymax, zmin, zmax). This method will clear the array by default. To append ids to an array, set clearArray to false.