0022767: Extension of DRAW command fixshape
authorDBV <>
Fri, 16 Dec 2011 11:18:18 +0000 (11:18 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:31:36 +0000 (19:31 +0400)
src/SHMessage/SHAPE.fr
src/SHMessage/SHAPE.us
src/SWDRAW/SWDRAW_ShapeFix.cxx
src/ShapeFix/ShapeFix_Face.cxx
src/ShapeFix/ShapeFix_Shell.cxx
src/ShapeFix/ShapeFix_Wire.cxx

index a48e2ab..f1ab94b 100755 (executable)
@@ -86,10 +86,10 @@ L'arete n0 %d etait petite, supprimee
 Auto-intersection corrigee
 !
 .FixAdvWire.FixIntersection.MSG5
 Auto-intersection corrigee
 !
 .FixAdvWire.FixIntersection.MSG5
-L'arete %d etait auto-intersectante, corrigee
+L'arete etait auto-intersectante, corrigee
 !
 .FixAdvWire.FixIntersection.MSG10
 !
 .FixAdvWire.FixIntersection.MSG10
-Les aretes n0 %d et %d s'intersectaient, corrigees
+Les aretes s'intersectent, corrigees
 !
 .FixAdvWire.FixLacking.MSG0
 Insertion d'arete(s) manquante(s)
 !
 .FixAdvWire.FixLacking.MSG0
 Insertion d'arete(s) manquante(s)
@@ -118,11 +118,8 @@ Face creee avec bords naturels
 .FixAdvFace.FixOrientation.MSG5
 Contour sur face inverse
 !
 .FixAdvFace.FixOrientation.MSG5
 Contour sur face inverse
 !
-.FixAdvFace.FixOrientation.MSG10
-Le Contour n0 %d parmi %d de la face a ete inverse
-!
 .FixAdvFace.FixOrientation.MSG11
 .FixAdvFace.FixOrientation.MSG11
-Impossible d'orienter les contour n0 %d parmi %d
+Impossible d'orienter le contour
 !
 .FixAdvShell.FixOrientation.MSG20
 Impossible d'orienter les faces dans le shell, creation de plusieurs shells
 !
 .FixAdvShell.FixOrientation.MSG20
 Impossible d'orienter les faces dans le shell, creation de plusieurs shells
index 36d4ef2..ff4a0bb 100755 (executable)
@@ -94,10 +94,10 @@ Edge %d was small, removed
 Self-intersection corrected
 !
 .FixAdvWire.FixIntersection.MSG5
 Self-intersection corrected
 !
 .FixAdvWire.FixIntersection.MSG5
-Edge %d was self-intersecting, corrected
+Edge was self-intersecting, corrected
 !
 .FixAdvWire.FixIntersection.MSG10
 !
 .FixAdvWire.FixIntersection.MSG10
-Edges %d and %d were intersecting, corrected
+Edges were intersecting, corrected
 !
 .FixAdvWire.FixLacking.MSG0
 Lacking edge(s) inserted
 !
 .FixAdvWire.FixLacking.MSG0
 Lacking edge(s) inserted
@@ -126,11 +126,8 @@ Face created with natural bounds
 .FixAdvFace.FixOrientation.MSG5
 Wire on face was reversed
 !
 .FixAdvFace.FixOrientation.MSG5
 Wire on face was reversed
 !
-.FixAdvFace.FixOrientation.MSG10
-Wire %d of %d on face was reversed
-!
 .FixAdvFace.FixOrientation.MSG11
 .FixAdvFace.FixOrientation.MSG11
-Cannot orient wire %d of %d
+Cannot orient wire
 !
 .FixAdvShell.FixOrientation.MSG20
 Impossible to orient faces in shell, several shells created
 !
 .FixAdvShell.FixOrientation.MSG20
 Impossible to orient faces in shell, several shells created
@@ -148,7 +145,7 @@ Orientation of shell(s) in solid was corrected
 Improperly connected solid split into several parts
 !
 .FixAdvFace.FixLoopWire.MSG0
 Improperly connected solid split into several parts
 !
 .FixAdvFace.FixLoopWire.MSG0
-Wire was splitted on %d wires
+Wire was splitted on several wires
 !
 .FixAdvFace..MSG5
 !
 !
 .FixAdvFace..MSG5
 !
index 451087b..6c8ea3e 100755 (executable)
@@ -17,6 +17,7 @@
 #include <TopoDS_Iterator.hxx>
 #include <TopExp_Explorer.hxx>
 #include <BRep_Tool.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopExp_Explorer.hxx>
 #include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
 #include <BRepBuilderAPI.hxx>
 #include <BRepTopAdaptor_FClass2d.hxx>
 
 #include <BRepBuilderAPI.hxx>
 #include <BRepTopAdaptor_FClass2d.hxx>
 
@@ -40,6 +41,8 @@
 #include <Message_ListIteratorOfListOfMsg.hxx>
 #include <Message_Msg.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <Message_ListIteratorOfListOfMsg.hxx>
 #include <Message_Msg.hxx>
 #include <TCollection_AsciiString.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfAsciiStringInteger.hxx>
+#include <TColStd_DataMapOfAsciiStringInteger.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_DataMapOfShapeListOfShape.hxx>
 #include <TopAbs_State.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_DataMapOfShapeListOfShape.hxx>
 #include <TopAbs_State.hxx>
@@ -395,15 +398,15 @@ static Standard_Integer fixshape (Draw_Interpretor& di, Standard_Integer argc, c
     if ( argv[i][0] == '-' || argv[i][0] == '+' || argv[i][0] == '*' ) {
       Standard_Integer val = ( argv[i][0] == '-' ? 0 : argv[i][0] == '+' ? 1 : -1 );
       switch ( argv[i][1] ) {
     if ( argv[i][0] == '-' || argv[i][0] == '+' || argv[i][0] == '*' ) {
       Standard_Integer val = ( argv[i][0] == '-' ? 0 : argv[i][0] == '+' ? 1 : -1 );
       switch ( argv[i][1] ) {
-      case 'l': sfs->FixWireTool()->FixLackingMode()          = val;
-      case 'o': sfs->FixFaceTool()->FixOrientationMode()      = val;
-      case 'h': sfs->FixWireTool()->FixShiftedMode()          = val;
-      case 'm': sfs->FixFaceTool()->FixMissingSeamMode()      = val;
-      case 'd': sfs->FixWireTool()->FixDegeneratedMode()      = val;
-      case 's': sfs->FixWireTool()->FixSmallMode()            = val;
-      case 'i': sfs->FixWireTool()->FixSelfIntersectionMode() = val;
-      case 'n': sfs->FixWireTool()->FixNotchedEdgesMode()     = val;
-      case '?': mess                                          = val;
+      case 'l': sfs->FixWireTool()->FixLackingMode()          = val; break;
+      case 'o': sfs->FixFaceTool()->FixOrientationMode()      = val; break;
+      case 'h': sfs->FixWireTool()->FixShiftedMode()          = val; break;
+      case 'm': sfs->FixFaceTool()->FixMissingSeamMode()      = val; break;
+      case 'd': sfs->FixWireTool()->FixDegeneratedMode()      = val; break;
+      case 's': sfs->FixWireTool()->FixSmallMode()            = val; break;
+      case 'i': sfs->FixWireTool()->FixSelfIntersectionMode() = val; break;
+      case 'n': sfs->FixWireTool()->FixNotchedEdgesMode()     = val; break;
+      case '?': mess                                          = val; break;
       }
       continue;
     }
       }
       continue;
     }
@@ -444,24 +447,49 @@ static Standard_Integer fixshape (Draw_Interpretor& di, Standard_Integer argc, c
   sfs->Perform (aProgress);
   DBRep::Set (res,sfs->Shape());
 
   sfs->Perform (aProgress);
   DBRep::Set (res,sfs->Shape());
 
-  if ( mess ) {
-    Standard_Integer num = 0;
+  if ( mess ) 
+  {
+    TColStd_DataMapOfAsciiStringInteger aMapOfNumberOfFixes;
+    Standard_SStream aSStream;
+    TopoDS_Compound aCompound;
+    BRep_Builder aBuilder;
+    aBuilder.MakeCompound (aCompound);
     const ShapeExtend_DataMapOfShapeListOfMsg &map = msg->MapShape();
     const ShapeExtend_DataMapOfShapeListOfMsg &map = msg->MapShape();
-    for ( ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg it(map); it.More(); it.Next() ) {
-      //cout << it.Key().TShape()->DynamicType()->Name() << " " << *(void**)&it.Key().TShape();
-      Standard_SStream aSStream;
-      aSStream << it.Key().TShape()->DynamicType()->Name() << " " << *(void**)&it.Key().TShape();
-      di << aSStream;
-
-      if ( mess <0 ) {
-        char buff[256];
-        sprintf ( buff, "%s_%d", res, ++num );
-        di << " (saved in DRAW shape " << buff << ")";
-        DBRep::Set (buff,it.Key());
+    // Counting the number of each type of fixes. If the switch '*?' store all modified shapes in compound.
+    for ( ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg it ( map ); it.More(); it.Next() )
+    {
+      for ( Message_ListIteratorOfListOfMsg iter ( it.Value() ); iter.More(); iter.Next() )
+      {
+        if ( aMapOfNumberOfFixes.IsBound ( iter.Value().Value() ) )
+        {
+          aMapOfNumberOfFixes ( iter.Value().Value() )++;
+        }
+        else
+        {
+          aMapOfNumberOfFixes.Bind ( iter.Value().Value(), 1 );
+        }
       }
       }
-      di << ":" << "\n";
-      for (Message_ListIteratorOfListOfMsg iter (it.Value()); iter.More(); iter.Next())
-        di << "  " << TCollection_AsciiString(iter.Value().Value()).ToCString() << "\n";
+      if ( mess < 0 )
+      {
+        aBuilder.Add ( aCompound, it.Key() );
+      }
+    }
+    
+    aSStream << " Fix" << setw (58) << "Count\n";
+    aSStream << " ------------------------------------------------------------\n";
+    for ( TColStd_DataMapIteratorOfDataMapOfAsciiStringInteger anIter ( aMapOfNumberOfFixes ); anIter.More(); anIter.Next() )
+    {
+      aSStream << " " << anIter.Key() << setw ( 60 - anIter.Key().Length() ) << anIter.Value() << "\n";
+    }
+    aSStream << " ------------------------------------------------------------\n";
+    di << aSStream;
+
+    if ( mess < 0 )
+    {
+      char buff[256];
+      sprintf ( buff, "%s_%s", res, "m" );
+      di << " Modified shapes saved in compound: " << buff;
+      DBRep::Set (buff, aCompound);
     }
   }
   
     }
   }
   
index 5cc1987..2c6255b 100755 (executable)
@@ -517,7 +517,8 @@ Standard_Boolean ShapeFix_Face::Perform()
         //fix for loop of wire
         TopTools_SequenceOfShape aLoopWires;
         if(NeedFix ( myFixLoopWiresMode) && FixLoopWire(aLoopWires)) {
         //fix for loop of wire
         TopTools_SequenceOfShape aLoopWires;
         if(NeedFix ( myFixLoopWiresMode) && FixLoopWire(aLoopWires)) {
-          
+          if (aLoopWires.Length() > 1)
+            SendWarning ( wire, Message_Msg ( "FixAdvFace.FixLoopWire.MSG0" ) );// Wire was splitted on several wires
           myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
           fixed = Standard_True;
           Standard_Integer k=1;
           myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
           fixed = Standard_True;
           Standard_Integer k=1;
@@ -776,7 +777,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
     }
 
 //    B.UpdateFace (myFace,myPrecision);
     }
 
 //    B.UpdateFace (myFace,myPrecision);
-    SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG0"));//Face created with natural bounds
+    SendWarning ( myFace, Message_Msg ( "FixAdvFace.FixOrientation.MSG0" ) );// Face created with natural bounds
     BRepTools::Update(myFace);
     return Standard_True;
   }
     BRepTools::Update(myFace);
     return Standard_True;
   }
@@ -926,7 +927,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
 #ifdef DEBUG
   cout<<"Natural bound on sphere or torus with holes added"<<endl; // mise au point !
 #endif
 #ifdef DEBUG
   cout<<"Natural bound on sphere or torus with holes added"<<endl; // mise au point !
 #endif
-  SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG0"));//Face created with natural bounds
+  SendWarning ( myFace, Message_Msg ( "FixAdvFace.FixOrientation.MSG0" ) );// Face created with natural bounds
   return Standard_True;
 }
 
   return Standard_True;
 }
 
