BV_Tree Class Reference

#include <BV_Tree.h>

Inheritance diagram for BV_Tree:

BV_KDOPTree< K > BV_KDOPTree< K > BV_OBBTree GU_KDOPTree< K > GU_OBBTree

List of all members.

Public Types

enum  Status { BV_PASS, BV_FAIL_ROTATIONS_UNSUPPORTED, BV_FAIL_BAD_TYPE, BV_FAIL }

Public Member Functions

 BV_Tree ()
virtual ~BV_Tree ()
BV_Treeclone () const
virtual const char * getType () const =0
virtual const BV_TreecastTo (const char *type) const
virtual BV_TreecastTo (const char *type)
int64 getMemoryUsage () const
int getNumLeaves () const
void build (BV_LeafIterator &leafIt)
 Construct a volume hierarchy from the given primitives.
void updateExtents (BV_LeafIterator &leafIt)
void save (ostream &os, bool onlyStructure) const
bool load (UT_IStream &is, bool onlyStructure)
Status intersect (BV_Callback &callback, const BV_Tree &treeb, const UT_DMatrix4 &xforma, const UT_DMatrix4 &xformb, fpreal tol=0.001F) const
Status intersect (BV_Callback &callback, const BV_Tree &treeb, fpreal tol=0.001F) const
 Static boxes only!
Status intersect (BV_Callback &callback, const BV_Tree &treeb, const UT_DMatrix4 &startxforma, const UT_DMatrix4 &startxformb, const UT_DMatrix4 &endxforma, const UT_DMatrix4 &endxformb, fpreal tol=0.001F) const
 Moving boxes only!
Status intersect (BV_Callback &callback, const BV_Tree &treeb, const UT_DMatrix4 &xforma, const UT_DMatrix4 &startxforma, const UT_DMatrix4 &startxformb, const UT_DMatrix4 &xformb, const UT_DMatrix4 &endxforma, const UT_DMatrix4 &endxformb, fpreal tol=0.001F) const
 Moving boxes only!

Protected Member Functions

 BV_Tree (const BV_Tree &tree)
virtual BV_TreecloneSubclass () const =0
virtual void buildSubclass (BV_LeafIterator &leafIt)=0
virtual int64 getMemoryUsageSubclass () const =0
virtual int getNumLeavesSubclass () const =0
virtual void saveSubclass (ostream &os, bool onlyStructure) const =0
virtual bool loadSubclass (UT_IStream &is, bool onlyStructure)=0
virtual void updateExtentsSubclass (BV_LeafIterator &leafIt)=0
virtual Status intersectSubclass (BV_Callback &callback, const BV_Tree &treeb, const UT_DMatrix4 &startxforma, const UT_DMatrix4 &startxformb, const UT_DMatrix4 &endxforma, const UT_DMatrix4 &endxformb, fpreal tol) const =0


Detailed Description

Base class for bounding volume hierarchies. It's not really intended to be an all-encompassing base class; it's more intended as a rough template for other bounding volume classes to follow.

Definition at line 31 of file BV_Tree.h.


Member Enumeration Documentation

Enumerator:
BV_PASS 
BV_FAIL_ROTATIONS_UNSUPPORTED  Rotations are not allowed.
BV_FAIL_BAD_TYPE  Tree B was an unsupported type.
BV_FAIL  Failed for some other reason.

Definition at line 34 of file BV_Tree.h.


Constructor & Destructor Documentation

BV_Tree::BV_Tree (  ) 

virtual BV_Tree::~BV_Tree (  )  [virtual]

BV_Tree::BV_Tree ( const BV_Tree tree  )  [protected]


Member Function Documentation

void BV_Tree::build ( BV_LeafIterator leafIt  )  [inline]

Construct a volume hierarchy from the given primitives.

Definition at line 70 of file BV_Tree.h.

virtual void BV_Tree::buildSubclass ( BV_LeafIterator leafIt  )  [protected, pure virtual]

virtual BV_Tree* BV_Tree::castTo ( const char *  type  )  [virtual]

Reimplemented in BV_KDOPTree< K >, BV_OBBTree, and BV_KDOPTree< K >.

virtual const BV_Tree* BV_Tree::castTo ( const char *  type  )  const [virtual]

