SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::component::collision::detection::algorithm::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

collision::geometry::Cube cube
 
EndPointID_min [3]
 
EndPointID_max [3]
 

Static Public Attributes

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

Public Member Functions

 ISAPBox ()
 
 ISAPBox (collision::geometry::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

◆ _max

EndPointID* sofa::component::collision::detection::algorithm::ISAPBox::_max[3]

◆ _min

EndPointID* sofa::component::collision::detection::algorithm::ISAPBox::_min[3]

◆ cube

collision::geometry::Cube sofa::component::collision::detection::algorithm::ISAPBox::cube

◆ tolerance

double sofa::component::collision::detection::algorithm::ISAPBox::tolerance = (double)(1e-7)
static

Constructor details

◆ ISAPBox() [1/2]

sofa::component::collision::detection::algorithm::ISAPBox::ISAPBox ( )
inline

◆ ISAPBox() [2/2]

sofa::component::collision::detection::algorithm::ISAPBox::ISAPBox ( collision::geometry::Cube  c)
inline

Function details

◆ curMax()

double sofa::component::collision::detection::algorithm::ISAPBox::curMax ( int  dim) const
inline

◆ curMin()

double sofa::component::collision::detection::algorithm::ISAPBox::curMin ( int  dim) const
inline

◆ endPointsAreAlright()

bool sofa::component::collision::detection::algorithm::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.

◆ endPointsOverlap()

bool sofa::component::collision::detection::algorithm::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.

◆ finalElement()

const core::CollisionElementIterator sofa::component::collision::detection::algorithm::ISAPBox::finalElement ( ) const
inline

◆ init()

void sofa::component::collision::detection::algorithm::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.

◆ max() [1/2]

EndPointID & sofa::component::collision::detection::algorithm::ISAPBox::max ( int  dim)
inline

◆ max() [2/2]

const EndPointID & sofa::component::collision::detection::algorithm::ISAPBox::max ( int  dim) const
inline

◆ maxMoving()

bool sofa::component::collision::detection::algorithm::ISAPBox::maxMoving ( int  axis,
double  alarmDist 
) const
inline

◆ min() [1/2]

EndPointID & sofa::component::collision::detection::algorithm::ISAPBox::min ( int  dim)
inline

◆ min() [2/2]

const EndPointID & sofa::component::collision::detection::algorithm::ISAPBox::min ( int  dim) const
inline

◆ minMoving()

bool sofa::component::collision::detection::algorithm::ISAPBox::minMoving ( int  axis,
double  alarmDist 
) const
inline

◆ moving() [1/2]

bool sofa::component::collision::detection::algorithm::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.

◆ moving() [2/2]

bool sofa::component::collision::detection::algorithm::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).

◆ overlaps()

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

Returns true if this overlaps other along the three dimensions.

◆ show()

void sofa::component::collision::detection::algorithm::ISAPBox::show ( ) const
inline

◆ showEndPoints()

void sofa::component::collision::detection::algorithm::ISAPBox::showEndPoints ( ) const
inline

◆ squaredDistance()

double sofa::component::collision::detection::algorithm::ISAPBox::squaredDistance ( const ISAPBox other) const

◆ update()

void sofa::component::collision::detection::algorithm::ISAPBox::update ( double  alarmDist)
inline

◆ updatedMax()

void sofa::component::collision::detection::algorithm::ISAPBox::updatedMax ( int  dim,
EndPointID end_point,
double  alarmDist 
) const
inline

◆ updatedMin()

void sofa::component::collision::detection::algorithm::ISAPBox::updatedMin ( int  dim,
EndPointID end_point,
double  alarmDist 
) const
inline

◆ updateMax()

void sofa::component::collision::detection::algorithm::ISAPBox::updateMax ( int  dim,
double  alarmDist 
)
inline

◆ updateMin()

void sofa::component::collision::detection::algorithm::ISAPBox::updateMin ( int  dim,
double  alarmDist 
)
inline