From 63223a661fd6d73cd16f89b79c79a12de5126a89 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Mon, 17 Sep 2012 17:24:04 -0400 Subject: [PATCH] Added basic BSP test --- sample/CMakeLists.txt | 5 ++++- sample/testBSP.cpp | 3 +++ src/bsp_simple.hpp | 2 ++ src/bsp_simple.tcc | 14 +++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index d895959..aa4091a 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -35,4 +35,7 @@ add_executable(testEskow testEskow.cpp) target_link_libraries(testEskow ${tolink}) add_executable(testAlgo testAlgo.cpp) -target_link_libraries(testAlgo ${tolink}) \ No newline at end of file +target_link_libraries(testAlgo ${tolink}) + +add_executable(testBSP testBSP.cpp) +target_link_libraries(testBSP ${tolink}) \ No newline at end of file diff --git a/sample/testBSP.cpp b/sample/testBSP.cpp index 38bbd2a..f142fc2 100644 --- a/sample/testBSP.cpp +++ b/sample/testBSP.cpp @@ -1,3 +1,4 @@ +#if 0 #include "bsp_simple.hpp" int main(int argc, char **argv) @@ -10,3 +11,5 @@ int main(int argc, char **argv) return 0; } +#endif +int main() {} diff --git a/src/bsp_simple.hpp b/src/bsp_simple.hpp index 1f48296..b61bcf3 100644 --- a/src/bsp_simple.hpp +++ b/src/bsp_simple.hpp @@ -154,6 +154,8 @@ namespace CosmoTool f.data = data; insert(f); } + + bool inside(const typename space_t::coord_t& p) const; }; }; diff --git a/src/bsp_simple.tcc b/src/bsp_simple.tcc index 0dc41e0..6b74db4 100644 --- a/src/bsp_simple.tcc +++ b/src/bsp_simple.tcc @@ -98,7 +98,19 @@ namespace CosmoTool *(*i) = current; allocated.push(current); - } + } + + template + bool BSP::inside(const typename space_t::coord_t& p) const + { + node_t *current = root; + + do + { + } + while(); + current + } };