Reimplemented in BV_KDOPTree< K >, BV_OBBTree, and BV_KDOPTree< K >.

BV_Tree* BV_Tree::clone (  )  const [inline]

Definition at line 46 of file BV_Tree.h.

virtual BV_Tree* BV_Tree::cloneSubclass (  )  const [protected, pure virtual]

int64 BV_Tree::getMemoryUsage (  )  const [inline]

Definition at line 54 of file BV_Tree.h.

virtual int64 BV_Tree::getMemoryUsageSubclass (  )  const [protected, pure virtual]

int BV_Tree::getNumLeaves (  )  const [inline]

Definition at line 56 of file BV_Tree.h.

virtual int BV_Tree::getNumLeavesSubclass (  )  const [protected, pure virtual]

virtual const char* BV_Tree::getType (  )  const [pure virtual]

Status BV_Tree::intersect ( BV_Callback callback,
const BV_Tree treeb,
const UT_DMatrix4 xforma,
const UT_DMatrix4 startxforma,
const UT_DMatrix4 startxformb,
const UT_DMatrix4 xformb,
const UT_DMatrix4 endxforma,
const UT_DMatrix4 endxformb,
fpreal  tol = 0.001F 
) const [inline]

Moving boxes only!

Definition at line 131 of file BV_Tree.h.

Status BV_Tree::intersect ( BV_Callback callback,
const BV_Tree treeb,
const UT_DMatrix4 startxforma,
const UT_DMatrix4 startxformb,
const UT_DMatrix4 endxforma,
const UT_DMatrix4 endxformb,
fpreal  tol = 0.001F 
) const [inline]

Moving boxes only!

Definition at line 115 of file BV_Tree.h.

Status BV_Tree::intersect ( BV_Callback callback,
const BV_Tree treeb,
fpreal  tol = 0.001F 
) const [inline]

Static boxes only!

Definition at line 103 of file BV_Tree.h.

Status BV_Tree::intersect ( BV_Callback callback,
const BV_Tree treeb,
const UT_DMatrix4 xforma,
const UT_DMatrix4 xformb,
fpreal  tol = 0.001F 
) const [inline]

Find intersections of bounding volumes of this tree ("A") with tree B, rotated by ra and rb and translated by ta and tb respectively. For each intersection, call the callback with the leaves whose bounding volumes overlap.

The callback can return a "stop" status to stop testing for further intersections.

Note:

  • Not all trees can deal with rotations. e.g., an AABB tree can't, unless it expands all nodes to handle the contents at any orientation.
  • method may not succeed if treeb is a different type.

Static boxes only!

Definition at line 91 of file BV_Tree.h.

virtual Status BV_Tree::intersectSubclass ( BV_Callback callback,
const BV_Tree treeb,
const UT_DMatrix4 startxforma,
const UT_DMatrix4 startxformb,
const UT_DMatrix4 endxforma,
const UT_DMatrix4 endxformb,
fpreal  tol 
) const [protected, pure virtual]

bool BV_Tree::load ( UT_IStream is,
bool  onlyStructure 
) [inline]

If the "onlyStructure" flag is set, then the dimensions of the boxes are not saved/loaded, only the structure of the tree.

Definition at line 64 of file BV_Tree.h.

virtual bool BV_Tree::loadSubclass ( UT_IStream is,
bool  onlyStructure 
) [protected, pure virtual]

void BV_Tree::save ( ostream &  os,
bool  onlyStructure 
) const [inline]

If the "onlyStructure" flag is set, then the dimensions of the boxes are not saved/loaded, only the structure of the tree.

Definition at line 62 of file BV_Tree.h.

virtual void BV_Tree::saveSubclass ( ostream &  os,
bool  onlyStructure 
) const [protected, pure virtual]

void BV_Tree::updateExtents ( BV_LeafIterator leafIt  )  [inline]

Update an existing volume hierarchy by updating the bounding box sizes without changing the hierarchy structure.

Definition at line 74 of file BV_Tree.h.

virtual void BV_Tree::updateExtentsSubclass ( BV_LeafIterator leafIt  )  [protected, pure virtual]


The documentation for this class was generated from the following file:

Generated on Fri May 25 00:10:17 2012 for HDK by  doxygen 1.5.9