xmsgrid
1.0
|
Tests for TrTin. More...
Public Member Functions | |
void | test1 () |
Tests a bunch of the TrTin methods. More... | |
void | testOptimizeTriangulation () |
void | testSwap () |
void | testBoundaries () |
Tests TrTin::GetBoundaryPoints and TrTin::GetBoundaryPolys. More... | |
void | testDeleteTriangles () |
Tests TrTin::DeleteTriangles. More... | |
void | testDeletePoints () |
Tests TrTin::DeletePoints. More... | |
void | testRemoveLongThinTrianglesOnPerimeter () |
Tests TrTin::RemoveLongThinTrianglesOnPerimeter. | |
void TrTinUnitTests::test1 | ( | ) |
Tests a bunch of the TrTin methods.
// 10- 3-----------4 // | /0\2 1/2\ // | / \ 2 / \ // | / \ / \ // | / 0 \ / 1 \ // | /1 2\0/0 1\ // 0- 0-----------1-----------2 // // |-----|-----|-----|-----| // 0 5 10 15 20 // // m_tris = 3,0,1, 1,2,4, 1,4,3 // m_trisAdjToPts = [0][0,1,2][1][0,2][1,2] ///
Definition at line 1671 of file TrTin.cpp.
References xms::TrTin::New(), TS_ASSERT_DELTA_PT3D, XM_NONE, and xmAsserting().
void TrTinUnitTests::testBoundaries | ( | ) |
Tests TrTin::GetBoundaryPoints and TrTin::GetBoundaryPolys.
// 40 34-35--36--37--38--39--40--41--42 // |\15|\23|\19|\44|41/|42/|\51|\49| // |16\|17\|20\|21\|/37|/40|43\|50\| // 30 25-26--27--28--29--30--31--32--33 // |\13| \18|\52|38/|39/ \48|\47| // |14\| \|22\|/29|/ \|45\| // 20 18-19 20--21--22 23--24 // |\ 3| /|\24|\26|\ |46/| // |1 \| / 9|12\|27\|28\ |/36| // 10 9--10--11--12--13--14--15--16--17 // |2 /|\11|7 /|8 /|\31|\30|\32|35/| // |/ 0|4 \|/ 5|/ 6|10\|25\|33\|/34| // 0 0---1---2---3---4---5---6---7---8 // 0 10 20 30 40 50 60 70 80 ///
Definition at line 2050 of file TrTin.cpp.
References trBuildTestTin6(), TS_ASSERT_EQUALS_VEC2D, and XM_COUNTOF.
void TrTinUnitTests::testDeletePoints | ( | ) |
Tests TrTin::DeletePoints.
40 34-35–36–37–38–39–40–41–42 |\15|\23|\19|\44|41/|42/|\51|\49| |16|17|20|21|/37|/40|43|50| 30 25-26–27–28–29–30–31–32–33 |\13| \18|\52|38/|39/ \48|\47| |14| |22|/29|/ |45| 20 18-19 20–21–22 23–24 |\ 3| /|\24|\26|\ |46/| |1 | / 9|12|27|28\ |/36| 10 9–10–11–12–13–14–15–16–17 |2 /|\11|7 /|8 /|\31|\30|\32|35/| |/ 0|4 |/ 5|/ 6|10|25|33|/34| 0 0—1—2—3—4—5—6—7—8 0 10 20 30 40 50 60 70 80
Definition at line 2141 of file TrTin.cpp.
References trBuildTestTin6().
void TrTinUnitTests::testDeleteTriangles | ( | ) |
Tests TrTin::DeleteTriangles.
40 36-37–38–39–40–41–42–43–44 |\15|\23|\19|\48|45/|46/|\55|\53| |16|17|20|21|/41|/44|47|54| 30 27-28–29–30–31–32–33–34–35 |\13| \18|\57|42/|43/|\52|\51| |14| |22|/29|/40|56|49| 20 18-19 20 21–22–23–24–25–26 |\ 3| /|\24|\26|\39|\35|50/| |1 | / 9|12|27|28|36|/38| 10 9–10–11–12–13–14–15–16–17 |2 /|\11|7 /|8 /|\31|\30|\32|37/| |/ 0|4 |/ 5|/ 6|10|25|33|/34| 0 0—1—2—3—4—5—6—7—8 0 10 20 30 40 50 60 70 80
Definition at line 2079 of file TrTin.cpp.
References trBuildTestTin6().
void TrTinUnitTests::testOptimizeTriangulation | ( | ) |
// Before // // 20- 6------7------8 // | |\ |\ | // | |\\ 3 |\\ 7 | // | |\ \ |\ \ | // | | \ \ | \ \ | // | | \ \ | \ \ | // | | \ \| \ \| // 10- 3 1 \2 4 5 \6 5 // | |\ \ |\ \ | // | | \ \ | \ \ | // | | \ \ | \ \ | // | | \ \| \ \| // | | 0 \\| 4 \\| // | | \| \|0 // 0 - 0------1------2 // // |------|------| // 0 10 20 // After // 20- 6------7------8 // | |\ |\ | // | | \ 3 | \ 7 | // | | \ | \ | // | | \ | \ | // | | 2 \ | 6 \ | // | | \| \| // 10- 3------4------5 // | |\ |\ | // | | \ 1 | \ 5 | // | | \ | \ | // | | \ | \ | // | | 0 \ | 4 \ | // | | \| \| // 0 - 0------1------2 // // |------|------| // 0 10 20 ///
Definition at line 1888 of file TrTin.cpp.
References xms::TrTin::New(), and TS_ASSERT_EQUALS_VEC.
void TrTinUnitTests::testSwap | ( | ) |
// 20- 5-----------6-----------7 20- 5-----------6-----------7 // | |\ / \ /| | |\ /|\ /| // | | \ 1 / \ 6 / | | | \ 1 / | \ 6 / | // | | \ / \ / | | | \ / | \ / | // | | \ / 7 \ / | | | \ / | \ / | // | | \ / \ / | | | \ / | \ / | // 10- | 2 3-----------4 4 | 10- | 2 3 3 | 7 4 4 | // | | / \ / \ | | | / \ | / \ | // | | / \ 3 / \ | | | / \ | / \ | // | | / \ / \ | | | / \ | / \ | // | | / 0 \ / 5 \ | | | / 0 \ | / 5 \ | // | |/ \ / \| | |/ \|/ \| // 0- 0-----------1-----------2 0- 0-----------1-----------2 // // |-----|-----|-----|-----| |-----|-----|-----|-----| // 0 5 10 15 20 0 5 10 15 20 ///
Definition at line 1941 of file TrTin.cpp.
References xms::TrTin::New(), and xms::TrTriangulator::Triangulate().