xmsgrid
1.0
|
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... | |
2D geometric extents (min/max).
Definition at line 36 of file GmExtents.h.
|
explicit |
constructor
[in] | a_extents | GmExtents3d |
Definition at line 48 of file GmExtents.cpp.
References xms::GmExtents3d::GetMax(), xms::GmExtents3d::GetMin(), m_max, and m_min.
constructor
[in] | a_min | Minimum extents. |
[in] | a_max | Maximum extents. |
Definition at line 58 of file GmExtents.cpp.
constructor
[in] | a_min | Minimum extents. |
[in] | a_max | Maximum extents. |
Definition at line 68 of file GmExtents.cpp.
void xms::GmExtents2d::Add | ( | ItrType | a_begin, |
ItrType | a_end | ||
) |
Adds a range defined by two iterators to the extents.
[in] | a_begin | Start of range. |
[in] | a_end | End of range. |
Definition at line 83 of file GmExtents.h.
References AddToExtents().
|
virtual |
Add a point to the extents.
[in] | pt | A 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().
void xms::GmExtents2d::GetExtents | ( | double * | a_MinX, |
double * | a_MaxX, | ||
double * | a_MinY, | ||
double * | a_MaxY | ||
) |
Gets the extents via the parameters.
[out] | a_MinX | Minimum x. |
[out] | a_MaxX | Maximum x. |
[out] | a_MinY | Minimum y. |
[out] | a_MaxY | Maximum y. |
Definition at line 172 of file GmExtents.cpp.
References m_max, m_min, xms::Pt2< T >::x, and xms::Pt2< T >::y.
Gets the extents via the parameters.
[out] | a_dMin | Minimum. |
[out] | a_dMax | Maximum. |
Definition at line 196 of file GmExtents.cpp.
Pt2d xms::GmExtents2d::GetMax | ( | ) | const |
Gets the maximum.
Definition at line 245 of file GmExtents.cpp.
References m_max.
Referenced by xms::GmExtents3d::GmExtents3d().
double xms::GmExtents2d::GetMaxX | ( | ) | const |
Gets the maximum x.
Definition at line 213 of file GmExtents.cpp.
References m_max, and xms::Pt2< T >::x.
double xms::GmExtents2d::GetMaxY | ( | ) | const |
Gets the maximum y.
Definition at line 229 of file GmExtents.cpp.
References m_max, and xms::Pt2< T >::y.
Pt2d xms::GmExtents2d::GetMin | ( | ) | const |
Gets the minimum.
Definition at line 237 of file GmExtents.cpp.
References m_min.
Referenced by xms::GmExtents3d::GmExtents3d().
double xms::GmExtents2d::GetMinX | ( | ) | const |
Gets the minimum x.
Definition at line 205 of file GmExtents.cpp.
References m_min, and xms::Pt2< T >::x.
double xms::GmExtents2d::GetMinY | ( | ) | const |
Gets the minimum y.
Definition at line 221 of file GmExtents.cpp.
References m_min, and xms::Pt2< T >::y.
|
static |
Gets the tolerance in use.
Definition at line 123 of file GmExtents.cpp.
References m_tolerance.
Referenced by GmExtents3dUnitTests::testOverlapping().
bool xms::GmExtents2d::IsValid | ( | ) |
If we don't have any data we return false.
Definition at line 107 of file GmExtents.cpp.
References m_max, m_min, and xms::Pt2< T >::x.
Referenced by GmExtents3dUnitTests::testOverlapping().
void xms::GmExtents2d::operator+= | ( | const GmExtents2d & | a_rhs | ) |
operator +=
[in] | a_rhs | GmExtents2d |
Definition at line 83 of file GmExtents.cpp.
References m_max, m_min, xms::Pt2< T >::x, and xms::Pt2< T >::y.
bool xms::GmExtents2d::Overlap | ( | const GmExtents2d & | a_b | ) | const |
Test to see if two extents overlap.
[in] | a_b | The other extents. |
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().
void xms::GmExtents2d::serialize | ( | Archive & | archive, |
const unsigned int | version | ||
) |
Boost serialize function.
[in,out] | archive | An archive. |
[in] | version | The version number. |
Definition at line 98 of file GmExtents.h.
References m_max, m_min, and m_tolerance.
Sets the min/max.
[in] | a_min | The minimum extents. |
[in] | a_max | The maximum extents. |
Definition at line 254 of file GmExtents.cpp.
|
static |
Sets the tolerance to use.
[in] | a_Tol | The tolerance. |
Definition at line 115 of file GmExtents.cpp.
References m_tolerance.
|
staticprotected |
Tolerance used in comparisons.
Tolerance. Static ?
Definition at line 74 of file GmExtents.h.
Referenced by GetTolerance(), Overlap(), serialize(), and SetTolerance().