version 3.3

VRS::Bounds Class Reference

3D rectangular, axis parallel volume. More...

#include <vrs/bounds.h>

List of all members.

Public Member Functions

 Bounds ()
 Initializes a zero volume and sets the "defined" flag to false.
 Bounds (const Vector &point)
 Constructs a bounding box with a degenerated volume at the given point.
 Bounds (const Vector &llf, const Vector &urb)
 Constructs a bounding box with a volume spacified by its extremal points.
bool operator== (const Bounds &) const
 Compares bounding boxes.
bool operator!= (const Bounds &) const
 Compares bounding boxes, see operator==.
void addPoint (const Vector &point)
 Extends the volume to contain the given point, if neccessary.
void addVolume (const Bounds &bound)
 Extends the volume to contain the given bounding box, if neccessary.
Boundsoperator+= (const Vector &point)
 Extends the volume to contain the given point, if neccessary.
Boundsoperator+= (const Bounds &bound)
 Extends the volume to contain the given bounding box, if neccessary.
Bounds operator+ (const Vector &point) const
 Builds a volume containing both, the bounding box and the point.
Bounds operator+ (const Bounds &bound) const
 Builds a volume containing both bounding boxes.
Vector getLLF () const
 Returns the lower left front point of the volume.
Vector getURB () const
 Returns the upper right back point of the volume.
Vector point (double x, double y, double z) const
 Returns a point specified by the parameters x, y and z in [0, 1], see center.
Vector center () const
 Returns the center of the bounding box.
Vector diagonal () const
 Returns the vector from llf to urb.
double volume () const
 Returns the volume of the bounding box.
bool isDefined () const
 Returns if the volume object has been specified or is (still) undefined.
bool containsPoint (const Vector &p) const
 Returns if the bounding box contains the given point.
bool containsPointInPlane (const Vector &p, unsigned int a=0, unsigned int b=1) const
bool containsVolume (const Bounds &b) const
 Returns if the bounding box contains the volume of the given bounding box.
bool intersects (const Bounds &b) const
 Returns if there is an intersection volume with the given bounding box.
bool intersectsInPlane (const Bounds &bounds, unsigned int a=0, unsigned int b=1) const
Bounds intersection (const Bounds &bounds) const
 Returns the intersection volume with the given bounding box.
void transform (const Matrix &matrix)
 Transforms the bounding box.
void expand (double factor)
 expands/shrinks the bounding box while keeping the center. factor must be positive. */
 VRS_SERIALIZABLE_NO_SO_CLASS (Bounds)

Friends

VRS_CORE_API std::ostream & operator<< (std::ostream &, const Bounds &)
VRS_CORE_API std::istream & operator>> (std::istream &, Bounds &)


Detailed Description

3D rectangular, axis parallel volume.

Constructor & Destructor Documentation

VRS::Bounds::Bounds (  )  [inline]

Initializes a zero volume and sets the "defined" flag to false.

VRS::Bounds::Bounds ( const Vector point  )  [inline, explicit]

Constructs a bounding box with a degenerated volume at the given point.

VRS::Bounds::Bounds ( const Vector llf,
const Vector urb 
)

Constructs a bounding box with a volume spacified by its extremal points.

llf is the lower left front point and urb the upper right back point.


Member Function Documentation

bool VRS::Bounds::operator== ( const Bounds v  )  const [inline]

Compares bounding boxes.

The boxes are equal, if they match in llf and urb.

bool VRS::Bounds::operator!= ( const Bounds v  )  const [inline]

Compares bounding boxes, see operator==.

void VRS::Bounds::addPoint ( const Vector point  )  [inline]

Extends the volume to contain the given point, if neccessary.

void VRS::Bounds::addVolume ( const Bounds bound  )  [inline]

Extends the volume to contain the given bounding box, if neccessary.

Bounds& VRS::Bounds::operator+= ( const Vector point  ) 

Extends the volume to contain the given point, if neccessary.

Bounds& VRS::Bounds::operator+= ( const Bounds bound  ) 

Extends the volume to contain the given bounding box, if neccessary.

Bounds VRS::Bounds::operator+ ( const Vector point  )  const [inline]

Builds a volume containing both, the bounding box and the point.

Bounds VRS::Bounds::operator+ ( const Bounds bound  )  const [inline]

Builds a volume containing both bounding boxes.

Vector VRS::Bounds::getLLF (  )  const [inline]

Returns the lower left front point of the volume.

Vector VRS::Bounds::getURB (  )  const [inline]

Returns the upper right back point of the volume.

Vector VRS::Bounds::point ( double  x,
double  y,
double  z 
) const

Returns a point specified by the parameters x, y and z in [0, 1], see center.

Vector VRS::Bounds::center (  )  const

Returns the center of the bounding box.

This is a short form for point(0.5, 0.5, 0.5).

Vector VRS::Bounds::diagonal (  )  const

Returns the vector from llf to urb.

double VRS::Bounds::volume (  )  const

Returns the volume of the bounding box.

bool VRS::Bounds::isDefined (  )  const [inline]

Returns if the volume object has been specified or is (still) undefined.

bool VRS::Bounds::containsPoint ( const Vector p  )  const

Returns if the bounding box contains the given point.

bool VRS::Bounds::containsPointInPlane ( const Vector p,
unsigned int  a = 0,
unsigned int  b = 1 
) const

Returns if the bounding box contains the given point. Coordinate comparison is restricted on index a and b (X=0,Y=1,Z=2; default: XY plane).

bool VRS::Bounds::containsVolume ( const Bounds b  )  const

Returns if the bounding box contains the volume of the given bounding box.

bool VRS::Bounds::intersects ( const Bounds b  )  const

Returns if there is an intersection volume with the given bounding box.

bool VRS::Bounds::intersectsInPlane ( const Bounds bounds,
unsigned int  a = 0,
unsigned int  b = 1 
) const

Returns if there is an intersection volume with the given bounding box. Coordinate comparison is restricted on index a and b (X=0,Y=1,Z=2; default: XY plane).

Bounds VRS::Bounds::intersection ( const Bounds bounds  )  const

Returns the intersection volume with the given bounding box.

The result is a (possibly degenerated) volume.

void VRS::Bounds::transform ( const Matrix matrix  ) 

Transforms the bounding box.

The eight corners will be transformated and a new volume will be calculated containing the all transformed points.

void VRS::Bounds::expand ( double  factor  ) 

expands/shrinks the bounding box while keeping the center. factor must be positive. */

VRS::Bounds::VRS_SERIALIZABLE_NO_SO_CLASS ( Bounds   ) 


Friends And Related Function Documentation

VRS_CORE_API std::ostream& operator<< ( std::ostream &  ,
const Bounds  
) [friend]

VRS_CORE_API std::istream& operator>> ( std::istream &  ,
Bounds  
) [friend]


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

Generated on Wed May 22 06:00:21 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact