xmsgeom  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 108 of file GmExtents.h.

Constructor & Destructor Documentation

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

constructor

Parameters
a_extentsGmExtents2d.

Definition at line 298 of file GmExtents.cpp.

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

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

constructor

Parameters
a_minMinimum.
a_maxMaximum.

Definition at line 279 of file GmExtents.cpp.

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

constructor

Parameters
a_minMinimum.
a_maxMaximum.

Definition at line 289 of file GmExtents.cpp.

Member Function Documentation

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

Add a point to the extents.

Parameters
[in]ptA point

Definition at line 320 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().

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 418 of file GmExtents.cpp.

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

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 455 of file GmExtents.cpp.

References m_max, and m_min.

Pt3d xms::GmExtents3d::GetMax ( ) const

Gets the maximum.

Returns
Maximum.

Definition at line 520 of file GmExtents.cpp.

References m_max.

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

double xms::GmExtents3d::GetMaxX ( ) const

Gets the maximum x.

Returns
Maximum x.

Definition at line 472 of file GmExtents.cpp.

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

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

double xms::GmExtents3d::GetMaxY ( ) const

Gets the maximum y.

Returns
Maximum y.

Definition at line 488 of file GmExtents.cpp.

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

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

double xms::GmExtents3d::GetMaxZ ( ) const

Gets the maximum z.

Returns
Maximum z.

Definition at line 504 of file GmExtents.cpp.

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

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

Pt3d xms::GmExtents3d::GetMin ( ) const

Gets the minimum.

Returns
Minimum.

Definition at line 512 of file GmExtents.cpp.

References m_min.

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

double xms::GmExtents3d::GetMinX ( ) const

Gets the minimum x.

Returns
Minimum x.

Definition at line 464 of file GmExtents.cpp.

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

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

double xms::GmExtents3d::GetMinY ( ) const

Gets the minimum y.

Returns
Minimum y.

Definition at line 480 of file GmExtents.cpp.

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

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

double xms::GmExtents3d::GetMinZ ( ) const

Gets the minimum z.

Returns
Minimum z.

Definition at line 496 of file GmExtents.cpp.

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

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

double xms::GmExtents3d::GetTolerance ( )
static

Gets the tolerance in use.

Returns
tolerance.

Definition at line 349 of file GmExtents.cpp.

References m_tolerance.

Referenced by GmExtents3dUnitTests::testOverlapping().

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 404 of file GmExtents.cpp.

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

bool xms::GmExtents3d::IsValid ( ) const

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

Returns
true if we have data.

Definition at line 333 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().

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

operator +=

Parameters
[in]a_rhsGmExtents2d

Definition at line 307 of file GmExtents.cpp.

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

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 358 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().

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 163 of file GmExtents.h.

References m_max, m_min, and m_tolerance.

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 529 of file GmExtents.cpp.

References m_max, and m_min.

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

Sets the tolerance to use.

Parameters
[in]a_TolThe tolerance.

Definition at line 341 of file GmExtents.cpp.

References m_tolerance.

Referenced by GmExtents3dUnitTests::testOverlapping().

Member Data Documentation

double xms::GmExtents3d::m_tolerance
staticprotected

Tolerance used in comparisons.

Tolerance. Static ?

Definition at line 154 of file GmExtents.h.

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


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