Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
hpp::fcl::BVHModelBase Class Referenceabstract

A base 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 hpp::fcl::BVHModelBase:
Inheritance graph
[legend]

Public Member Functions

int addSubModel (const std::vector< Vec3f > &ps, const std::vector< Triangle > &ts)
 Add a set of triangles in the new BVH model. More...
 
int addSubModel (const std::vector< Vec3f > &ps)
 Add a set of points in the new BVH model. More...
 
int addTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Add one triangle in the new BVH model. More...
 
int addTriangles (const Matrixx3i &triangles)
 Add triangles in the new BVH model. More...
 
int addVertex (const Vec3f &p)
 Add one point in the new BVH model. More...
 
int addVertices (const Matrixx3f &points)
 Add points in the new BVH model. More...
 
int beginModel (unsigned int num_tris=0, unsigned int num_vertices=0)
 Begin a new BVH model. More...
 
int beginReplaceModel ()
 Replace the geometry information of current frame (i.e. should have the same mesh topology with the previous frame) More...
 
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. More...
 
bool buildConvexHull (bool keepTriangle, const char *qhullCommand=NULL)
 Build a convex hull and store it in attribute convex. More...
 
void buildConvexRepresentation (bool share_memory)
 Build this Convex<Triangle> representation of this model. The result is stored in attribute convex. More...
 
 BVHModelBase ()
 Constructing an empty BVH. More...
 
 BVHModelBase (const BVHModelBase &other)
 copy from another BVH More...
 
Vec3f computeCOM () const
 compute center of mass More...
 
void computeLocalAABB ()
 Compute the AABB for the BVH, used for broad-phase collision. More...
 
Matrix3f computeMomentofInertia () const
 compute the inertia matrix, related to the origin More...
 
FCL_REAL computeVolume () const
 compute the volume More...
 
int endModel ()
 End BVH model construction, will build the bounding volume hierarchy. More...
 
int endReplaceModel (bool refit=true, bool bottomup=true)
 End BVH model replacement, will also refit or rebuild the bounding volume hierarchy. More...
 
int endUpdateModel (bool refit=true, bool bottomup=true)
 End BVH model update, will also refit or rebuild the bounding volume hierarchy. More...
 
BVHModelType getModelType () const
 Model type described by the instance. More...
 
OBJECT_TYPE getObjectType () const
 Get the object type: it is a BVH. More...
 
virtual void makeParentRelative ()=0
 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. More...
 
virtual int memUsage (const bool msg=false) const =0
 
int replaceSubModel (const std::vector< Vec3f > &ps)
 Replace a set of points in the old BVH model. More...
 
int replaceTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Replace one triangle in the old BVH model. More...
 
int replaceVertex (const Vec3f &p)
 Replace one point in the old BVH model. More...
 
int updateSubModel (const std::vector< Vec3f > &ps)
 Update a set of points in the old BVH model. More...
 
int updateTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3)
 Update one triangle in the old BVH model. More...
 
int updateVertex (const Vec3f &p)
 Update one point in the old BVH model. More...
 
virtual ~BVHModelBase ()
 deconstruction, delete mesh data related. More...
 
- Public Member Functions inherited from hpp::fcl::CollisionGeometry
virtual CollisionGeometryclone () const =0
 Clone *this into a new CollisionGeometry. More...
 
 CollisionGeometry ()
 
 CollisionGeometry (const CollisionGeometry &other)=default
 Copy constructor. More...
 
virtual Matrix3f computeMomentofInertiaRelatedToCOM () const
 compute the inertia matrix, related to the com More...
 
virtual NODE_TYPE getNodeType () const
 get the node type More...
 
void * getUserData () const
 get user data in geometry More...
 
bool isFree () const
 whether the object is completely free More...
 
bool isOccupied () const
 whether the object is completely occupied More...
 
bool isUncertain () const
 whether the object has some uncertainty More...
 
bool operator!= (const CollisionGeometry &other) const
 Difference operator. More...
 
bool operator== (const CollisionGeometry &other) const
 Equality operator. More...
 
void setUserData (void *data)
 set user data in geometry More...
 
virtual ~CollisionGeometry ()
 

Public Attributes

