MeVisLab Toolbox Reference
ml::CSOBoundingBox Class Reference

The CSOBoundingBox defines an axis parallel bounding box with double precision. More...

#include <CSOBoundingBox.h>

Public Member Functions

 CSOBoundingBox ()
 Constructor. More...
 
 CSOBoundingBox (CSO *cso)
 Constructor. More...
 
 CSOBoundingBox (const Vector3 &bbv1, const Vector3 &bbv2)
 Constructor. More...
 
 CSOBoundingBox (const CSOBoundingBox &bBox)
 Copy constructor. More...
 
 ~CSOBoundingBox ()
 Destructor. More...
 
CSOBoundingBoxoperator= (const CSOBoundingBox &)=default
 default assignment operator More...
 
bool isEmpty () const
 Returns whether this bounding box is empty. More...
 
void makeEmpty ()
 Empties this bounding box (set all values to +/- ML_FLOAT_MAX). More...
 
void correct ()
 Corrects all coordinates, so that the min values are indeed smaller than the max values. More...
 
bool intersects (const CSOBoundingBox &bBox) const
 Returns whether this bounding box intersects with the given bounding box. More...
 
bool intersects (const Vector3 &argv1, const Vector3 &argv2) const
 Returns whether this bounding box intersects with a bounding box given by its two vectors. More...
 
bool intersects (const Vector3 &center, double radius) const
 Returns whether this bounding box intersects a given sphere. More...
 
void set (const Vector3 &argv1, const Vector3 &argv2)
 Sets starting and ending vector for this bounding box. More...
 
CSOBoundingBox unify (const CSOBoundingBox &bBox) const
 Returns the union bounding box of this BB and the given one. More...
 
CSOBoundingBox intersect (const CSOBoundingBox &bBox) const
 Returns the intersection bounding box of this BB and the given one. More...
 
bool containsPoint (double x, double y, double z) const
 Returns whether this bounding box contains the given point. More...
 
bool enclosesSlabWithZPosition (double z) const
 Returns whether the given z-value is in the same slice/slab as this bounding box encloses. More...
 
bool containsBoundingBox (const CSOBoundingBox &innerBoundingBox, const double epsilon=0.0) const
 Returns whether this bounding box encloses the given bounding box fully. More...
 
void augment (float value)
 Augments this bounding box by the given value in all directions. More...
 
CSOBoundingBox getShifted (double dx, double dy, double dz) const
 Returns a bounding box shifted by the given values. More...
 
void makeCubic ()
 Modifies the bounding box so it becomes cubic with all sides as long as the former longest. More...
 
double getSize () const
 Returns the volume or the area of the bounding box, or 0 if empty. More...
 
Vector3 getCenterPoint () const
 Returns the center point of the bounding box. More...
 
void print ()
 Prints the v1/v2 coordinates to the console. For debugging convenience. More...
 

Public Attributes

Vector3 v1
 The x/y/z min values. More...
 
Vector3 v2
 the x/y/z max values. More...
 

Detailed Description

The CSOBoundingBox defines an axis parallel bounding box with double precision.

Definition at line 30 of file CSOBoundingBox.h.

Constructor & Destructor Documentation

◆ CSOBoundingBox() [1/4]

ml::CSOBoundingBox::CSOBoundingBox ( )

Constructor.

◆ CSOBoundingBox() [2/4]

ml::CSOBoundingBox::CSOBoundingBox ( CSO cso)

Constructor.

◆ CSOBoundingBox() [3/4]

ml::CSOBoundingBox::CSOBoundingBox ( const Vector3 bbv1,
const Vector3 bbv2 
)

Constructor.

◆ CSOBoundingBox() [4/4]

ml::CSOBoundingBox::CSOBoundingBox ( const CSOBoundingBox bBox)

Copy constructor.

◆ ~CSOBoundingBox()

ml::CSOBoundingBox::~CSOBoundingBox ( )

Destructor.

Member Function Documentation

◆ augment()

void ml::CSOBoundingBox::augment ( float  value)

Augments this bounding box by the given value in all directions.

◆ containsBoundingBox()

bool ml::CSOBoundingBox::containsBoundingBox ( const CSOBoundingBox innerBoundingBox,
const double  epsilon = 0.0 
) const

Returns whether this bounding box encloses the given bounding box fully.

◆ containsPoint()

bool ml::CSOBoundingBox::containsPoint ( double  x,
double  y,
double  z 
) const

Returns whether this bounding box contains the given point.

◆ correct()

void ml::CSOBoundingBox::correct ( )

Corrects all coordinates, so that the min values are indeed smaller than the max values.

◆ enclosesSlabWithZPosition()

bool ml::CSOBoundingBox::enclosesSlabWithZPosition ( double  z) const

Returns whether the given z-value is in the same slice/slab as this bounding box encloses.

◆ getCenterPoint()

Vector3 ml::CSOBoundingBox::getCenterPoint ( ) const

Returns the center point of the bounding box.

◆ getShifted()

CSOBoundingBox ml::CSOBoundingBox::getShifted ( double  dx,
double  dy,
double  dz 
) const

Returns a bounding box shifted by the given values.

◆ getSize()

double ml::CSOBoundingBox::getSize ( ) const

Returns the volume or the area of the bounding box, or 0 if empty.

◆ intersect()

CSOBoundingBox ml::CSOBoundingBox::intersect ( const CSOBoundingBox bBox) const

Returns the intersection bounding box of this BB and the given one.

◆ intersects() [1/3]

bool ml::CSOBoundingBox::intersects ( const CSOBoundingBox bBox) const

Returns whether this bounding box intersects with the given bounding box.

◆ intersects() [2/3]

bool ml::CSOBoundingBox::intersects ( const Vector3 argv1,
const Vector3 argv2 
) const

Returns whether this bounding box intersects with a bounding box given by its two vectors.

◆ intersects() [3/3]

bool ml::CSOBoundingBox::intersects ( const Vector3 center,
double  radius 
) const

Returns whether this bounding box intersects a given sphere.

◆ isEmpty()

bool ml::CSOBoundingBox::isEmpty ( ) const

Returns whether this bounding box is empty.

◆ makeCubic()

void ml::CSOBoundingBox::makeCubic ( )

Modifies the bounding box so it becomes cubic with all sides as long as the former longest.

◆ makeEmpty()

void ml::CSOBoundingBox::makeEmpty ( )

Empties this bounding box (set all values to +/- ML_FLOAT_MAX).

◆ operator=()

CSOBoundingBox& ml::CSOBoundingBox::operator= ( const CSOBoundingBox )
default

default assignment operator

◆ print()

void ml::CSOBoundingBox::print ( )
inline

Prints the v1/v2 coordinates to the console. For debugging convenience.

Definition at line 103 of file CSOBoundingBox.h.

References CSO_PRINT.

◆ set()

void ml::CSOBoundingBox::set ( const Vector3 argv1,
const Vector3 argv2 
)

Sets starting and ending vector for this bounding box.

The set values are corrected.

◆ unify()

CSOBoundingBox ml::CSOBoundingBox::unify ( const CSOBoundingBox bBox) const

Returns the union bounding box of this BB and the given one.

Member Data Documentation

◆ v1

Vector3 ml::CSOBoundingBox::v1

The x/y/z min values.

Definition at line 107 of file CSOBoundingBox.h.

◆ v2

Vector3 ml::CSOBoundingBox::v2

the x/y/z max values.

Definition at line 109 of file CSOBoundingBox.h.


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