@@ -1033,7 +1034,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
         new ShapeExtend_WireData (TopoDS::Wire(ws.Value(1)));
       sbdw->Reverse ( myFace );
       ws.SetValue ( 1, sbdw->Wire() );
         new ShapeExtend_WireData (TopoDS::Wire(ws.Value(1)));
       sbdw->Reverse ( myFace );
       ws.SetValue ( 1, sbdw->Wire() );
-      SendWarning (Message_Msg ("FixAdvFace.FixOrientation.MSG5"));//Wire on face was reversed
+      SendWarning ( sbdw->Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
       done = Standard_True;
 #ifdef DEBUG
       cout<<"Wire reversed"<<endl; // mise au point !
       done = Standard_True;
 #ifdef DEBUG
       cout<<"Wire reversed"<<endl; // mise au point !
@@ -1179,10 +1180,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
       }
 
       if (sta == TopAbs_UNKNOWN) {    // ERREUR
       }
 
       if (sta == TopAbs_UNKNOWN) {    // ERREUR
-       Message_Msg MSG ("FixAdvFace.FixOrientation.MSG11"); //Cannot orient wire %d of %d
-       MSG.Arg (i);
-       MSG.Arg (nb);
-       SendWarning (MSG);
+        SendWarning ( aw, Message_Msg ( "FixAdvFace.FixOrientation.MSG11" ) );// Cannot orient wire
       } 
       else {
         MW.Bind(aw,IntWires);
       } 
       else {
         MW.Bind(aw,IntWires);
@@ -1193,6 +1191,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
+            SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
             aSeqReversed.Append(i);
             done = Standard_True;
             SI.Bind(ws.Value(i),1);
             aSeqReversed.Append(i);
             done = Standard_True;
             SI.Bind(ws.Value(i),1);
@@ -1223,6 +1222,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
+            SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
             aSeqReversed.Append(i);
             done = Standard_True;
             MapWires.Bind(ws.Value(i),IW);
             aSeqReversed.Append(i);
             done = Standard_True;
             MapWires.Bind(ws.Value(i),IW);
@@ -1235,6 +1235,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
             ShapeExtend_WireData sewd (aw);
             sewd.Reverse(myFace);
             ws.SetValue (i,sewd.Wire());
+            SendWarning ( sewd.Wire(), Message_Msg ( "FixAdvFace.FixOrientation.MSG5" ) );// Wire on face was reversed
             aSeqReversed.Append(i);
             done = Standard_True;
           }
             aSeqReversed.Append(i);
             done = Standard_True;
           }
