diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index fad3bc0325..54f2ff569d 100755 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -3389,6 +3389,168 @@ static Standard_Integer OCC25547( return 0; } +#include +#include +#include +#include +#include +#ifdef WNT +#define EXCEPTION ... +#else +#define EXCEPTION Standard_Failure +#endif + +static ShapeExtend_Status getStatusGap(const Handle(ShapeFix_Wire)& theFix, + const Standard_Boolean theIs3d) +{ + for (Standard_Integer i=ShapeExtend_OK; i<=ShapeExtend_FAIL; i++) + { + Standard_Boolean isFound; + if (theIs3d) + isFound = theFix->StatusGaps3d( (ShapeExtend_Status) i ); + else + isFound = theFix->StatusGaps2d( (ShapeExtend_Status) i ); + if (isFound) return ShapeExtend_Status(i); + } + return ShapeExtend_OK; +} + +//=================== +//function : OCC24881 +//purpose : +//=================== +static Standard_Integer OCC24881 (Draw_Interpretor& di, Standard_Integer narg , const char** a) +{ + if (narg < 2) { + di<<"Usage: "<Load (aSrcWire); + aWireFix->SetFace (TopoDS::Face(aFace)); + aWireFix->FixReorder(); //correct order is a prerequisite + // fix 3d + if (!aWireFix->FixGaps3d()) + { + // not fixed, why? + aStatus = getStatusGap(aWireFix, Standard_True); + if (aStatus == ShapeExtend_OK) + wasOk = Standard_True; + else + { + // keep 3d fail status + if (aStatusNbDMap.IsBound (aStatus)) + aStatusNbDMap(aStatus)++; + else + aStatusNbDMap.Bind(aStatus,1); + continue; + } + } + + // fix 2d + if (aWireFix->FixGaps2d()) + nbFixed++; + else + { + aStatus = getStatusGap(aWireFix, Standard_False); + if (aStatus == ShapeExtend_OK) + { + if (wasOk) + { + nbOk++; + continue; + } + else + nbFixed++; + } + else + { + // keep 2d fail status + Standard_Integer aStatus2d = aStatus + ShapeExtend_FAIL; + if (aStatusNbDMap.IsBound (aStatus2d)) + aStatusNbDMap(aStatus2d)++; + else + aStatusNbDMap.Bind(aStatus2d,1); + continue; + } + } + } + } +//End: STEP 7 + } catch (EXCEPTION) { + di << "Exception is raised = " <