20 #include <boost/serialization/export.hpp> 21 #include <boost/serialization/vector.hpp> 162 m_min = XM_DBL_HIGHEST;
163 m_max = XM_DBL_LOWEST;
395 m_min = XM_DBL_HIGHEST;
396 m_max = XM_DBL_LOWEST;
422 double* a_MaxZ)
const 559 Pt3d pt(50.0, 60.0, 80.0);
564 const double kDelta = 0.000001;
565 TS_ASSERT_DELTA(50.0, e.
GetMinX(), kDelta);
566 TS_ASSERT_DELTA(50.0, e.
GetMaxX(), kDelta);
567 TS_ASSERT_DELTA(60.0, e.
GetMinY(), kDelta);
568 TS_ASSERT_DELTA(60.0, e.
GetMaxY(), kDelta);
569 TS_ASSERT_DELTA(80.0, e.
GetMinZ(), kDelta);
570 TS_ASSERT_DELTA(80.0, e.
GetMaxZ(), kDelta);
579 Pt3d pt(50.0, 60.0, 80.0);
583 pt.
Set(100.0, 120.0, 160.0);
585 pt.
Set(200.0, -100.0, -200.0);
589 const double kDelta = 0.000001;
590 TS_ASSERT_DELTA(50.0, e.
GetMinX(), kDelta);
591 TS_ASSERT_DELTA(200.0, e.
GetMaxX(), kDelta);
592 TS_ASSERT_DELTA(-100.0, e.
GetMinY(), kDelta);
593 TS_ASSERT_DELTA(120.0, e.
GetMaxY(), kDelta);
594 TS_ASSERT_DELTA(-200.0, e.
GetMinZ(), kDelta);
595 TS_ASSERT_DELTA(160.0, e.
GetMaxZ(), kDelta);
615 Pt3d pt(-100.0, 50.0, -25.0);
617 pt.
Set(-50.0, 100.0, -25.0);
619 pt.
Set(-50.0, 100.0, 25.0);
623 pt.
Set(-150.0, 30.0, 55.0);
625 pt.
Set(-50.0, 25.0, -5.0);
627 pt.
Set(-40.0, 75.0, -15.0);
632 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
636 pt.
Set(-101.0, 101.0, -125.0);
638 pt.
Set(-550.0, 182.0, -98.0);
640 pt.
Set(-150.0, 251.0, -26.0);
643 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
650 pt.
Set(-150.0, 100.0, -25.0);
652 pt.
Set(-150.0, 100.0, 25.0);
655 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
661 Pt3d pt(-100.0, 50.0, 0);
663 pt.
Set(-50.0, 100.0, 0);
666 pt.
Set(-150.0, 25.0, 0);
668 pt.
Set(-101.0, 75.0, 0);
678 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
681 pt.
Set(-550.0, 251.0, 0);
683 pt.
Set(-101.0, 101.0, 0);
691 TS_ASSERT_EQUALS(e.
Overlap(f),
false);
701 pt.
Set(-150.0, 75.0, 0);
704 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
714 pt.
Set(-60.0, 125.0, 0);
717 TS_ASSERT_EQUALS(e.
Overlap(f),
true);
bool Overlap(const GmExtents2d &a_b) const
Test to see if two extents overlap.
Pt2d GetMin() const
Gets the minimum.
double GetMinX() const
Gets the minimum x.
Pt3d GetMin() const
Gets the minimum.
bool IsValid()
If we don't have any data we return false.
double GetMaxY() const
Gets the maximum y.
static double GetTolerance()
Gets the tolerance in use.
void GetExtents(double *a_MinX, double *a_MaxX, double *a_MinY, double *a_MaxY)
Gets the extents via the parameters.
bool IsValid() const
If we don't have any data we return false.
Pt2d m_max
Maximum, maximum extents.
virtual void AddToExtents(const Pt3d &pt)
Add a point to the extents.
Pt3d GetMax() const
Gets the maximum.
Pt2d GetMax() const
Gets the maximum.
static void SetTolerance(double a_Tol)
Sets the tolerance to use.
3D geometric extents (min/max).
bool IsPointWithin(const Pt3d &pt) const
Tests if the point is inside the extents.
bool Overlap(GmExtents3d &a_b) const
Test to see if two extents overlap.
void testOverlapping()
Tests overlap.
void Set(const Pt3d &a_min, const Pt3d &a_max)
Sets the min/max.
double GetMaxY() const
Gets the maximum y.
void testSinglePt()
Tests a single point.
double GetMinY() const
Gets the minimum y.
static double m_tolerance
Tolerance used in comparisons.
double GetMaxZ() const
Gets the maximum z.
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 m_tolerance
Tolerance used in comparisons.
void testMultiplePts()
Tests multiple points.
double GetMinZ() const
Gets the minimum z.
void testNoPts()
Tests no points.
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 +=
double GetMaxX() const
Gets the maximum x.
void AddToExtents(const Pt3d &pt)
Add a point to the extents.
double GetMinY() const
Gets the minimum y.
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.
double GetMinX() const
Gets the minimum x.
static double GetTolerance()
Gets the tolerance in use.
Pt3d m_min
Minimum, maximum extents.
double GetMaxX() const
Gets the maximum x.
virtual ~GmExtents2d()
destructor
void operator+=(const GmExtents3d &a_rhs)
operator +=
Pt2d m_min
Minimum, maximum extents.