All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends

fcl::BVHModel< BV > Class Template Reference

A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh). More...

#include <BVH_model.h>

Inheritance diagram for fcl::BVHModel< BV >:

[legend]
List of all members.

Public Member Functions

BVHModelType getModelType () const
 Model type described by the instance.
 BVHModel ()
 Constructing an empty BVH.
 BVHModel (const BVHModel &other)
 copy from another BVH
 ~BVHModel ()
 deconstruction, delete mesh data related.
const BVNode< BV > & getBV (int id) const
 Access the bv giving the its index.
BVNode< BV > & getBV (int id)
 Access the bv giving the its index.
int getNumBVs () const
 Get the number of bv in the BVH.
OBJECT_TYPE getObjectType () const
 Get the object type: it is a BVH.
NODE_TYPE getNodeType () const
 Get the BV type: default is unknown.
void computeLocalAABB ()
 Compute the AABB for the BVH, used for broad-phase collision.
int beginModel (int num_tris=0, int num_vertices=0)
 Begin a new BVH model.
int addVertex (const Vec3f &p)
 Add one point in the new BVH model.
int addTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Add one triangle in the new BVH model.
int addSubModel (const std::vector< Vec3f > &ps, const std::vector< Triangle > &ts)
 Add a set of triangles in the new BVH model.
int addSubModel (const std::vector< Vec3f > &ps)
 Add a set of points in the new BVH model.
int endModel ()
 End BVH model construction, will build the bounding volume hierarchy.
int beginReplaceModel ()
 Replace the geometry information of current frame (i.e. should have the same mesh topology with the previous frame).
int replaceVertex (const Vec3f &p)
 Replace one point in the old BVH model.
int replaceTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Replace one triangle in the old BVH model.
int replaceSubModel (const std::vector< Vec3f > &ps)
 Replace a set of points in the old BVH model.
int endReplaceModel (bool refit=true, bool bottomup=true)
 End BVH model replacement, will also refit or rebuild the bounding volume hierarchy.
int beginUpdateModel ()
 Replace the geometry information of current frame (i.e. should have the same mesh topology with the previous frame). The current frame will be saved as the previous frame in prev_vertices.
int updateVertex (const Vec3f &p)
 Update one point in the old BVH model.
int updateTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Update one triangle in the old BVH model.
int updateSubModel (const std::vector< Vec3f > &ps)
 Update a set of points in the old BVH model.
int endUpdateModel (bool refit=true, bool bottomup=true)
 End BVH model update, will also refit or rebuild the bounding volume hierarchy.
int memUsage (int msg) const
 Check the number of memory used.
void makeParentRelative ()
 This is a special acceleration: BVH_model default stores the BV's transform in world coordinate. However, we can also store each BV's transform related to its parent BV node. When traversing the BVH, this can save one matrix transformation.
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
void makeParentRelativeRecurse (int bv_id, Vec3f parent_axis[], const Vec3f &parent_c)
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type
template<>
NODE_TYPE getNodeType () const
 get the node type

Public Attributes

Vec3fvertices
 Geometry point data.
Triangletri_indices
 Geometry triangle index data, will be NULL for point clouds.
Vec3fprev_vertices
 Geometry point data in previous frame.
int num_tris
 Number of triangles.
int num_vertices
 Number of points.
BVHBuildState build_state
 The state of BVH building process.
boost::shared_ptr< BVSplitterBase<
BV > > 
bv_splitter
 Split rule to split one BV node into two children.
boost::shared_ptr< BVFitterBase<
BV > > 
bv_fitter
 Fitting rule to fit a BV node to a set of geometry primitives.

Detailed Description

template<typename BV>
class fcl::BVHModel< BV >

A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh).

Definition at line 53 of file BVH_model.h.


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