Version: 5.1.6

INTERP_KERNEL.BoundingBox Class Reference

Class representing the bounding box of a number of points. More...

#include <BoundingBox.hxx>

Public Types

enum  BoxCoord {
  XMIN = 0, YMIN = 1, ZMIN = 2, XMAX = 3,
  YMAX = 4, ZMAX = 5
}
 

Enumeration representing the six coordinates that define the bounding box.

More...

Public Member Functions

 BoundingBox (const double **pts, const unsigned numPts)
 Constructor creating box from an array of the points corresponding to the vertices of the element.
 BoundingBox (const BoundingBox &box1, const BoundingBox &box2)
 Constructor creating box from union of two boxes, resulting in a box that encloses both of them.
 ~BoundingBox ()
 Destructor.
bool isDisjointWith (const BoundingBox &box) const
 Determines if the intersection with a given box is empty.
void setCoordinate (const BoxCoord coord, double value)
 Sets a coordinate of the box to a given value.
double getCoordinate (const BoxCoord coord) const
 Gets a coordinate of the box.
void updateWithPoint (const double *pt)
 Updates the bounding box to include a given point.
void dumpCoords () const
 Prints the coordinates of the box to std.cout.

Private Member Functions

bool isValid () const
 Checks if the box is valid, which it is if its minimum coordinates are smaller than its maximum coordinates in all directions.
 BoundingBox (const BoundingBox &box)
 disallow copying
BoundingBoxoperator= (const BoundingBox &box)
 disallow assignment

Private Attributes

double_coords
 Vector containing the coordinates of the box interlaced in the order XMIN, YMIN, ZMIN, XMAX, YMAX, ZMAX.

Detailed Description

Class representing the bounding box of a number of points.


Member Enumeration Documentation

Enumeration representing the six coordinates that define the bounding box.

Enumerator:
XMIN 
YMIN 
ZMIN 
XMAX 
YMAX 
ZMAX 

Constructor & Destructor Documentation

INTERP_KERNEL.BoundingBox::BoundingBox ( const double **  pts,
const unsigned  numPts 
)

Constructor creating box from an array of the points corresponding to the vertices of the element.

Each point is represented by an array of three doubles.

Parameters:
pts array of points
numPts number of vertices

References INTERP_KERNEL.BoundingBox._coords, INTERP_KERNEL.BoundingBox.isValid(), INTERP_KERNEL.BoundingBox.updateWithPoint(), INTERP_KERNEL.BoundingBox.XMIN, and INTERP_KERNEL.BoundingBox.ZMIN.

INTERP_KERNEL.BoundingBox::BoundingBox ( const BoundingBox box1,
const BoundingBox box2 
)

Constructor creating box from union of two boxes, resulting in a box that encloses both of them.

Parameters:
box1 the first box
box2 the second box

References INTERP_KERNEL.BoundingBox._coords, INTERP_KERNEL.BoundingBox.isValid(), INTERP_KERNEL.BoundingBox.XMIN, and INTERP_KERNEL.BoundingBox.ZMIN.

INTERP_KERNEL.BoundingBox::~BoundingBox (  ) 

Destructor.

References INTERP_KERNEL.BoundingBox._coords.

INTERP_KERNEL.BoundingBox.BoundingBox ( const BoundingBox box  )  [private]

disallow copying


Member Function Documentation

bool INTERP_KERNEL.BoundingBox::isDisjointWith ( const BoundingBox box  )  const

Determines if the intersection with a given box is empty.

Parameters:
box BoundingBox with which intersection is tested
Returns:
true if intersection between boxes is empty, false if not

References INTERP_KERNEL.BoundingBox._coords, INTERP_KERNEL.BoundingBox.getCoordinate(), INTERP_KERNEL.BoundingBox.XMIN, and INTERP_KERNEL.BoundingBox.ZMIN.

void INTERP_KERNEL.BoundingBox::setCoordinate ( const BoxCoord  coord,
double  value 
)

Sets a coordinate of the box to a given value.

Parameters:
coord coordinate to set
value new value for coordinate

References INTERP_KERNEL.BoundingBox._coords.

double INTERP_KERNEL.BoundingBox::getCoordinate ( const BoxCoord  coord  )  const

Gets a coordinate of the box.

Parameters:
coord coordinate to get
Returns:
value of coordinate

References INTERP_KERNEL.BoundingBox._coords.

void INTERP_KERNEL.BoundingBox::updateWithPoint ( const double pt  ) 

Updates the bounding box to include a given point.

Parameters:
pt point to be included

References INTERP_KERNEL.BoundingBox._coords, INTERP_KERNEL.BoundingBox.XMIN, and INTERP_KERNEL.BoundingBox.ZMIN.

void INTERP_KERNEL.BoundingBox::dumpCoords (  )  const
bool INTERP_KERNEL.BoundingBox::isValid (  )  const [private]

Checks if the box is valid, which it is if its minimum coordinates are smaller than its maximum coordinates in all directions.

Returns:
true if the box is valid, false if not

References INTERP_KERNEL.BoundingBox._coords, INTERP_KERNEL.BoundingBox.XMIN, and INTERP_KERNEL.BoundingBox.ZMIN.

BoundingBox& INTERP_KERNEL.BoundingBox.operator= ( const BoundingBox box  )  [private]

disallow assignment


Field Documentation

Vector containing the coordinates of the box interlaced in the order XMIN, YMIN, ZMIN, XMAX, YMAX, ZMAX.