xmsgrid  1.0
xms::GmExtents2d Class Reference

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

Public Member Functions

 GmExtents2d ()
 constructor
 
 GmExtents2d (const GmExtents3d &a_extents)
 constructor More...
 
 GmExtents2d (const Pt2d &a_min, const Pt2d &a_max)
 constructor More...
 
 GmExtents2d (const Pt3d &a_min, const Pt3d &a_max)
 constructor More...
 
virtual ~GmExtents2d ()
 destructor
 
void operator+= (const GmExtents2d &a_rhs)
 operator += More...
 
virtual void AddToExtents (const Pt3d &pt)
 Add a point to the extents. More...
 
template<class ItrType >
void Add (ItrType a_begin, ItrType a_end)
 Adds a range defined by two iterators to the extents. More...
 
bool IsValid ()
 If we don't have any data we return false. More...
 
bool Overlap (const GmExtents2d &a_b) const
 Test to see if two extents overlap. More...
 
void Clear ()
 Resets the extents to defaults. IsValid will return false.
 
void GetExtents (double *a_MinX, double *a_MaxX, double *a_MinY, double *a_MaxY)
 Gets the extents via the parameters. More...
 
void GetExtents (Pt3d &a_dMin, Pt3d &a_dMax)
 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...
 
Pt2d GetMin () const
 Gets the minimum. More...
 
Pt2d GetMax () const
 Gets the maximum. More...
 
void Set (const Pt2d &a_min, const Pt2d &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

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

Static Protected Attributes

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

Detailed Description

2D geometric extents (min/max).

Definition at line 36 of file GmExtents.h.

Constructor & Destructor Documentation

◆ GmExtents2d() [1/3]

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

constructor

Parameters
[in]a_extentsGmExtents3d

Definition at line 48 of file GmExtents.cpp.

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

◆ GmExtents2d() [2/3]

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

constructor

Parameters
[in]a_minMinimum extents.
[in]a_maxMaximum extents.

Definition at line 58 of file GmExtents.cpp.

◆ GmExtents2d() [3/3]

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

constructor

Parameters
[in]a_minMinimum extents.
[in]a_maxMaximum extents.

Definition at line 68 of file GmExtents.cpp.

Member Function Documentation

◆ Add()

template<typename ItrType >
void xms::GmExtents2d::Add ( ItrType  a_begin,
ItrType  a_end 
)

Adds a range defined by two iterators to the extents.

Parameters
[in]a_beginStart of range.
[in]a_endEnd of range.

Definition at line 83 of file GmExtents.h.

References AddToExtents().

◆ AddToExtents()

void xms::GmExtents2d::AddToExtents ( const Pt3d pt)
virtual

Add a point to the extents.

Parameters
[in]ptA point

Definition at line 94 of file GmExtents.cpp.

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

Referenced by Add(), and GmExtents3dUnitTests::testOverlapping().

◆ GetExtents() [1/2]

void xms::GmExtents2d::GetExtents ( double *  a_MinX,
double *  a_MaxX,
double *  a_MinY,
double *  a_MaxY 
)

Gets the extents via the parameters.

Parameters
[out]a_MinXMinimum x.
[out]a_MaxXMaximum x.
[out]a_MinYMinimum y.
[out]a_MaxYMaximum y.

Definition at line 172 of file GmExtents.cpp.

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

◆ GetExtents() [2/2]

void xms::GmExtents2d::GetExtents ( Pt3d a_dMin,
Pt3d a_dMax 
)

Gets the extents via the parameters.

Parameters
[out]a_dMinMinimum.
[out]a_dMaxMaximum.

Definition at line 196 of file GmExtents.cpp.

References m_max, and m_min.

◆ GetMax()

Pt2d xms::GmExtents2d::GetMax ( ) const

Gets the maximum.

Returns
Maximum.

Definition at line 245 of file GmExtents.cpp.

References m_max.

Referenced by xms::GmExtents3d::GmExtents3d().

◆ GetMaxX()

double xms::GmExtents2d::GetMaxX ( ) const

Gets the maximum x.

Returns
Maximum x.

Definition at line 213 of file GmExtents.cpp.

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

◆ GetMaxY()

double xms::GmExtents2d::GetMaxY ( ) const

Gets the maximum y.

Returns
Maximum y.

Definition at line 229 of file GmExtents.cpp.

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

◆ GetMin()

Pt2d xms::GmExtents2d::GetMin ( ) const

Gets the minimum.

Returns
Minimum.

Definition at line 237 of file GmExtents.cpp.

References m_min.

Referenced by xms::GmExtents3d::GmExtents3d().

◆ GetMinX()

double xms::GmExtents2d::GetMinX ( ) const

Gets the minimum x.

Returns
Minimum x.

Definition at line 205 of file GmExtents.cpp.

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

◆ GetMinY()

double xms::GmExtents2d::GetMinY ( ) const

Gets the minimum y.

Returns
Minimum y.

Definition at line 221 of file GmExtents.cpp.

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

◆ GetTolerance()

double xms::GmExtents2d::GetTolerance ( )
static

Gets the tolerance in use.

Returns
tolerance.

Definition at line 123 of file GmExtents.cpp.

References m_tolerance.

Referenced by GmExtents3dUnitTests::testOverlapping().

◆ IsValid()

bool xms::GmExtents2d::IsValid ( )

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

Returns
true if we have data.

Definition at line 107 of file GmExtents.cpp.

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

Referenced by GmExtents3dUnitTests::testOverlapping().

◆ operator+=()

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

operator +=

Parameters
[in]a_rhsGmExtents2d

Definition at line 83 of file GmExtents.cpp.

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

◆ Overlap()

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

Test to see if two extents overlap.

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

Definition at line 132 of file GmExtents.cpp.

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

Referenced by GmExtents3dUnitTests::testOverlapping().

◆ serialize()

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

Boost serialize function.

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

Definition at line 98 of file GmExtents.h.

References m_max, m_min, and m_tolerance.

◆ Set()

void xms::GmExtents2d::Set ( const Pt2d a_min,
const Pt2d a_max 
)

Sets the min/max.

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

Definition at line 254 of file GmExtents.cpp.

References m_max, and m_min.

◆ SetTolerance()

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

Sets the tolerance to use.

Parameters
[in]a_TolThe tolerance.

Definition at line 115 of file GmExtents.cpp.

References m_tolerance.

Member Data Documentation

◆ m_tolerance

double xms::GmExtents2d::m_tolerance
staticprotected

Tolerance used in comparisons.

Tolerance. Static ?

Definition at line 74 of file GmExtents.h.

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


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