21 #include <boost/serialization/export.hpp>
22 #include <boost/serialization/vector.hpp>
423 double* a_MaxZ)
const
560 Pt3d pt(50.0, 60.0, 80.0);
565 const double kDelta = 0.000001;
566 TS_ASSERT_DELTA(50.0, e.
GetMinX(), kDelta);
567 TS_ASSERT_DELTA(50.0, e.
GetMaxX(), kDelta);
568 TS_ASSERT_DELTA(60.0, e.
GetMinY(), kDelta);
569 TS_ASSERT_DELTA(60.0, e.
GetMaxY(), kDelta);
570 TS_ASSERT_DELTA(80.0, e.
GetMinZ(), kDelta);
571 TS_ASSERT_DELTA(80.0, e.
GetMaxZ(), kDelta);
580 Pt3d pt(50.0, 60.0, 80.0);
584 pt.
Set(100.0, 120.0, 160.0);
586 pt.
Set(200.0, -100.0, -200.0);
590 const double kDelta = 0.000001;
591 TS_ASSERT_DELTA(50.0, e.
GetMinX(), kDelta);
592 TS_ASSERT_DELTA(200.0, e.
GetMaxX(), kDelta);
593 TS_ASSERT_DELTA(-100.0, e.
GetMinY(), kDelta);
594 TS_ASSERT_DELTA(120.0, e.
GetMaxY(), kDelta);
595 TS_ASSERT_DELTA(-200.0, e.
GetMinZ(), kDelta);
596 TS_ASSERT_DELTA(160.0, e.
GetMaxZ(), kDelta);
616 Pt3d pt(-100.0, 50.0, -25.0);
618 pt.
Set(-50.0, 100.0, -25.0);
620 pt.
Set(-50.0, 100.0, 25.0);
624 pt.
Set(-150.0, 30.0, 55.0);
626 pt.
Set(-50.0, 25.0, -5.0);
628 pt.
Set(-40.0, 75.0, -15.0);
633 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
637 pt.
Set(-101.0, 101.0, -125.0);
639 pt.
Set(-550.0, 182.0, -98.0);
641 pt.
Set(-150.0, 251.0, -26.0);
644 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
651 pt.
Set(-150.0, 100.0, -25.0);
653 pt.
Set(-150.0, 100.0, 25.0);
656 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
662 Pt3d pt(-100.0, 50.0, 0);
664 pt.
Set(-50.0, 100.0, 0);
667 pt.
Set(-150.0, 25.0, 0);
669 pt.
Set(-101.0, 75.0, 0);
679 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
682 pt.
Set(-550.0, 251.0, 0);
684 pt.
Set(-101.0, 101.0, 0);
692 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
702 pt.
Set(-150.0, 75.0, 0);
705 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
715 pt.
Set(-60.0, 125.0, 0);
718 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
bool Overlap(const GmExtents2d &a_b) const
Test to see if two extents overlap.
bool IsValid()
If we don't have any data we return false.
double GetMinZ() const
Gets the minimum z.
static const double XM_DBL_LOWEST
static double GetTolerance()
Gets the tolerance in use.
Pt3d GetMax() const
Gets the maximum.
void GetExtents(double *a_MinX, double *a_MaxX, double *a_MinY, double *a_MaxY)
Gets the extents via the parameters.
Pt2d m_max
Maximum, maximum extents.
virtual void AddToExtents(const Pt3d &pt)
Add a point to the extents.
static void SetTolerance(double a_Tol)
Sets the tolerance to use.
3D geometric extents (min/max).
double GetMinY() const
Gets the minimum y.
double GetMaxX() const
Gets the maximum x.
void testOverlapping()
Tests overlap.
double GetMaxY() const
Gets the maximum y.
void Set(const Pt3d &a_min, const Pt3d &a_max)
Sets the min/max.
double GetMinX() const
Gets the minimum x.
void testSinglePt()
Tests a single point.
static double m_tolerance
Tolerance used in comparisons.
bool IsValid() const
If we don't have any data we return false.
double GetMaxX() const
Gets the maximum x.
Pt2d GetMin() const
Gets the minimum.
static double m_tolerance
Tolerance used in comparisons.
void testMultiplePts()
Tests multiple points.
void testNoPts()
Tests no points.
Pt2d GetMax() const
Gets the maximum.
void Set(const Pt2d &a_min, const Pt2d &a_max)
Sets the min/max.
void Set(T a_x, T a_y, T a_z)
static void SetTolerance(double a_Tol)
Sets the tolerance to use.
void operator+=(const GmExtents2d &a_rhs)
operator +=
void AddToExtents(const Pt3d &pt)
Add a point to the extents.
void Clear()
Resets the extents to defaults. IsValid will return false.
2D geometric extents (min/max).
Pt3d m_max
Maximum, maximum extents.
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.
double GetMinX() const
Gets the minimum x.
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.
static double GetTolerance()
Gets the tolerance in use.
double GetMaxZ() const
Gets the maximum z.
Pt3d GetMin() const
Gets the minimum.
double GetMaxY() const
Gets the maximum y.
double GetMinY() const
Gets the minimum y.
Pt3d m_min
Minimum, maximum extents.
virtual ~GmExtents2d()
destructor
bool Overlap(GmExtents3d &a_b) const
Test to see if two extents overlap.
void operator+=(const GmExtents3d &a_rhs)
operator +=
Pt2d m_min
Minimum, maximum extents.
static const double XM_DBL_HIGHEST