Documentation for vtkOBBTree

vtkOBBTree - generate oriented bounding box (OBB) tree

Super Class: vtkCellLocator

Description:

vtkOBBTree is an object to generate oriented bounding box (OBB) trees. An oriented bounding box is a bounding box that does not necessarily line up along coordinate axes. The OBB tree is a hierarchical tree structure of such boxes, where deeper levels of OBB confine smaller regions of space. To build the OBB, a recursive, top-down process is used. First, the root OBB is constructed by finding the mean and covariance matrix of the cells (and their points) that define the dataset. The eigenvectors of the covariance matrix are extracted, giving a set of three orthogonal vectors that define the tightest-fitting OBB. To create the two children OBB's, a split plane is found that (approximately) divides the number cells in half. These are then assigned to the children OBB's. This process then continues until the MaxLevel ivar limits the recursion, or no split plane can be found. A good reference for OBB-trees is Gottschalk & Manocha in Proceedings of Siggraph `96.

 

Caveats:

Since this algorithms works from a list of cells, the OBB tree will only bound the "geometry" attached to the cells if the convex hull of the cells bounds the geometry. Long, skinny cells (i.e., cells with poor aspect ratio) may cause unsatisfactory results. This is due to the fact that this is a top-down implementation of the OBB tree, requiring that one or more complete cells are contained in each OBB. This requirement makes it hard to find good split planes during the recurion process. A bottom-up implementation would go a long way to correcting this problem.

 

See Also:

vtkLocator vtkCellLocator vtkLocatorFilter

 

Methods:

void vtkOBBTree ()
void vtkOBBTree ()
const char *GetClassName ()
static vtkOBBTree *New ()
void ComputeOBB (vtkPoints * ,float ,float ,float ,float ,float )
int IntersectWithLine (float ,float ,float & ,float ,float ,int &)
void FreeSearchStructure ()
void BuildLocator ()
void GenerateRepresentation (int ,vtkPolyData *)
void BuildTree (vtkIdList * ,vtkOBBNode * ,int )
void DeleteTree (vtkOBBNode *)
void GeneratePolygons (vtkOBBNode * ,int ,int ,vtkPoints * ,vtkCellArray *)

 

Detailed Method Descriptions:

Construct with automatic computation of divisions, averaging 25 cells per octant.

static vtkOBBTree *New ()

Compute an OBB from the list of points given. Return the corner point and the three axes defining the orientation of the OBB. Also return a sorted list of relative "sizes" of axes for comparison purposes.

void ComputeOBB (vtkPoints * ,float ,float ,float ,float ,float )

Return intersection point of line defined by two points (a0,a1) in dataset coordinate system; returning cellId (or -1 if no intersection). The argument list returns the intersection parametric coordinate, t, along the line; the coordinate of intersection, x[3]; the cell parametric coordinates, pcoords[3]; and subId of the cell. (Not yet implemented.)

int IntersectWithLine (float ,float ,float & ,float ,float ,int &)

Satisfy locator'a abstract interface, see vtkLocator.

void FreeSearchStructure ()
void BuildLocator ()

Create polygonal representation for OBB tree at specified level. If level <0, then the leaf OBB nodes will be gathered. The aspect ratio (ar) and line diameter (d) are used to control the building of the representation. If a OBB node edge ratio's are greater than ar, then the dimension of the OBB is collapsed (OBB->plane->line). A "line" OBB will be represented either as two crossed polygons, or as a line, depending on the relative diameter of the OBB compared to the diameter (d).

void GenerateRepresentation (int ,vtkPolyData *)