diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 2a55a8fa..2842c7e8 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -19,8 +19,15 @@
  • make all negative handles invalid, not just -1
  • Several warnings fixed (Including the checked iterators)
  • split_copy and split_edge_copy operations now also copy internal properties.
  • +
  • fix halfedge indices in OpenMeshTrimeshCirculatorHalfedgeLoop CWAndCCWCheck
  • +
  • Fix wrong behaviour of HalfedgeLoopIterators by changing the template parameter
  • +
  • Added 1-4 triangle split funtion(splits all edges at Midpoints)
  • +Utils + Tools Unittests diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake index d75ba753..6918c7d9 100644 --- a/cmake/FindGoogleTest.cmake +++ b/cmake/FindGoogleTest.cmake @@ -45,7 +45,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) ~/sw/gtest-1.8.0/include ~/sw/gtest-1.7.0/include ~/sw/gtest/include - /ACG/acgdev/gcc-4.7-x86_64/gtest/include + /ACG/acgdev/gcc-x86_64/gtest/include /opt/local/include /usr/local/include /usr/include @@ -56,7 +56,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) ~/sw/gtest-1.8.0/lib ~/sw/gtest-1.7.0/lib ~/sw/gtest/lib - /ACG/acgdev/gcc-4.7-x86_64/gtest/lib + /ACG/acgdev/gcc-x86_64/gtest/lib /opt/local/lib /usr/local/lib /usr/lib @@ -67,7 +67,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES) ~/sw/gtest-1.8.0/lib ~/sw/gtest-1.7.0/lib ~/sw/gtest/lib - /ACG/acgdev/gcc-4.7-x86_64/gtest/lib + /ACG/acgdev/gcc-x86_64/gtest/lib /opt/local/lib /usr/local/lib /usr/lib diff --git a/src/OpenMesh/Core/Geometry/QuadricT.hh b/src/OpenMesh/Core/Geometry/QuadricT.hh index fdec0c9c..8d2943ae 100644 --- a/src/OpenMesh/Core/Geometry/QuadricT.hh +++ b/src/OpenMesh/Core/Geometry/QuadricT.hh @@ -218,7 +218,7 @@ public: template Scalar operator()(const _Vec& _v) const { - return evaluate(_v, GenProg::Int2Type<_Vec::size_>()); + return evaluate(_v, GenProg::Int2Type::size_>()); } Scalar a() const { return a_; } diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.hh b/src/OpenMesh/Core/Mesh/PolyConnectivity.hh index 5dfc9daf..3a93941f 100644 --- a/src/OpenMesh/Core/Mesh/PolyConnectivity.hh +++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.hh @@ -1123,6 +1123,9 @@ public: ITER_TYPE (CONTAINER_TYPE::*end_fn)() const> class EntityRange { public: + typedef ITER_TYPE iterator; + typedef ITER_TYPE const_iterator; + EntityRange(CONTAINER_TYPE &container) : container_(container) {} ITER_TYPE begin() const { return (container_.*begin_fn)(); } ITER_TYPE end() const { return (container_.*end_fn)(); } @@ -1184,12 +1187,15 @@ public: ITER_TYPE (CONTAINER_TYPE::*end_fn)(CENTER_ENTITY_TYPE) const> class CirculatorRange { public: + typedef ITER_TYPE iterator; + typedef ITER_TYPE const_iterator; + CirculatorRange( const CONTAINER_TYPE &container, CENTER_ENTITY_TYPE center) : container_(container), center_(center) {} - ITER_TYPE begin() { return (container_.*begin_fn)(center_); } - ITER_TYPE end() { return (container_.*end_fn)(center_); } + ITER_TYPE begin() const { return (container_.*begin_fn)(center_); } + ITER_TYPE end() const { return (container_.*end_fn)(center_); } private: const CONTAINER_TYPE &container_; diff --git a/src/Unittests/unittests_cpp_11_features.cc b/src/Unittests/unittests_cpp_11_features.cc index c6d673e4..fa992673 100644 --- a/src/Unittests/unittests_cpp_11_features.cc +++ b/src/Unittests/unittests_cpp_11_features.cc @@ -249,6 +249,72 @@ TEST_F(OpenMesh_Poly, cpp11_vvrange_test) { EXPECT_EQ(iteration_counter,4); } + +/** + * @brief Test combined vertex iterator and vertex vertex iter. + */ +TEST_F(OpenMesh_Triangle, cpp11_test_enumerate_combined_run) { + //check empty vv_range + mesh_.clear(); + Mesh::VertexHandle vhandle[5]; + vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0)); + for(Mesh::VertexHandle t : mesh_.vv_range(vhandle[0])) + { + FAIL() << "The vvrange for a single vertex in a TriMesh is not empty"; + EXPECT_TRUE(t.is_valid()); // Just so we don't get an unused variable warning. + } + + //add more vertices + vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0)); + vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 3)); + vhandle[3] = mesh_.add_vertex(Mesh::Point(0,-1, 4)); + vhandle[4] = mesh_.add_vertex(Mesh::Point(2,3, 5)); + + // Add 4 faces + std::vector face_vhandles; + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[2]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[4]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[1]); + mesh_.add_face(face_vhandles); + + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[4]); + mesh_.add_face(face_vhandles); + + Mesh::Point p = Mesh::Point(0,0,0); + for ( auto vh : mesh_.vertices() ) { + + for ( auto vv_it : mesh_.vv_range(vh) ) { + p += mesh_.point(vv_it); + } + + } + + EXPECT_EQ(p[0],16); + EXPECT_EQ(p[1],12); + EXPECT_EQ(p[2],36); + +} + + #endif }