@@ -1271,13 +1272,10 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
     myFace = TopoDS::Face ( S );
     BRepTools::Update(myFace);
     Standard_Integer k =1;
     myFace = TopoDS::Face ( S );
     BRepTools::Update(myFace);
     Standard_Integer k =1;
-    for( ; k <= aSeqReversed.Length();k++) {
-      Message_Msg MSG ("FixAdvFace.FixOrientation.MSG10"); //Wire %d of %d on face was reversed
-      MSG.Arg (aSeqReversed.Value(k));
-      MSG.Arg (nb);
-      SendWarning (MSG);
+    for( ; k <= aSeqReversed.Length(); k++ )
+    {
 #ifdef DEBUG
 #ifdef DEBUG
-       cout<<"Wire no "<<aSeqReversed.Value(k)<<" of "<<nb<<" reversed"<<endl; // mise au point !
+      cout<<"Wire no "<<aSeqReversed.Value(k)<<" of "<<nb<<" reversed"<<endl; // mise au point !
 #endif
     }
       
 #endif
     }
       
@@ -1650,7 +1648,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
     BRepTools::Update(myFace); //:p4
   }
 
     BRepTools::Update(myFace); //:p4
   }
 
-  SendWarning (Message_Msg ("FixAdvFace.FixMissingSeam.MSG0"));//Missing seam-edge added
+  SendWarning ( Message_Msg ( "FixAdvFace.FixMissingSeam.MSG0" ) );// Missing seam-edge added
   return Standard_True;
 }
 
   return Standard_True;
 }
 
