xmsgrid  1.0
xms::GmExtents3d Class Reference

3D geometric extents (min/max). More...

Public Member Functions

 GmExtents3d ()
 constructor
 
 GmExtents3d (const GmExtents2d &a_extents)
 constructor More...
 
 GmExtents3d (const Pt3d &a_min, const Pt3d &a_max)
 constructor More...
 
 GmExtents3d (const Pt2d &a_min, const Pt2d &a_max)
 constructor More...
 
void operator+= (const GmExtents3d &a_rhs)
 operator += More...
 
void AddToExtents (const Pt3d &pt)
 Add a point to the extents. More...
 
bool IsValid () const
 If we don't have any data we return false. More...
 
bool Overlap (GmExtents3d &a_b) const
 Test to see if two extents overlap. More...
 
void Clear ()
 Resets the extents to defaults. IsValid will return false.
 
bool IsPointWithin (const Pt3d &pt) const
 Tests if the point is inside the extents. More...
 
void GetExtents (double *a_MinX, double *a_MaxX, double *a_MinY, double *a_MaxY, double *a_MinZ, double *a_MaxZ) const
 Gets the extents via the parameters. More...
 
void GetExtents (Pt3d &a_dMin, Pt3d &a_dMax) const
 Gets the extents via the parameters. More...
 
double GetMinX () const
 Gets the minimum x. More...
 
double GetMaxX () const
 Gets the maximum x. More...
 
double GetMinY () const
 Gets the minimum y. More...
 
double GetMaxY () const
 Gets the maximum y. More...
 
double GetMinZ () const
 Gets the minimum z. More...
 
double GetMaxZ () const
 Gets the maximum z. More...
 
Pt3d GetMin () const
 Gets the minimum. More...
 
Pt3d GetMax () const
 Gets the maximum. More...
 
void Set (const Pt3d &a_min, const Pt3d &a_max)
 Sets the min/max. More...
 
template<typename Archive >
void serialize (Archive &archive, const unsigned int version)
 Boost serialize function. More...
 

Static Public Member Functions

static void SetTolerance (double a_Tol)
 Sets the tolerance to use. More...
 
static double GetTolerance ()
 Gets the tolerance in use. More...
 

Protected Attributes

Pt3d m_min
 Minimum, maximum extents.
 
Pt3d m_max
 Maximum, maximum extents.
 

Static Protected Attributes

static double m_tolerance
 Tolerance used in comparisons. More...
 

Detailed Description

3D geometric extents (min/max).

Definition at line 107 of file GmExtents.h.

Constructor & Destructor Documentation

◆ GmExtents3d() [1/3]

xms::GmExtents3d::GmExtents3d ( const GmExtents2d a_extents)
explicit

constructor

Parameters
a_extentsGmExtents2d.

Definition at line 297 of file GmExtents.cpp.

References xms::GmExtents2d::GetMax(), xms::GmExtents2d::GetMin(), m_max, and m_min.

◆ GmExtents3d() [2/3]

xms::GmExtents3d::GmExtents3d ( const Pt3d a_min,
const Pt3d a_max 
)

constructor

Parameters
a_minMinimum.
a_maxMaximum.

Definition at line 278 of file GmExtents.cpp.

◆ GmExtents3d() [3/3]

xms::GmExtents3d::GmExtents3d ( const Pt2d a_min,
const Pt2d a_max 
)

constructor

Parameters
a_minMinimum.
a_maxMaximum.

Definition at line 288 of file GmExtents.cpp.

Member Function Documentation

◆ AddToExtents()

void xms::GmExtents3d::AddToExtents ( const Pt3d pt)

Add a point to the extents.

Parameters
[in]ptA point

Definition at line 319 of file GmExtents.cpp.

References m_max, m_min, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by GmExtents3dUnitTests::testMultiplePts(), GmExtents3dUnitTests::testOverlapping(), and GmExtents3dUnitTests::testSinglePt().

◆ GetExtents() [1/2]

void xms::GmExtents3d::GetExtents ( double *  a_MinX,
double *  a_MaxX,
double *  a_MinY,
double *  a_MaxY,
double *  a_MinZ,
double *  a_MaxZ 
) const

Gets the extents via the parameters.

Parameters
[out]a_MinXMinimum x.
[out]a_MaxXMaximum x.
[out]a_MinYMinimum y.
[out]a_MaxYMaximum y.
[out]a_MinZMinimum z.
[out]a_MaxZMaximum z.

Definition at line 417 of file GmExtents.cpp.

References m_max, m_min, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

◆ GetExtents() [2/2]

void xms::GmExtents3d::GetExtents ( Pt3d a_dMin,
Pt3d a_dMax 
) const

Gets the extents via the parameters.

Parameters
[out]a_dMinMinimum.
[out]a_dMaxMaximum.

Definition at line 454 of file GmExtents.cpp.

References m_max, and m_min.

◆ GetMax()

Pt3d xms::GmExtents3d::GetMax ( ) const

