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

2D cartesian region in space. More...

#include <extent2.h>

Public Member Functions

 Extent2 ()
 Default constructor, no data initialization.
 
 Extent2 (const T &x1, const T &x2, const T &y1, const T &y2)
 Explicit constructor, given the x and y extents.
 
 Extent2 (const Vector2< T > &v11, const Vector2< T > &v22)
 Explicit constructor, given the lower and upper bounds as two Vector2.
 
 Extent2 (const Extent2< T > &r)
 Copy constructor.
 
constexpr const Extent2operator= (const Extent2 &e)
 
const T & x1 () const
 Returns the lower x-bound.
 
const T & x2 () const
 Returns the upper x-bound.
 
const T & y1 () const
 Returns the lower y-bound.
 
const T & y2 () const
 Returns the upper y-bound.
 
const T & dof1 (uint32 u) const
 Returns the lower bound of degree-of-freedom dof.
 
const T & dof2 (uint32 u) const
 Returns the upper bound of degree-of-freedom dof.
 
width () const
 Returns the size of the x-extent (x2-x1)
 
height () const
 Return sthe size of the y-extent (y2-y1)
 
Vector2< T > centroid () const
 Returns the centroid of the Extent2 as a Vector2.
 
Vector2< T > c11 () const
 Returns one of the four characteristic corners of the 2D extent.
 
Vector2< T > c12 () const
 Returns one of the four characteristic corners of the 2D extent.
 
Vector2< T > c21 () const
 Returns one of the four characteristic corners of the 2D extent.
 
Vector2< T > c22 () const
 Returns one of the four characteristic corners of the 2D extent.
 
Vector2< T > lowerBound () const
 Returns the lower bound of the Extent2 (minimum x and y corner).
 
Vector2< T > upperBound () const
 Returns the upper bound of the Extent2 (maximum x and y corner).
 
Vector2< T > size () const
 Returns the size of the Extent2, the width() and height() encoded as a Vector2.
 
area () const
 Returns the width()*height() - could be negative.
 
volume () const
 Returns the volume of the extent assuming unit depth ( width() * height()).
 
diagonal () const
 Returns the length of the diagonal from the lower bound to the upper bound.
 
bool isEmpty () const
 Returns true if the area of the Extent2 is <= 0.
 
bool tolIsEmpty (const double &tol=limits< double >::epsilon() *100) const
 Returns true if the area of the Extent2 is <= 0 with a tolerance.
 
bool operator== (const Extent2< T > &r) const
 Comparison operator, no tolerance applied.
 
bool operator!= (const Extent2< T > &r) const
 Comparison operator, no tolerance applied.
 
bool operator< (const Extent2< T > &r) const
 Comparison operator, using area() as a metric.
 
bool operator> (const Extent2< T > &r) const
 Comparison operator, using area() as a metric.
 
bool isIn (const Vector2< T > &v) const
 Returns true if point v is inside (inclusive) the Extent2.
 
bool isIn (const Extent2< T > &r) const
 Returns true Extent2 v is inside (inclusive) the Extent2.
 
bool tolIsIn (const Vector2< T > &v, const T &tol) const
 Returns true if point v is inside (inclusive) the Extent2 with an added tolerance factor.
 
bool tolIsIn (const Extent2< T > &r, const T &tol) const
 Returns true Extent2 v is inside (inclusive) the Extent2 with an added tolerance factor.
 
bool intersects (const Extent2< T > &r) const
 Returns true if Extent2 r intersects (inclusive) the Extent2.
 
bool tolIntersects (const Extent2< T > &r, const T &tol) const
 Returns true if Extent2 r intersects (inclusive) the Extent2 with an added tolerance factor.
 
T & rx1 ()
 Access reference to the minimum x extent.
 
T & rx2 ()
 Access reference to the maximum x extent.
 
T & ry1 ()
 Access reference to the minimum y extent.
 
T & ry2 ()
 Access reference to the maximum y extent.
 
