From e00cd745b3406aef8c5a0c9decb50d01f6fa66dd Mon Sep 17 00:00:00 2001 From: ink Date: Wed, 30 Dec 2015 13:55:57 +0300 Subject: [PATCH] 0026168: Lost colors for IGES import --- src/IGESToBRep/IGESToBRep_Actor.cxx | 4 +- .../ShapeProcess_ShapeContext.cxx | 41 +++++++++++++------ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/IGESToBRep/IGESToBRep_Actor.cxx b/src/IGESToBRep/IGESToBRep_Actor.cxx index ac79cedfc4..4509e48ddf 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/IGESToBRep/IGESToBRep_Actor.cxx @@ -185,7 +185,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer theeps = eps*CAS.GetUnitFactor(); // Interface_Static::SetRVal("lastpreci",theeps); } - Standard_Integer nbTPitems = TP->NbMapped(); + //Standard_Integer nbTPitems = TP->NbMapped(); { try { OCC_CATCH_SIGNALS @@ -205,7 +205,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer "read.iges.resource.name", "read.iges.sequence", info, TP->GetProgress() ); - XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems); + XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info); } ShapeExtend_Explorer SBE; diff --git a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx index 526dcaa71f..b58feca7d1 100644 --- a/src/ShapeProcess/ShapeProcess_ShapeContext.cxx +++ b/src/ShapeProcess/ShapeProcess_ShapeContext.cxx @@ -270,22 +270,35 @@ static void RecModif (const TopoDS_Shape &S, const Handle(ShapeExtend_MsgRegistrator) &msg, TopTools_DataMapOfShapeShape &map, Handle(ShapeExtend_MsgRegistrator) &myMsg, - const TopAbs_ShapeEnum until) + const TopAbs_ShapeEnum until, + Standard_Boolean theResetLocation = Standard_False) { if(S.IsNull()) return; //gka -modification to keep history for shape with location (OCC21617) TopLoc_Location aNullLoc; TopoDS_Shape aS = S.Located(aNullLoc); - TopoDS_Shape r = aS; - - if ( map.IsBound ( r ) ) - r = map.Find ( r ); + TopoDS_Shape aSh = S; + + if(aSh.ShapeType() == TopAbs_COMPOUND || theResetLocation) + { + aSh.Location(aNullLoc); + theResetLocation = Standard_False; + } + + TopoDS_Shape r = aSh; + if ( map.IsBound ( aS ) ) + r = map.Find ( aS ); if ( ! r.IsNull() ) { TopoDS_Shape res; - if ( repl->Status (r, res, Standard_True ) && res != r ) + if ( repl->Status (r, res, Standard_True ) > 0 && res != r ) + { + if(res.ShapeType() < S.ShapeType()) + { + theResetLocation = Standard_True; + } map.Bind ( aS, res ); - + } // Treat special case: if S was split, r will be a compound of // resulting shapes, recursive procedure should be applied else if ( r.ShapeType() < S.ShapeType() ) { @@ -314,17 +327,21 @@ static void RecModif (const TopoDS_Shape &S, } if ( until == TopAbs_SHAPE || S.ShapeType() >= until ) return; - - for ( TopoDS_Iterator it(S,Standard_False/*,Standard_False*/); it.More(); it.Next() ) { - RecModif ( it.Value(), repl, msg, map, myMsg, until ); + + Standard_Integer i = 1; + for ( TopoDS_Iterator it(aSh,Standard_False/*,Standard_False*/); it.More(); it.Next(),i++ ) { + RecModif ( it.Value(), repl, msg, map, myMsg, until, theResetLocation ); } + } void ShapeProcess_ShapeContext::RecordModification (const Handle(ShapeBuild_ReShape) &repl, const Handle(ShapeExtend_MsgRegistrator) &msg) { - - RecModif ( myShape, repl, msg, myMap, myMsg, myUntil ); + TopLoc_Location aNullLoc; + TopoDS_Shape aS = myShape; + aS = myShape.Located(aNullLoc); + RecModif ( aS, repl, msg, myMap, myMsg, myUntil ); if ( myMap.IsBound(myShape) ) { myResult = myMap.Find ( myShape ); -- 2.39.5