UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
U3dBox Class Reference

#include <u3d_box.hpp>

Public Member Functions

 U3dBox ()
 
 U3dBox (double x_size, double y_size, double z_size)
 
 U3dBox (const U3dPoint &p1, const U3dPoint &p2)
 
 U3dBox (const U3dPoint &p, double x_size, double y_size, double z_size)
 
 U3dBox (const U3dBox &box)
 
U3D_BOX_STATE validate (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) const
 
bool checkOverlay (const U3dBox &box) const
 
BOX_TRI_INT intersectWithTriangle (const U3dTriangle &triangle, const U3dPoint &p1, const U3dPoint &p2, const U3dPoint &p3)
 
bool intersectWithSegment (U3dPoint pA, U3dPoint pB)
 
bool checkInside (const U3dPoint &p) const
 
bool checkDefinitelyInside (const U3dPoint &p) const
 
bool checkInsideEps (const U3dPoint &p) const
 
double getXMin () const
 
double getXMax () const
 
double getYMin () const
 
double getYMax () const
 
double getZMin () const
 
double getZMax () const
 
void setCoords (const double &xmin, const double &xmax, const double &ymin, const double &ymax, const double &zmin, const double &zmax)
 
int setXMin (double)
 
int setXMax (double)
 
int setYMin (double)
 
int setYMax (double)
 
int setZMin (double)
 
int setZMax (double)
 
double getXSize () const
 
double getYSize () const
 
double getZSize () const
 
double getDiag () const
 
U3dPoint getCenter ()
 
U3dPoint getInitPoint ()
 
U3dPoint getLimitPoint ()
 
int operator== (const U3dBox &rbox) const
 
int operator!= (const U3dBox &rbox) const
 
 U3dBox ()
 
 U3dBox (double x_size, double y_size, double z_size)
 
 U3dBox (const U3dPoint &p1, const U3dPoint &p2)
 
 U3dBox (const U3dPoint &p, double x_size, double y_size, double z_size)
 
 U3dBox (const U3dBox &box)
 
U3D_BOX_STATE validate (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) const
 
bool checkOverlay (const U3dBox &box) const
 
BOX_TRI_INT intersectWithTriangle (const U3dTriangle &triangle, const U3dPoint &p1, const U3dPoint &p2, const U3dPoint &p3)
 
bool intersectWithSegment (U3dPoint pA, U3dPoint pB)
 
bool checkInside (const U3dPoint &p) const
 
bool checkDefinitelyInside (const U3dPoint &p) const
 
bool checkInsideEps (const U3dPoint &p) const
 
double getXMin () const
 
double getXMax () const
 
double getYMin () const
 
double getYMax () const
 
double getZMin () const
 
double getZMax () const
 
void setCoords (const double &xmin, const double &xmax, const double &ymin, const double &ymax, const double &zmin, const double &zmax)
 
int setXMin (double)
 
int setXMax (double)
 
int setYMin (double)
 
int setYMax (double)
 
int setZMin (double)
 
int setZMax (double)
 
double getXSize () const
 
double getYSize () const
 
double getZSize () const
 
double getDiag () const
 
U3dPoint getCenter ()
 
U3dPoint getInitPoint ()
 
U3dPoint getLimitPoint ()
 
int operator== (const U3dBox &rbox) const
 
int operator!= (const U3dBox &rbox) const
 

Protected Attributes

double m_x_range [2]
 
double m_y_range [2]
 
double m_z_range [2]
 
double fXRange [2]
 
double fYRange [2]
 
double fZRange [2]
 

Detailed Description

A 3D rectangular object which has all edges parallel to XOY, XOZ, YOZ planes

Constructor & Destructor Documentation

U3dBox::U3dBox ( )

Empty constructor

U3dBox::U3dBox ( double  x_size,
double  y_size,
double  z_size 
)

Create box with given size started at (0,0,0) point.

U3dBox::U3dBox ( const U3dPoint p1,
const U3dPoint p2 
)

Create box from two diagonal points.

U3dBox::U3dBox ( const U3dPoint p,
double  x_size,
double  y_size,
double  z_size 
)

Create box from given diagonal point and sizes.

U3dBox::U3dBox ( const U3dBox box)

Create copy of given box.

U3dBox::U3dBox ( )

Empty constructor

U3dBox::U3dBox ( double  x_size,
double  y_size,
double  z_size 
)

Create box with given size started at (0,0,0) point.

U3dBox::U3dBox ( const U3dPoint p1,
const U3dPoint p2 
)

Create box from two diagonal points.

U3dBox::U3dBox ( const U3dPoint p,
double  x_size,
double  y_size,
double  z_size 
)

Create box from given diagonal point and sizes.

U3dBox::U3dBox ( const U3dBox box)

Create copy of given box.

Member Function Documentation

bool U3dBox::checkDefinitelyInside ( const U3dPoint p) const

Check the point is inside the box (except box faces)

bool U3dBox::checkDefinitelyInside ( const U3dPoint p) const

Check the point is inside the box (except box faces)

bool U3dBox::checkInside ( const U3dPoint p) const

Check the point is inside the box (including box faces)

bool U3dBox::checkInside ( const U3dPoint p) const

Check the point is inside the box (including box faces)

bool U3dBox::checkInsideEps ( const U3dPoint p) const

Check the point is inside the box (with precision = U3D_EPSILON - see u3d_defines.hpp)

bool U3dBox::checkInsideEps ( const U3dPoint p) const

Check the point is inside the box (with precision = U3D_EPSILON - see u3d_defines.hpp)

bool U3dBox::checkOverlay ( const U3dBox box) const