Gets the maximum.

Returns
Maximum.

Definition at line 519 of file GmExtents.cpp.

References m_max.

Referenced by xms::GmExtents2d::GmExtents2d().

◆ GetMaxX()

double xms::GmExtents3d::GetMaxX ( ) const

Gets the maximum x.

Returns
Maximum x.

Definition at line 471 of file GmExtents.cpp.

References m_max, and xms::Pt3< T >::x.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetMaxY()

double xms::GmExtents3d::GetMaxY ( ) const

Gets the maximum y.

Returns
Maximum y.

Definition at line 487 of file GmExtents.cpp.

References m_max, and xms::Pt3< T >::y.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetMaxZ()

double xms::GmExtents3d::GetMaxZ ( ) const

Gets the maximum z.

Returns
Maximum z.

Definition at line 503 of file GmExtents.cpp.

References m_max, and xms::Pt3< T >::z.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetMin()

Pt3d xms::GmExtents3d::GetMin ( ) const

Gets the minimum.

Returns
Minimum.

Definition at line 511 of file GmExtents.cpp.

References m_min.

Referenced by xms::GmExtents2d::GmExtents2d().

◆ GetMinX()

double xms::GmExtents3d::GetMinX ( ) const

Gets the minimum x.

Returns
Minimum x.

Definition at line 463 of file GmExtents.cpp.

References m_min, and xms::Pt3< T >::x.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetMinY()

double xms::GmExtents3d::GetMinY ( ) const

Gets the minimum y.

Returns
Minimum y.

Definition at line 479 of file GmExtents.cpp.

References m_min, and xms::Pt3< T >::y.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetMinZ()

double xms::GmExtents3d::GetMinZ ( ) const

Gets the minimum z.

Returns
Minimum z.

Definition at line 495 of file GmExtents.cpp.

References m_min, and xms::Pt3< T >::z.

Referenced by GmExtents3dUnitTests::testMultiplePts(), and GmExtents3dUnitTests::testSinglePt().

◆ GetTolerance()

double xms::GmExtents3d::GetTolerance ( )
static

Gets the tolerance in use.

Returns
tolerance.

Definition at line 348 of file GmExtents.cpp.

References m_tolerance.

Referenced by GmExtents3dUnitTests::testOverlapping().

◆ IsPointWithin()

bool xms::GmExtents3d::IsPointWithin ( const Pt3d pt) const

Tests if the point is inside the extents.

Parameters
[out]ptA point
Returns
true if point is inside or on.

Definition at line 403 of file GmExtents.cpp.

References m_max, m_min, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

◆ IsValid()

bool xms::GmExtents3d::IsValid ( ) const

If we don't have any data we return false.

Returns
true if we have data.

Definition at line 332 of file GmExtents.cpp.

References m_max, m_min, and xms::Pt3< T >::x.

Referenced by GmExtents3dUnitTests::testMultiplePts(), GmExtents3dUnitTests::testNoPts(), GmExtents3dUnitTests::testOverlapping(), and GmExtents3dUnitTests::testSinglePt().

◆ operator+=()

void xms::GmExtents3d::operator+= ( const GmExtents3d a_rhs)

operator +=

Parameters
[in]a_rhsGmExtents2d

Definition at line 306 of file GmExtents.cpp.

References m_max, m_min, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

◆ Overlap()

bool xms::GmExtents3d::Overlap ( GmExtents3d a_b) const

Test to see if two extents overlap.

Parameters
[in]a_bThe other extents.
Returns
true if they overlap.

Definition at line 357 of file GmExtents.cpp.

References m_max, m_min, m_tolerance, xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by GmExtents3dUnitTests::testOverlapping().

◆ serialize()

template<typename Archive >
void xms::GmExtents3d::serialize ( Archive &  archive,
const unsigned int  version 
)

Boost serialize function.

Parameters
[in,out]archiveAn archive.
[in]versionThe version number.

Definition at line 162 of file GmExtents.h.

References m_max, m_min, and m_tolerance.

◆ Set()

void xms::GmExtents3d::Set ( const Pt3d a_min,
const Pt3d a_max 
)

Sets the min/max.

Parameters
[in]a_minThe minimum extents.
[in]a_maxThe maximum extents.

Definition at line 528 of file GmExtents.cpp.

References m_max, and m_min.

◆ SetTolerance()

void xms::GmExtents3d::SetTolerance ( double  a_Tol)
static

Sets the tolerance to use.

Parameters
[in]a_TolThe tolerance.

Definition at line 340 of file GmExtents.cpp.

References m_tolerance.

Referenced by GmExtents3dUnitTests::testOverlapping().

Member Data Documentation

◆ m_tolerance

double xms::GmExtents3d::m_tolerance
staticprotected

Tolerance used in comparisons.

Tolerance. Static ?

Definition at line 153 of file GmExtents.h.

Referenced by GetTolerance(), Overlap(), serialize(), and SetTolerance().


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