SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::component::collision::TriangleOctree Class Reference

#include <TriangleOctree.h>

Classes

class  traceResult
 

Public Attributes

double x
 
double y
 
double z
 
bool visited
 
double size
 
bool val
 
bool is_leaf
 
bool internal
 
TriangleOctreeRoottm
 
helper::vector< intobjects
 
TriangleOctreechildVec [8]
 

Public Member Functions

 ~TriangleOctree ()
 
 TriangleOctree (TriangleOctreeRoot *_tm, double _x=(double)-CUBE_SIZE, double _y=(double)-CUBE_SIZE, double _z=(double)-CUBE_SIZE, double _size=2 *CUBE_SIZE)
 
void draw (const core::visual::VisualParams *vparams)
 
int trace (defaulttype::Vector3 origin, defaulttype::Vector3 direction, traceResult &result)
 Find the nearest triangle intersecting the given ray, or -1 of not found. More...
 
void traceAll (defaulttype::Vector3 origin, defaulttype::Vector3 direction, helper::vector< traceResult > &results)
 Find all triangles intersecting the given ray. More...
 
void traceAllCandidates (defaulttype::Vector3 origin, defaulttype::Vector3 direction, std::set< int > &results)
 Find all triangles intersecting the given ray. More...
 
void bboxAllCandidates (defaulttype::Vector3 bbmin, defaulttype::Vector3 bbmax, std::set< int > &results)
 Find all triangles intersecting the given ray. More...
 

Protected Member Functions

int trace (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, double tx0, double ty0, double tz0, double tx1, double ty1, double tz1, unsigned int a, unsigned int b, defaulttype::Vector3 &origin1, defaulttype::Vector3 &direction1, traceResult &result)
 
template<class Res >
void traceAllStart (defaulttype::Vector3 origin, defaulttype::Vector3 direction, Res &results)
 
template<class Res >
void traceAll (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, double tx0, double ty0, double tz0, double tx1, double ty1, double tz1, unsigned int a, unsigned int b, defaulttype::Vector3 &origin1, defaulttype::Vector3 &direction1, Res &results)
 
template<class Res >
void bbAll (const defaulttype::Vector3 &bbmin, const defaulttype::Vector3 &bbmax, Res &results)
 
int nearestTriangle (int minIndex, const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, traceResult &result)
 
void allTriangles (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, helper::vector< traceResult > &results)
 
void allTriangles (const defaulttype::Vector3 &origin, const defaulttype::Vector3 &direction, std::set< int > &results)
 
void bbAllTriangles (const defaulttype::Vector3 &bbmin, const defaulttype::Vector3 &bbmax, std::set< int > &results)
 
void insert (double _x, double _y, double _z, double _inc, int t)
 

Friends

class TriangleOctreeRoot
 

Attribute details

TriangleOctree* sofa::component::collision::TriangleOctree::childVec[8]
bool sofa::component::collision::TriangleOctree::internal
bool sofa::component::collision::TriangleOctree::is_leaf
helper::vector< int > sofa::component::collision::TriangleOctree::objects
double sofa::component::collision::TriangleOctree::size
TriangleOctreeRoot* sofa::component::collision::TriangleOctree::tm
bool sofa::component::collision::TriangleOctree::val
bool sofa::component::collision::TriangleOctree::visited
double sofa::component::collision::TriangleOctree::x
double sofa::component::collision::TriangleOctree::y
double sofa::component::collision::TriangleOctree::z

Constructor details

sofa::component::collision::TriangleOctree::~TriangleOctree ( )
sofa::component::collision::TriangleOctree::TriangleOctree ( TriangleOctreeRoot _tm,
double  _x = (double)-CUBE_SIZE,
double  _y = (double)-CUBE_SIZE,
double  _z = (double) -CUBE_SIZE,
double  _size = 2 * CUBE_SIZE 
)
inline

Function details

void sofa::component::collision::TriangleOctree::allTriangles ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
helper::vector< traceResult > &  results 
)
protected
void sofa::component::collision::TriangleOctree::allTriangles ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
std::set< int > &  results 
)
protected
template<class Res >
void sofa::component::collision::TriangleOctree::bbAll ( const defaulttype::Vector3 &  bbmin,
const defaulttype::Vector3 &  bbmax,
Res &  results 
)
protected
void sofa::component::collision::TriangleOctree::bbAllTriangles ( const defaulttype::Vector3 &  bbmin,
const defaulttype::Vector3 &  bbmax,
std::set< int > &  results 
)
protected
void sofa::component::collision::TriangleOctree::bboxAllCandidates ( defaulttype::Vector3  bbmin,
defaulttype::Vector3  bbmax,
std::set< int > &  results 
)

Find all triangles intersecting the given ray.

void sofa::component::collision::TriangleOctree::draw ( const core::visual::VisualParams vparams)
void sofa::component::collision::TriangleOctree::insert ( double  _x,
double  _y,
double  _z,
double  _inc,
int  t 
)
protected
int sofa::component::collision::TriangleOctree::nearestTriangle ( int  minIndex,
const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
traceResult result 
)
protected
int sofa::component::collision::TriangleOctree::trace ( defaulttype::Vector3  origin,
defaulttype::Vector3  direction,
traceResult result 
)

Find the nearest triangle intersecting the given ray, or -1 of not found.

int sofa::component::collision::TriangleOctree::trace ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
double  tx0,
double  ty0,
double  tz0,
double  tx1,
double  ty1,
double  tz1,
unsigned int  a,
unsigned int  b,
defaulttype::Vector3 &  origin1,
defaulttype::Vector3 &  direction1,
traceResult result 
)
protected
void sofa::component::collision::TriangleOctree::traceAll ( defaulttype::Vector3  origin,
defaulttype::Vector3  direction,
helper::vector< traceResult > &  results 
)

Find all triangles intersecting the given ray.

template<class Res >
void sofa::component::collision::TriangleOctree::traceAll ( const defaulttype::Vector3 &  origin,
const defaulttype::Vector3 &  direction,
double  tx0,
double  ty0,
double  tz0,
double  tx1,
double  ty1,
double  tz1,
unsigned int  a,
unsigned int  b,
defaulttype::Vector3 &  origin1,
defaulttype::Vector3 &  direction1,
Res &  results 
)
protected
void sofa::component::collision::TriangleOctree::traceAllCandidates ( defaulttype::Vector3  origin,
defaulttype::Vector3  direction,
std::set< int > &  results 
)

Find all triangles intersecting the given ray.

template<class Res >
void sofa::component::collision::TriangleOctree::traceAllStart ( defaulttype::Vector3  origin,
defaulttype::Vector3  direction,
Res &  results 
)
protected

Related details

friend class TriangleOctreeRoot
friend