]> OCCT Git - occt-copy.git/commitdiff
0026168: Lost colors for IGES import
authorink <ink@opencascade.com>
Wed, 30 Dec 2015 10:55:57 +0000 (13:55 +0300)
committerink <ink@opencascade.com>
Wed, 30 Dec 2015 10:59:16 +0000 (13:59 +0300)
src/IGESToBRep/IGESToBRep_Actor.cxx
src/ShapeProcess/ShapeProcess_ShapeContext.cxx

index ac79cedfc4a50a8dfab64d8433eed343d8b2d763..4509e48ddf8103227a6371657ad7a3ff0db38251 100644 (file)
@@ -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;
index 526dcaa71f3821bd97330e26975408b06af56b07..b58feca7d15eb600ccea06fe91b00f590e3ad1e6 100644 (file)
@@ -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 );