@@ -1679,8 +1677,13 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
         continue;
     TopoDS_Wire wire = TopoDS::Wire ( wi.Value() );
     Handle(ShapeAnalysis_Wire) saw = new ShapeAnalysis_Wire(wire,myFace,prec);
         continue;
     TopoDS_Wire wire = TopoDS::Wire ( wi.Value() );
     Handle(ShapeAnalysis_Wire) saw = new ShapeAnalysis_Wire(wire,myFace,prec);
-    if ( saw->CheckSmallArea(prec) ) nbRemoved++;
-    else {
+    if ( saw->CheckSmallArea(prec) )
+    {
+      SendWarning ( wire, Message_Msg ("FixAdvFace.FixSmallAreaWire.MSG0") );// Null area wire detected, wire skipped
+      nbRemoved++;
+    }
+    else
+    {
       B.Add(face,wire);
       nbWires++;
     }
       B.Add(face,wire);
       nbWires++;
     }
@@ -1698,7 +1701,6 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire()
 #endif
   if ( ! Context().IsNull() ) Context()->Replace ( myFace, face );
   myFace = face;
 #endif
   if ( ! Context().IsNull() ) Context()->Replace ( myFace, face );
   myFace = face;
-  SendWarning (Message_Msg ("FixAdvFace.FixSmallAreaWire.MSG0"));//Null area wire detected, wire skipped
   return Standard_True;
 }
 //=======================================================================
   return Standard_True;
 }
 //=======================================================================
