Itasca C++ Interface
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
Cube< T > Class Template Reference

A Class representing a cartesian extent in 3D. More...

#include <cube.h>

Public Member Functions

 Cube ()
 Default constructor, no data initialization.
 
 Cube (const T &x1, const T &x2, const T &y1, const T &y2, const T &z1, const T &z2)
 Explicit constructor, by providing all six cartesian extents.
 
 Cube (const Vector3< T > &v111, const Vector3< T > &v222)
 Explicit constructor, by providing the lower-bound and upper-bound as two Vector3.
 
PUSHWARNING Cube (const Cube< T > &r)
 Copy constructor.
 
 Cube (const Extent2< T > &r)
 Explicit contructor, from a Rectangle. The z extent is set to (0,1).
 
POPWARNING const T & x1 () const
 Returns the lower bound of the extent in the x-direction.
 
const T & x2 () const
 Returns the upper bound of the extent in the x-direction.
 
const T & y1 () const
 Returns the lower bound of the extent in the y-direction.
 
const T & y2 () const
 Returns the upper bound of the extent in the y-direction.
 
const T & z1 () const
 Returns the lower bound of the extent in the y-direction.
 
const T & z2 () const
 Returns the upper bound of the extent in the y-direction.
 
const T & dof1 (uint32 dof) const
 Returns the lower bound of degree-of-freedom dof.
 
const T & dof2 (uint32 dof) const
 Returns the upper bound of degree-of-freedom dof.
 
width () const
 Returns the size of the extent in the x-direction.
 
height () const
 Returns the size of the extent in the y-direction.
 
depth () const
 Returns the size of the extent in the z-direction.
 
Vector3< T > centroid () const
 Returns the geometric center of the extent as a Vector3.
 
volume () const
 Returns the volume of the extent ( width() * height() * depth() ).
 
diagonal () const
 Returns the diagonal length of the extent, or the distance from the lower bound corner to the upper bound.
 
Vector3< T > corner (uint32 x, uint32 y, uint32 z) const
 
Vector3< T > c111 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c121 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c211 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c221 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c112 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c122 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c212 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > c222 () const
 Returns one of the eith corners that characterize the extent.
 
Vector3< T > lowerBound () const
 Returns the lower bounding corner of the extent, minimum value of x,y, and z.
 
Vector3< T > upperBound () const
 Returns the upper bounding corner of the extent, maximum value of x,y, and z.
 
Vector3< T > size () const
 Returns the size of the extent as a Vector3(width(),height(),depth()).
 
bool isEmpty () const
 Returns true if the region is "inside out" in any of its three coordinates.
 
bool tolIsEmpty (const double &tol=limits< double >::epsilon() *100) const
 Returns true if the region is "inside out" with a tolerance in any of its three coordinates.
 
bool operator== (const Cube< T > &c) const
 Comparison operator.
 
bool operator!= (const Cube< T > &r) const
 Comparison operator.
 
bool operator< (const Cube< T > &c) const
 Comparison operator, based on volume.
 
bool operator> (const Cube< T > &c) const
 Comparison operator, based on volume.
 
bool isIn (const Vector3< T > &v) const
 Returns true if Vector3 v is "inside" the extent, inclusive.
 
bool isIn (const Cube< T > &c) const
 Returns true if the Cube c falls completely inside (inclusive) the extent.
 
bool tolIsIn (const Vector3< T > &v, const T &tol) const
 Returns true if Vector3 v is "inside" the extent, inclusive with an added tolerance factor.
 
bool tolIsIn (const Cube< T > &c, const T &tol) const
 Returns true if the Cube c falls completely inside (inclusive) the extent with an added tolerance factor.
 
bool intersects (const Cube< T > &c) const
 Returns true if the cube C intersects (inclusive) this extent in any way.
 
bool tolIntersects (const Cube< T > &c, const T &tol) const
 Returns true if the cube C intersects (inclusive) this extent in any way with an added tolerance factor.
 
T & rx1 ()
 Reference access to the minimum x extent.
 
T & rx2 ()
 Reference access to the maximum x extent.
 
T & ry1 ()
 Reference access to the minimum y extent.
 
T & ry2 ()
 Reference access to the maximum y extent.
 
T & rz1 ()
 Reference access to the minimum z extent.
 
T & rz2 ()
 
T & rdof1 (uint32 dof)
 Reference access to lower bound of degree-of-freedom dof.
 
T & rdof2 (uint32 dof)
 Reference access to lower bound of degree-of-freedom dof.
 
