xmsgrid
1.0
|
Tests GmPolygon. More...
#include <GmPolygon.t.h>
Public Member Functions | |
void | testNoHoles () |
Test a simple polygon with some points outside, some inside, some on, and some coincident with polygon points. More... | |
void | testWithHoles () |
Test a polygon with holes. More... | |
void | testMinDistanceToBoundary () |
tests calculating the minimum distance to the boundary of a polygon. | |
void | testIntersection () |
tests intersection of polygons | |
void | testUnion () |
tests union of polygons | |
Static Public Member Functions | |
static void | SetUpPolyWithHoles1 (xms::VecPt3d &a_outPoly, xms::VecPt3d2d &a_inPolys, xms::VecPt3d &a_ptsToTest) |
Used in tests to create a polygon with two holes. More... | |
static void | SetUpPolyWithHole (xms::VecPt3d &a_outPoly, xms::VecPt3d &a_inPolys) |
Used in tests to create a polygon with lots of segments and 2 holes. More... | |
|
static |
Used in tests to create a polygon with lots of segments and 2 holes.
a_outPoly | The outside polygon. |
a_inPoly | The inside polygons. The first point is not repeated. Outer poly is CCW, inners are CW. // 30 - 8---9 12--13 16--17 20--21 24------25 // | | | | | | | | | | | // 25 - 7 10--11 14--15 18--19 22--23 27--26 // | | | // 20 - 6---5 2---3---4---5---6---7---8 28--29 // | | | | | // 15 - 3---4 1 18---17 14---13 10---9 31--30 // | | | | | | | | | // 10 - 2 0---19 16---15 12---11 32--33 // | | | // 5 - 1 51-50 47-46 43-42 39-38 35-34 // | | | | | | | | | | | // 0 - 0--52 49-48 45--44 41-40 37-36 // // |---|---|---|---|---|---|---|---|---|---| // 0 5 10 15 20 25 30 35 40 45 50 55 /// |
Definition at line 624 of file GmPolygon.cpp.
References xms::gmArrayToVecPt3d(), and XM_COUNTOF.
Referenced by GmPointInPolyUnitTests::Setup().
|
static |
Used in tests to create a polygon with two holes.
a_outPoly | The outside polygon. |
a_inPolys | The inside polygons. |
a_ptsToTest | Locations to test if they are inside the polygon. The first point is not repeated. Outer poly is CCW, inners are CW. // 30 - 1---------------------------------------2 // | | | // 25 - | | // | | | // 20 - | 5-------4 5-------4 | // | | | | | | | // 15 - | | 3 | 3 3 // | | | | | | | // 10 - | 0---1---2 0---1---2 | // | | | // 5 - | | // | | | // 0 - 0-------------------5-------------------4 // // |---|---|---|---|---|---|---|---|---|---| // 0 5 10 15 20 25 30 35 40 45 50 55 /// |
Definition at line 568 of file GmPolygon.cpp.
Referenced by testWithHoles().
void GmPolygonUnitTests::testNoHoles | ( | ) |
Test a simple polygon with some points outside, some inside, some on, and some coincident with polygon points.
// 15 - 0 1 2 3 4 // | // 10 - 5 6---7---8 9 // | | | // 5 - 10 11 12 13 14 // | | | // 0 - 15 16--17--18 19 // | // -5 - 20 21 22 23 24 // // |---|---|---|---| // -5 0 5 10 15 ///
Definition at line 396 of file GmPolygon.cpp.
References xms::GmPolygon::New().
void GmPolygonUnitTests::testWithHoles | ( | ) |
Test a polygon with holes.
// 35 - * * * * * * * * * * * * * // | // 30 - * 5---*---*---*---*---*---*---*---*---*---4 * // | | | // 25 - * * * * * * * * * * * * * // | | | // 20 - * * * 1---*---2 * 1---*---2 * * * // | | | | | | | // 15 - * * * * * 3 * * * 3 * 3 * // | | | | | | | // 10 - * * * 0---5---4 * 0---5---4 * * * // | | | // 5 - * * * * * * * * * * * * * // | | | // 0 - * 0---*---*---*---*---1---*---*---*---*---2 * // | // -5 - * * * * * * * * * * * * * // // |---|---|---|---|---|---|---|---|---|---|---|---| // -5 0 5 10 15 20 25 30 35 40 45 50 55 ///
Definition at line 484 of file GmPolygon.cpp.
References xms::GmPolygon::New(), SetUpPolyWithHoles1(), and TS_ASSERT_EQUALS_VEC.