@@ -1907,12 +1909,10 @@ Standard_Boolean ShapeFix_Face::FixLoopWire(TopTools_SequenceOfShape& aResWires)
   }
   
   Standard_Boolean isDone =(aResWires.Length() && isClosed);
   }
   
   Standard_Boolean isDone =(aResWires.Length() && isClosed);
-  if(isDone && aResWires.Length() >1) {
-    
-      Message_Msg MSG ("FixAdvFace.FixLoopWire.MSG0"); //Wire was splitted on %d wires
-      MSG.Arg (aResWires.Length());
+  if(isDone && aResWires.Length() >1)
+  {
 #ifdef DEBUG
 #ifdef DEBUG
-      cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
+    cout<<"Wire was splitted on "<<aResWires.Length()<<" wires"<< endl;
 #endif
   }
 
 #endif
   }
 
index f49a2dc..65d95dd 100755 (executable)
@@ -903,7 +903,7 @@ Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,co
     
     done = Standard_True;
     myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL);
     
     done = Standard_True;
     myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL);
-    SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG20"));//Faces were incorrectly oriented in the shell, a few shells were created;
+    SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG20" ) );// Impossible to orient faces in shell, several shells created
     return Standard_True;
   }
   if(aNumMultShell >1) {
     return Standard_True;
   }
   if(aNumMultShell >1) {
@@ -958,10 +958,10 @@ Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,co
     myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE2);
     if(!Context().IsNull())
       Context()->Replace(shell, myShape);
     myStatus = ShapeExtend::EncodeStatus (ShapeExtend_DONE2);
     if(!Context().IsNull())
       Context()->Replace(shell, myShape);
