+ //if nothing changes => the result shape should be the same
+ //hence the map will be empty
+
+ NCollection_IndexedDataMap<TopoDS_Face, TopoDS_Face> ShF2FHistory;
+ RemoveInternal(aResult, &ShF2FHistory);
+
+ //one face => mark as unchanged
+ if( aListOfFaces.Extent() == 1 )
+ ShHistory.Add(aResult, TopTools_ListOfShape());
+
+ NCollection_IndexedDataMap<TopoDS_Face, QString> aChF2ST;
+ QStringList aSTypes;
+ //
+ for( int i = 1; i <= theMap.Extent(); i++ )
+ {
+ TopoDS_Face aFF = theMap.FindKey(i);
+ //DEBTRACE(" --- " << aFF);
+ if( aFF.IsNull() )
+ continue;
+ //DEBTRACE(ShHistory.IsEmpty());
+ //DEBTRACE(aFF.Checked());
+ TopTools_ListOfShape aLS;
+ try
+ {
+ aLS = ShHistory.FindFromKey(aFF); //TODO: bug to fix. Observed on an incomplete split of a face
+ }
+ catch (...)
+ {
+ DEBTRACE("TODO: bug to fix. Observed on an incomplete split of a face");
+ //continue; // No, keep aLS empty and propagate the type of the original face
+ }
+ if (aLS.IsEmpty())
+ {
+ //DEBTRACE("--- aLS.IsEmpty()");
+ QString aSType = theMap.FindFromKey(aFF);
+ //DEBTRACE(" --- " << aSType.toStdString());
+ if (ShF2FHistory.Contains(aFF))
+ {
+ //DEBTRACE("ShF2FHistory.FindFromKey(aFF) " << ShF2FHistory.FindFromKey(aFF));
+ aChF2ST.Add(ShF2FHistory.FindFromKey(aFF), aSType);
+ }
+ else
+ {
+ //DEBTRACE("aFF " << aFF);
+ aChF2ST.Add(aFF, aSType);
+ }
+ }
+ else
+ {
+ //DEBTRACE("--- !aLS.IsEmpty()");
+ TopTools_ListIteratorOfListOfShape anIt(aLS);
+ for (; anIt.More(); anIt.Next())
+ {
+ QString aSType = theMap.FindFromKey(aFF);
+ //DEBTRACE(" --- " << aSType.toStdString());
+ const TopoDS_Face& aMF = TopoDS::Face(anIt.Value());
+ //if (ShF2FHistory.Contains(aFF))
+ if (ShF2FHistory.Contains(aMF))
+ {
+ //DEBTRACE("ShF2FHistory.FindFromKey(aMF) " << ShF2FHistory.FindFromKey(aFF));
+ aChF2ST.Add(ShF2FHistory.FindFromKey(aMF), aSType);
+ }
+ else
+ {
+ //DEBTRACE("aMF " << aMF);
+ aChF2ST.Add(aMF, aSType);
+ }
+ }
+ }
+ }
+ //