BVHBuildState build_state
 The state of BVH building process. More...
 
shared_ptr< ConvexBaseconvex
 Convex<Triangle> representation of this object. More...
 
unsigned int num_tris
 Number of triangles. More...
 
unsigned int num_vertices
 Number of points. More...
 
Vec3fprev_vertices
 Geometry point data in previous frame. More...
 
Triangletri_indices
 Geometry triangle index data, will be NULL for point clouds. More...
 
Vec3fvertices
 Geometry point data. More...
 
- Public Attributes inherited from hpp::fcl::CollisionGeometry
Vec3f aabb_center
 AABB center in local coordinate. More...
 
AABB aabb_local
 AABB in local coordinate, used for tight AABB when only translation transform. More...
 
FCL_REAL aabb_radius
 AABB radius. More...
 
FCL_REAL cost_density
 collision cost for unit volume More...
 
FCL_REAL threshold_free
 threshold for free (<= is free) More...
 
FCL_REAL threshold_occupied
 threshold for occupied ( >= is occupied) More...
 
void * user_data
 pointer to user defined data specific to this object More...
 

Protected Member Functions

virtual bool allocateBVs ()=0
 
virtual int buildTree ()=0
 Build the bounding volume hierarchy. More...
 
virtual void deleteBVs ()=0
 
virtual bool isEqual (const CollisionGeometry &other) const
 for ccd vertex update More...
 
virtual int refitTree (bool bottomup)=0
 Refit the bounding volume hierarchy. More...
 

Protected Attributes

unsigned int num_tris_allocated
 
unsigned int num_vertex_updated
 
unsigned int num_vertices_allocated
 

Detailed Description

A base 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 63 of file BVH/BVH_model.h.

Constructor & Destructor Documentation

◆ BVHModelBase() [1/2]

hpp::fcl::BVHModelBase::BVHModelBase ( )

Constructing an empty BVH.

Definition at line 53 of file BVH_model.cpp.

◆ BVHModelBase() [2/2]

hpp::fcl::BVHModelBase::BVHModelBase ( const BVHModelBase other)

copy from another BVH

Definition at line 64 of file BVH_model.cpp.

◆ ~BVHModelBase()

virtual hpp::fcl::BVHModelBase::~BVHModelBase ( )
inlinevirtual

deconstruction, delete mesh data related.

Definition at line 103 of file BVH/BVH_model.h.

Member Function Documentation

◆ addSubModel() [1/2]

int hpp::fcl::BVHModelBase::addSubModel ( const std::vector< Vec3f > &  ps,
const std::vector< Triangle > &  ts 
)

Add a set of triangles in the new BVH model.

Definition at line 410 of file BVH_model.cpp.

◆ addSubModel() [2/2]

int hpp::fcl::BVHModelBase::addSubModel ( const std::vector< Vec3f > &  ps)

Add a set of points in the new BVH model.

Definition at line 374 of file BVH_model.cpp.

◆ addTriangle()

int hpp::fcl::BVHModelBase::addTriangle ( const Vec3f p1,
const Vec3f p2,
const Vec3f p3 
)

Add one triangle in the new BVH model.

Definition at line 317 of file BVH_model.cpp.

◆ addTriangles()

int hpp::fcl::BVHModelBase::addTriangles ( const Matrixx3i triangles)

Add triangles in the new BVH model.

Definition at line 251 of file BVH_model.cpp.

◆ addVertex()

int hpp::fcl::BVHModelBase::addVertex ( const Vec3f p)

Add one point in the new BVH model.

Definition at line 221 of file BVH_model.cpp.

◆ addVertices()

int hpp::fcl::BVHModelBase::addVertices ( const Matrixx3f points)

Add points in the new BVH model.

Definition at line 287 of file BVH_model.cpp.

◆ allocateBVs()

virtual bool hpp::fcl::BVHModelBase::allocateBVs ( )
protectedpure virtual

Implemented in hpp::fcl::BVHModel< BV >.

◆ beginModel()

int hpp::fcl::BVHModelBase::beginModel ( unsigned int  num_tris = 0,
unsigned int  num_vertices = 0 
)

Begin a new BVH model.

Definition at line 170 of file BVH_model.cpp.