-    if( myNbShells == 1)
-    SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG0"));//Faces were incorrectly oriented in the shell, corrected
+    if ( myNbShells == 1 )
+      SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG0" ) );// Faces were incorrectly oriented in the shell, corrected
     else
     else
-      SendWarning (Message_Msg ("FixAdvShell.FixOrientation.MSG30"));//Bad connected shell ,a few shells were created.
+      SendWarning ( Message_Msg ( "FixAdvShell.FixOrientation.MSG30" ) );// Improperly connected shell split into parts
     return Standard_True;
   }
   else return Standard_False;
     return Standard_True;
   }
   else return Standard_False;
index a3eae03..428ef6f 100755 (executable)
@@ -442,10 +442,7 @@ Standard_Integer ShapeFix_Wire::FixSmall (const Standard_Boolean lockvtx,
     FixSmall ( i, lockvtx, precsmall );
     myStatusSmall |= myLastFixStatus;
   }
     FixSmall ( i, lockvtx, precsmall );
     myStatusSmall |= myLastFixStatus;
   }
-  
-  if ( StatusSmall ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
-    SendWarning (Message_Msg ("FixAdvWire.FixSmall.MSG0"));//Small edge(s) removed
-  }
+
   return StatusSmall ( ShapeExtend_DONE );
 
 }
   return StatusSmall ( ShapeExtend_DONE );
 
 }
@@ -673,12 +670,12 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves()
         TopLoc_Location L;
         Standard_Real first, last;
         BRep_Tool::CurveOnSurface ( sbwd->Edge(i), C, S, L, first, last );
         TopLoc_Location L;
         Standard_Real first, last;
         BRep_Tool::CurveOnSurface ( sbwd->Edge(i), C, S, L, first, last );
-        if ( C.IsNull() ) {
+        if ( C.IsNull() )
+        {
+          SendWarning ( sbwd->Edge ( i ), Message_Msg ( "FixWire.FixCurve3d.Removed" ) );// Incomplete edge (with no pcurves or 3d curve) removed
           sbwd->Remove ( i-- );
           nb--;
           myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
           sbwd->Remove ( i-- );
           nb--;
           myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
-          if ( ! myShape.IsNull() ) 
-            SendWarning (Message_Msg ("FixWire.FixCurve3d.Removed")); // Incomplete edge (with no pcurves or 3d curve) removed
         }
        myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL5 );
       }
         }
        myStatusEdgeCurves |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL5 );
       }
@@ -776,10 +773,6 @@ Standard_Boolean ShapeFix_Wire::FixDegenerated()
     }
     else prevcoded = coded; 
   }
     }
     else prevcoded = coded; 
   }
-  
-  if ( StatusDegenerated ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
-    SendWarning (Message_Msg ("FixWire.FixDegenerated.MSG0")); //Degenerated edge(s) detected
-  }
 
   return StatusDegenerated ( ShapeExtend_DONE );
 }
 
   return StatusDegenerated ( ShapeExtend_DONE );
 }
@@ -935,9 +928,6 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersection()
 */
   }
 
 */
   }
 
-  if ( StatusSelfIntersection ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
-    SendWarning (Message_Msg ("FixAdvWire.FixIntersection.MSG0")); // Self-intersection corrected
-  }
   return StatusSelfIntersection ( ShapeExtend_DONE );
 }
 
   return StatusSelfIntersection ( ShapeExtend_DONE );
 }
 