Check if the given 3dBox overlays with other 3dBox (returns true if these boxes have common face)

bool U3dBox::checkOverlay ( const U3dBox box) const

Check if the given 3dBox overlays with other 3dBox (returns true if these boxes have common face)

U3dPoint U3dBox::getCenter ( )

Get coordinates of the box center point

U3dPoint U3dBox::getCenter ( )

Get coordinates of the box center point

double U3dBox::getDiag ( ) const

Get box diagonal value

double U3dBox::getDiag ( ) const

Get box diagonal value

U3dPoint U3dBox::getInitPoint ( )

Get coordinates of the box minimal point

U3dPoint U3dBox::getInitPoint ( )

Get coordinates of the box minimal point

U3dPoint U3dBox::getLimitPoint ( )

Get coordinates of the box maximal point

U3dPoint U3dBox::getLimitPoint ( )

Get coordinates of the box maximal point

double U3dBox::getXMax ( ) const
inline

Get max value of x coordinate range.

double U3dBox::getXMax ( ) const

Get max value of x coordinate range.

double U3dBox::getXMin ( ) const
inline

Get min value of x coordinate range.

double U3dBox::getXMin ( ) const

Get min value of x coordinate range.

double U3dBox::getXSize ( ) const
inline

Get x size of the box.

double U3dBox::getXSize ( ) const

Get x size of the box.

double U3dBox::getYMax ( ) const
inline

Get max value of y coordinate range.

double U3dBox::getYMax ( ) const

Get max value of y coordinate range.

double U3dBox::getYMin ( ) const

Get min value of y coordinate range.

double U3dBox::getYMin ( ) const
inline

Get min value of y coordinate range.

double U3dBox::getYSize ( ) const
inline

Get y size of the box.

double U3dBox::getYSize ( ) const

Get y size of the box.

double U3dBox::getZMax ( ) const

Get max value of z coordinate range.

double U3dBox::getZMax ( ) const
inline

Get max value of z coordinate range.

double U3dBox::getZMin ( ) const
inline

Get min value of z coordinate range.

double U3dBox::getZMin ( ) const

Get min value of z coordinate range.

double U3dBox::getZSize ( ) const
inline

Get z size of the box.

double U3dBox::getZSize ( ) const

Get z size of the box.

bool U3dBox::intersectWithSegment ( U3dPoint  pA,
U3dPoint  pB 
)

Check if the 3dBox intersects with segment pA-pB

bool U3dBox::intersectWithSegment ( U3dPoint  pA,
U3dPoint  pB 
)

Check if the 3dBox intersects with segment pA-pB

BOX_TRI_INT U3dBox::intersectWithTriangle ( const U3dTriangle triangle,
const U3dPoint p1,
const U3dPoint p2,
const U3dPoint p3 
)

Check if the 3dBox intersects with triangle defined by p1, p2, p3

BOX_TRI_INT U3dBox::intersectWithTriangle ( const U3dTriangle triangle,
const U3dPoint p1,
const U3dPoint p2,
const U3dPoint p3 
)

Check if the 3dBox intersects with triangle defined by p1, p2, p3

int U3dBox::operator!= ( const U3dBox rbox) const
inline

Return FALSE in case of two boxes are equal (m_x_range, m_y_range, m_z_range) and true otherwise.

int U3dBox::operator!= ( const U3dBox rbox) const
inline

Return FALSE in case of two boxes are equal (fXRange, fYRange, fZRange) and true otherwise.

int U3dBox::operator== ( const U3dBox rbox) const

Return true in case of two boxes are equal (fXRange, fYRange, fZRange) and FALSE otherwise.

int U3dBox::operator== ( const U3dBox rbox) const

Return true in case of two boxes are equal (m_x_range, m_y_range, m_z_range) and FALSE otherwise.

void U3dBox::setCoords ( const double &  xmin,
const double &  xmax,
const double &  ymin,
const double &  ymax,
const double &  zmin,
const double &  zmax 
)

Set coordinates of box without check if they are valid

void U3dBox::setCoords ( const double &  xmin,
const double &  xmax,
const double &  ymin,
const double &  ymax,
const double &  zmin,
const double &  zmax 
)
inline

Set coordinates of box without check if they are valid

int U3dBox::setXMax ( double  )

Set max value of x coordinate range.

int U3dBox::setXMax ( double  xMax)
inline

Set max value of x coordinate range.

int U3dBox::setXMin ( double  xMin)
inline

Set min value of x coordinate range.

int U3dBox::setXMin ( double  )

Set min value of x coordinate range.

int U3dBox::setYMax ( double  yMax)
inline

Set max value of y coordinate range.

int U3dBox::setYMax ( double  )

Set max value of y coordinate range.

int U3dBox::setYMin ( double  yMin)
inline

Set min value of y coordinate range.

int U3dBox::setYMin ( double  )

Set min value of y coordinate range.

int U3dBox::setZMax ( double  zMax)
inline

Set max value of z coordinate range.

int U3dBox::setZMax ( double  )

Set max value of z coordinate range.

int U3dBox::setZMin ( double  )

Set min value of z coordinate range.

int U3dBox::setZMin ( double  zMin)
inline

Set min value of z coordinate range.

Member Data Documentation

double U3dBox::fXRange[2]
protected

Range of x coordinates.

double U3dBox::fYRange[2]
protected

Range of y coordinates.

double U3dBox::fZRange[2]
protected

Range of z coordinates.

double U3dBox::m_x_range[2]
protected

Range of x coordinates.

double U3dBox::m_y_range[2]
protected

Range of y coordinates.

double U3dBox::m_z_range[2]
protected

Range of z coordinates.


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