- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(aMainShape, anIndices);
+ CORBA::String_var aMainIOR = geom->GetStringFromIOR(aShape->GetMainShape());
+ TCollection_AsciiString mainIOR = (char*)aMainIOR.in();
+
+ //find subshapes only one time
+ if (_mySubShapes.count(mainIOR) == 0)
+ {
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aMainShape, anIndices);
+ Standard_Integer ii = 1, nbSubSh = anIndices.Extent();
+ for (; ii <= nbSubSh; ii++)
+ {
+ _mySubShapes[mainIOR].push_back(anIndices.FindKey(ii));
+ }
+ }