@@ -1077,7 +1067,9 @@ Standard_Boolean ShapeFix_Wire::FixSmall (const Standard_Integer num,
   else myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
 
   // action: remove edge
   else myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
 
   // action: remove edge
-  if ( ! Context().IsNull() ) Context()->Remove(WireData()->Edge(n));
+  if ( ! Context().IsNull() ) 
+    Context()->Remove(WireData()->Edge(n));
+  SendWarning ( WireData()->Edge ( n ), Message_Msg ( "FixAdvWire.FixSmall.MSG0" ) ); //Small edge(s) removed
   WireData()->Remove ( n );
   
   // call FixConnected in the case if vertices of the small edge were not the same
   WireData()->Remove ( n );
   
   // call FixConnected in the case if vertices of the small edge were not the same
@@ -1089,12 +1081,7 @@ Standard_Boolean ShapeFix_Wire::FixSmall (const Standard_Integer num,
       savLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 );
     myLastFixStatus = savLastFixStatus;
   }
       savLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL3 );
     myLastFixStatus = savLastFixStatus;
   }
-  
-  if ( ! myShape.IsNull() ) {
-    Message_Msg MSG ("FixAdvWire.FixSmall.MSG0"); //Small edge %d removed
-    MSG.Arg (n);
-    SendWarning (MSG);
-  }
+
   return Standard_True;
 }
 
   return Standard_True;
 }
 
@@ -1633,10 +1620,10 @@ Standard_Boolean ShapeFix_Wire::FixDegenerated (const Standard_Integer num)
     sbwd->Set ( degEdge, n2 );
     myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
   }
     sbwd->Set ( degEdge, n2 );
     myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
   }
-//: abv 28.08.01 - commented to avoid extra messages
-//  Message_Msg MSG ("FixWire.FixDegenerated.MSG5"); //Degenerated edge %d detected
-//  MSG.Arg (n2);
-//  SendWarning (MSG);
+
+//  commented to avoid extra messages
+//  SendWarning ( degEdge, Message_Msg ( "FixWire.FixDegenerated.MSG0" ) );// Degenerated edge(s) detected
+
   return Standard_True;
 }
 
   return Standard_True;
 }
 
@@ -2214,9 +2201,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge (const Standard_Integer
   }
 
   if ( LastFixStatus ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
   }
 
   if ( LastFixStatus ( ShapeExtend_DONE ) && ! myShape.IsNull() ) {
-    Message_Msg MSG ("FixAdvWire.FixIntersection.MSG5"); //Edge %d was self-intersecting, corrected
-    MSG.Arg (num);
-    SendWarning (MSG);
+    SendWarning ( E, Message_Msg ( "FixAdvWire.FixIntersection.MSG5" ) );// Edge was self-intersecting, corrected
   }
 
   return LastFixStatus ( ShapeExtend_DONE );
   }
 
   return LastFixStatus ( ShapeExtend_DONE );
@@ -2418,10 +2403,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num
     myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
   }
   if ( ! myShape.IsNull() ) {
     myLastFixStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE7 );
   }
   if ( ! myShape.IsNull() ) {
-    Message_Msg MSG ("FixAdvWire.FixIntersection.MSG10"); //Edges %d and %d were intersecting, corrected
-    MSG.Arg (n1);
-    MSG.Arg (n2);
-    SendWarning (MSG);
+    SendWarning ( Message_Msg ( "FixAdvWire.FixIntersection.MSG10" ) );// Edges were intersecting, corrected
   }
   return Standard_True;
 }
   }
   return Standard_True;
 }
@@ -2600,10 +2582,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges (const Standard_Integer num
     if(newTolers(i)>0) B.UpdateVertex(TopoDS::Vertex(vertices(i)),newTolers(i));
   
   if ( ! myShape.IsNull() ) {
     if(newTolers(i)>0) B.UpdateVertex(TopoDS::Vertex(vertices(i)),newTolers(i));
   
   if ( ! myShape.IsNull() ) {
-    Message_Msg MSG ("FixAdvWire.FixIntersection.MSG10"); //Edges %d and %d were intersecting, corrected
-    MSG.Arg (n1);
-    MSG.Arg (n2);
-    SendWarning (MSG);
+    SendWarning ( Message_Msg ( "FixAdvWire.FixIntersection.MSG10" ) );// Edges were intersecting, corrected
   }
   return Standard_True;
 }
   }
   return Standard_True;
 }