◆ beginReplaceModel()

int hpp::fcl::BVHModelBase::beginReplaceModel ( )

Replace the geometry information of current frame (i.e. should have the same mesh topology with the previous frame)

Definition at line 533 of file BVH_model.cpp.

◆ beginUpdateModel()

int hpp::fcl::BVHModelBase::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.

Definition at line 629 of file BVH_model.cpp.

◆ buildConvexHull()

bool hpp::fcl::BVHModelBase::buildConvexHull ( bool  keepTriangle,
const char *  qhullCommand = NULL 
)

Build a convex hull and store it in attribute convex.

Parameters
keepTrianglewhether the convex should be triangulated.
qhullCommandsee ConvexBase::convexHull.
Returns
true if this object is convex, hence the convex hull represents the same object.
See also
ConvexBase::convexHull
Warning
At the moment, the return value only checks whether there are as many points in the convex hull as in the original object. This is neither necessary (duplicated vertices get merged) nor sufficient (think of a U with 4 vertices and 3 edges).

Definition at line 132 of file BVH_model.cpp.

◆ buildConvexRepresentation()

void hpp::fcl::BVHModelBase::buildConvexRepresentation ( bool  share_memory)

Build this Convex<Triangle> representation of this model. The result is stored in attribute convex.

Note
this only takes the points of this model. It does not check that the object is convex. It does not compute a convex hull.

Definition at line 116 of file BVH_model.cpp.

◆ buildTree()

virtual int hpp::fcl::BVHModelBase::buildTree ( )
protectedpure virtual

Build the bounding volume hierarchy.

Implemented in hpp::fcl::BVHModel< BV >.

◆ computeCOM()

Vec3f hpp::fcl::BVHModelBase::computeCOM ( ) const
inlinevirtual

compute center of mass

Reimplemented from hpp::fcl::CollisionGeometry.

Definition at line 203 of file BVH/BVH_model.h.

◆ computeLocalAABB()

void hpp::fcl::BVHModelBase::computeLocalAABB ( )
virtual

Compute the AABB for the BVH, used for broad-phase collision.

Implements hpp::fcl::CollisionGeometry.

Definition at line 736 of file BVH_model.cpp.

◆ computeMomentofInertia()

Matrix3f hpp::fcl::BVHModelBase::computeMomentofInertia ( ) const
inlinevirtual

compute the inertia matrix, related to the origin

Reimplemented from hpp::fcl::CollisionGeometry.

Definition at line 230 of file BVH/BVH_model.h.

◆ computeVolume()

FCL_REAL hpp::fcl::BVHModelBase::computeVolume ( ) const
inlinevirtual

compute the volume

Reimplemented from hpp::fcl::CollisionGeometry.

Definition at line 218 of file BVH/BVH_model.h.

◆ deleteBVs()

virtual void hpp::fcl::BVHModelBase::deleteBVs ( )
protectedpure virtual

Implemented in hpp::fcl::BVHModel< BV >.

◆ endModel()

int hpp::fcl::BVHModelBase::endModel ( )

End BVH model construction, will build the bounding volume hierarchy.

Definition at line 473 of file BVH_model.cpp.

◆ endReplaceModel()

int hpp::fcl::BVHModelBase::endReplaceModel ( bool  refit = true,
bool  bottomup = true 
)

End BVH model replacement, will also refit or rebuild the bounding volume hierarchy.

Definition at line 601 of file BVH_model.cpp.

◆ endUpdateModel()

int hpp::fcl::BVHModelBase::endUpdateModel ( bool  refit = true,
bool  bottomup = true 
)

End BVH model update, will also refit or rebuild the bounding volume hierarchy.

Definition at line 704 of file BVH_model.cpp.

◆ getModelType()

BVHModelType hpp::fcl::BVHModelBase::getModelType ( ) const
inline

Model type described by the instance.

Definition at line 87 of file BVH/BVH_model.h.

◆ getObjectType()

OBJECT_TYPE hpp::fcl::BVHModelBase::getObjectType ( ) const
inlinevirtual

Get the object type: it is a BVH.

Reimplemented from hpp::fcl::CollisionGeometry.

Definition at line 110 of file BVH/BVH_model.h.

