diff --git a/src/BRepCheck/BRepCheck.cxx b/src/BRepCheck/BRepCheck.cxx index a290d5ae53..5215d1a438 100755 --- a/src/BRepCheck/BRepCheck.cxx +++ b/src/BRepCheck/BRepCheck.cxx @@ -80,112 +80,44 @@ Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W, void BRepCheck::Print(const BRepCheck_Status stat, Standard_OStream& OS) { +#define PRINT_CASE(stat) case stat: OS << #stat "\n"; break switch (stat) { - case BRepCheck_NoError: - OS << "BRepCheck_NoError\n"; - break; - case BRepCheck_InvalidPointOnCurve: - OS << "BRepCheck_InvalidPointOnCurve\n"; - break; - case BRepCheck_InvalidPointOnCurveOnSurface: - OS << "BRepCheck_InvalidPointOnCurveOnSurface\n"; - break; - case BRepCheck_InvalidPointOnSurface: - OS << "BRepCheck_InvalidPointOnSurface\n"; - break; - case BRepCheck_No3DCurve: - OS << "BRepCheck_No3DCurve\n"; - break; - case BRepCheck_Multiple3DCurve: - OS << "BRepCheck_Multiple3DCurve\n"; - break; - case BRepCheck_Invalid3DCurve: - OS << "BRepCheck_Invalid3DCurve\n"; - break; - case BRepCheck_NoCurveOnSurface: - OS << "BRepCheck_NoCurveOnSurface\n"; - break; - case BRepCheck_InvalidCurveOnSurface: - OS << "BRepCheck_InvalidCurveOnSurface\n"; - break; - case BRepCheck_InvalidCurveOnClosedSurface: - OS << "BRepCheck_InvalidCurveOnClosedSurface\n"; - break; - case BRepCheck_InvalidSameRangeFlag: - OS << "BRepCheck_InvalidSameRangeFlag\n"; - break; - case BRepCheck_InvalidSameParameterFlag: - OS << "BRepCheck_InvalidSameParameterFlag\n"; - break; - case BRepCheck_InvalidDegeneratedFlag: - OS << "BRepCheck_InvalidDegeneratedFlag\n"; - break; - case BRepCheck_FreeEdge: - OS << "BRepCheck_FreeEdge\n"; - break; - case BRepCheck_InvalidMultiConnexity: - OS << "BRepCheck_InvalidMultiConnexity\n"; - break; - case BRepCheck_InvalidRange: - OS << "BRepCheck_InvalidRange\n"; - break; - case BRepCheck_EmptyWire: - OS << "BRepCheck_EmptyWire\n"; - break; - case BRepCheck_RedundantEdge: - OS << "BRepCheck_RedundantEdge\n"; - break; - case BRepCheck_SelfIntersectingWire: - OS << "BRepCheck_SelfIntersectingWire\n"; - break; - case BRepCheck_NoSurface: - OS << "BRepCheck_NoSurface\n"; - break; - case BRepCheck_InvalidWire: - OS << "BRepCheck_InvalidWire\n"; - break; - case BRepCheck_RedundantWire: - OS << "BRepCheck_RedundantWire\n"; - break; - case BRepCheck_IntersectingWires: - OS << "BRepCheck_IntersectingWires\n"; - break; - case BRepCheck_InvalidImbricationOfWires: - OS << "BRepCheck_InvalidImbricationOfWires\n"; - break; - case BRepCheck_EmptyShell: - OS << "BRepCheck_EmptyShell\n"; - break; - case BRepCheck_RedundantFace: - OS << "BRepCheck_RedundantFace\n"; - break; - case BRepCheck_UnorientableShape: - OS << "BRepCheck_UnorientableShape\n"; - break; - case BRepCheck_NotClosed: - OS << "BRepCheck_NotClosed\n"; - break; - case BRepCheck_NotConnected: - OS << "BRepCheck_NotConnected\n"; - break; - case BRepCheck_SubshapeNotInShape: - OS << "BRepCheck_SubshapeNotInShape\n"; - break; - case BRepCheck_BadOrientation: - OS << "BRepCheck_BadOrientation\n"; - break; - case BRepCheck_BadOrientationOfSubshape: - OS << "BRepCheck_BadOrientationOfSubshape\n"; - break; - case BRepCheck_CheckFail: - OS << "BRepCheck_CheckFail\n"; - break; -#ifndef DEB + PRINT_CASE(BRepCheck_NoError); + PRINT_CASE(BRepCheck_InvalidPointOnCurve); + PRINT_CASE(BRepCheck_InvalidPointOnCurveOnSurface); + PRINT_CASE(BRepCheck_InvalidPointOnSurface); + PRINT_CASE(BRepCheck_No3DCurve); + PRINT_CASE(BRepCheck_Multiple3DCurve); + PRINT_CASE(BRepCheck_Invalid3DCurve); + PRINT_CASE(BRepCheck_NoCurveOnSurface); + PRINT_CASE(BRepCheck_InvalidCurveOnSurface); + PRINT_CASE(BRepCheck_InvalidCurveOnClosedSurface); + PRINT_CASE(BRepCheck_InvalidSameRangeFlag); + PRINT_CASE(BRepCheck_InvalidSameParameterFlag); + PRINT_CASE(BRepCheck_InvalidDegeneratedFlag); + PRINT_CASE(BRepCheck_FreeEdge); + PRINT_CASE(BRepCheck_InvalidMultiConnexity); + PRINT_CASE(BRepCheck_InvalidRange); + PRINT_CASE(BRepCheck_EmptyWire); + PRINT_CASE(BRepCheck_RedundantEdge); + PRINT_CASE(BRepCheck_SelfIntersectingWire); + PRINT_CASE(BRepCheck_NoSurface); + PRINT_CASE(BRepCheck_InvalidWire); + PRINT_CASE(BRepCheck_RedundantWire); + PRINT_CASE(BRepCheck_IntersectingWires); + PRINT_CASE(BRepCheck_InvalidImbricationOfWires); + PRINT_CASE(BRepCheck_EmptyShell); + PRINT_CASE(BRepCheck_RedundantFace); + PRINT_CASE(BRepCheck_UnorientableShape); + PRINT_CASE(BRepCheck_NotClosed); + PRINT_CASE(BRepCheck_NotConnected); + PRINT_CASE(BRepCheck_SubshapeNotInShape); + PRINT_CASE(BRepCheck_BadOrientation); + PRINT_CASE(BRepCheck_BadOrientationOfSubshape); + PRINT_CASE(BRepCheck_InvalidToleranceValue); + PRINT_CASE(BRepCheck_CheckFail); default: break; -#endif } } - - diff --git a/src/BRepCheck/BRepCheck_Edge.cxx b/src/BRepCheck/BRepCheck_Edge.cxx index efe5ace99e..833ce9c5fe 100755 --- a/src/BRepCheck/BRepCheck_Edge.cxx +++ b/src/BRepCheck/BRepCheck_Edge.cxx @@ -63,8 +63,6 @@ #include #include - -//modified by NIZNHY-PKV Thu May 05 09:01:57 2011f static Standard_Boolean Validate(const Adaptor3d_Curve&, const Adaptor3d_CurveOnSurface&, @@ -83,12 +81,6 @@ static static Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS); -//static Standard_Boolean Validate(const Adaptor3d_Curve&, -// const Adaptor3d_Curve&, -// const Standard_Real, -// const Standard_Boolean); -//modified by NIZNHY-PKV Thu May 05 09:02:01 2011t - #define NCONTROL 23 //======================================================================= @@ -230,7 +222,6 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S) Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape)); TopAbs_ShapeEnum styp = S.ShapeType(); -// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) { TopExp_Explorer exp(S,TopAbs_EDGE) ; for ( ; exp.More(); exp.Next()) { if (exp.Current().IsSame(myShape)) { @@ -244,6 +235,9 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S) switch (styp) { case TopAbs_FACE: + if(BRep_Tool::Tolerance(TopoDS::Face(S)) - Tol > Precision::Confusion()) + BRepCheck::Add(lst,BRepCheck_InvalidToleranceValue); + if (!myCref.IsNull()) { Standard_Boolean SameParameter = TE->SameParameter(); diff --git a/src/BRepCheck/BRepCheck_Vertex.cxx b/src/BRepCheck/BRepCheck_Vertex.cxx index 358a68badf..812dafb4f7 100755 --- a/src/BRepCheck/BRepCheck_Vertex.cxx +++ b/src/BRepCheck/BRepCheck_Vertex.cxx @@ -22,6 +22,7 @@ #include +#include #include #include @@ -46,9 +47,9 @@ #include #include -#include #include #include +#include //======================================================================= //function : BRepCheck_Vertex @@ -115,7 +116,6 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) case TopAbs_EDGE: { // Try to find the vertex on the edge - const TopoDS_Edge& E = TopoDS::Edge(S); TopoDS_Iterator itv(E.Oriented(TopAbs_FORWARD)); TopoDS_Vertex VFind; @@ -149,9 +149,15 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) // VFind is not null for sure TopAbs_Orientation orv = VFind.Orientation(); - Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); - Tol = Max(Tol,BRep_Tool::Tolerance(E)); // to check - Tol *= Tol; + Standard_Real TolV = TV->Tolerance(); + Standard_Real TolE = BRep_Tool::Tolerance(E); + if (TolE > TolV) + { + if (TolE - TolV > Precision::Confusion()) + BRepCheck::Add(myMap(S),BRepCheck_InvalidToleranceValue); + TolV = TolE; + } + Standard_Real aTol2 = TolV * TolV; Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); @@ -173,7 +179,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) if (pr->IsPointOnCurve(C,L)) { Controlp = C->Value(pr->Parameter()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { + if (prep.SquareDistance(Controlp) > aTol2) { BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve); } } @@ -184,14 +190,14 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) if (orv == TopAbs_FORWARD || multiple) { Controlp = C->Value(GC->First()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { + if (prep.SquareDistance(Controlp) > aTol2) { BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve); } } if (orv == TopAbs_REVERSED || multiple) { Controlp = C->Value(GC->Last()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { + if (prep.SquareDistance(Controlp) > aTol2) { BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve); } } @@ -212,18 +218,16 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) gp_Pnt2d p2d = PC->Value(pr->Parameter()); Controlp = Su->Value(p2d.X(),p2d.Y()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { - BRepCheck::Add(myMap(S), - BRepCheck_InvalidPointOnCurveOnSurface); + if (prep.SquareDistance(Controlp) > aTol2) { + BRepCheck::Add(myMap(S), BRepCheck_InvalidPointOnCurveOnSurface); } } if (!PC2.IsNull() && pr->IsPointOnCurveOnSurface(PC2,Su,L)) { gp_Pnt2d p2d = PC2->Value(pr->Parameter()); Controlp = Su->Value(p2d.X(),p2d.Y()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { - BRepCheck::Add(myMap(S), - BRepCheck_InvalidPointOnCurveOnSurface); + if (prep.SquareDistance(Controlp) > aTol2) { + BRepCheck::Add(myMap(S), BRepCheck_InvalidPointOnCurveOnSurface); } } itpr.Next(); @@ -247,9 +251,15 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) const Handle(Geom_Surface)& Su = TF->Surface(); TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location()); - Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); - Tol = Max(Tol,BRep_Tool::Tolerance(TopoDS::Face(S))); // to check - Tol *= Tol; + Standard_Real TolV = TV->Tolerance(); + Standard_Real TolF = TF->Tolerance(); + if (TolF > TolV) + { + if (TolF - TolV > Precision::Confusion()) + BRepCheck::Add(myMap(S),BRepCheck_InvalidToleranceValue); + TolV = TolF; + } + Standard_Real aTol2 = TolV * TolV; BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); while (itpr.More()) { @@ -257,7 +267,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) if (pr->IsPointOnSurface(Su,L)) { Controlp = Su->Value(pr->Parameter(),pr->Parameter2()); Controlp.Transform(L.Transformation()); - if (prep.SquareDistance(Controlp)> Tol) { + if (prep.SquareDistance(Controlp) > aTol2) { BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnSurface); } } diff --git a/src/BRepTest/BRepTest_CheckCommands.cxx b/src/BRepTest/BRepTest_CheckCommands.cxx index b6ea15b43c..d46467805c 100755 --- a/src/BRepTest/BRepTest_CheckCommands.cxx +++ b/src/BRepTest/BRepTest_CheckCommands.cxx @@ -76,6 +76,7 @@ #include #include +#include //#ifdef WNT #include @@ -114,13 +115,13 @@ Standard_IMPORT Standard_Integer BRepCheck_Trace(const Standard_Integer phase); //function : FindNamed //======================================================================= static Standard_Boolean FindNamed(const TopoDS_Shape& S, - char*& Name) + const char*& Name) { for (Standard_Integer i = 1 ;i <= lfaulty.Length(); i++) { Handle(DBRep_DrawableShape) DS = Handle(DBRep_DrawableShape)::DownCast(lfaulty(i)); if (DS->Shape().IsSame(S)) { - Name = (char*)DS->Name(); + Name = DS->Name(); return Standard_True; } } @@ -154,7 +155,6 @@ static void PrintSub(Standard_OStream& OS, const TopAbs_ShapeEnum Subtype) { - char* Name; BRepCheck_ListIteratorOfListOfStatus itl; TopExp_Explorer exp; for (exp.Init(S,Subtype); exp.More(); exp.Next()) { @@ -168,25 +168,27 @@ static void PrintSub(Standard_OStream& OS, theMap(sub).Append(S); itl.Initialize(res->StatusOnShape()); if (itl.Value() != BRepCheck_NoError) { - if (!FindNamed(sub,Name)) { + const char* pName; + if (!FindNamed(sub,pName)) { nbfaulty++; - Name = (char*)malloc(18*sizeof(char)); - sprintf(Name,"%s%d",checkfaultyname,nbfaulty); - DBRep::Set(Name,sub); - lfaulty.Append(Draw::Get((Standard_CString&)Name)); - } - OS << "Shape " << Name << " "; - if (!FindNamed(S,Name)) { - nbfaulty++; - Name = (char*)malloc(18*sizeof(char)); - sprintf(Name,"%s%d",checkfaultyname,nbfaulty); - DBRep::Set(Name,S); - lfaulty.Append(Draw::Get((Standard_CString&)Name)); - } - OS << " on shape " << Name << " :\n"; - for (;itl.More(); itl.Next()) { - BRepCheck::Print(itl.Value(),OS); - } + char aName[256]; + sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty); + DBRep::Set(aName,sub); + pName = aName; + lfaulty.Append(Draw::Get(pName)); + OS << "Shape " << pName << " "; + if (!FindNamed(S,pName)) { + nbfaulty++; + sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty); + DBRep::Set(aName,S); + pName = aName; + lfaulty.Append(Draw::Get(pName)); + } + OS << " on shape " << pName << " :\n"; + for (;itl.More(); itl.Next()) { + BRepCheck::Print(itl.Value(),OS); + } + } } break; } @@ -206,20 +208,21 @@ static void Print(Standard_OStream& OS, Print(OS,Ana,iter.Value()); } - char* Name; TopAbs_ShapeEnum styp = S.ShapeType(); BRepCheck_ListIteratorOfListOfStatus itl; if (!Ana.Result(S).IsNull() && !theMap.IsBound(S)) { itl.Initialize(Ana.Result(S)->Status()); if (itl.Value() != BRepCheck_NoError) { - if (!FindNamed(S,Name)) { + const char* pName; + char aName[256]; + if (!FindNamed(S,pName)) { nbfaulty++; - Name = (char*)malloc(18*sizeof(char)); - sprintf(Name,"%s%d",checkfaultyname,nbfaulty); - DBRep::Set(Name,S); - lfaulty.Append(Draw::Get((Standard_CString&)Name)); + sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty); + DBRep::Set(aName,S); + pName = aName; + lfaulty.Append(Draw::Get(pName)); } - OS << "On Shape " << Name << " :\n"; + OS << "On Shape " << pName << " :\n"; for (;itl.More(); itl.Next()) { BRepCheck::Print(itl.Value(),OS); @@ -466,99 +469,18 @@ void ContextualDump(Draw_Interpretor& theCommands, nbfaulty = 0; lfaulty.Clear(); - //Print(cout, theAna, theShape); Standard_SStream aSStream; Print(aSStream, theAna, theShape); theCommands << aSStream; - //cout<<"\n"; theCommands<<"\n"; theMap.Clear(); if (nbfaulty !=0) theCommands<<"Faulty shapes in variables "<SetValue(1,NbProblems->Value(1)+1); break; - case BRepCheck_InvalidPointOnCurveOnSurface: - NbProblems->SetValue(2,NbProblems->Value(2)+1); break; - case BRepCheck_InvalidPointOnSurface: - NbProblems->SetValue(3,NbProblems->Value(3)+1); break; - case BRepCheck_No3DCurve: - NbProblems->SetValue(4,NbProblems->Value(4)+1); break; - case BRepCheck_Multiple3DCurve: - NbProblems->SetValue(5,NbProblems->Value(5)+1); break; - case BRepCheck_Invalid3DCurve: - NbProblems->SetValue(6,NbProblems->Value(6)+1); break; - case BRepCheck_NoCurveOnSurface: - NbProblems->SetValue(7,NbProblems->Value(7)+1); break; - case BRepCheck_InvalidCurveOnSurface: - NbProblems->SetValue(8,NbProblems->Value(8)+1); break; - case BRepCheck_InvalidCurveOnClosedSurface: - NbProblems->SetValue(9,NbProblems->Value(9)+1); break; - case BRepCheck_InvalidSameRangeFlag: - NbProblems->SetValue(10,NbProblems->Value(10)+1); break; - case BRepCheck_InvalidSameParameterFlag: - NbProblems->SetValue(11,NbProblems->Value(11)+1); break; - case BRepCheck_InvalidDegeneratedFlag: - NbProblems->SetValue(12,NbProblems->Value(12)+1); break; - case BRepCheck_FreeEdge: - NbProblems->SetValue(13,NbProblems->Value(13)+1); break; - case BRepCheck_InvalidMultiConnexity: - NbProblems->SetValue(14,NbProblems->Value(14)+1); break; - case BRepCheck_InvalidRange: - NbProblems->SetValue(15,NbProblems->Value(15)+1); break; - case BRepCheck_EmptyWire: - NbProblems->SetValue(16,NbProblems->Value(16)+1); break; - case BRepCheck_RedundantEdge: - NbProblems->SetValue(17,NbProblems->Value(17)+1); break; - case BRepCheck_SelfIntersectingWire: - NbProblems->SetValue(18,NbProblems->Value(18)+1); break; - case BRepCheck_NoSurface: - NbProblems->SetValue(19,NbProblems->Value(19)+1); break; - case BRepCheck_InvalidWire: - NbProblems->SetValue(20,NbProblems->Value(20)+1); break; - case BRepCheck_RedundantWire: - NbProblems->SetValue(21,NbProblems->Value(21)+1); break; - case BRepCheck_IntersectingWires: - NbProblems->SetValue(22,NbProblems->Value(22)+1); break; - case BRepCheck_InvalidImbricationOfWires: - NbProblems->SetValue(23,NbProblems->Value(23)+1); break; - case BRepCheck_EmptyShell: - NbProblems->SetValue(24,NbProblems->Value(24)+1); break; - case BRepCheck_RedundantFace: - NbProblems->SetValue(25,NbProblems->Value(25)+1); break; - case BRepCheck_UnorientableShape: - NbProblems->SetValue(26,NbProblems->Value(26)+1); break; - case BRepCheck_NotClosed: - NbProblems->SetValue(27,NbProblems->Value(27)+1); break; - case BRepCheck_NotConnected: - NbProblems->SetValue(28,NbProblems->Value(28)+1); break; - case BRepCheck_SubshapeNotInShape: - NbProblems->SetValue(29,NbProblems->Value(29)+1); break; - case BRepCheck_BadOrientation: - NbProblems->SetValue(30,NbProblems->Value(30)+1); break; - case BRepCheck_BadOrientationOfSubshape: - NbProblems->SetValue(31,NbProblems->Value(31)+1); break; - case BRepCheck_CheckFail: - NbProblems->SetValue(32,NbProblems->Value(32)+1); break; - default: - break; - } -} //======================================================================= @@ -593,13 +515,13 @@ static void GetProblemSub(const BRepCheck_Analyzer& Ana, if(ii>sl->Length()) { sl->Append(sub); - FillProblems(itl.Value(),NbProblems); + NbProblems->ChangeValue(itl.Value())++; } for(ii=1; ii<=sl->Length(); ii++) if(sl->Value(ii).IsSame(Shape)) break; if(ii>sl->Length()) { sl->Append(Shape); - FillProblems(itl.Value(),NbProblems); + NbProblems->ChangeValue(itl.Value())++; } } break; @@ -628,7 +550,7 @@ static void GetProblemShapes(const BRepCheck_Analyzer& Ana, if (itl.Value() != BRepCheck_NoError) { sl->Append(Shape); - FillProblems(itl.Value(),NbProblems); + NbProblems->ChangeValue(itl.Value())++; } } if (!theMap.IsBound(Shape)) { @@ -653,7 +575,6 @@ static void GetProblemShapes(const BRepCheck_Analyzer& Ana, default: break; } - } //======================================================================= @@ -672,122 +593,60 @@ void StructuralDump(Draw_Interpretor& theCommands, const TopoDS_Shape &theShape) { Standard_Integer i; - //cout << "StructuralDump" << endl; - //cout << " -- The Shape " << ShName << " has problems :"<SetValue(i,0); + Handle(TColStd_HArray1OfInteger) NbProblems = new TColStd_HArray1OfInteger(1,33); + for (i=1; i<=33; i++) NbProblems->SetValue (i,0); Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo; sl = new TopTools_HSequenceOfShape(); theMap.Clear(); GetProblemShapes(theAna, theShape, sl, NbProblems); theMap.Clear(); - if(NbProblems->Value(1)>0) - theCommands<<" Invalid Point on Curve ................... "<Value(1)<<"\n"; - //cout<<" Invalid Point on Curve ................... "<Value(1)<Value(2)>0) - theCommands<<" Invalid Point on CurveOnSurface .......... "<Value(2)<<"\n"; - //cout<<" Invalid Point on CurveOnSurface .......... "<Value(2)<Value(3)>0) - theCommands<<" Invalid Point on Surface ................. "<Value(3)<<"\n"; - //cout<<" Invalid Point on Surface ................. "<Value(3)<Value(4)>0) - theCommands<<" No 3D Curve .............................. "<Value(4)<<"\n"; - //cout<<" No 3D Curve .............................. "<Value(4)<Value(5)>0) - theCommands<<" Multiple 3D Curve ........................ "<Value(5)<<"\n"; - //cout<<" Multiple 3D Curve ........................ "<Value(5)<Value(6)>0) - theCommands<<" Invalid 3D Curve ......................... "<Value(6)<<"\n"; - //cout<<" Invalid 3D Curve ......................... "<Value(6)<Value(7)>0) - theCommands<<" No Curve on Surface ...................... "<Value(7)<<"\n"; - //cout<<" No Curve on Surface ...................... "<Value(7)<Value(8)>0) - theCommands<<" Invalid Curve on Surface ................. "<Value(8)<<"\n"; - //cout<<" Invalid Curve on Surface ................. "<Value(8)<Value(9)>0) - theCommands<<" Invalid Curve on closed Surface .......... "<Value(9)<<"\n"; - //cout<<" Invalid Curve on closed Surface .......... "<Value(9)<Value(10)>0) - theCommands<<" Invalid SameRange Flag ................... "<Value(10)<<"\n"; - //cout<<" Invalid SameRange Flag ................... "<Value(10)<Value(11)>0) - theCommands<<" Invalid SameParameter Flag ............... "<Value(11)<<"\n"; - //cout<<" Invalid SameParameter Flag ............... "<Value(11)<Value(12)>0) - theCommands<<" Invalid Degenerated Flag ................. "<Value(12)<<"\n"; - //cout<<" Invalid Degenerated Flag ................. "<Value(12)<Value(13)>0) - theCommands<<" Free Edge ................................ "<Value(13)<<"\n"; - //cout<<" Free Edge ................................ "<Value(13)<Value(14)>0) - theCommands<<" Invalid MultiConnexity ................... "<Value(14)<<"\n"; - //cout<<" Invalid MultiConnexity ................... "<Value(14)<Value(15)>0) - theCommands<<" Invalid Range ............................ "<Value(15)<<"\n"; - //cout<<" Invalid Range ............................ "<Value(15)<Value(16)>0) - theCommands<<" Empty Wire ............................... "<Value(16)<<"\n"; - //cout<<" Empty Wire ............................... "<Value(16)<Value(17)>0) - theCommands<<" Redundant Edge ........................... "<Value(17)<<"\n"; - //cout<<" Redundant Edge ........................... "<Value(17)<Value(18)>0) - theCommands<<" Self Intersecting Wire ................... "<Value(18)<<"\n"; - //cout<<" Self Intersecting Wire ................... "<Value(18)<Value(19)>0) - theCommands<<" No Surface ............................... "<Value(19)<<"\n"; - //cout<<" No Surface ............................... "<Value(19)<Value(20)>0) - theCommands<<" Invalid Wire ............................. "<Value(20)<<"\n"; - //cout<<" Invalid Wire ............................. "<Value(20)<Value(21)>0) - theCommands<<" Redundant Wire ........................... "<Value(21)<<"\n"; - //cout<<" Redundant Wire ........................... "<Value(21)<Value(22)>0) - theCommands<<" Intersecting Wires ....................... "<Value(22)<<"\n"; - //cout<<" Intersecting Wires ....................... "<Value(22)<Value(23)>0) - theCommands<<" Invalid Imbrication of Wires ............. "<Value(23)<<"\n"; - //cout<<" Invalid Imbrication of Wires ............. "<Value(23)<Value(24)>0) - theCommands<<" Empty Shell .............................. "<Value(24)<<"\n"; - //cout<<" Empty Shell .............................. "<Value(24)<Value(25)>0) - theCommands<<" Redundant Face ........................... "<Value(25)<<"\n"; - //cout<<" Redundant Face ........................... "<Value(25)<Value(26)>0) - theCommands<<" Unorientable Shape ....................... "<Value(26)<<"\n"; - //cout<<" Unorientable Shape ....................... "<Value(26)<Value(27)>0) - theCommands<<" Not Closed ............................... "<Value(27)<<"\n"; - //cout<<" Not Closed ............................... "<Value(27)<Value(28)>0) - theCommands<<" Not Connected ............................ "<Value(28)<<"\n"; - //cout<<" Not Connected ............................ "<Value(28)<Value(29)>0) - theCommands<<" Subshape not in Shape .................... "<Value(29)<<"\n"; - //cout<<" Subshape not in Shape .................... "<Value(29)<Value(30)>0) - theCommands<<" Bad Orientation .......................... "<Value(30)<<"\n"; - //cout<<" Bad Orientation .......................... "<Value(30)<Value(31)>0) - theCommands<<" Bad Orientation of Subshape .............. "<Value(31)<<"\n"; - //cout<<" Bad Orientation of Subshape .............. "<Value(31)<Value(32)>0) - theCommands<<" checkshape failure......... .............. "<Value(32)<<"\n"; - //cout<<" checkshape failure......... .............. "<Value(32)< aProblems (1,33); + + aProblems.SetValue( BRepCheck_InvalidPointOnCurve, " Invalid Point on Curve ................... "); + aProblems.SetValue(BRepCheck_InvalidPointOnCurveOnSurface, " Invalid Point on CurveOnSurface .......... "); + aProblems.SetValue(BRepCheck_InvalidPointOnSurface, " Invalid Point on Surface ................. "); + aProblems.SetValue(BRepCheck_No3DCurve, " No 3D Curve .............................. "); + aProblems.SetValue(BRepCheck_Multiple3DCurve, " Multiple 3D Curve ........................ "); + aProblems.SetValue(BRepCheck_Invalid3DCurve, " Invalid 3D Curve ......................... "); + aProblems.SetValue(BRepCheck_NoCurveOnSurface, " No Curve on Surface ...................... "); + aProblems.SetValue(BRepCheck_InvalidCurveOnSurface, " Invalid Curve on Surface ................. "); + aProblems.SetValue(BRepCheck_InvalidCurveOnClosedSurface, " Invalid Curve on Closed Surface ................. "); + aProblems.SetValue(BRepCheck_InvalidSameRangeFlag, " Invalid SameRange Flag ................... "); + aProblems.SetValue(BRepCheck_InvalidSameParameterFlag, " Invalid SameParameter Flag ............... "); + aProblems.SetValue(BRepCheck_InvalidDegeneratedFlag, " Invalid Degenerated Flag ................. "); + aProblems.SetValue(BRepCheck_FreeEdge, " Free Edge ................................ "); + aProblems.SetValue(BRepCheck_InvalidMultiConnexity, " Invalid Multi Connexity ................... "); + aProblems.SetValue(BRepCheck_InvalidRange, " Invalid Range ................... "); + aProblems.SetValue(BRepCheck_EmptyWire, " Empty Wire ................... "); + aProblems.SetValue(BRepCheck_RedundantEdge, " BRepCheck_RedundantEdge ................... "); + aProblems.SetValue(BRepCheck_SelfIntersectingWire, " Self Intersecting Wire ................... "); + aProblems.SetValue(BRepCheck_NoSurface, " No Surface ................... "); + aProblems.SetValue(BRepCheck_InvalidWire, " Invalid Wire ................... "); + aProblems.SetValue(BRepCheck_RedundantWire, " Redundant Wire ................... "); + aProblems.SetValue(BRepCheck_IntersectingWires, " Intersecting Wires ................... "); + aProblems.SetValue(BRepCheck_InvalidImbricationOfWires, " Invalid Imbrication Of Wires .................. "); + aProblems.SetValue(BRepCheck_EmptyShell, " Empty Shell ................... "); + aProblems.SetValue(BRepCheck_RedundantFace, " Redundant Face ................... "); + aProblems.SetValue(BRepCheck_UnorientableShape, " Unorientable Shape ................... "); + aProblems.SetValue(BRepCheck_NotClosed, " Not Closed ................... "); + aProblems.SetValue(BRepCheck_NotConnected, " Not Connected ................... "); + aProblems.SetValue(BRepCheck_SubshapeNotInShape, " Subshape Not In Shape ................... "); + aProblems.SetValue(BRepCheck_BadOrientation, " Bad Orientation ................... "); + aProblems.SetValue(BRepCheck_BadOrientationOfSubshape, " Bad Orientation of Subshape .............. "); + aProblems.SetValue(BRepCheck_InvalidToleranceValue, " Invalid tolerance value................... "); + aProblems.SetValue(BRepCheck_CheckFail, " Checkshape failure....................... "); + + for (Standard_Integer i = (Standard_Integer)BRepCheck_InvalidPointOnCurve; i <= (Standard_Integer)BRepCheck_CheckFail; ++i) + { + if (NbProblems->Value (i) > 0) + theCommands << i << aProblems.Value (i) << "\n"; + } - //cout<<" ------------------------------------------------"<Length()<Length()<<"\n"; diff --git a/src/GeomliteTest/GeomliteTest_CurveCommands.cxx b/src/GeomliteTest/GeomliteTest_CurveCommands.cxx index 796c7885fe..2d345bd0a8 100755 --- a/src/GeomliteTest/GeomliteTest_CurveCommands.cxx +++ b/src/GeomliteTest/GeomliteTest_CurveCommands.cxx @@ -912,7 +912,8 @@ static Standard_Integer cfindp (Draw_Interpretor& , Standard_Integer n, const ch Draw_Display d = dout.MakeDisplay(view); - Handle(Draw_Drawable3D) D = Draw::Get(a[1]); + Handle( + Draw_Drawable3D) D = Draw::Get(a[1]); Handle(DrawTrSurf_BezierCurve) DBz = Handle(DrawTrSurf_BezierCurve)::DownCast(D);