SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::collision::ISAPBox Class Reference

#include <IncrSAP.h>

Detailed Description

ISAPBox is a simple bounding box. It contains a Cube which contains only one final CollisionElement and pointers to min and max EndPoints along the three dimensions. min and max end points are respectively min and max coordinates of the cube on a coordinate axis. The between end points (_min, _max) and the field cube is that cube is always updated whereas _min and _max are stored values of the cube end points at previous time step.

Public Attributes

Cube cube
 
EndPointID_min [3]
 
EndPointID_max [3]
 

Static Public Attributes

static double tolerance = (double)(1e-7)
 

Public Member Functions

 ISAPBox ()
 
 ISAPBox (Cube c)
 
bool endPointsOverlap (const ISAPBox &other, int axis) const
 
bool overlaps (const ISAPBox &other, double alarmDist) const
 
double squaredDistance (const ISAPBox &other) const
 
void show () const
 
void showEndPoints () const
 
bool moving (int axis, double alarmDist) const
 
bool moving (double alarmDist) const
 
void init (int boxID, EndPointID **endPts)
 
void update (double alarmDist)
 
void updatedMin (int dim, EndPointID &end_point, double alarmDist) const
 
void updatedMax (int dim, EndPointID &end_point, double alarmDist) const
 
void updateMin (int dim, double alarmDist)
 
void updateMax (int dim, double alarmDist)
 
bool minMoving (int axis, double alarmDist) const
 
bool maxMoving (int axis, double alarmDist) const
 
const core::CollisionElementIterator finalElement () const
 
EndPointIDmin (int dim)
 
const EndPointIDmin (int dim) const
 
EndPointIDmax (int dim)
 
const EndPointIDmax (int dim) const
 
double curMin (int dim) const
 
double curMax (int dim) const
 
bool endPointsAreAlright (int ID)
 

Attribute details

EndPointID* sofa::component::collision::ISAPBox::_max[3]
EndPointID* sofa::component::collision::ISAPBox::_min[3]
Cube sofa::component::collision::ISAPBox::cube
double sofa::component::collision::ISAPBox::tolerance = (double)(1e-7)
static

Constructor details

sofa::component::collision::ISAPBox::ISAPBox ( )
inline
sofa::component::collision::ISAPBox::ISAPBox ( Cube  c)
inline

Function details

double sofa::component::collision::ISAPBox::curMax ( int  dim) const
inline
double sofa::component::collision::ISAPBox::curMin ( int  dim) const
inline
bool sofa::component::collision::ISAPBox::endPointsAreAlright ( int  ID)
inline

Returns true if the endpoints have id ID and if min end points are min and max are max. It checks only the field data.

bool sofa::component::collision::ISAPBox::endPointsOverlap ( const ISAPBox other,
int  axis 
) const
inline

Returns true if this overlaps other along the dimension axis. For the two following methods, end points are not used but real positions of end points of the field cube.

const core::CollisionElementIterator sofa::component::collision::ISAPBox::finalElement ( ) const
inline
void sofa::component::collision::ISAPBox::init ( int  boxID,
EndPointID **  endPts 
)
inline

Inits _min and _max fiels with endPts. endPts is an one dimension array of EndPointID pointers. After this method, the first three end points are the mins in the dimension 0, 1, 2. The last three end points are the maxs in the dimension 0, 1, 2. Values and IDs of endPts are updated after this method.

EndPointID & sofa::component::collision::ISAPBox::max ( int  dim)
inline
const EndPointID & sofa::component::collision::ISAPBox::max ( int  dim) const
inline
bool sofa::component::collision::ISAPBox::maxMoving ( int  axis,
double  alarmDist 
) const
inline
EndPointID & sofa::component::collision::ISAPBox::min ( int  dim)
inline
const EndPointID & sofa::component::collision::ISAPBox::min ( int  dim) const
inline
bool sofa::component::collision::ISAPBox::minMoving ( int  axis,
double  alarmDist 
) const
inline
bool sofa::component::collision::ISAPBox::moving ( int  axis,
double  alarmDist 
) const
inline

Returns true if the ISAPBox is moving along the dimension axis. i.e., returns true if the value of the end point of dimension axis is different from the end point of the field cube (which is the real position of the ISAPBox).

bool sofa::component::collision::ISAPBox::moving ( double  alarmDist) const
inline

The same than the previous one except that this one checks the three dimensions, i.e. it returns true if the ISAPBox is moving at least along one dimension.

bool sofa::component::collision::ISAPBox::overlaps ( const ISAPBox other,
double  alarmDist 
) const

Returns true if this overlaps other along the three dimensions.

void sofa::component::collision::ISAPBox::show ( ) const
inline
void sofa::component::collision::ISAPBox::showEndPoints ( ) const
inline
double sofa::component::collision::ISAPBox::squaredDistance ( const ISAPBox other) const
void sofa::component::collision::ISAPBox::update ( double  alarmDist)
inline
void sofa::component::collision::ISAPBox::updatedMax ( int  dim,
EndPointID end_point,
double  alarmDist 
) const
inline
void sofa::component::collision::ISAPBox::updatedMin ( int  dim,
EndPointID end_point,
double  alarmDist 
) const
inline
void sofa::component::collision::ISAPBox::updateMax ( int  dim,
double  alarmDist 
)
inline
void sofa::component::collision::ISAPBox::updateMin ( int  dim,
double  alarmDist 
)
inline