◆ isEqual()

bool hpp::fcl::BVHModelBase::isEqual ( const CollisionGeometry other) const
protectedvirtual

for ccd vertex update

Comparison operators

Implements hpp::fcl::CollisionGeometry.

Reimplemented in hpp::fcl::BVHModel< BV >.

Definition at line 91 of file BVH_model.cpp.

◆ makeParentRelative()

virtual void hpp::fcl::BVHModelBase::makeParentRelative ( )
pure virtual

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.

Implemented in hpp::fcl::BVHModel< BV >.

◆ memUsage()

virtual int hpp::fcl::BVHModelBase::memUsage ( const bool  msg = false) const
pure virtual

Implemented in hpp::fcl::BVHModel< BV >.

◆ refitTree()

virtual int hpp::fcl::BVHModelBase::refitTree ( bool  bottomup)
protectedpure virtual

Refit the bounding volume hierarchy.

Implemented in hpp::fcl::BVHModel< BV >.

◆ replaceSubModel()

int hpp::fcl::BVHModelBase::replaceSubModel ( const std::vector< Vec3f > &  ps)

Replace a set of points in the old BVH model.

Definition at line 585 of file BVH_model.cpp.

◆ replaceTriangle()

int hpp::fcl::BVHModelBase::replaceTriangle ( const Vec3f p1,
const Vec3f p2,
const Vec3f p3 
)

Replace one triangle in the old BVH model.

Definition at line 566 of file BVH_model.cpp.

◆ replaceVertex()

int hpp::fcl::BVHModelBase::replaceVertex ( const Vec3f p)

Replace one point in the old BVH model.

Definition at line 551 of file BVH_model.cpp.

◆ updateSubModel()

int hpp::fcl::BVHModelBase::updateSubModel ( const std::vector< Vec3f > &  ps)

Update a set of points in the old BVH model.

Definition at line 688 of file BVH_model.cpp.

◆ updateTriangle()

int hpp::fcl::BVHModelBase::updateTriangle ( const Vec3f p1,
const Vec3f p2,
const Vec3f p3 
)

Update one triangle in the old BVH model.

Definition at line 669 of file BVH_model.cpp.

◆ updateVertex()

int hpp::fcl::BVHModelBase::updateVertex ( const Vec3f p)

Update one point in the old BVH model.

Definition at line 654 of file BVH_model.cpp.

Member Data Documentation

◆ build_state

BVHBuildState hpp::fcl::BVHModelBase::build_state

The state of BVH building process.

Definition at line 81 of file BVH/BVH_model.h.

◆ convex

shared_ptr<ConvexBase> hpp::fcl::BVHModelBase::convex

Convex<Triangle> representation of this object.

Definition at line 84 of file BVH/BVH_model.h.

◆ num_tris

unsigned int hpp::fcl::BVHModelBase::num_tris

Number of triangles.

Definition at line 75 of file BVH/BVH_model.h.

◆ num_tris_allocated

unsigned int hpp::fcl::BVHModelBase::num_tris_allocated
protected

Definition at line 260 of file BVH/BVH_model.h.

◆ num_vertex_updated

unsigned int hpp::fcl::BVHModelBase::num_vertex_updated
protected

Definition at line 262 of file BVH/BVH_model.h.

◆ num_vertices

unsigned int hpp::fcl::BVHModelBase::num_vertices

Number of points.

Definition at line 78 of file BVH/BVH_model.h.

◆ num_vertices_allocated

unsigned int hpp::fcl::BVHModelBase::num_vertices_allocated
protected

Definition at line 261 of file BVH/BVH_model.h.

◆ prev_vertices

Vec3f* hpp::fcl::BVHModelBase::prev_vertices

Geometry point data in previous frame.

Definition at line 72 of file BVH/BVH_model.h.

◆ tri_indices

Triangle* hpp::fcl::BVHModelBase::tri_indices

Geometry triangle index data, will be NULL for point clouds.

Definition at line 69 of file BVH/BVH_model.h.

◆ vertices

Vec3f* hpp::fcl::BVHModelBase::vertices

Geometry point data.

Definition at line 66 of file BVH/BVH_model.h.


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


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:03