T & rdof1 (uint32 u)
 Reference access to lower bound of degree-of-freedom dof.
 
T & rdof2 (uint32 u)
 Reference access to lower bound of degree-of-freedom dof.
 
void width (const T &t)
 Sets the width of the Extent2 by moving the maximum x extent, leaving the minimum alone.
 
void height (const T &t)
 Sets the height of the Extent2 by moving the maximum y extent, leaving the minimum alone.
 
void c11 (const Vector2< T > &v)
 Sets one of the four characteristic corners of the extent, leaving the other two values alone.
 
void c12 (const Vector2< T > &v)
 Sets one of the four characteristic corners of the extent, leaving the other two values alone.
 
void c21 (const Vector2< T > &v)
 Sets one of the four characteristic corners of the extent, leaving the other two values alone.
 
void c22 (const Vector2< T > &v)
 Sets one of the four characteristic corners of the extent, leaving the other two values alone.
 
void lowerBound (const Vector2< T > &v)
 Sets the lower bound of the Extent2, leaving the upper bound alone.
 
void upperBound (const Vector2< T > &v)
 Sets the upper bound of the Extent2, leaving the lower bound alone.
 
void size (const Vector2< T > &v)
 Sets the size of the Extent2 by moving the maximum x and y extents, leaving the minimum alone.
 
Vector2< T > bound (const Vector2< T > &v) const
 Forces the point v to fall within the Extent2, by clamping the x and y values to fall within it's extent.
 
const Extent2< T > & operator+= (const Vector2< T > &v)
 In place addition operator, offsets the exent by v.
 
const Extent2< T > & operator-= (const Vector2< T > &v)
 In place subtraction operator, offsets the exent by -v.
 
Extent2< T > operator+ (const Vector2< T > &v) const
 Binary addition operator, returns a Extent2 offset by v.
 
Extent2< T > operator- (const Vector2< T > &v) const
 Binary subtraction operator, returns a Extent2 offset by -v.
 
Extent2< T > intersectedWith (const Extent2< T > &r) const
 
const Extent2< T > & expandToInclude (const Extent2< T > &r)
 Expands the extent of this Extent2 as necessary to completely include r.
 
const Extent2< T > & expandToInclude (const Vector2< T > &v)
 Expands the extent of this Extent2 as necessary to completely include point v.
 
Extent2< T > expandedToInclude (const Extent2< T > &r) const
 Returns a Extent2 expanded to completely include r.
 
Extent2< T > expandedToInclude (const Vector2< T > &v) const
 Returns a Extent2 expanded to include point v..
 
const Extent2< T > & expand (const T &tol)
 
Extent2< T > expanded (const T &tol) const
 
const Extent2< T > & center (const Vector2< T > &v)
 Centers this Extent2 about point v.
 
Extent2< T > center (const Vector2< T > &v) const
 Returns a Extent2 centered about point v.
 
Extent2< T > biggerBy (const T &fact) const
 

Static Public Member Functions

static constexpr Extent2< T > nothing ()
 Static function returning object with maximum negative size, useful for calculating bounds.
 

Related Symbols

(Note that these are not member symbols.)

typedef Extent2< double > DExtent2
 
typedef Extent2< float > FExtent2
 
typedef Extent2< int32 > IExtent2
 
typedef Extent2< uint32 > UExtent2
 
typedef Extent2< int64 > I64Extent2
 
typedef Extent2< uint64 > U64Extent2
 

Detailed Description

template<class T>
class Extent2< T >

2D cartesian region in space.

Member Function Documentation

◆ biggerBy()

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

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

◆ expand()

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

Expands this Extent2 by 2*tol in all directions. The centroid will remain the same.

◆ expanded()

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

Returns Extent2 bigger by 2*tol in all directions. The centroid will remain the same.

◆ intersectedWith()

template<class T >
Extent2< T > Extent2< T >::intersectedWith ( const Extent2< T > & r) const
inline

Returns a Extent2 representing the intersection (inclusive) of this with r. The returned extent may be "empty" (have zero or negative area).


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