HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BV_KDOPTree< K > Class Template Reference

#include <BV_KDOPTree.h>

+ Inheritance diagram for BV_KDOPTree< K >:

Classes

class  bvLeaf
 

Public Types

typedef BV_Tree BaseClass
 
- Public Types inherited from BV_Tree
enum  BV_Status { BV_PASS, BV_FAIL_ROTATIONS_UNSUPPORTED, BV_FAIL_BAD_TYPE, BV_FAIL }
 

Public Member Functions

 BV_KDOPTree ()
 
 BV_KDOPTree (const BV_KDOPTree &)
 
 ~BV_KDOPTree () override
 
BV_KDOPTreeoperator= (const BV_KDOPTree &)
 
const char * getType () const override
 
const BV_TreecastTo (const char *type) const override
 
BV_TreecastTo (const char *type) override
 
- Public Member Functions inherited from BV_Tree
 BV_Tree ()
 
virtual ~BV_Tree ()
 
BV_Treeclone () const
 
int64 getMemoryUsage () const
 
int getNumLeaves () const
 
void build (BV_LeafIterator &leafIt)
 Construct a volume hierarchy from the given primitives. More...
 
void updateExtents (BV_LeafIterator &leafIt)
 
void save (std::ostream &os, bool onlyStructure) const
 
bool load (UT_IStream &is, bool onlyStructure)
 
BV_Status intersect (BV_Callback &callback, const BV_Tree &treeb, const UT_DMatrix4 &xforma, const UT_DMatrix4 &xformb, fpreal tol=0.001F) const
 
BV_Status intersect (BV_Callback &callback, const BV_Tree &treeb, fpreal tol=0.001F) const
 Static boxes only! More...
 
BV_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! More...
 
BV_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! More...
 

Static Public Member Functions

static int getNumSlabs ()
 This defines the number of "slabs" used to define the polytope. More...
 
static const UT_Vector3getPlaneDir (int k)
 Retrieve the orientation of the k-th slab. More...
 

Protected Member Functions

BV_TreecloneSubclass () const override
 
int64 getMemoryUsageSubclass () const override
 
int getNumLeavesSubclass () const override
 
void saveSubclass (std::ostream &os, bool onlyStructure) const override
 
bool loadSubclass (UT_IStream &is, bool onlyStructure) override
 
void buildSubclass (BV_LeafIterator &leafIt) override
 
void updateExtentsSubclass (BV_LeafIterator &leafIt) override
 
BV_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 override
 
const BV_KDOPNode< K > * getRoot () const
 
- Protected Member Functions inherited from BV_Tree
 BV_Tree (const BV_Tree &tree)
 

Static Protected Member Functions

static bool intersectRecurse (BV_Callback &callback, const BV_KDOPNode< K > &nodea, const BV_KDOPNode< K > &nodeb, fpreal tol)
 
static BV_KDOPNode< K > * buildRecurse (UT_Array< bvLeaf > &leafData, int startLeaf, int numLeaves)
 
static void updateExtentsRecurse (BV_LeafIterator &leafIt, BV_KDOPNode< K > &node)
 

Detailed Description

template<int K>
class BV_KDOPTree< K >

Bounding Volume Tree using k-Discrete Oriented Polytopes.

Build: O(n^2) Update extents: O(n log n)

Defined for: k=6 (axis aligned bounding box) k=14 (AABB with cut corners) k=18 (AABB with cut edges) k=26 (AABB with cut corners and edges).

Source: Klosowski, Held, Mitchell, Sowizral and Zikan, "Efficient Collision Detection Using Bounding Volume Hierarchies of k-DOPs," IEEE Transactions on Visualization and Computer Graphics 4(1):21-36, 1998. ftp://ams.sunysb.edu/pub/geometry/cd-tvcg-97.ps.gz

Definition at line 74 of file BV_KDOPTree.h.

Member Typedef Documentation

template<int K>
typedef BV_Tree BV_KDOPTree< K >::BaseClass

Definition at line 77 of file BV_KDOPTree.h.

Constructor & Destructor Documentation

template<int K>
BV_KDOPTree< K >::BV_KDOPTree ( )
template<int K>
BV_KDOPTree< K >::BV_KDOPTree ( const BV_KDOPTree< K > &  )
template<int K>
BV_KDOPTree< K >::~BV_KDOPTree ( )
override

Member Function Documentation

template<int K>
static BV_KDOPNode<K>* BV_KDOPTree< K >::buildRecurse ( UT_Array< bvLeaf > &  leafData,
int  startLeaf,
int  numLeaves 
)
staticprotected
template<int K>
void BV_KDOPTree< K >::buildSubclass ( BV_LeafIterator leafIt)
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
const BV_Tree* BV_KDOPTree< K >::castTo ( const char *  type) const
overridevirtual

Reimplemented from BV_Tree.

template<int K>
BV_Tree* BV_KDOPTree< K >::castTo ( const char *  type)
overridevirtual

Reimplemented from BV_Tree.

template<int K>
BV_Tree* BV_KDOPTree< K >::cloneSubclass ( ) const
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
int64 BV_KDOPTree< K >::getMemoryUsageSubclass ( ) const
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
int BV_KDOPTree< K >::getNumLeavesSubclass ( ) const
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
static int BV_KDOPTree< K >::getNumSlabs ( )
inlinestatic

This defines the number of "slabs" used to define the polytope.

Definition at line 92 of file BV_KDOPTree.h.

template<int K>
static const UT_Vector3& BV_KDOPTree< K >::getPlaneDir ( int  k)
static

Retrieve the orientation of the k-th slab.

template<int K>
const BV_KDOPNode<K>* BV_KDOPTree< K >::getRoot ( ) const
inlineprotected

Definition at line 136 of file BV_KDOPTree.h.

template<int K>
const char* BV_KDOPTree< K >::getType ( ) const
overridevirtual

Implements BV_Tree.

template<int K>
static bool BV_KDOPTree< K >::intersectRecurse ( BV_Callback callback,
const BV_KDOPNode< K > &  nodea,
const BV_KDOPNode< K > &  nodeb,
fpreal  tol 
)
staticprotected
template<int K>
BV_Status BV_KDOPTree< K >::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
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
bool BV_KDOPTree< K >::loadSubclass ( UT_IStream is,
bool  onlyStructure 
)
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
BV_KDOPTree& BV_KDOPTree< K >::operator= ( const BV_KDOPTree< K > &  )
template<int K>
void BV_KDOPTree< K >::saveSubclass ( std::ostream &  os,
bool  onlyStructure 
) const
overrideprotectedvirtual

Implements BV_Tree.

template<int K>
static void BV_KDOPTree< K >::updateExtentsRecurse ( BV_LeafIterator leafIt,
BV_KDOPNode< K > &  node 
)
staticprotected
template<int K>
void BV_KDOPTree< K >::updateExtentsSubclass ( BV_LeafIterator leafIt)
overrideprotectedvirtual

Implements BV_Tree.


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