xmsgrid  1.0
geoms.t.h
Go to the documentation of this file.
1 #pragma once
2 #ifdef CXX_TEST
3 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
9 
10 // 3. Standard Library Headers
11 
12 // 4. External Library Headers
13 #include <cxxtest/TestSuite.h>
14 #pragma warning(push)
15 #pragma warning(disable : 4103) // boost code: alignment change
16 #include <boost/timer/timer.hpp> // boost::timer::cpu_timer
17 #pragma warning(pop)
18 
19 // 5. Shared Headers
20 #include <xmscore/points/ptsfwd.h>
22 
23 // 6. Non-shared Headers
24 
25 //----- Namespace declaration --------------------------------------------------
26 
27 // namespace xms {
28 
30 class GeomsXmsngUnitTests : public CxxTest::TestSuite
31 {
32 public:
35 
37  void testConvexHull();
39 }; // class GeomsXmsngUnitTests
40 
43 {
44 public:
46  void DoTest();
47 
48 protected:
49  // You must override these
52  virtual void CheckPoint(const xms::Pt3d& a_pt) = 0;
55  virtual double MaxTime() = 0;
56 
57  // You don't have to override these
58  virtual void Setup();
59  virtual void CheckPoints();
60  virtual void GetResults();
61 
62 protected:
63  std::vector<xms::Pt3d> m_outPoly;
64  std::vector<xms::Pt3d> m_inPoly;
65  boost::timer::cpu_timer m_timer;
66  int m_count;
67  int m_status;
68 
69 private:
71 }; // GmPointInPolyUnitTests
72 
74 class GeomsXmsngIntermediateTests : public CxxTest::TestSuite
75 {
76 public:
78 };
79 
80 //} // namespace xms
81 
82 #endif
virtual void Setup()
Setup the polygons.
Definition: geoms.cpp:2312
void testConvexHull()
Test building a convex hull.
Definition: geoms.cpp:2516
Tests for functions in geoms.cpp.
Definition: geoms.t.h:30
virtual void GetResults()
Get the timer results and do some assertions.
Definition: geoms.cpp:2341
virtual double MaxTime()=0
virtual void CheckPoint(const xms::Pt3d &a_pt)=0
boost::timer::cpu_timer m_timer
Timer.
Definition: geoms.t.h:65
int m_status
Status (in, out, on) of at least one pt.
Definition: geoms.t.h:67
void DoTest()
Run the test. This is the main function to call.
Definition: geoms.cpp:2303
XM_DISALLOW_COPY_AND_ASSIGN(GmPointInPolyUnitTests)
Hide compiler generated copy and assign.
GmPointInPolyUnitTests()
constructor
Definition: geoms.cpp:2292
void test_gmPointInPolygon2D_Speed()
Test lots of points for timing purposes. Only in release, not debug.
Definition: geoms.cpp:2506
void test_gmComputePolygonCentroid()
Definition: geoms.cpp:2476
int m_count
Number of points checked.
Definition: geoms.t.h:66
std::vector< xms::Pt3d > m_inPoly
Input polygon.
Definition: geoms.t.h:64
virtual void CheckPoints()
Check a lot of points to see if they are in the polys.
Definition: geoms.cpp:2319
Used for speed tests of various point in poly functions / classes.
Definition: geoms.t.h:42
void test_gmComputeCentroid()
Definition: geoms.cpp:2449
std::vector< xms::Pt3d > m_outPoly
Output polygon.
Definition: geoms.t.h:63
Intermediate tests for functions in geoms.cpp.
Definition: geoms.t.h:74
void testDoLineSegmentsCross()
Test determining if two lines intersect.
Definition: geoms.cpp:2544