return;
SeqOfGroupsDefs::Iterator anIter( *theGroupsDefs );
+ if (theAlgo->History().IsNull())
+ return;
+
for ( ; anIter.More(); anIter.Next() )
{
GroupDefinition& aGroupDef = anIter.ChangeValue();
{
TopoDS_Shape aShape = aGroupDef.Shapes.Value( i );
- TopoDS_Shape aGeneratedByAlgo = TopoDS_Shape();
- if ( !theAlgo->History().IsNull() && ! aShape.IsNull())
+ TopoDS_Shape aModifSh;
+ if ( !aShape.IsNull())
+ {
+ const TopTools_ListOfShape& listModified = theAlgo->History()->Modified(aShape);
+ if (listModified.Extent() > 0)
{
- const TopTools_ListOfShape& listModified = theAlgo->History()->Modified(aShape);
- if (listModified.Extent() > 0)
- aGeneratedByAlgo = listModified.First();
+ aModifSh = listModified.First();
+ // Edge has been modified
+ aShapesToAdd.Append( aModifSh );
+ aGroupDef.Shapes.Remove( i );
+ --i;
}
- if ( aGeneratedByAlgo.IsNull() )
- {
- // Edge has been removed
- aGroupDef.Shapes.Remove( i );
- --i;
- }
- else if ( !aShape.IsEqual( aGeneratedByAlgo ) )
- {
- // Edge has been modified
- aShapesToAdd.Append( aGeneratedByAlgo );
- aGroupDef.Shapes.Remove( i );
- --i;
+ else if ( theAlgo->History()->IsRemoved(aShape) )
+ {
+ // Edge has been removed
+ aGroupDef.Shapes.Remove( i );
+ --i;
+ }
+
}
- }
+ }
HYDROData_ShapesTool::AddShapes( aGroupDef.Shapes, aShapesToAdd );
}