xmsgrid
1.0
|
Tests for TrBreaklineAdder. More...
Public Member Functions | |
void | test1 () |
Test a simple case involving a swap and removal of outer triangle. More... | |
void | test2 () |
Test a more complex case involving two inner polygons and removal of outer triangles. This doesn't remove the triangles - that would be the next step. More... | |
void | testCrossingBoundary () |
Test a case involving crossing a hole and the outer boundary. More... | |
Tests for TrBreaklineAdder.
Definition at line 28 of file TrBreaklineAdder.t.h.
void TrBreaklineAdderUnitTests::test1 | ( | ) |
Test a simple case involving a swap and removal of outer triangle.
// Before // // 4- 3---------------4 // | / | \ / | \ // | / | \ 5 / | \ // | / | \ / | \ // 0- 0 0 | 1 1 2 | 4 2 // | \ | / \ | / // | \ | / 3 \ | / // | \ | / \ | / // -4- 5-------------- 6 // // |-------|-------|-------|-------| // 0 5 10 15 20 // // After // // 4- 3---------------4 // | / | \ / \ // | / | \ 5 / 2 \ // | / | \ / \ // 0- 0 0 | 1 1---------------2 // | \ | / \ / // | \ | / 3 \ 4 / // | \ | / \ / // -4- 5-------------- 6 // // |-------|-------|-------|-------| // 0 5 10 15 20 ///
Definition at line 628 of file TrBreaklineAdder.cpp.
References xms::TrBreaklineAdder::New(), xms::TrTin::New(), xms::TrTriangulator::Triangulate(), and XM_COUNTOF.
void TrBreaklineAdderUnitTests::test2 | ( | ) |
Test a more complex case involving two inner polygons and removal of outer triangles. This doesn't remove the triangles - that would be the next step.
// Before // // 10- 17-----18------19------20------21 // | |\ 8 /|\ 11 /|\ 22 / \ 26 /| // | | \ / | \ / | \ / \ //| // | | \ / | \ /30|23\ / 27 \ / /| // 5- |6 13 12|9 14 | 15------16 /| // | | / \ | /|\ | / \ 25 /|28/| // | | / \ | / | \ | / \ / | / | // | |/ 7 \|/ | \|/ 24 \ /29| / | // 0- 9------10 10|3 11------12 | / | // | |\ 13 / \ | / \ 15 / \ |/ | // | | \ / \ | / \ / \ |/ | // | | \ / 5 \|/ 16 \ / 21 \|/ | // -5- | 0 5-------6-------7-------8 18| // | | / \ 4 / \ 14 / \ 19 / \ | // | | / \ / \ / \ / \ | // | |/ 1 \ / 2 \ / 20 \ / 17 \| // -10- 0-------1-------2-------3-------4 // // |-------|-------|-------|-------| // 0 10 20 30 40 // // After swapping // // 10- 17-----18------19------20------21 // | |\ 8 / \ 11 /|\ 22 / \ 26 /| // | | \ / \ / | \ / \ //| // | | \ / 12 \ /30|23\ / 27 \ / /| // 5- |6 13------14 | 15------16 /| // | | /|\ 9 /|\ | /|\ 25 /|28/| // | | / | \ / | \ | / | \ / | / | // | |/ | \ / | \|/ |24\ /29| / | // 0- 9 13|7 10 10|3 11 15| 12 | / | // | |\ | / \ | / \ | / \ |/ | // | | \ | / \ | / \ | / \ |/ | // | | \|/ 5 \|/ 16 \|/ 21 \|/ | // -5- | 0 5-------6-------7-------8 18| // | | / \ 4 / \ 14 / \ 19 / \ | // | | / \ / \ / \ / \ | // | |/ 1 \ / 2 \ / 20 \ / 17 \| // -10- 0-------1-------2-------3-------4 // // |-------|-------|-------|-------| // 0 10 20 30 40 // // After removing triangles (*** means a hole) // // 10- 17-----18------19------20------21 // | |\ 7 / \ 9 /|\ 17 / \ 21 / // | | \ / \ / | \ / \ / // | | \ / 10 \ /24|18\ / 22 \ / // 5- |6 13------14 | 15------16 // | | /|******/|\ | /|\ 20 /| // | | / |*****/ | \ | /*| \ / | // | |/ |****/ | \|/**|19\ /23| // 0- 9 11|**10 8|3 11***| 12 | // | |\ |**/ \ | /****| / \ | // | | \ |*/ \ | /*****| / \ | // | | \|/ 5 \|/******|/ 16 \| // -5- | 0 5-------6-------7-------8 // | | / \ 4 / \ 12 / \ 14 / \ // | | / \ / \ / \ / \ // | |/ 1 \ / 2 \ / 15 \ / 13 \ // -10- 0-------1-------2-------3-------4 // // |-------|-------|-------|-------| // 0 10 20 30 40 ///
Definition at line 727 of file TrBreaklineAdder.cpp.
References xms::TrBreaklineAdder::New(), trBuildTestTin7(), and XM_COUNTOF.
void TrBreaklineAdderUnitTests::testCrossingBoundary | ( | ) |
Test a case involving crossing a hole and the outer boundary.
// /// 15.0 9----10----11 /// /|\ 10 | 11 / /// / | \ | / /// / 8 | 9 \|/ /// 10.0 6-----7-----8 /// |\ 5 |\ 6 |\ /// | \ | \ | \ /// | 4 \| \| 7 \ /// 5.0 2-----3-----4-----5 /// \ 0 |\ 2 | 3 / /// \ | \ | / /// \| 1 \|/ /// 0.0 0-----1 /// /// 0.0 5.0 10.0 15.0 ///
Definition at line 786 of file TrBreaklineAdder.cpp.
References xms::XmLog::GetAndClearStack(), xms::XmLog::GetAndClearStackStr(), Singleton< XmLog >::Instance(), xms::TrBreaklineAdder::New(), trBuildTestTin8(), and XM_COUNTOF.