fix Enumerate(IndexMap)

This commit is contained in:
Joachim Schoeberl 2021-11-06 16:14:19 +01:00
parent 50398c18c4
commit 1eca091fd3
2 changed files with 6 additions and 1 deletions

View File

@ -395,9 +395,14 @@ namespace netgen
(*testout) << "faces = " << geom.fmap.Extent() << endl; (*testout) << "faces = " << geom.fmap.Extent() << endl;
int curr = 0; int curr = 0;
/*
for (int i3 = 1; i3 <= geom.fmap.Extent(); i3++) for (int i3 = 1; i3 <= geom.fmap.Extent(); i3++)
{ {
TopoDS_Face face = TopoDS::Face(geom.fmap(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 facenr = geom.fmap.FindIndex (face); // sollte doch immer == i3 sein ??? JS
if (facenr != i3) if (facenr != i3)
cout << "info: facenr != i3, no problem, but please report to developers" << endl; cout << "info: facenr != i3, no problem, but please report to developers" << endl;

View File

@ -292,7 +292,7 @@ namespace netgen
const TopTools_IndexedMapOfShape & indmap; const TopTools_IndexedMapOfShape & indmap;
IndexMapIterator (const TopTools_IndexedMapOfShape & aindmap) : indmap(aindmap) { } IndexMapIterator (const TopTools_IndexedMapOfShape & aindmap) : indmap(aindmap) { }
Iterator begin() { return Iterator(indmap, 1); } 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) inline auto Enumerate (const TopTools_IndexedMapOfShape & indmap)