diff --git a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx index 310837ff5a..fc9074212b 100644 --- a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx +++ b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx @@ -908,169 +908,6 @@ di << "transfert resultat" << "\n"; return 0; } - - -//======================================================================= -//function : DT_SupportModification -//purpose : Changes the supports of a Shell -// The given surface wil support all the faces of the new shell. -// with the PCurves of the old ones. -// -//======================================================================= -/*static Standard_Integer DT_SupportModification (Draw_Interpretor& di, - Standard_Integer n, const char** a) - -{ - // a[1]= result - // a[2]= input Shell - // a[3]= new Surface - // a[4]= 2d3d Scale Factor - - if (n !=5) { - di << "bad number of arguments" <<"\n"; - return 1; - } - - TopoDS_Shape inputShape= DBRep::Get(a[2]); - TopoDS_Shell inputShell = TopoDS::Shell(inputShape); - if (inputShell.IsNull()) { - di << a[2] << " is not a shell" << "\n"; - return 1; - } - - Handle(Geom_Surface) theSurf = DrawTrSurf::GetSurface(a[3]); - if ( theSurf.IsNull()) { - di << a[3] << " is not a surface" << "\n"; - return 1; - } - - ShapeUpgrade_DataMapOfShapeSurface theMap; - // Associates thesurf to each face of inputShell. - TopExp_Explorer ExpSh; - for (ExpSh.Init(inputShell,TopAbs_FACE); ExpSh.More(); ExpSh.Next()){ - TopoDS_Face theFace= TopoDS::Face(ExpSh.Current()); - theMap.Bind(theFace,theSurf); - } - - Standard_Real the2d3dFactor=Draw::Atof(a[4]); - ShapeUpgrade_SupportModification theTool(inputShell,theMap,the2d3dFactor); - - TopoDS_Shell res = theTool.Shell(); - DBRep::Set(a[1],res); - - return 0; -}*/ - -//======================================================================= -//function : DT_Debug -//purpose : activation of the debug mode -// -//======================================================================= -/* -static Standard_Integer DT_Debug (Draw_Interpretor& di, - Standard_Integer n, const char** a) - -{ - // a[1]= 0/1 - - if (n !=2) { - di << "bad number of arguments" <<"\n"; - return 1; - } - - if (Draw::Atoi(a[1])==1) { - di << "Activation of debug messages"<<"\n"; - ShapeUpgrade::SetDebug(Standard_True); - } - else { - di << "Desactivation of debug messages"<<"\n"; - ShapeUpgrade::SetDebug(Standard_False); - } - return 0; -} -*/ - -/*static Standard_Integer shellsolid - (Draw_Interpretor& di, Standard_Integer argc, const char** argv) -{ - if (argc < 4) { - di<<"Donner option + nom de SHAPE + nom de RESULTAT"<<"\n"; - di<<"Options : a all (sewing sur tous les shells\n" - << " c check (sewing sur shells avec bad edges\n" - <<" b bad edges\n f free edges"<<"\n"; - return 1 ; - } - Standard_CString arg1 = argv[1]; - Standard_CString arg2 = argv[2]; - Standard_CString arg3 = argv[3]; - - TopoDS_Shape Shape = DBRep::Get(arg2); - if (Shape.IsNull()) { di<<"Shape unknown : "<Add (TopoDS::Edge(edges.Current())); nbe ++; - } - ShapeAnalysis_WireOrder WO (Standard_True,BRepBuilderAPI::Precision()); - ShapeAnalysis_Wire saw; - saw.Load ( Frees ); - saw.SetPrecision ( BRepBuilderAPI::Precision() ); - saw.CheckOrder ( WO ); - - Standard_Integer stat = WO.Status(); - di<<"Wire Order Status = "<Length() / 2; - myOrd = new TColStd_HArray1OfInteger(1,nb); myOrd->Init(0); + myStat = 0; + Standard_Integer i, nb = NbEdges(); + if(nb == 0) + return; // no edges loaded, nothing to do -- return with status OK + myOrd = new TColStd_HArray1OfInteger(1,nb); + myOrd->Init(0); Handle(TColStd_HSequenceOfInteger) seq = new TColStd_HSequenceOfInteger; TColStd_SequenceOfTransient loops; diff --git a/tests/bugs/heal/bug25014 b/tests/bugs/heal/bug25014 new file mode 100755 index 0000000000..492bc7ec23 --- /dev/null +++ b/tests/bugs/heal/bug25014 @@ -0,0 +1,10 @@ +puts "============" +puts "OCC25014" +puts "============" +puts "" +####################################################################### +## ShapeAnalysis_WireOrder produces Standard_RangeError on empty wire (debug mode only) +####################################################################### + +shape w w +stwire w r +r