From 1eca091fd3fd6dfc350a433ab924ef512b51b2f5 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 6 Nov 2021 16:14:19 +0100 Subject: [PATCH] fix Enumerate(IndexMap) --- libsrc/occ/occgenmesh.cpp | 5 +++++ libsrc/occ/occgeom.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 8bb2ce6a..8683c36f 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -395,9 +395,14 @@ namespace netgen (*testout) << "faces = " << geom.fmap.Extent() << endl; int curr = 0; + /* for (int i3 = 1; i3 <= geom.fmap.Extent(); i3++) { TopoDS_Face face = TopoDS::Face(geom.fmap(i3)); + */ + for (auto [i3,faceshape] : Enumerate(geom.fmap)) + { + TopoDS_Face face = TopoDS::Face(faceshape); facenr = geom.fmap.FindIndex (face); // sollte doch immer == i3 sein ??? JS if (facenr != i3) cout << "info: facenr != i3, no problem, but please report to developers" << endl; diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index c6abf5f1..3ab07700 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -292,7 +292,7 @@ namespace netgen const TopTools_IndexedMapOfShape & indmap; IndexMapIterator (const TopTools_IndexedMapOfShape & aindmap) : indmap(aindmap) { } Iterator begin() { return Iterator(indmap, 1); } - Iterator end() { return Iterator(indmap, indmap.Extent()); } + Iterator end() { return Iterator(indmap, indmap.Extent()+1); } }; inline auto Enumerate (const TopTools_IndexedMapOfShape & indmap)