summaryrefslogtreecommitdiff
path: root/test/test-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-05 13:07:32 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-05 13:07:40 +0000
commit04078dbb3fe4acd09d150e016c2b2e0d5d036950 (patch)
treea612b49c5be8104dafe403674716f3b3403e65ae /test/test-geoData.cpp
parentRefactor to further simplify line/point operations (diff)
downloadilt-04078dbb3fe4acd09d150e016c2b2e0d5d036950.tar.bz2
ilt-04078dbb3fe4acd09d150e016c2b2e0d5d036950.tar.xz
ilt-04078dbb3fe4acd09d150e016c2b2e0d5d036950.zip
Add methods to walk the boundary of the terrain mesh
Diffstat (limited to 'test/test-geoData.cpp')
-rw-r--r--test/test-geoData.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test-geoData.cpp b/test/test-geoData.cpp
index 258bd9c..34c9cb6 100644
--- a/test/test-geoData.cpp
+++ b/test/test-geoData.cpp
@@ -118,6 +118,16 @@ BOOST_DATA_TEST_CASE(findRayIntersect,
BOOST_CHECK_CLOSE_VEC(fixedTerrtain.intersectRay({p, d}).value(), i);
}
+BOOST_AUTO_TEST_CASE(boundaryWalk)
+{
+ size_t count {};
+ fixedTerrtain.boundaryWalk([&count](auto heh) {
+ BOOST_CHECK(fixedTerrtain.is_boundary(heh));
+ count++;
+ });
+ BOOST_CHECK_EQUAL(count, 2 * (ncols + nrows - 2));
+}
+
using WalkTerrainData = std::tuple<glm::vec2, glm::vec2, std::vector<int>>;
BOOST_DATA_TEST_CASE(walkTerrain,