void width (const T &t)
 Sets the width of the extent by moving the maximum x extent, keeping the minimum constant.
 
void height (const T &t)
 Sets the height of the extent by moving the maximum y extent, keeping the minimum constant.
 
void depth (const T &t)
 Sets the depth of the extent by moving the maximum z extent, keeping the minimum constant.
 
void c111 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c121 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c211 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c221 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c112 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c122 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c212 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void c222 (const Vector3< T > &v)
 Sets one of the eight characteristic corners of the extent, keeping the other three extents constant.
 
void lowerBound (const Vector3< T > &v)
 Sets the lower bound of the exetnt, keeping the upper bound constant. Synonym to c111().
 
void upperBound (const Vector3< T > &v)
 Sets the upper bound of the exetnt, keeping the lower bound constant. Synonym to c222().
 
void size (const Vector3< T > &v)
 Specifies the size of the extent by moving the upper bound, keeping the lower bound constnat.
 
Vector3< T > bound (const Vector3< T > &v) const
 
const Cube< T > & operator+= (const Vector3< T > &v)
 Adds v to all extent boundaries, effectively translating it.
 
const Cube< T > & operator-= (const Vector3< T > &v)
 Subtracts v from all extent boundaries, effectively translating it.
 
Cube< T > operator+ (const Vector3< T > &v) const
 Returns the extent created ty translating this one v units.
 
Cube< T > operator- (const Vector3< T > &v) const
 Returns the extent created ty translating this one -v units.
 
Cube< T > intersectedWith (const Cube< T > &r) const
 Returns the extemt formed by the intersections of the two extents. May end up empty.
 
const Cube< T > & expandToInclude (const Cube< T > &r)
 Enlarges the extent to include both its original extent and r.
 
const Cube< T > & expandToInclude (const Vector3< T > &v)
 Enlarges the extent to contain v.
 
const Cube< T > & expandToInclude (const T &x, const T &y, const T &z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
Cube< T > expandedToInclude (const Cube< T > &r) const
 Returns an extent large enough to contain this one and r.
 
Cube< T > expandedToInclude (const Vector3< T > &v) const
 Returns an extent large enough to contain this one and the point v.
 
Cube< T > expandedToInclude (const T &x, const T &y, const T &z) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const Cube< T > & expand (const T &tol)
 
Cube< T > expanded (const T &tol) const
 
Cube< T > biggerBy (const T &fact) const
 
const Cube< T > & center (const Vector3< T > &v)
 Centers this rectangle about point v.
 
Cube< T > center (const Vector3< T > &v) const
 Returns a rectangle centered about point v.
 

Static Public Member Functions

static Cube< T > nothing ()
 Returns an Cube with maximum negative size. Useful for calculating bounds.
 

Related Symbols

(Note that these are not member symbols.)

typedef Cube< double > DCube
 
typedef Cube< float > FCube
 
typedef Cube< int32 > ICube
 
typedef Cube< uint32 > UCube
 

Detailed Description

template<class T>
class Cube< T >

A Class representing a cartesian extent in 3D.

Essentially a 3D version of Extent2. Some effort has been made to keep the API the same for Cube and Rectangle, to enable better 2D/3D compilation.

Member Function Documentation

◆ biggerBy()

template<class T >
Cube< T > Cube< T >::biggerBy ( const T & fact) const
inline

Returns an extent expanded by a factor of fact in all directions. The centroid will remain constant.

◆ bound()

template<class T >
Vector3< T > Cube< T >::bound ( const Vector3< T > & v) const
inline

Constrains the point v to fall inside the extent. Any coordinate outside the extent is moved to the minimum or maximum boundary.

◆ corner()

template<class T >
Vector3< T > Cube< T >::corner ( uint32 x,
uint32 y,
uint32 z ) const
inline

This function retrieves the coordinates of the 8 different vertices. x,y,z are either zero or non-zero.

◆ expand()

template<class T >
const Cube< T > & Cube< T >::expand ( const T & tol)
inline

The extent is made bigger by 2*tol in all directions. In other words, each extent component is moved tol units away from the center. The centroid will remain constant.

◆ expanded()

template<class T >
Cube< T > Cube< T >::expanded ( const T & tol) const
inline

Returns an extent that is bigger by 2*tol in all directions. In other words, each extent component is moved tol units away from the center. The centroid will remain constant.

◆ rz2()

template<class T >
T & Cube< T >::rz2 ( )
inline

Reference access to the maximum z extent.


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