diff --git a/src/QABugs/QABugs_10.cxx b/src/QABugs/QABugs_10.cxx index 0195192461..45c84fd01f 100644 --- a/src/QABugs/QABugs_10.cxx +++ b/src/QABugs/QABugs_10.cxx @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -49,23 +48,14 @@ #include #include +#include + static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if(argc < 7 || argc > 8) { - di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 8) { + di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 shape7\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 8) { - Standard_Integer IsB = Draw::Atoi(argv[7]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } BRepBuilderAPI_MakePolygon W1; W1.Add(gp_Pnt(10, 0, 0)); @@ -117,29 +107,26 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con Standard_Real angle3 = 360 * (M_PI / 180.0); TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3); - TopoDS_Shape fuse32, fuse321; - if (IsBRepAlgoAPI) { - di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n"; - di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n"; - fuse32 = BRepAlgoAPI_Fuse(rs3, rs2); - fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1); - } else { - di << "fuse32 = BRepAlgo_Fuse(rs3, rs2)\n"; - di << "fuse321 = BRepAlgo_Fuse(fuse32, rs1)\n"; - fuse32 = BRepAlgo_Fuse(rs3, rs2); - fuse321 = BRepAlgo_Fuse(rs1, fuse32); - } + di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n"; + di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n"; + TopoDS_Shape fuse32 = BRepAlgoAPI_Fuse(rs3, rs2).Shape(); + TopoDS_Shape fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1).Shape(); - //Give the mass claculation of the shpae "fuse321" + // unify the faces of the Fuse result + ShapeUpgrade_UnifySameDomain anUnify(fuse321, Standard_True, Standard_True, Standard_True); + anUnify.Build(); + const TopoDS_Shape& aFuseUnif = anUnify.Shape(); + + //Give the mass claculation of the shpae "aFuseUnif" GProp_GProps G; - BRepGProp::VolumeProperties(fuse321, G); + BRepGProp::VolumeProperties(aFuseUnif, G); di<<" \n"; di<<"Mass: "< #include #include -#include //======================================================================= //function : OCC822_1 //purpose : //======================================================================= static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if(argc < 4 || argc > 5) { - di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " name1 name2 result\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif -#if ! defined(BRepAlgo_def02) -// di << "Error: There is not BRepAlgo_Cut class\n"; -// return 1; -#endif - } - } int index = 1; @@ -495,69 +467,50 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c di << "All primitives created..... Creating Boolean\n"; - TopoDS_Shape theIn, theOut, theRes; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n"; - di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n"; - di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\n"; - theIn = BRepAlgoAPI_Fuse(cylIn, conIn); - theOut = BRepAlgoAPI_Fuse(cylOut, conOut); - theRes = BRepAlgoAPI_Cut(theOut, theIn); - } else { - di << "theIn = BRepAlgo_Fuse(cylIn, conIn)\n"; - di << "theOut = BRepAlgo_Fuse(cylOut, conOut)\n"; - theIn = BRepAlgo_Fuse(cylIn, conIn); - theOut = BRepAlgo_Fuse(cylOut, conOut); - di << "theRes = BRepAlgo_Cut(theOut, theIn)\n"; - theRes = BRepAlgo_Cut(theOut, theIn); - } - if (index < argc) DBRep::Set(argv[index++], theIn); - if (index < argc) DBRep::Set(argv[index++], theOut); - if (index < argc) DBRep::Set(argv[index++], theRes); - di << "Booleans Created ! Triangulating !\n"; + di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n"; + di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n"; + di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\n"; + TopoDS_Shape theIn = BRepAlgoAPI_Fuse(cylIn, conIn).Shape(); + TopoDS_Shape theOut = BRepAlgoAPI_Fuse(cylOut, conOut).Shape(); + TopoDS_Shape theRes = BRepAlgoAPI_Cut(theOut, theIn).Shape(); - performTriangulation(theRes, di); - } + if (index < argc) DBRep::Set(argv[index++], theIn); + if (index < argc) DBRep::Set(argv[index++], theOut); + if (index < argc) DBRep::Set(argv[index++], theRes); + di << "Booleans Created ! Triangulating !\n"; + + performTriangulation(theRes, di); + } catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in Shoe Function *****\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in Shoe Function *****\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } #include #include + //======================================================================= // OCC822_2 //======================================================================= static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) { - if(argc < 4 || argc > 5) { - di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " name1 name2 result\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } int index = 1; @@ -575,31 +528,27 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co di << "All primitives created..... Creating Cut Objects\n"; - TopoDS_Shape fuse; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "fuse = BRepAlgoAPI_Fuse(box, sph)\n"; - fuse = BRepAlgoAPI_Fuse(box, sph); - } else { - di << "fuse = BRepAlgo_Fuse(box, sph)\n"; - fuse = BRepAlgo_Fuse(box, sph); - } - if (index < argc) DBRep::Set(argv[index++], fuse); - di << "Object Created ! Now Triangulating !" ; - performTriangulation(fuse, di); - } + di << "fuse = BRepAlgoAPI_Fuse(box, sph)\n"; + TopoDS_Shape fuse = BRepAlgoAPI_Fuse(box, sph).Shape(); + + if (index < argc) DBRep::Set(argv[index++], fuse); + di << "Object Created ! Now Triangulating !"; + + performTriangulation(fuse, di); + } catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in HSP Function ******\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in HSP Function ******\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } @@ -610,21 +559,11 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) { - if(argc < 4 || argc > 5) { - di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " name1 name2 result\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } + int index = 1; Standard_Real size = 0.001; @@ -644,31 +583,27 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons di << "All primitives created..... Creating Boolean\n"; - TopoDS_Shape fuse; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n"; - fuse = BRepAlgoAPI_Fuse(cyl2, cyl1); - } else { - di << "fuse = BRepAlgo_Fuse(cyl2, cyl1)\n"; - fuse = BRepAlgo_Fuse(cyl2, cyl1); - } - if (index < argc) DBRep::Set(argv[index++], fuse); - di << "Fuse Created ! Triangulating !\n"; - performTriangulation(fuse, di); - } - catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in TEE Function ******\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n"; + TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl2, cyl1).Shape(); + + if (index < argc) DBRep::Set(argv[index++], fuse); + di << "Fuse Created ! Triangulating !\n"; + + performTriangulation(fuse, di); + } + catch (Standard_Failure) + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in TEE Function ******\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } @@ -678,21 +613,11 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) { - if(argc < 4 || argc > 5) { - di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " name1 name2 result\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } + int index = 1; gp_Pnt P1(100, 0, 0); @@ -708,31 +633,27 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons di << "All primitives created..... Creating Boolean\n"; - TopoDS_Shape fuse; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n"; - fuse = BRepAlgoAPI_Fuse(cyl, sph); - } else { - di << "fuse = BRepAlgo_Fuse(cyl, sph)\n"; - fuse = BRepAlgo_Fuse(cyl, sph); - } - di << "Fuse Created ! Triangulating !\n"; - if (index < argc) DBRep::Set(argv[index++], fuse); - performTriangulation(fuse, di); - } - catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in YOU Function ******\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n"; + TopoDS_Shape fuse = BRepAlgoAPI_Fuse(cyl, sph).Shape(); + + di << "Fuse Created ! Triangulating !\n"; + if (index < argc) DBRep::Set(argv[index++], fuse); + + performTriangulation(fuse, di); + } + catch (Standard_Failure) + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in YOU Function ******\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } @@ -747,21 +668,11 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) { - if(argc < 6 || argc > 7) { - di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 6) { + di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 7) { - Standard_Integer IsB = Draw::Atoi(argv[6]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def02) -// di << "Error: There is not BRepAlgo_Cut class\n"; -// return 1; -#endif - } - } + int index = 1; Standard_Real size = 50; @@ -792,57 +703,50 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons di << "All primitives created..... Creating Cut Objects\n"; - TopoDS_Shape cut1, cut2; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n"; - cut1 = BRepAlgoAPI_Cut(sph1, hsp); - } else { - di << "cut1 = BRepAlgo_Cut(sph1, hsp)\n"; - cut1 = BRepAlgo_Cut(sph1, hsp); - } - if (index < argc) DBRep::Set(argv[index++], cut1); - di << "CUT 1 Created ! " ; - if (IsBRepAlgoAPI) { - di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n"; - cut2 = BRepAlgoAPI_Cut(sph2, hsp); - } else { - di << "cut2 = BRepAlgo_Cut(sph2, hsp)\n"; - cut2 = BRepAlgo_Cut(sph2, hsp); - } - if (index < argc) DBRep::Set(argv[index++], cut2); - di << "CUT 2 Created !\n\n"; + di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n"; + TopoDS_Shape cut1 = BRepAlgoAPI_Cut(sph1, hsp).Shape(); - GProp_GProps G; - BRepGProp::VolumeProperties(cut1, G); - di<<"CUT 1 Mass = "< 5) { - di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " name1 name2 result\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } + int index = 1; Standard_Real x1 = 181.82808; @@ -898,30 +792,26 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons di << "All primitives created..... Creating Boolean\n"; - TopoDS_Shape fuse; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n"; - fuse = BRepAlgoAPI_Fuse(rev, sph); - } else { - di << "fuse = BRepAlgo_Fuse(rev, sph)\n"; - fuse = BRepAlgo_Fuse(rev, sph); - } - if (index < argc) DBRep::Set(argv[index++], fuse); - di << "Fuse Created ! Triangulating !\n"; - performTriangulation(fuse, di); - } - catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in SPH Function ******\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + + di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n"; + TopoDS_Shape fuse = BRepAlgoAPI_Fuse(rev, sph).Shape(); + + if (index < argc) DBRep::Set(argv[index++], fuse); + di << "Fuse Created ! Triangulating !\n"; + performTriangulation(fuse, di); + } + catch (Standard_Failure) + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in SPH Function ******\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } @@ -932,21 +822,11 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) { - if(argc < 6 || argc > 7) { - di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 6) { + di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 7) { - Standard_Integer IsB = Draw::Atoi(argv[6]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } + int index = 1; BRepBuilderAPI_MakePolygon W1; @@ -984,40 +864,33 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons di << "All primitives created..... Creating Boolean\n"; - TopoDS_Shape fuse1, fuse2; try - { + { OCC_CATCH_SIGNALS - if (IsBRepAlgoAPI) { - di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n"; - fuse1 = BRepAlgoAPI_Fuse(tor1, rev); - } else { - di << "Fuse1 = BRepAlgo_Fuse(tor1, rev)\n"; - fuse1 = BRepAlgo_Fuse(tor1, rev); - } - if (index < argc) DBRep::Set(argv[index++], fuse1); - di << "Fuse1 Created ! Creating Fuse 2\n"; - if (IsBRepAlgoAPI) { - di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n"; - fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1); - } else { - di << "Fuse2 = BRepAlgo_Fuse(tor2, fuse1)\n"; - fuse2 = BRepAlgo_Fuse(tor2, fuse1); - } - if (index < argc) DBRep::Set(argv[index++], fuse2); - di << "Fuse2 Created ! Triangulating !\n"; - performTriangulation(fuse2, di); - } - catch ( Standard_Failure ) - { - di<<"*********************************************************\n"; - di<<"***** ******\n"; - di<<"***** Standard_Failure : Exception in REV Function ******\n"; - di<<"***** ******\n"; - di<<"*********************************************************\n"; - return 1; - } + di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n"; + TopoDS_Shape fuse1 = BRepAlgoAPI_Fuse(tor1, rev).Shape(); + + if (index < argc) DBRep::Set(argv[index++], fuse1); + di << "Fuse1 Created ! Creating Fuse 2\n"; + + di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n"; + TopoDS_Shape fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1).Shape(); + + if (index < argc) DBRep::Set(argv[index++], fuse2); + di << "Fuse2 Created ! Triangulating !\n"; + + performTriangulation(fuse2, di); + } + catch (Standard_Failure) + { + di << "*********************************************************\n"; + di << "***** ******\n"; + di << "***** Standard_Failure : Exception in REV Function ******\n"; + di << "***** ******\n"; + di << "*********************************************************\n"; + return 1; + } return 0; } @@ -1164,18 +1037,18 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons void QABugs::Commands_10(Draw_Interpretor& theCommands) { const char *group = "QABugs"; - theCommands.Add ("OCC426", "OCC426 shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC426, group); + theCommands.Add ("OCC426", "OCC426 shape1 shape2 shape3 shape4 shape5 shape6 shape7", __FILE__, OCC426, group); theCommands.Add("isperiodic", "Use : isperiodic surfaceOfRevolution", __FILE__, isPeriodic, group); theCommands.Add("OCC486", "Use : OCC486 surf x y z du dv ", __FILE__, OCC486, group); theCommands.Add("OCC712", "OCC712 draftAngle slabThick", __FILE__, OCC712, group); - theCommands.Add("OCC822_1", "OCC822_1 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC822_1, group); - theCommands.Add("OCC822_2", "OCC822_2 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC822_2, group); - theCommands.Add("OCC823", "OCC823 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC823, group); - theCommands.Add("OCC824", "OCC824 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC824, group); - theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC825, group); - theCommands.Add("OCC826", "OCC826 name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC826, group); - theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__,OCC827, group); + theCommands.Add("OCC822_1", "OCC822_1 name1 name2 result", __FILE__,OCC822_1, group); + theCommands.Add("OCC822_2", "OCC822_2 name1 name2 result", __FILE__,OCC822_2, group); + theCommands.Add("OCC823", "OCC823 name1 name2 result", __FILE__,OCC823, group); + theCommands.Add("OCC824", "OCC824 name1 name2 result", __FILE__,OCC824, group); + theCommands.Add("OCC825", "OCC825 name1 name2 name3 name4 name5", __FILE__,OCC825, group); + theCommands.Add("OCC826", "OCC826 name1 name2 result", __FILE__,OCC826, group); + theCommands.Add("OCC827", "OCC827 name1 name2 name3 result1 result2", __FILE__,OCC827, group); theCommands.Add("OCC828", "OCC828 redius shape result ", __FILE__,OCC828, group); return; diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index 8895b28d4b..0b3be5ee96 100644 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -596,7 +596,6 @@ Standard_Integer OCC165(Draw_Interpretor& di , } #include -#include #include #include @@ -609,71 +608,55 @@ Standard_Integer OCC165(Draw_Interpretor& di , static Standard_Integer OCC297 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** argv ) { - Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext(); - if(myAISContext.IsNull()) { + if (myAISContext.IsNull()) { di << "use 'vinit' command before " << argv[0] << "\n"; return -1; } + + gp_Pnt pt1_(250., 250., 0.); + gp_Pnt pt2_(-250., 250., 0.); + gp_Pnt pt3_(-250., -250., 0.); + gp_Pnt pt4_(250., -250., 0.); + BRepBuilderAPI_MakeEdge edg1_(pt1_, pt2_); + BRepBuilderAPI_MakeEdge edg2_(pt2_, pt3_); + BRepBuilderAPI_MakeEdge edg3_(pt3_, pt4_); + BRepBuilderAPI_MakeEdge edg4_(pt4_, pt1_); + BRepBuilderAPI_MakeWire wire_(edg1_, edg2_, edg3_, edg4_); + BRepBuilderAPI_MakeFace face_(wire_); + TopoDS_Face sh_ = face_.Face(); - gp_Pnt pt1_(250.,250.,0.); - gp_Pnt pt2_(-250.,250.,0.); - gp_Pnt pt3_(-250.,-250.,0.); - gp_Pnt pt4_(250.,-250.,0.); - BRepBuilderAPI_MakeEdge edg1_(pt1_, pt2_); - BRepBuilderAPI_MakeEdge edg2_(pt2_, pt3_); - BRepBuilderAPI_MakeEdge edg3_(pt3_, pt4_); - BRepBuilderAPI_MakeEdge edg4_(pt4_, pt1_); + int up = 1; - BRepBuilderAPI_MakeWire wire_(edg1_, edg2_, edg3_, edg4_); - BRepBuilderAPI_MakeFace face_(wire_); - TopoDS_Face sh_ = face_.Face(); + gp_Pnt g_pnt; + if (up) + g_pnt = gp_Pnt(0, 0, -100); + else + g_pnt = gp_Pnt(0, 0, 100); - int up = 1; + myAISContext->EraseAll(Standard_False); + Handle(Geom_CartesianPoint) GEOMPoint = new Geom_CartesianPoint(g_pnt); + Handle(AIS_Point) AISPoint = new AIS_Point(GEOMPoint); + myAISContext->Display(AISPoint, Standard_True); - gp_Pnt g_pnt; - if(up) - g_pnt = gp_Pnt(0,0,-100); - else - g_pnt = gp_Pnt(0,0,100); + BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt); + TopoDS_Solid sol1_ = half_.Solid(); - myAISContext->EraseAll(Standard_False); - Handle(Geom_CartesianPoint) GEOMPoint = new Geom_CartesianPoint(g_pnt); - Handle(AIS_Point) AISPoint = new AIS_Point(GEOMPoint); - myAISContext->Display (AISPoint, Standard_True); + DBRep::Set("Face", sol1_); - BRepPrimAPI_MakeHalfSpace half_(sh_, g_pnt); - TopoDS_Solid sol1_ = half_.Solid(); -// Handle(AIS_Shape) AISHalf = new AIS_Shape(sol1_); -// AISHalf->SetColor(Quantity_NOC_GREEN); -// myAISContext->Display(AISHalf); + gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.)); - DBRep::Set("Face",sol1_); + Standard_Real x = 0., y = 0., z = -80.; - gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.)); + BRepPrimAPI_MakeBox box(gp_Pnt(x, y, z), gp_Pnt(x + 150, y + 200, z + 200)); - Standard_Real x=0., y=0., z=-80.; - - BRepPrimAPI_MakeBox box(gp_Pnt(x,y,z),gp_Pnt(x+150,y+200,z+200)); -// Handle(AIS_Shape) AISBox = new AIS_Shape(box); -// AISBox->SetColor(Quantity_NOC_BLUE1); -// myAISContext->Display(AISBox); - - DBRep::Set("Box",box.Shape()); - -// BRepAlgoAPI_Cut cut( sol1_, box.Shape() ); -// //BRepAlgoAPI_Cut cut( box.Shape(), sol1_ ); -// TopoDS_Shape sh1_ = cut.Shape(); -// Handle(AIS_Shape) AISCut = new AIS_Shape(sh1_); -// AISCut->SetColor(Quantity_NOC_RED); -// myAISContext->Display(AISCut); - -// DBRep::Set("Cut",sh1_); + DBRep::Set("Box", box.Shape()); return 0; } + #include #include @@ -944,26 +927,13 @@ static Standard_Integer OCC310bug (Draw_Interpretor& di, Standard_Integer nb, co #include #include -#include -#include static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, const char ** a) { - //if (nb != 1) { - // cout << "Usage: " << a[0] << endl; - // return 1; - //} - if(nb < 1 || nb > 2) { - di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(nb != 1) { + di << "Usage : " << a[0] << "\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (nb == 2) { - Standard_Integer IsB = Draw::Atoi(a[1]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; - } - } BRepPrimAPI_MakeBox box1( 100, 100, 100 ); BRepPrimAPI_MakeBox box2( gp_Pnt( 50, 50,50 ), 200, 200, 200 ); @@ -971,25 +941,11 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co TopoDS_Shape shape1 = box1.Shape(); TopoDS_Shape shape2 = box2.Shape(); -//#if ! defined(BRepAlgoAPI_def01) -// TopoDS_Shape fuse = BRepAlgoAPI_Fuse( shape1, shape2 ); -// TopoDS_Shape comm = BRepAlgoAPI_Common( shape1, shape2 ); -//#else -// TopoDS_Shape fuse = BRepAlgo_Fuse( shape1, shape2 ); -// TopoDS_Shape comm = BRepAlgo_Common( shape1, shape2 ); -//#endif TopoDS_Shape fuse,comm; - if (IsBRepAlgoAPI) { - di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n"; - di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n"; - fuse = BRepAlgoAPI_Fuse( shape1, shape2 ); - comm = BRepAlgoAPI_Common( shape1, shape2 ); - } else { - di << "fuse = BRepAlgo_Fuse( shape1, shape2 )\n"; - fuse = BRepAlgo_Fuse( shape1, shape2 ); - di << "comm = BRepAlgo_Common( shape1, shape2 )\n"; - comm = BRepAlgo_Common( shape1, shape2 ); - } + di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n"; + di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n"; + fuse = BRepAlgoAPI_Fuse(shape1, shape2).Shape(); + comm = BRepAlgoAPI_Common(shape1, shape2).Shape(); return 0; } @@ -1444,35 +1400,16 @@ static Standard_Integer OCC525(Draw_Interpretor& di, Standard_Integer /*argc*/, #include #include #include -#include -#include -#include -#include //======================================================================= //function : OCC578 //purpose : //======================================================================= static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - //if (argc!=4) { - // di<<"Usage : " << argv[0] << " shape1 shape2 shape3\n"; - // return 1; - //} - if(argc < 4 || argc > 5) { - di << "Usage : " << argv[0] << " shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 4) { + di << "Usage : " << argv[0] << " shape1 shape2 shape3\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 5) { - Standard_Integer IsB = Draw::Atoi(argv[4]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -// di << "Error: There is not BRepAlgo_Cut class\n"; -// return 1; - } - } gp_Pnt P0(0,0,0.0); double xperiod = 1.0; @@ -1537,35 +1474,12 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con // combine wedges -//#if ! defined(BRepAlgoAPI_def01) -// TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a); -//#else -// TopoDS_Shape wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a); -//#endif - TopoDS_Shape wedge_common; - if (IsBRepAlgoAPI) { - di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n"; - wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a); - } else { - di << "wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a)\n"; - wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a); - } - - // remove wedge area from substrate -//#if ! defined(BRepAlgoAPI_def01) -// TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common); -//#else -// TopoDS_Shape sub_etch1 = BRepAlgo_Cut(substrate, wedge_common); -//#endif - TopoDS_Shape sub_etch1; - if (IsBRepAlgoAPI) { - di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n"; - sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common); - } else { - di << "sub_etch1 = BRepAlgo_Cut(substrate, wedge_common)\n"; - sub_etch1 = BRepAlgo_Cut(substrate, wedge_common); - } + di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n"; + TopoDS_Shape wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a).Shape(); + di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n"; + TopoDS_Shape sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common).Shape(); + if (sub_etch1.IsNull()) { di<<" Null shape3 is not allowed\n"; return 1; @@ -2047,31 +1961,16 @@ static Standard_Integer OCC1034_AISSelectionMode (Draw_Interpretor& di, return 1; } -#include -#include //======================================================================= //function : OCC1487 //purpose : //======================================================================= static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - //if(argc != 5) { - // cerr << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape" << endl; - // return -1; - //} - if(argc < 5 || argc > 6) { - di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 5) { + di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 6) { - Standard_Integer IsB = Draw::Atoi(argv[5]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -// di << "Error: There is not BRepAlgo_Cut class\n"; -// return 1; - } - } Standard_Integer CaseNumber = Draw::Atoi(argv[1]); @@ -2093,18 +1992,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); cyl2 = o_mc2.Shape(); -//#if ! defined(BRepAlgoAPI_def01) -// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); -//#else -// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); -//#endif - if (IsBRepAlgoAPI) { - di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; - o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); - } else { - di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; - o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); - } + di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; + o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape(); } else { //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(M_PI/3), 0.0, 0.5)), 5, 150); gp_Dir myDir_mc2(sin(M_PI/3), 0.0, 0.5); @@ -2113,18 +2002,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); cyl2 = o_mc2.Shape(); -//#if ! defined(BRepAlgoAPI_def01) -// o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); -//#else -// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); -//#endif - if (IsBRepAlgoAPI) { - di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; - o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); - } else { - di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; - o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); - } + di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n"; + o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()).Shape(); } DBRep::Set(argv[2],cyl1); @@ -4983,7 +4862,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC310","OCC310", __FILE__, OCC310bug, group); //theCommands.Add("OCC277","OCC277", __FILE__, OCC277bug, group); - theCommands.Add("OCC277","OCC277 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC277bug, group); + theCommands.Add("OCC277","OCC277", __FILE__, OCC277bug, group); theCommands.Add("OCC333","OCC333 edge1 edge2 [toler domaindist]; Check overlapping edges", __FILE__, OCC333bug, group); @@ -4997,7 +4876,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC524", "OCC524 LowerVector UpperVector InitialValueVector LowerRowMatrix UpperRowMatrix LowerColMatrix UpperColMatrix InitialValueMatrix", __FILE__, OCC524, group); theCommands.Add("OCC525", "OCC525", __FILE__, OCC525, group); //theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group); - theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC578, group); + theCommands.Add("OCC578", "OCC578 shape1 shape2 shape3", __FILE__, OCC578, group); theCommands.Add("OCC669", "OCC669 GUID", __FILE__, OCC669, group); theCommands.Add("OCC738_ShapeRef", "OCC738_ShapeRef", __FILE__, OCC738_ShapeRef, group); theCommands.Add("OCC738_Assembly", "OCC738_Assembly", __FILE__, OCC738_Assembly, group); @@ -5016,7 +4895,7 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add ("OCC1034_AISSelectionMode", "OCC1034_AISSelectionMode (DOC, entry, [selectionmode])", __FILE__, OCC1034_AISSelectionMode, group); //theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape", __FILE__, OCC1487, group); - theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC1487, group); + theCommands.Add("OCC1487", "OCC1487 CylinderVariant(=1/2) cylinder1 cylinder2 cutshape", __FILE__, OCC1487, group); theCommands.Add("OCC1077", "OCC1077 result", __FILE__, OCC1077, group); theCommands.Add("OCC5739", "OCC5739 name shape step", __FILE__, OCC5739_UniAbs, group); diff --git a/src/QABugs/QABugs_13.cxx b/src/QABugs/QABugs_13.cxx index 796373b9ee..9dfa0c8495 100644 --- a/src/QABugs/QABugs_13.cxx +++ b/src/QABugs/QABugs_13.cxx @@ -388,10 +388,6 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc, #include #include #include -///////#else -///////#include -///////#include -#include //======================================================================= //function : OCC544 @@ -399,21 +395,10 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc, //======================================================================= static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - if(argc > 7) { - di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]\n"; + if(argc > 6) { + di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 7) { - Standard_Integer IsB = Draw::Atoi(argv[6]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } // Used to Display Geometry or Topolgy char name[255]; @@ -681,29 +666,18 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con wallSolid = TopoDS::Solid(getSol.Current()); TopoDS_Solid test_solid; while (getSol.More()) - { - di << "Next solid found in compound\n"; - getSol.Next(); - test_solid = TopoDS::Solid(getSol.Current()); -//////#if ! defined(BRepAlgoAPI_def01) -////// BRepAlgoAPI_Fuse fuser(test_solid, wallSolid); -//////#else -////// BRepAlgo_Fuse fuser(test_solid, wallSolid); -//////#endif -////// fuser.Build(); - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n"; - BRepAlgoAPI_Fuse fuser(test_solid, wallSolid); - fuser.Build(); - wallSolid = TopoDS::Solid(fuser.Shape()); - } else { - di << "BRepAlgo_Fuse fuser(test_solid, wallSolid)\n"; - BRepAlgo_Fuse fuser(test_solid, wallSolid); - fuser.Build(); - wallSolid = TopoDS::Solid(fuser.Shape()); - } -////// wallSolid = TopoDS::Solid(fuser.Shape()); - } + { + di << "Next solid found in compound\n"; + getSol.Next(); + test_solid = TopoDS::Solid(getSol.Current()); + + di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n"; + BRepAlgoAPI_Fuse fuser(test_solid, wallSolid); + TopExp_Explorer aExpS(fuser.Shape(), TopAbs_SOLID); + if (aExpS.More()) { + wallSolid = TopoDS::Solid(aExpS.Current()); + } + } } else { // Let's see if we can extract shells instead of solids. TopExp_Explorer getShel; @@ -794,41 +768,15 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con #include #include #include -//////////#else -//////////#include -//////////#include -//////////#include -//////////#include -#include -#include #include static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - //////////if(argc != 3) { - ////////// cout << "Usage : " << argv[0] << " result mesh_delta" << endl; - ////////// return 1; - //////////} - if(argc < 3 || argc > 4) { - di << "Usage : " << argv[0] << " result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 3) { + di << "Usage : " << argv[0] << " result mesh_delta\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 4) { - Standard_Integer IsB = Draw::Atoi(argv[3]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def02) -// di << "Error: There is not BRepAlgo_Cut class\n"; -// return 1; -#endif -#if ! defined(BRepAlgo_def03) -// di << "Error: There is not BRepAlgo_Common class\n"; -// return 1; -#endif - } - } - + Standard_Real delt = 5.0*Precision::Confusion(); Standard_Real mesh_delt = Draw::Atof(argv[2]); if (mesh_delt <= 0.0) @@ -846,38 +794,14 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con TopoDS_Solid internalSolid = BRepPrimAPI_MakeBox(P, 10.0, 10.0, 10.0).Solid(); // Cut inner from outer -//////////#if ! defined(BRepAlgoAPI_def01) -////////// BRepAlgoAPI_Cut cut( fullSolid, internalSolid ); -//////////#else -////////// BRepAlgo_Cut cut( fullSolid, internalSolid ); -//////////#endif -////////// TopoDS_Shape cut_shape = cut.Shape(); -////////// if ( !cut.IsDone() ) -////////// { -////////// cout << "Error: Could not cut volumes" << endl; -////////// return -1; -////////// } - - TopoDS_Shape cut_shape; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n"; - BRepAlgoAPI_Cut cut( fullSolid, internalSolid ); - cut_shape = cut.Shape(); - if ( !cut.IsDone() ) - { - di << "Error: Could not cut volumes\n"; - return -1; - } - } else { - di << "BRepAlgo_Cut cut( fullSolid, internalSolid )\n"; - BRepAlgo_Cut cut( fullSolid, internalSolid ); - cut_shape = cut.Shape(); - if ( !cut.IsDone() ) - { - di << "Error: Could not cut volumes\n"; - return -1; - } + di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n"; + BRepAlgoAPI_Cut cut(fullSolid, internalSolid); + if (!cut.IsDone()) + { + di << "Error: Could not cut volumes\n"; + return -1; } + const TopoDS_Shape& cut_shape = cut.Shape(); // see if we have a solid Standard_Integer found_solid = 0; @@ -979,37 +903,14 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con TopoDS_Shape copySolid = BRepBuilderAPI_Copy(cutSolid).Shape(); // perform common -//////////#if ! defined(BRepAlgoAPI_def01) -////////// BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); -//////////#else -////////// BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); -//////////#endif -////////// if (!common.IsDone()) -////////// { -////////// cout << "Error: could not construct a common solid " << l << endl; -////////// return 1; -////////// } - - TopoDS_Shape aCommonShape; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n"; - BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); - if (!common.IsDone()) - { - di << "Error: could not construct a common solid " << l << "\n"; - return 1; - } - aCommonShape = common.Shape(); - } else { - di << "BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n"; - BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); - if (!common.IsDone()) - { - di << "Error: could not construct a common solid " << l << "\n"; - return 1; - } - aCommonShape = common.Shape(); + di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n"; + BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); + if (!common.IsDone()) + { + di << "Error: could not construct a common solid " << l << "\n"; + return 1; } + const TopoDS_Shape& aCommonShape = common.Shape(); // see if we have a solid found_solid = 0; @@ -1055,9 +956,9 @@ void QABugs::Commands_13(Draw_Interpretor& theCommands) { theCommands.Add ("OCC332", "OCC332 [wall_thickness [dia1 [dia2 [length [major_radius]]]]]", __FILE__, OCC332bug, group); //////theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length]]]]]", __FILE__, OCC544, group); - theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]", __FILE__, OCC544, group); + theCommands.Add("OCC544", "OCC544 [[[[[wT [[[[d1 [[[d2 [[R [length ]]]]]", __FILE__, OCC544, group); //////theCommands.Add("OCC817", "OCC817 result mesh_delta", __FILE__, OCC817, group); - theCommands.Add("OCC817", "OCC817 result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC817, group); + theCommands.Add("OCC817", "OCC817 result mesh_delta ", __FILE__, OCC817, group); return; } diff --git a/src/QABugs/QABugs_17.cxx b/src/QABugs/QABugs_17.cxx index 5f4f92b246..69f6bc34c2 100644 --- a/src/QABugs/QABugs_17.cxx +++ b/src/QABugs/QABugs_17.cxx @@ -1399,7 +1399,6 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons #include #include #include -#include //======================================================================= //function : OCCN2 //purpose : BOOLEAN OPERATION @@ -1407,18 +1406,9 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { if (argc > 2) { - di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + di << "Usage : " << argv[0] << "\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 2) { - Standard_Integer IsB = Draw::Atoi(argv[1]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def04) -#endif - } - } Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); if(aContext.IsNull()) @@ -1433,27 +1423,12 @@ static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, cons BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50); TopoDS_Shape sphere_sh = sphere.Shape(); - //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh); - //TopoDS_Shape shape = section.Shape(); - - TopoDS_Shape shape; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n"; - BRepAlgoAPI_Section section(cylinder_sh, sphere_sh); - section.Build(); - if(!section.IsDone()){ - di << "Error performing intersection: not done.\n"; - } - shape = section.Shape(); - } else { - di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)\n"; - BRepAlgo_Section section(cylinder_sh, sphere_sh); - section.Build(); - if(!section.IsDone()){ - di << "Error performing intersection: not done.\n"; - } - shape = section.Shape(); + di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n"; + BRepAlgoAPI_Section section(cylinder_sh, sphere_sh); + if (!section.IsDone()){ + di << "Error performing intersection: not done.\n"; } + const TopoDS_Shape& shape = section.Shape(); DBRep::Set("OCCN2_cylinder",cylinder_sh); DBRep::Set("OCCN2_sphere",sphere_sh); diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index 4399aa6fee..efe20de11b 100644 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -125,7 +125,7 @@ static Standard_Integer OCC23237 (Draw_Interpretor& di, Standard_Integer /*argc* // do some operation that will take considerable time compared with time of starting / stopping timers BRepPrimAPI_MakeBox aBox (10., 10., 10.); BRepPrimAPI_MakeSphere aSphere (10.); - BRepAlgo_Cut aCutter (aBox.Shape(), aSphere.Shape()); + BRepAlgoAPI_Cut aCutter (aBox.Shape(), aSphere.Shape()); aTM.Stop(); aPM.Stop(); diff --git a/src/QABugs/QABugs_2.cxx b/src/QABugs/QABugs_2.cxx index ace869c480..c5cb0d7602 100644 --- a/src/QABugs/QABugs_2.cxx +++ b/src/QABugs/QABugs_2.cxx @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -49,23 +48,11 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons { OCC_CATCH_SIGNALS // 1. Verify amount of arguments of the command - //if (argc < 2) { di << "OCC527 FAULTY. Use : OCC527 shape "; return 0;} - if (argc < 2 || argc > 3) { - di << "Usage : " << argv[0] << " shape [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if (argc != 2) { + di << "Usage : " << argv[0] << "OCC527 shape\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 3) { - Standard_Integer IsB = Draw::Atoi(argv[2]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -//#if ! defined(BRepAlgo_def04) -// di << "Error: There is not BRepAlgo_Section class\n"; -// return 1; -//#endif - } - } - + // 2. Get selected shape TopoDS_Shape aShape = DBRep::Get(argv[1]); if(aShape.IsNull()) { di << "OCC527 FAULTY. Entry shape is NULL"; return 0;} @@ -97,62 +84,34 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons // Build current section gp_Pln pl(0,0,1,-zcur); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Section aSection(aFace,pl,Standard_False); -//#else -// BRepAlgo_Section aSection(aFace,pl,Standard_False); -//#endif -// aSection.Approximation(Standard_True); -// aSection.Build(); -// // If section was built meassure distance between vertexes and plane of the one. Max distance is stored. -// if (aSection.IsDone()) - - Standard_Boolean IsDone; - TopoDS_Shape aResult; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n"; - BRepAlgoAPI_Section aSection(aFace,pl,Standard_False); - aSection.Approximation(Standard_True); - aSection.Build(); - IsDone = aSection.IsDone(); - aResult = aSection.Shape(); - } else { - di << "BRepAlgo_Section aSection(aFace,pl,Standard_False)\n"; - BRepAlgo_Section aSection(aFace,pl,Standard_False); - aSection.Approximation(Standard_True); - aSection.Build(); - IsDone = aSection.IsDone(); - aResult = aSection.Shape(); - } + + // + di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n"; + BRepAlgoAPI_Section aSection(aFace, pl, Standard_False); + aSection.Approximation(Standard_True); + aSection.Build(); + Standard_Boolean IsDone = aSection.IsDone(); if (IsDone) - { -// TopoDS_Shape aResult = aSection.Shape(); - if (!aResult.IsNull()) - { + { + const TopoDS_Shape& aResult = aSection.Shape(); + if (!aResult.IsNull()) + { double lmaxdist = 0.0; TopExp_Explorer aExp2; - for (aExp2.Init(aResult,TopAbs_VERTEX); aExp2.More(); aExp2.Next()) + for (aExp2.Init(aResult, TopAbs_VERTEX); aExp2.More(); aExp2.Next()) { TopoDS_Vertex aV = TopoDS::Vertex(aExp2.Current()); Standard_Real toler = BRep_Tool::Tolerance(aV); double dist = pl.Distance(BRep_Tool::Pnt(aV)); if (dist > lmaxdist) lmaxdist = dist; - // If section was built check distance beetwen vertexes and plane of the one - str[0] =0; -// if (wasBuilt) -// { -// if(gmaxdist > Precision::Confusion()) -// Sprintf(str,"Dist=%f, Param=%f FAULTY\n",gmaxdist,gzmax); -// else -// Sprintf(str,"Dist=%f, Param=%f\n",gmaxdist,gzmax); - if(dist > toler) - Sprintf(str,"Dist=%f, Toler=%f, Param=%f FAULTY\n",dist,toler,gzmax); - else - Sprintf(str,"Dist=%f, Toler=%f, Param=%f\n",dist,toler,gzmax); -// } -// else Sprintf(str,"No result\n"); - di << str; + // If section was built check distance beetwen vertexes and plane of the one + str[0] = 0; + if (dist > toler) + Sprintf(str, "Dist=%f, Toler=%f, Param=%f FAULTY\n", dist, toler, gzmax); + else + Sprintf(str, "Dist=%f, Toler=%f, Param=%f\n", dist, toler, gzmax); + di << str; } if (lmaxdist > gmaxdist) { @@ -195,8 +154,7 @@ static Standard_Integer OCC1048 (Draw_Interpretor& di, Standard_Integer argc, co void QABugs::Commands_2(Draw_Interpretor& theCommands) { const char *group = "QABugs"; - //theCommands.Add("OCC527", "OCC527 shape", __FILE__, OCC527, group); - theCommands.Add("OCC527", "OCC527 shape [BRepAlgoAPI/BRepAlgo = 1/0]", __FILE__, OCC527, group); - theCommands.Add("OCC1048", "OCC1048 shape", __FILE__, OCC1048, group); + theCommands.Add("OCC527", "OCC527 shape", __FILE__, OCC527, group); + theCommands.Add("OCC1048", "OCC1048 shape", __FILE__, OCC1048, group); return; } diff --git a/src/QABugs/QABugs_3.cxx b/src/QABugs/QABugs_3.cxx index 2bc76152f0..cb94d9fc00 100644 --- a/src/QABugs/QABugs_3.cxx +++ b/src/QABugs/QABugs_3.cxx @@ -323,7 +323,6 @@ static Standard_Integer BUC60574(Draw_Interpretor& di, Standard_Integer /*n*/, c #include #include -#include #include #include @@ -732,21 +731,10 @@ static int BUC60825(Draw_Interpretor& di, Standard_Integer argc, const char ** a static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if(argc > 2) { - di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 1) { + di << "Usage : " << argv[0] << "\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 2) { - Standard_Integer IsB = Draw::Atoi(argv[1]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } double bottompoints1[12] = { 10, -10, 0, 100, -10, 0, 100, -100, 0, 10, -100, 0}; double toppoints1[12] = { 0, 0, 10, 100, 0, 10, 100, -100, 10, 0, -100, 10}; @@ -785,22 +773,10 @@ static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** a DBRep::Set("TS1",loft1.Shape()); DBRep::Set("TS2",loft2.Shape()); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape()); -//#else -// BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape()); -//#endif - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n"; - BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape()); - DBRep::Set("F",result.Shape()); - } else { - di << "BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape())\n"; - BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape()); - DBRep::Set("F",result.Shape()); - } + di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n"; + BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape()); + DBRep::Set("F", result.Shape()); -// DBRep::Set("F",result.Shape()); return 0; } @@ -945,21 +921,10 @@ static Standard_Integer BUC60773 (Draw_Interpretor& /*di*/, Standard_Integer /*n static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if(argc > 2) { - di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 1) { + di << "Usage : " << argv[0] << "\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 2) { - Standard_Integer IsB = Draw::Atoi(argv[1]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } //Cylindre 36.085182 20.0 8.431413 88.04671 20.0 38.931416 10.0 @@ -1000,34 +965,15 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar TopoDS_Shape SCon = cone.Shape(); DBRep::Set("con", SCon); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Fuse SFuse(SCyl, SCon); -//#else -// BRepAlgo_Fuse SFuse(SCyl, SCon); -//#endif -// -// if(! SFuse.IsDone() ) -// cout<<"Error: Boolean fuse operation failed !"< 2) { - di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if(argc != 1) { + di << "Usage : " << argv[0] << "\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 2) { - Standard_Integer IsB = Draw::Atoi(argv[1]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0)); BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150); @@ -1156,52 +1091,21 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co TopoDS_Shape sh2 = trans1.Shape(); DBRep::Set("sh2",sh2); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Fuse fuse1(sh1, sh2); -//#else -// BRepAlgo_Fuse fuse1(sh1, sh2); -//#endif -// -// TopoDS_Shape fsh1 = fuse1.Shape(); - - TopoDS_Shape fsh1; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n"; - BRepAlgoAPI_Fuse fuse1(sh1, sh2); - fsh1 = fuse1.Shape(); - } else { - di << "BRepAlgo_Fuse fuse1(sh1, sh2)\n"; - BRepAlgo_Fuse fuse1(sh1, sh2); - fsh1 = fuse1.Shape(); - } - + di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n"; + BRepAlgoAPI_Fuse fuse1(sh1, sh2); + TopoDS_Shape fsh1 = fuse1.Shape(); DBRep::Set("fsh1",fsh1); + BRepBuilderAPI_Transform trans2(fsh1, trsf2); TopoDS_Shape sh3 = trans2.Shape(); DBRep::Set("sh3",sh3); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Fuse fuse2(fsh1,sh3); -//#else -// BRepAlgo_Fuse fuse2(fsh1,sh3); -//#endif -// -// TopoDS_Shape fsh2 = fuse2.Shape(); - - TopoDS_Shape fsh2; - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n"; - BRepAlgoAPI_Fuse fuse2(fsh1,sh3); - fsh2 = fuse2.Shape(); - } else { - di << "BRepAlgo_Fuse fuse2(fsh1,sh3)\n"; - BRepAlgo_Fuse fuse2(fsh1,sh3); - fsh2 = fuse2.Shape(); - } - + di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n"; + BRepAlgoAPI_Fuse fuse2(fsh1, sh3); + const TopoDS_Shape& fsh2 = fuse2.Shape(); DBRep::Set("fsh2",fsh2); + Handle(AIS_Shape) aisp1 = new AIS_Shape(fsh2); -// aContext->Display(aisp1); return 0; } @@ -1596,27 +1500,11 @@ static Standard_Integer BUC60921 (Draw_Interpretor& di, static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, const char ** a) { - //if(argc!=2) - // { - // cerr << "Usage : " << a[0] << " file.igs" << endl; - // return -1; - // } - if(argc < 2 || argc > 3) { - di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n"; + if (argc != 2) { + di << "Usage : " << a[0] << " file.igs\n"; return 1; } - Standard_Boolean IsBRepAlgoAPI = Standard_True; - if (argc == 3) { - Standard_Integer IsB = Draw::Atoi(a[2]); - if (IsB != 1) { - IsBRepAlgoAPI = Standard_False; -#if ! defined(BRepAlgo_def01) -// di << "Error: There is not BRepAlgo_Fuse class\n"; -// return 1; -#endif - } - } - + Handle(AIS_InteractiveContext) myContext = ViewerTest::GetAISContext(); if(myContext.IsNull()) { @@ -1649,23 +1537,9 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300); TopoDS_Shape sh = cyl.Shape(); -//#if ! defined(BRepAlgoAPI_def01) -// BRepAlgoAPI_Fuse fuse(sol, sh); -//#else -// BRepAlgo_Fuse fuse(sol, sh); -//#endif -// -// sh = fuse.Shape(); - - if (IsBRepAlgoAPI) { - di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n"; - BRepAlgoAPI_Fuse fuse(sol, sh); - sh = fuse.Shape(); - } else { - di << "BRepAlgo_Fuse fuse(sol, sh)\n"; - BRepAlgo_Fuse fuse(sol, sh); - sh = fuse.Shape(); - } + di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n"; + BRepAlgoAPI_Fuse fuse(sol, sh); + sh = fuse.Shape(); Handle(AIS_Shape) res = new AIS_Shape(sh); myContext->Display (res, Standard_True); @@ -1694,7 +1568,7 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) { theCommands.Add("BUC60825","BUC60825",__FILE__,BUC60825,group); - theCommands.Add("OCC10006","OCC10006 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,OCC10006,group); + theCommands.Add("OCC10006","OCC10006",__FILE__,OCC10006,group); theCommands.Add("BUC60856","BUC60856",__FILE__,BUC60856,group); @@ -1705,11 +1579,11 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) { theCommands.Add("BUC60876","BUC60876 shape",__FILE__,BUC60876_,group); theCommands.Add("BUC60773","BUC60773",__FILE__,BUC60773,group); - theCommands.Add("TestCMD","TestCMD [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,TestCMD,group); + theCommands.Add("TestCMD","TestCMD",__FILE__,TestCMD,group); theCommands.Add("statface","statface face",__FILE__,statface,group); - theCommands.Add("BUC60841","BUC60841 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60841,group); + theCommands.Add("BUC60841","BUC60841",__FILE__,BUC60841,group); theCommands.Add("BUC60874","BUC60874",__FILE__,BUC60874,group); @@ -1726,6 +1600,6 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) { theCommands.Add("AISWidth","AISWidth (DOC,entry,[width])",__FILE__,AISWidth,group); theCommands.Add("BUC60921","BUC60921 Doc label brep_file",__FILE__,BUC60921,group); - theCommands.Add("BUC60951","BUC60951 file.igs [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60951_, group ); + theCommands.Add("BUC60951","BUC60951 file.igs",__FILE__,BUC60951_, group ); } diff --git a/tests/bugs/modalg_2/bug426 b/tests/bugs/modalg_2/bug426 index beb76b362c..447701c3b5 100755 --- a/tests/bugs/modalg_2/bug426 +++ b/tests/bugs/modalg_2/bug426 @@ -1,8 +1,6 @@ -if { ![checkplatform -windows] } { - puts "TODO ?OCC12345 MacOS: \\*\\* Exception" - puts "TODO ?OCC12345 MacOS: An exception was caught" - puts "TODO ?OCC12345 MacOS: TEST INCOMPLETE" -} +puts "TODO OCC24156 MacOS: \\*\\* Exception \\*\\*.*" +puts "TODO OCC24156 MacOS: An exception was caught" +puts "TODO OCC24156 MacOS: TEST INCOMPLETE" pload QAcommands @@ -15,10 +13,8 @@ puts "========" ############################################################################# ## BRepFilletAPI_MakeFillet presents a bug on fillet computation (build()) ############################################################################# -## (old topology) -############################################################################# -OCC426 result rs1 rs2 rs3 fuse32 fuse321 0 +OCC426 result rs1 rs2 rs3 fuse32 fuse321 fuseUnif checkshape rs1 checkshape rs2 @@ -29,4 +25,3 @@ checkshape fuse321 checkprops result -s 7507.61 checkshape result checkview -display result -2d -path ${imagedir}/${test_image}.png - diff --git a/tests/bugs/modalg_2/bug426_1 b/tests/bugs/modalg_2/bug426_1 deleted file mode 100755 index 5f20076c09..0000000000 --- a/tests/bugs/modalg_2/bug426_1 +++ /dev/null @@ -1,29 +0,0 @@ -puts "TODO OCC24156 MacOS: \\*\\* Exception \\*\\*.*" -puts "TODO OCC24156 MacOS: An exception was caught" -puts "TODO OCC24156 MacOS: TEST INCOMPLETE" -puts "TODO OCC25920 ALL: Faulty shapes in variables faulty_1 to faulty_" -puts "TODO OCC25920 ALL: Error : The area of result shape is" - -pload QAcommands - -puts "========" -puts "OCC426" -puts "OCC50" -puts "========" -############################################################################# -## The result of fuse operation is invalid -############################################################################# -## BRepFilletAPI_MakeFillet presents a bug on fillet computation (build()) -############################################################################# - -OCC426 result rs1 rs2 rs3 fuse32 fuse321 - -checkshape rs1 -checkshape rs2 -checkshape rs3 -checkshape fuse32 -checkshape fuse321 - -checkprops result -s 7507.61 -checkshape result -checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_4/bug822_1 b/tests/bugs/modalg_4/bug822_1 index 8bbdc89de0..5252857a58 100755 --- a/tests/bugs/modalg_4/bug822_1 +++ b/tests/bugs/modalg_4/bug822_1 @@ -7,10 +7,8 @@ puts "" ##################################### ## BRepMesh_IncrementalMesh fails on some faces ##################################### -## (old topology) -##################################### -if {[ catch { set info_result [OCC822_1 a1 a2 result 0] } ] } { +if {[ catch { set info_result [OCC822_1 a1 a2 result] } ] } { puts "Faulty OCC822" } else { if { [regexp {FAILED} $info_result] } { diff --git a/tests/bugs/modalg_4/bug822_2 b/tests/bugs/modalg_4/bug822_2 index e4896131e0..8a1d0277d5 100755 --- a/tests/bugs/modalg_4/bug822_2 +++ b/tests/bugs/modalg_4/bug822_2 @@ -10,7 +10,7 @@ puts "" ## (old topology) ##################################### -if { [ catch { set info_result [OCC822_2 a1 a2 result 0] } ] } { +if { [ catch { set info_result [OCC822_2 a1 a2 result] } ] } { puts "Faulty OCC822" } else { if { [regexp {FAILED} $info_result] } { diff --git a/tests/bugs/modalg_4/bug823 b/tests/bugs/modalg_4/bug823 index 22c3bf240b..df2e468c71 100755 --- a/tests/bugs/modalg_4/bug823 +++ b/tests/bugs/modalg_4/bug823 @@ -7,8 +7,6 @@ puts "" ############################### ## BRepAlgoAPI_Fuse fails on two cylinders ############################### -## (old topology) -##################################### if { [ catch { set info_result [OCC823 a1 a2 result] } ] } { puts "Faulty OCC823" diff --git a/tests/bugs/modalg_4/bug823_1 b/tests/bugs/modalg_4/bug823_1 deleted file mode 100755 index de47f9a830..0000000000 --- a/tests/bugs/modalg_4/bug823_1 +++ /dev/null @@ -1,31 +0,0 @@ -pload QAcommands - -puts "============" -puts "OCC823" -puts "============" -puts "" -################################ -## BRepAlgoAPI_Fuse fails on two cylinders -################################ -## -## Note: test for old topology -## -################################ - -if { [ catch { set info_result [OCC823 a1 a2 a3] } ] } { - puts "Faulty : exception was caught" -} else { - checkshape a1 - checkshape a2 - bfuse result a1 a2 - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 23189.5 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png - diff --git a/tests/bugs/modalg_4/bug824 b/tests/bugs/modalg_4/bug824 index d4bc4ddc8d..285eeccfca 100755 --- a/tests/bugs/modalg_4/bug824 +++ b/tests/bugs/modalg_4/bug824 @@ -7,10 +7,8 @@ puts "" #################################### ## BRepAlgoAPI_Fuse fails on cylinder and sphere #################################### -## (old topology) -##################################### -if { [ catch { set info_result [OCC824 a1 a2 result 0] } ] } { +if { [ catch { set info_result [OCC824 a1 a2 result] } ] } { puts "Faulty OCC824" } else { if { [regexp {FAILED} $info_result] } { diff --git a/tests/bugs/modalg_4/bug824_1 b/tests/bugs/modalg_4/bug824_1 deleted file mode 100755 index 94b83efe33..0000000000 --- a/tests/bugs/modalg_4/bug824_1 +++ /dev/null @@ -1,31 +0,0 @@ -pload QAcommands - -puts "=======" -puts "OCC824" -puts "=======" -puts "" -#################################### -## BRepAlgoAPI_Fuse fails on cylinder and sphere -#################################### -## -## Note: test for old topology -## -################################ - -if { [ catch { set info_result [OCC824 a1 a2 a3] } ] } { - puts "Faulty : exception was catch" -} else { - checkshape a1 - checkshape a2 - bfuse result a1 a2 - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 16336.3 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png - diff --git a/tests/bugs/modalg_4/bug825 b/tests/bugs/modalg_4/bug825 index 4909ffe59a..ac50a296a6 100755 --- a/tests/bugs/modalg_4/bug825 +++ b/tests/bugs/modalg_4/bug825 @@ -1,5 +1,4 @@ puts "TODO OCC25915 ALL: Faulty OCC825" -puts "TODO OCC25915 ALL: Error : The command is not valid. The area is" puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_" pload QAcommands @@ -14,7 +13,7 @@ puts "" ## (old topology) ##################################### -if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2 0] } ] } { +if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2] } ] } { puts "Faulty OCC825" } else { if { [regexp {FAILED} $info_result] } { @@ -30,13 +29,17 @@ if { [ catch { set info_result [OCC825 a1 a2 a3 res1 res2 0] } ] } { if {[llength ${ExplodeList}] < 1} { puts "Faulty OCC825" } - checkshape res1 + checkshape res1 + checkprops res1 -s 5890.42 checknbshapes res1 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 15 renamevar res2 result } -checkprops result -s 0 checkshape result +checkprops result -s 5890.42 + checkview -display result -2d -path ${imagedir}/${test_image}.png + + diff --git a/tests/bugs/modalg_4/bug825_1 b/tests/bugs/modalg_4/bug825_1 deleted file mode 100755 index 4c143ea360..0000000000 --- a/tests/bugs/modalg_4/bug825_1 +++ /dev/null @@ -1,28 +0,0 @@ -pload QAcommands - -puts "=======" -puts "OCC825" -puts "=======" -puts "" -###################################### -## BRepAlgoAPI_Cut fails on sphere and b-spline face -###################################### -## -## Note: test for old topology -## -################################ - -if { [ catch { set info_result [OCC825 a1 a2 a3 a4 a5] } ] } { - puts "Faulty : an exception was caught" -} else { - bcut result a2 a1 - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 5890.46 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_4/bug825_2 b/tests/bugs/modalg_4/bug825_2 deleted file mode 100755 index 5f64c543a7..0000000000 --- a/tests/bugs/modalg_4/bug825_2 +++ /dev/null @@ -1,30 +0,0 @@ -puts "TODO OCC25915 ALL: Faulty shapes in variables faulty_1 to faulty_" - -pload QAcommands - -puts "========" -puts "OCC825" -puts "========" -puts "" -###################################### -## BRepAlgoAPI_Cut fails on sphere and b-spline face -###################################### -## -## Note: test for old topology -## -################################ - -if { [ catch { set info_result [OCC825 a1 a2 a3 a4 a5] } ] } { - puts "Faulty : an exception was caught" -} else { - bcut result a3 a1 - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 5890.48 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_4/bug826_1 b/tests/bugs/modalg_4/bug826_1 deleted file mode 100755 index e41a1c7faa..0000000000 --- a/tests/bugs/modalg_4/bug826_1 +++ /dev/null @@ -1,37 +0,0 @@ -pload QAcommands - -puts "============" -puts "OCC826" -puts "============" -puts "" -################################### -## BRepAlgoAPI_Fuse fails on revolved and sphere -################################### -## Now this test uses BOPAlgo. -## Intersection of cylinder and sphere. At that, -## the intersection line goes near to the pole -## of the sphere (near, but not through). -## Walking-line has a point in the seam of -## the sphere and neighbour point. Both sections of the -## sphere (through every of these points and parallel to -## equatorial plane) are circles with small radii. As result, -## in 2D-space U-coordinates of these points are too different -## (may be even ~60 degrees) in spite of its neighbourhood. -##################################### - -if { [ catch { set result [OCC826 a1 a2 a3] } ] } { - puts "Faulty : an exception was caught" -} else { - checkshape a1 - checkshape a2 - bfuse result a1 a2 - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 272935 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_4/bug827_1 b/tests/bugs/modalg_4/bug827_1 deleted file mode 100755 index 92c573a325..0000000000 --- a/tests/bugs/modalg_4/bug827_1 +++ /dev/null @@ -1,47 +0,0 @@ -puts "TODO #23910 ALL: Faulty OCC827" -puts "TODO #23910 ALL: Faulty shapes in variables faulty_1 to faulty_" -pload QAcommands - -puts "========" -puts "OCC827" -puts "========" -puts "" -################################### -## BRepAlgoAPI_Fuse fails on cylinder and torus -################################### -## (old topology) -##################################### - -# -# a1 - Cylinder -# a2 - Torus1 -# a3 - Torus1 -# res1 - Fuse(Torus1 & Cylinder) -# res2 - Fuse(Torus2 & res1) -# - -if { [ catch { set info_result [OCC827 a1 a2 a3 res1 res2 0] } ] } { - puts "Faulty OCC827" -} else { - if { [regexp {FAILED} $info_result] } { - puts "Faulty OCC827" - } - checkshape a1 - checkshape a2 - checkshape a3 - checkshape res1 - - set ExplodeList [explode res1] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827" - } - - set ExplodeList [explode res2] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827" - } - renamevar res2 result -} -checkprops result -s 7046.01 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_4/bug827_2 b/tests/bugs/modalg_4/bug827_2 deleted file mode 100755 index 4fb078493a..0000000000 --- a/tests/bugs/modalg_4/bug827_2 +++ /dev/null @@ -1,43 +0,0 @@ -pload QAcommands - -puts "=======" -puts "OCC827" -puts "=======" -puts "" -#################################### -## BRepAlgoAPI_Fuse fails on cylinder and torus -#################################### - - -# -# a1 - Cylinder -# a2 - Torus1 -# a3 - Torus1 -# res1 - Fuse(Torus1 & Cylinder) -# res2 - Fuse(Torus2 & res1) -# - -if { [ catch { set info_result [OCC827 a1 a2 a3 a4 a5] } ] } { - puts "Faulty OCC827" -} else { - checkshape a1 - checkshape a2 - checkshape a3 - bop a1 a2 - bopfuse res1 - checkshape res1 - set ExplodeList [explode res1] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827 : Resulting shape is empty COMPOUND" - } - bop res1 a3 - bopfuse result - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827 : Resulting shape is empty COMPOUND" - } -} -checkprops result -s 11847.7 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png - diff --git a/tests/bugs/modalg_4/bug827_3 b/tests/bugs/modalg_4/bug827_3 deleted file mode 100755 index d28cdb4bd1..0000000000 --- a/tests/bugs/modalg_4/bug827_3 +++ /dev/null @@ -1,44 +0,0 @@ -pload QAcommands - -puts "=======" -puts "OCC827" -puts "=======" -puts "" -#################################### -## BRepAlgoAPI_Fuse fails on cylinder and torus -#################################### - -# -# a1 - Cylinder -# a2 - Torus1 -# a3 - Torus1 -# res1 - Fuse(Torus1 & Cylinder) -# res2 - Fuse(Torus2 & res1) -# - -if { [ catch { set info_result [OCC827 a1 a2 a3 a4 a5] } ] } { - puts "Faulty OCC827" -} else { - checkshape a1 - checkshape a2 - checkshape a3 - bop a2 a1 - bopfuse res1 - checkshape res1 - set ExplodeList [explode res1] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827 : Resulting shape is empty COMPOUND" - } - bop a3 res1 - bopfuse result - - set ExplodeList [explode result] - if {[llength ${ExplodeList}] < 1} { - puts "Faulty OCC827 : Resulting shape is empty COMPOUND" - } -} - -checkprops result -s 11847.7 -checkshape result -checkview -display result -2d -path ${imagedir}/${test_image}.png -