From: jfa Date: Mon, 15 Jan 2024 13:17:43 +0000 (+0000) Subject: Porting to OCCT 7.8.0 X-Git-Tag: V9_13_0a1~4^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=070485398985df636b4cf85f0250bb7ffb16758e;p=modules%2Fshaper.git Porting to OCCT 7.8.0 --- diff --git a/src/BuildPlugin/Test/Test20513_2.py b/src/BuildPlugin/Test/Test20513_2.py index 472287306..7770d81b4 100644 --- a/src/BuildPlugin/Test/Test20513_2.py +++ b/src/BuildPlugin/Test/Test20513_2.py @@ -1129,7 +1129,7 @@ model.testNbSubShapes(Filling_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Filling_2, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Filling_2, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Filling_2, GeomAPI_Shape.VERTEX, [8]) -model.testResultsAreas(Filling_2, [29.10364506]) +model.testResultsAreas(Filling_2, [29.09175882]) model.testNbResults(Filling_3, 1) model.testNbSubResults(Filling_3, [0]) @@ -1137,6 +1137,6 @@ model.testNbSubShapes(Filling_3, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Filling_3, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Filling_3, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Filling_3, GeomAPI_Shape.VERTEX, [8]) -model.testResultsAreas(Filling_3, [30.744277238]) +model.testResultsAreas(Filling_3, [30.720017606]) assert(model.checkPythonDump()) diff --git a/src/CTestTestfileInstall.cmake b/src/CTestTestfileInstall.cmake index c559f1a55..81b24a8da 100644 --- a/src/CTestTestfileInstall.cmake +++ b/src/CTestTestfileInstall.cmake @@ -46,4 +46,5 @@ SUBDIRS(ConnectorAPI ModelGeomAlgo Locale test_API + TestModels ) diff --git a/src/ExchangePlugin/Test/TestImportImage_3.py b/src/ExchangePlugin/Test/TestImportImage_3.py index 82b1a8974..4de0cf850 100755 --- a/src/ExchangePlugin/Test/TestImportImage_3.py +++ b/src/ExchangePlugin/Test/TestImportImage_3.py @@ -104,5 +104,9 @@ with TemporaryDirectory() as tmp_dir: # Close SALOME GUI import salome_utils import subprocess +import platform port = salome_utils.getPortNumber() -proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)]) +if platform.system() == "Windows": + proc = subprocess.Popen(["python", "killSalomeWithPort.py", "{}".format(port)]) +else: + proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)]) diff --git a/src/FeaturesPlugin/Test/Test20245_3.py b/src/FeaturesPlugin/Test/Test20245_3.py index 1c8898df0..8e5e3f32b 100644 --- a/src/FeaturesPlugin/Test/Test20245_3.py +++ b/src/FeaturesPlugin/Test/Test20245_3.py @@ -1090,7 +1090,7 @@ SketchLine_77.result().setName("SketchLine_118") SketchProjection_19 = Sketch_8.addProjection(model.selection("EDGE", "Split_2_1_17/Modified_Edge&PartSet/YOZ/YOZ&Sketch_1/SketchArc_2_2"), False) SketchProjection_19.setName("SketchProjection_40") SketchProjection_19.result().setName("SketchProjection_40") -SketchBSpline_1 = SketchProjection_19.createdFeature() +SketchProj19_1 = SketchProjection_19.createdFeature() ### Create SketchProjection SketchProjection_20 = Sketch_8.addProjection(model.selection("EDGE", "Partition_1_1_4/Generated_Edge&PartSet/YOZ/YOZ&Sketch_1/SketchLine_19"), False) @@ -1100,7 +1100,7 @@ SketchLine_78 = SketchProjection_20.createdFeature() SketchLine_78.setName("SketchLine_119") SketchLine_78.result().setName("SketchLine_119") Sketch_8.setCoincident(SketchLine_74.endPoint(), SketchLine_78.result()) -Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_BSpline(SketchBSpline_1).startPoint()) +Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_Arc(SketchProj19_1).startPoint()) ### Create SketchLine SketchLine_79 = Sketch_8.addLine(5.676067550792231, 10.23944020672391, 5.829536340268943, 10.44848598250872) diff --git a/src/FeaturesPlugin/Test/Test20245_3_geometrical.py b/src/FeaturesPlugin/Test/Test20245_3_geometrical.py index 70e5c1d7c..21fe714c6 100644 --- a/src/FeaturesPlugin/Test/Test20245_3_geometrical.py +++ b/src/FeaturesPlugin/Test/Test20245_3_geometrical.py @@ -366,10 +366,10 @@ Revolution_3 = model.addRevolution(Part_1_doc, [model.selection("WIRE", (4.21276 Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", (3.237566604725065, 1.012489110826635e-16, 11.61400119092393)), model.selection("SOLID", (3.223802337712571, 1.605864674679632e-16, 11.57493485456337))], model.selection("FACE", "PartSet/YOZ"), keepOriginal = True) ### Create Cut -Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.02393444277354129, -2.619925842544883e-15, -2.580701826672511))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))]) +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, 0, -2.581694))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))]) ### Create Fuse -Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.02010673966564346, 1.098068506034238e-08, -2.591493279117804)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True) +Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.592352)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True) ### Create Plane Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 3.6, False) @@ -485,10 +485,10 @@ Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPOUND", "all-in- Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", (5, 0, 1.2))], axis = model.selection("EDGE", "PartSet/OZ"), angle = -90) ### Create Fuse -Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.01517504751343968, 2.050041270815023e-08, -2.581926283264154)), model.selection("COMPOUND", (6.661338147750939e-16, -6.164784975045299, 1.5))], removeEdges = True) +Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.582588)), model.selection("COMPOUND", (6.661338147750939e-16, -6.164784975045299, 1.5))], removeEdges = True) ### Create Cut -Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.01123484393534465, -0.0370107755507461, -2.561989939908471))], [model.selection("SOLID", (6.683953801956267e-16, -5, 1.2))]) +Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, -0.030528, -2.562454))], [model.selection("SOLID", (6.683953801956267e-16, -5, 1.2))]) ### Create Group Group_1_objects = [model.selection("VERTEX", (-4.1398177019328, 0, 11.393656164374)), @@ -708,7 +708,7 @@ Group_3_objects = [model.selection("FACE_4", (-2.517545082612181, -9.79305648457 Group_3 = model.addGroup(Part_1_doc, "FACE", Group_3_objects) ### Create Partition -Partition_1_objects = [model.selection("SOLID", (-0.01000739040276288, -0.02886888807097911, -2.568297753475152)), +Partition_1_objects = [model.selection("SOLID", (0, -0.0201706, -2.568703)), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/YOZ")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects, keepSubResults = True) @@ -1090,7 +1090,7 @@ SketchLine_77.result().setName("SketchLine_118") SketchProjection_19 = Sketch_8.addProjection(model.selection("EDGE", (0, 5.790750667181333, 10.12202136327199)), False) SketchProjection_19.setName("SketchProjection_40") SketchProjection_19.result().setName("SketchProjection_40") -SketchBSpline_1 = SketchProjection_19.createdFeature() +SketchProj19_1 = SketchProjection_19.createdFeature() ### Create SketchProjection SketchProjection_20 = Sketch_8.addProjection(model.selection("EDGE", (0, 6.534999999999997, 9.721499999999999)), False) @@ -1100,7 +1100,7 @@ SketchLine_78 = SketchProjection_20.createdFeature() SketchLine_78.setName("SketchLine_119") SketchLine_78.result().setName("SketchLine_119") Sketch_8.setCoincident(SketchLine_74.endPoint(), SketchLine_78.result()) -Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_BSpline(SketchBSpline_1).startPoint()) +Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_Arc(SketchProj19_1).startPoint()) ### Create SketchLine SketchLine_79 = Sketch_8.addLine(5.676067550792231, 10.23944020672391, 5.829536340268943, 10.44848598250872) @@ -1126,7 +1126,7 @@ Sketch_8.setCoincident(SketchLine_73.endPoint(), SketchLine_80.result()) model.do() ### Create Revolution -Revolution_9 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", (0, 5.830822237526045, 10.15645361216909))], model.selection("EDGE", "PartSet/OZ"), 360, 0, "Edges") +Revolution_9 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", (0, 5.830822237526045, 10.3860737))], model.selection("EDGE", "PartSet/OZ"), 360, 0, "Edges") ### Create Split Split_4 = model.addSplit(Part_1_doc, [model.selection("COMPOUND", "all-in-Split_3")], [model.selection("COMPOUND", "all-in-Revolution_9")], keepSubResults = True) diff --git a/src/FeaturesPlugin/Test/Test2918.py b/src/FeaturesPlugin/Test/Test2918.py index 6f2c30429..7553224a0 100644 --- a/src/FeaturesPlugin/Test/Test2918.py +++ b/src/FeaturesPlugin/Test/Test2918.py @@ -237,8 +237,8 @@ model.do() Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("WIRE", (3.862008317343538, 0, 11.38077471561056))], model.selection("EDGE", (3.241000000000025, 0, 11.62374600149389)), 360, 0) Revolution_3 = model.addRevolution(Part_1_doc, [model.selection("WIRE", (4.212769702413368, 0, 11.10430922268928))], model.selection("EDGE", (3.241000000000025, 0, 11.62374600149389)), 360, 0) Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", (3.237566604725065, 0, 11.61400119092393)), model.selection("SOLID", (3.223802337712571, 0, 11.57493485456337))], model.selection("FACE", "PartSet/YOZ"), True) -Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.02393444277354109, 0, -2.580701826672493))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))]) -Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.0201067396659898, 0, -2.591493279115657)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True) +Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, 0, -2.5816942490967))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))]) +Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.5923523532641)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True) Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 3.6, False) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", (0, 0, 3.6))) SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", (-6.188, 7.578114393123822e-16, -3.45)), True) @@ -310,10 +310,10 @@ model.do() Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", (0, 0, 1.2))], model.selection(), 10, 0) Rotation_1_objects = [model.selection("SOLID", (5, 1.166200656118862e-18, 1.2)), model.selection("SOLID", (6.049686362669476, 0, 1.5)), model.selection("SOLID", (6.320976310013338, 0, 1.5))] Rotation_1 = model.addRotation(Part_1_doc, Rotation_1_objects, model.selection("EDGE", "PartSet/OZ"), -90) -Fuse_2_objects_1 = [model.selection("SOLID", (-0.01517504751345233, 0, -2.581926283264175)), model.selection("SOLID", (0, -6.049686362669479, 1.5)), model.selection("SOLID", (0, -6.320976310013339, 1.5))] +Fuse_2_objects_1 = [model.selection("SOLID", (0, 0, -2.5825883331029)), model.selection("SOLID", (0, -6.049686362669479, 1.5)), model.selection("SOLID", (0, -6.320976310013339, 1.5))] Fuse_2 = model.addFuse(Part_1_doc, Fuse_2_objects_1) -Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.01017608298903453, -0.03890028204629473, -2.562040714294322))], [model.selection("SOLID", (0, -5, 1.2))]) -FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", (-0.008741742572144908, -0.03112823644757425, -2.568357186681257))) +Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, -0.0305282901284, -2.5624546739218))], [model.selection("SOLID", (0, -5, 1.2))]) +FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", (0, -0.020170634783153, -2.5687034308941))) model.end() @@ -323,6 +323,6 @@ model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.FACE, [47]) model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.EDGE, [202]) model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.VERTEX, [404]) -model.testResultsVolumes(FusionFaces_1, [612.7268292882]) +model.testResultsVolumes(FusionFaces_1, [612.727466]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py index 92dce387c..63251df6e 100644 --- a/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py +++ b/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py @@ -57,7 +57,7 @@ SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchCircle_2.center(), ExtrusionCut_2.setNestedSketch(Sketch_2) model.do() Shape = ExtrusionCut_2.results()[0].resultSubShapePair()[0].shape() -checkMiddlePoint(Shape, 4.999955838, 4.99999192, 4.677925562) +checkMiddlePoint(Shape, 4.999955680, 4.99999176, 4.677925400) model.end() diff --git a/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py index e1d9fcec0..1e7b13719 100644 --- a/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py +++ b/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py @@ -57,7 +57,7 @@ SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchCircle_2.center(), ExtrusionFuse_2.setNestedSketch(Sketch_2) model.do() Shape = ExtrusionFuse_2.results()[0].resultSubShapePair()[0].shape() -checkMiddlePoint(Shape, 4.97994427, 4.995857948, 4.254078314) +checkMiddlePoint(Shape, 4.97994444, 4.995858131, 4.254077951) model.end() diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces11.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces11.py index bb7aeec4f..3102dc381 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces11.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces11.py @@ -75,9 +75,9 @@ model.testNbResults(Extrusion_1, 1) model.testNbSubResults(Extrusion_1, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [13]) -model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [61]) -model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [122]) -model.testResultsVolumes(Extrusion_1, [41289.10946]) +model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [59]) +model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [118]) +model.testResultsVolumes(Extrusion_1, [41289.17344]) # change radius of sketch circle and check failure ParamRCir.setValue(10) diff --git a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_3.py b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_3.py index 5bcec48e5..2e64f771f 100644 --- a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_3.py +++ b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_3.py @@ -112,9 +112,7 @@ model.testNbSubShapes(Fillet_5, GeomAPI_Shape.FACE, [12]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [53]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [106]) model.testResultsVolumes(Fillet_5, [976.519471836586]) -refPoint = GeomAPI_Pnt(54.98720346, 4.918055722, 4.987203302) -midPoint = Fillet_5.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 54.98720346, 4.918055722, 4.987203302) Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Top][Box_2_1/Front]"), model.selection("FACE", "Box_2_1/Right")], RADIUS_1, RADIUS_2) model.testNbResults(Fillet_6, 1) @@ -124,9 +122,7 @@ model.testNbSubShapes(Fillet_6, GeomAPI_Shape.FACE, [23]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190]) model.testResultsVolumes(Fillet_6, [1565.568094166]) -refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5) -midPoint = Fillet_6.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073) Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[AngularCopy_1_1_1/MF:Rotated&Box_3_1/Back][AngularCopy_1_1_1/MF:Rotated&Box_3_1/Top]"), model.selection("FACE", "AngularCopy_1_1_2/MF:Rotated&Box_3_1/Left")], RADIUS_1, RADIUS_2) model.testNbResults(Fillet_7, 2) diff --git a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_4.py index ff354c725..0d21109bc 100644 --- a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v0_4.py @@ -114,9 +114,7 @@ model.testNbSubShapes(Fillet_5, GeomAPI_Shape.FACE, [11]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [50]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [100]) model.testResultsVolumes(Fillet_5, [976.068565925934]) -refPoint = GeomAPI_Pnt(55.0654360945, 5.015632459, 4.985518188) -midPoint = Fillet_5.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 55.0654360945, 5.015632459, 4.985518188) Recover_1 = model.addRecover(Part_1_doc, Fillet_5, [Compound_1.result()], True) Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Recover_1_1_7_2/Modified_Face&Box_2_1/Top][Recover_1_1_7_2/Modified_Face&Box_2_1/Front]"), model.selection("FACE", "Recover_1_1_7_2/Modified_Face&Box_2_1/Right")], RADIUS_1, RADIUS_2) @@ -127,9 +125,7 @@ model.testNbSubShapes(Fillet_6, GeomAPI_Shape.FACE, [23]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190]) model.testResultsVolumes(Fillet_6, [1565.568094166]) -refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5) -midPoint = Fillet_6.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073) Recover_2 = model.addRecover(Part_1_doc, Fillet_6, [Compound_1.result()], True) Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Recover_2_1_8_1/Modified_Face&Box_3_1/Back][Recover_2_1_8_1/Modified_Face&Box_3_1/Top]"), model.selection("FACE", "Recover_2_1_8_2/Modified_Face&Box_3_1/Left")], RADIUS_1, RADIUS_2) diff --git a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_3.py b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_3.py index b21122362..2726321f2 100644 --- a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_3.py +++ b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_3.py @@ -112,9 +112,7 @@ model.testNbSubShapes(Fillet_5, GeomAPI_Shape.FACE, [12]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [53]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [106]) model.testResultsVolumes(Fillet_5, [976.519471836586]) -refPoint = GeomAPI_Pnt(54.98720346, 4.918055722, 4.987203302) -midPoint = Fillet_5.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 54.98720346, 4.918055722, 4.987203302) Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Top][Box_2_1/Front]"), model.selection("FACE", "Box_2_1/Right")], RADIUS_1, RADIUS_2, keepSubResults = True) model.testNbResults(Fillet_6, 1) @@ -124,9 +122,7 @@ model.testNbSubShapes(Fillet_6, GeomAPI_Shape.FACE, [23]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95]) model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190]) model.testResultsVolumes(Fillet_6, [1565.568094166]) -refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5) -midPoint = Fillet_6.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073) Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[AngularCopy_1_1_1/MF:Rotated&Box_3_1/Back][AngularCopy_1_1_1/MF:Rotated&Box_3_1/Top]"), model.selection("FACE", "AngularCopy_1_1_2/MF:Rotated&Box_3_1/Left")], RADIUS_1, RADIUS_2, keepSubResults = True) model.testNbResults(Fillet_7, 1) @@ -136,9 +132,8 @@ model.testNbSubShapes(Fillet_7, GeomAPI_Shape.FACE, [23]) model.testNbSubShapes(Fillet_7, GeomAPI_Shape.EDGE, [98]) model.testNbSubShapes(Fillet_7, GeomAPI_Shape.VERTEX, [196]) model.testResultsVolumes(Fillet_7, [2976.0685684791988]) -refPoint = GeomAPI_Pnt(-20.9807621135, 42.806, 5) -midPoint = Fillet_7.defaultResult().shape().middlePoint() -assert(midPoint.distance(refPoint) < TOLERANCE) +model.checkMiddlePoint(Fillet_7.defaultResult().shape(), -20.9807621135, 42.806, 5) + model.end() model.begin() diff --git a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_4.py b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_4.py index dba54c192..be4f3885f 100644 --- a/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_4.py +++ b/src/FeaturesPlugin/Test/TestFillet_MultiLevelCompound_v95_4.py @@ -142,7 +142,7 @@ VOLUME = 5565.117188528191 assertResult(Fillet_5) Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Compound_1_1_7_2/Modified_Face&Box_2_1/Top][Compound_1_1_7_2/Modified_Face&Box_2_1/Front]"), model.selection("FACE", "Compound_1_1_7_2/Modified_Face&Box_2_1/Right")], RADIUS_1, RADIUS_2, keepSubResults = True) -REFERENCE[6] = GeomAPI_Pnt(2.7448, 2.7448, 5) +REFERENCE[6] = GeomAPI_Pnt(2.58156073, 2.58159465, 4.83676073) NB_FACES += 6 NB_EDGES += 29 NB_VERTICES += 58 diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py index 46f3e690a..9c3f0dd05 100644 --- a/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py +++ b/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py @@ -44,7 +44,7 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), Sk RevolutionFuse_1.setNestedSketch(Sketch_1) model.do() Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape() -checkMiddlePoint(Shape, 5.000000277, 2.2088446592, 2.5458802675) +checkMiddlePoint(Shape, 5, 2.2080639645, 2.5532186547) RevolutionFuse_1.setPlanesAndOffsets(model.selection(), 0, model.selection("FACE", "Box_1_1/Bottom"), 0) model.do() diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py b/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py index 56620ba27..4616adae8 100644 --- a/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py +++ b/src/FeaturesPlugin/Test/TestRevolutionFuse_ThroughAll.py @@ -53,7 +53,7 @@ RevolutionFuse_1.setNestedSketch(Sketch_1) model.do() Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape() -checkMiddlePoint(Shape, 6.3892968486, 5.0, 6.3892968486) +checkMiddlePoint(Shape, 6.3943254561, 5.0, 6.3943306351) model.end() diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index e114d961c..3fb717b75 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -19,6 +19,8 @@ #include "GeomAPI_Shape.h" +#include + #include #include #include @@ -60,8 +62,6 @@ #include #include // for std::transform -#include - #define MY_SHAPE implPtr() GeomAPI_Shape::GeomAPI_Shape() @@ -810,8 +810,13 @@ bool GeomAPI_Shape::Comparator::operator()(const std::shared_ptr& const TopoDS_Shape& aShape2 = theShape2->impl(); bool isLess = aShape1.TShape() < aShape2.TShape(); if (aShape1.TShape() == aShape2.TShape()) { +#if OCC_VERSION_LARGE < 0x07080000 Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast()); Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast()); +#else + Standard_Integer aHash1 = aShape1.Location().HashCode(); + Standard_Integer aHash2 = aShape2.Location().HashCode(); +#endif isLess = aHash1 < aHash2; } return isLess; @@ -825,8 +830,13 @@ bool GeomAPI_Shape::ComparatorWithOri::operator()( const TopoDS_Shape& aShape2 = theShape2->impl(); bool isLess = aShape1.TShape() < aShape2.TShape(); if (aShape1.TShape() == aShape2.TShape()) { +#if OCC_VERSION_LARGE < 0x07080000 Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast()); Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast()); +#else + Standard_Integer aHash1 = aShape1.Location().HashCode(); + Standard_Integer aHash2 = aShape2.Location().HashCode(); +#endif isLess = (aHash1 < aHash2) || (aHash1 == aHash2 && aShape1.Orientation() < aShape2.Orientation()); } @@ -836,7 +846,11 @@ bool GeomAPI_Shape::ComparatorWithOri::operator()( int GeomAPI_Shape::Hash::operator()(const std::shared_ptr& theShape) const { const TopoDS_Shape& aShape = theShape->impl(); +#if OCC_VERSION_LARGE < 0x07080000 return aShape.HashCode(IntegerLast()); +#else + return std::hash{}(aShape); +#endif } bool GeomAPI_Shape::Equal::operator()(const std::shared_ptr& theShape1, @@ -845,8 +859,13 @@ bool GeomAPI_Shape::Equal::operator()(const std::shared_ptr& theS const TopoDS_Shape& aShape1 = theShape1->impl(); const TopoDS_Shape& aShape2 = theShape2->impl(); +#if OCC_VERSION_LARGE < 0x07080000 Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast()); Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast()); +#else + Standard_Integer aHash1 = aShape1.Location().HashCode(); + Standard_Integer aHash2 = aShape2.Location().HashCode(); +#endif return aShape1.TShape() == aShape2.TShape() && aHash1 == aHash2; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp index c3686dffd..651b1b401 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -153,12 +155,22 @@ bool STEPExport(const std::string& theFileName, Interface_Static::SetCVal("xstep.cascade.unit", "M"); Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree Interface_Static::SetCVal("write.step.unit", "M"); -#else +#elif OCC_VERSION_LARGE < 0x07080000 STEPCAFControl_Writer aWriterTmp; Interface_Static::SetCVal("xstep.cascade.unit", "M"); Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree Interface_Static::SetCVal("write.step.unit", "M"); STEPCAFControl_Writer aWriter; +#else + STEPCAFControl_Writer aWriter; + Interface_Static::SetCVal("xstep.cascade.unit", "M"); + Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree + Interface_Static::SetCVal("write.step.unit", "M"); + Handle(StepData_StepModel) aModel = aWriter.ChangeWriter().Model(); + aModel->InternalParameters.InitFromStatic(); + Standard_Integer aWriteUnitInt = Interface_Static::IVal("write.step.unit"); + Standard_Real aWriteUnitReal = UnitsMethods::GetLengthFactorValue(aWriteUnitInt); + aModel->SetWriteLengthUnit(aWriteUnitReal); #endif auto aStatus = aWriter.Transfer(aDoc, STEPControl_AsIs); diff --git a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx index 8f12c9e9b..e79ecdffb 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.cxx @@ -834,57 +834,6 @@ Standard_Integer GEOMAlgo_AlgoTools::RefineSDShapes // return 0; } -//======================================================================= -//function : BuildTriangulation -//purpose : -//======================================================================= -Standard_Boolean - GEOMAlgo_AlgoTools::BuildTriangulation (const TopoDS_Shape& theShape) -{ - // calculate deflection - Standard_Real aDeviationCoefficient = 0.001; - - Bnd_Box B; - BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - - Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin; - Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4; - Standard_Real aHLRAngle = 0.349066; - - // build triangulation - BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle); - - // check triangulation - bool isTriangulation = true; - - TopExp_Explorer exp (theShape, TopAbs_FACE); - if (exp.More()) - { - TopLoc_Location aTopLoc; - Handle(Poly_Triangulation) aTRF; - aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc); - if (aTRF.IsNull()) { - isTriangulation = false; - } - } - else // no faces, try edges - { - TopExp_Explorer expe (theShape, TopAbs_EDGE); - if (!expe.More()) { - isTriangulation = false; - } - else { - TopLoc_Location aLoc; - Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc); - if (aPE.IsNull()) { - isTriangulation = false; - } - } - } - return isTriangulation; -} //======================================================================= //function : IsCompositeShape diff --git a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.hxx b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.hxx index 7a9a20cb3..5182ff75f 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.hxx +++ b/src/GeomAlgoImpl/GEOMAlgo_AlgoTools.hxx @@ -90,9 +90,6 @@ class GEOMAlgo_AlgoTools { static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS); - GEOMALGOIMPL_EXPORT - static Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS); - GEOMALGOIMPL_EXPORT static Standard_Integer RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD, const Standard_Real aTol, diff --git a/src/GeomAlgoImpl/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx b/src/GeomAlgoImpl/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx index c848ff86c..68ad864de 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx +++ b/src/GeomAlgoImpl/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx @@ -29,6 +29,11 @@ #include #include + +#include + +#if OCC_VERSION_LARGE < 0x07080000 + #include #define _NCollection_MapHasher @@ -39,6 +44,13 @@ typedef NCollection_IndexedDataMap + +typedef NCollection_IndexedDataMap GEOMAlgo_IndexedDataMapOfIntegerShape; + +#endif // OCC_VERSION_LARGE < 0x07080000 #endif diff --git a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx index fa0c73ee7..e4ceeb154 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.cxx @@ -27,6 +27,8 @@ // #include +#include + #include #include @@ -94,7 +96,11 @@ static Clear(); myNbIds=1; myMap.Add(aS1); +#if OCC_VERSION_LARGE < 0x07080000 aHC=aS1.HashCode(myUpper); +#else + aHC = std::hash{}(aS1); +#endif mySum=NormalizedId(aHC, myNbIds); } //======================================================================= @@ -160,7 +166,11 @@ static myNbIds=myMap.Extent(); for(i=1; i<=myNbIds; ++i) { const TopoDS_Shape& aS=myMap(i); +#if OCC_VERSION_LARGE < 0x07080000 aId=aS.HashCode(myUpper); +#else + aId = std::hash{}(aS); +#endif aIdN=NormalizedId(aId, myNbIds); mySum+=aIdN; } @@ -195,6 +205,7 @@ static } return !bRet; } +#if OCC_VERSION_LARGE < 0x07080000 //======================================================================= //function : HashCode //purpose : @@ -203,6 +214,7 @@ static { return ::HashCode(mySum, aUpper); } +#endif //======================================================================= //function : Dump //purpose : diff --git a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.hxx b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.hxx index 420d9fdac..6719f01f6 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.hxx +++ b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShape.hxx @@ -31,6 +31,8 @@ #include +#include + #include #include #include @@ -92,8 +94,19 @@ class GEOMAlgo_PassKeyShape { GEOMALGOIMPL_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aOther) const; +#if OCC_VERSION_LARGE < 0x07080000 GEOMALGOIMPL_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const; +#endif + + GEOMALGOIMPL_EXPORT + bool operator==(const GEOMAlgo_PassKeyShape& theOther) const + { + return IsEqual(theOther); + } + + GEOMALGOIMPL_EXPORT + size_t GetSum() const { return (size_t)mySum; } GEOMALGOIMPL_EXPORT void Dump(const Standard_Integer aHex = 0) const; diff --git a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.cxx b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.cxx index 7e1dccbc1..e926870f9 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.cxx @@ -27,6 +27,8 @@ // #include +#if OCC_VERSION_LARGE < 0x07080000 + //======================================================================= //function : HashCode //purpose : @@ -45,3 +47,18 @@ { return aPK1.IsEqual(aPK2); } + +#else + +size_t GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey) const +{ + return aPKey.GetSum(); +} + +bool GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey1, + const GEOMAlgo_PassKeyShape& aPKey2) const +{ + return aPKey1.IsEqual(aPKey2); +} + +#endif // OCC_VERSION_LARGE < 0x07080000 diff --git a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.hxx b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.hxx index d6aafc70d..57e456448 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.hxx +++ b/src/GeomAlgoImpl/GEOMAlgo_PassKeyShapeMapHasher.hxx @@ -36,6 +36,8 @@ #include #include +#include + //======================================================================= //class : GEOMAlgo_PassKeyShapeMapHasher //purpose : @@ -43,6 +45,7 @@ class GEOMAlgo_PassKeyShapeMapHasher { public: +#if OCC_VERSION_LARGE < 0x07080000 GEOMALGOIMPL_EXPORT static Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey, const Standard_Integer Upper) ; @@ -50,5 +53,13 @@ class GEOMAlgo_PassKeyShapeMapHasher GEOMALGOIMPL_EXPORT static Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1, const GEOMAlgo_PassKeyShape& aPKey2) ; +#else + GEOMALGOIMPL_EXPORT + size_t operator()(const GEOMAlgo_PassKeyShape& aPKey) const; + + GEOMALGOIMPL_EXPORT + bool operator()(const GEOMAlgo_PassKeyShape& aPKey1, + const GEOMAlgo_PassKeyShape& aPKey2) const; +#endif // OCC_VERSION_LARGE < 0x07080000 }; #endif diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 9a9fc1454..0c48c192c 100644 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -19,6 +19,8 @@ #include +#include + #include #include @@ -938,7 +940,11 @@ int findAmbiguities(const TopoDS_Shape& theShapeIn, continue; Standard_Integer anID = 0; for(TopTools_ListIteratorOfListOfShape aFaceIt(ancestors); aFaceIt.More(); aFaceIt.Next()) { +#if OCC_VERSION_LARGE < 0x07080000 anID ^= HashCode(aFaceIt.ChangeValue(), 1990657); // Pierpont prime +#else + anID ^= ((std::hash{}(aFaceIt.ChangeValue()) & IntegerLast()) % 1990657 + 1); // Pierpont prime +#endif } if (aFacesIDs.IsBound(anID)) { // there found same edge, check they really have same faces const NCollection_List& aSameFaces1 = diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 1927466b4..5f313a855 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -690,7 +690,8 @@ void Model_Document::compactNested() /// references and Boolean and Integer Arrays for the current moment. static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) theAttr2) { - if (Standard_GUID::IsEqual(theAttr1->ID(), TDF_Reference::GetID())) { // reference + Standard_GUID aGUID1 = theAttr1->ID(); + if (aGUID1 == TDF_Reference::GetID()) { // reference Handle(TDF_Reference) aRef1 = Handle(TDF_Reference)::DownCast(theAttr1); Handle(TDF_Reference) aRef2 = Handle(TDF_Reference)::DownCast(theAttr2); if (aRef1.IsNull() && aRef2.IsNull()) @@ -698,7 +699,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) if (aRef1.IsNull() || aRef2.IsNull()) return false; return aRef1->Get().IsEqual(aRef2->Get()) == Standard_True; - } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_BooleanArray::GetID())) { + } else if (aGUID1 == TDataStd_BooleanArray::GetID()) { Handle(TDataStd_BooleanArray) anArr1 = Handle(TDataStd_BooleanArray)::DownCast(theAttr1); Handle(TDataStd_BooleanArray) anArr2 = Handle(TDataStd_BooleanArray)::DownCast(theAttr2); if (anArr1.IsNull() && anArr2.IsNull()) @@ -716,7 +717,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) } return true; } - } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_IntegerArray::GetID())) { + } else if (aGUID1 == TDataStd_IntegerArray::GetID()) { Handle(TDataStd_IntegerArray) anArr1 = Handle(TDataStd_IntegerArray)::DownCast(theAttr1); Handle(TDataStd_IntegerArray) anArr2 = Handle(TDataStd_IntegerArray)::DownCast(theAttr2); if (anArr1.IsNull() && anArr2.IsNull()) @@ -734,7 +735,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) } return true; } - } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceArray::GetID())) { + } else if (aGUID1 == TDataStd_ReferenceArray::GetID()) { Handle(TDataStd_ReferenceArray) anArr1 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr1); Handle(TDataStd_ReferenceArray) anArr2 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr2); if (anArr1.IsNull() && anArr2.IsNull()) @@ -752,7 +753,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) } return true; } - } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceList::GetID())) { + } else if (aGUID1 == TDataStd_ReferenceList::GetID()) { Handle(TDataStd_ReferenceList) aList1 = Handle(TDataStd_ReferenceList)::DownCast(theAttr1); Handle(TDataStd_ReferenceList) aList2= Handle(TDataStd_ReferenceList)::DownCast(theAttr2); if (aList1.IsNull() && aList2.IsNull()) @@ -768,7 +769,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) return false; } return !aLIter1.More() && !aLIter2.More(); // both lists are with the same size - } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDF_TagSource::GetID())) { + } else if (aGUID1 == TDF_TagSource::GetID()) { return true; // it just for created and removed feature: nothing is changed } return false; @@ -797,7 +798,7 @@ static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { continue; // attribute is not changed actually } } else - if (Standard_GUID::IsEqual(anADelta->Attribute()->ID(), TDataStd_AsciiString::GetID())) { + if (anADelta->Attribute()->ID() == TDataStd_AsciiString::GetID()) { continue; // error message is disappeared } } diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 7aa4407bf..544b5bef8 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -18,6 +18,9 @@ // #include + +#include + #include #include #include @@ -47,14 +50,18 @@ #include #include #include -#include #include #include +#if OCC_VERSION_LARGE < 0x07080000 + +#include // for TDF_Label map usage static Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper); static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2); +#endif + int kUNDEFINED_FEATURE_INDEX = -1; static const std::string& groupNameFoldering(const std::string& theGroupID, @@ -1491,7 +1498,7 @@ std::shared_ptr Model_Objects::findFolder( int aRefIndex = aRefs->Lower(); for(; aRefIndex <= aRefs->Upper(); ++aRefIndex) { // iterate all existing features TDF_Label aCurLabel = aRefs->Value(aRefIndex); - if (IsEqual(aCurLabel, aFirstFeatureLabel)) + if (aCurLabel.IsEqual(aFirstFeatureLabel)) break; // no need to continue searching // searching the folder below, just continue to search last feature from the list @@ -1502,7 +1509,7 @@ std::shared_ptr Model_Objects::findFolder( // because the folder may end by the feature which is // neither a sub-feature nor a feature in history. if (!aLastFeatureInFolder.IsNull()) { - if (IsEqual(aCurLabel, aLastFeatureInFolder)) + if (aCurLabel.IsEqual(aLastFeatureInFolder)) aLastFeatureInFolder.Nullify(); // the last feature in the folder is achieved continue; } @@ -2112,6 +2119,7 @@ std::shared_ptr Model_Objects::internalFeature(const int theIn return FeaturePtr(); // invalid } +#if OCC_VERSION_LARGE < 0x07080000 Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper) { return TDF_LabelMapHasher::HashCode(theLab, theUpper); @@ -2120,3 +2128,4 @@ Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2) { return TDF_LabelMapHasher::IsEqual(theLab1, theLab2); } +#endif diff --git a/src/ModelHighAPI/Test/Test18451.py b/src/ModelHighAPI/Test/Test18451.py index 604b90f66..d093526d3 100644 --- a/src/ModelHighAPI/Test/Test18451.py +++ b/src/ModelHighAPI/Test/Test18451.py @@ -482,7 +482,7 @@ model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [44]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [192]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [384]) -model.testResultsVolumes(Symmetry_2, [0.714262940088946862715602037]) +model.testResultsVolumes(Symmetry_2, [0.71426763]) from ModelAPI import * aFactory = ModelAPI_Session.get().validators() diff --git a/src/PythonAPI/model/tests/tests.py b/src/PythonAPI/model/tests/tests.py index e088f7c74..2b42350a2 100644 --- a/src/PythonAPI/model/tests/tests.py +++ b/src/PythonAPI/model/tests/tests.py @@ -473,3 +473,14 @@ def checkFeaturesValidity(thePartDoc): assert error == '', "The feature {0} is in error: {1}".format(name, error) # raise an error if the the feature is not valid (without error message) assert aFactory.validate(feature), "The feature {0} is in error.".format(name) + +def checkMiddlePoint(theShape, theX, theY, theZ, theTolerance = 1.e-7): + """ Check coordinates of middle point of the given shape. + :param theShape the shape to check + :param theX, theY, theZ the expected coordinates + :param theTolerance comparison tolerance + """ + assert(theShape is not None) + midPoint = theShape.middlePoint() + isEqual = math.fabs(midPoint.x() - theX) < theTolerance and math.fabs(midPoint.y() - theY) < theTolerance and math.fabs(midPoint.z() - theZ) < theTolerance + assert(isEqual), "Middle point: actual ({}, {}, {}) != expected ({}, {}, {})".format(midPoint.x(), midPoint.y(), midPoint.z(), theX, theY, theZ) diff --git a/test.models/CMakeLists.txt b/test.models/CMakeLists.txt index ac38f2b73..f414caccb 100644 --- a/test.models/CMakeLists.txt +++ b/test.models/CMakeLists.txt @@ -19,7 +19,7 @@ ENABLE_TESTING() -file(GLOB pyFiles "*.py") +file(GLOB pyFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.py") SET(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR} CACHE PATH "Path to the restricted repository") @@ -66,3 +66,22 @@ foreach(eachFilePath ${pyFiles};${pyFilesRestr}) endforeach(eachFilePath ${ARGN}) ADD_CUSTOM_TARGET(run_models_tests COMMAND ${CMAKE_CTEST_COMMAND} -C "${CMAKE_BUILD_TYPE}" -L "models_tests") + +include(tests.set) + +if(${HAVE_SALOME}) + enable_testing() + set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/TestModels") + + install(FILES CTestTestfileInstall.cmake + DESTINATION ${TEST_INSTALL_DIRECTORY} + RENAME CTestTestfile.cmake) + install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) + + set(TMP_TESTS_NAMES) + foreach(tfile ${TEST_NAMES}) + list(APPEND TMP_TESTS_NAMES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}) + endforeach(tfile ${TEST_NAMES}) + + install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY}) +endif(${HAVE_SALOME}) diff --git a/test.models/CTestTestfileInstall.cmake b/test.models/CTestTestfileInstall.cmake new file mode 100644 index 000000000..a97b7ea71 --- /dev/null +++ b/test.models/CTestTestfileInstall.cmake @@ -0,0 +1,26 @@ +# Copyright (C) 2021-2024 CEA, EDF +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +include(tests.set) + +foreach(tfile ${TEST_NAMES}) + set(TEST_NAME ${COMPONENT_NAME}_Models_${tfile}) + add_test(${TEST_NAME} python ${tfile}) + set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") +endforeach() diff --git a/test.models/bracket32.py b/test.models/bracket32.py index 2148d2444..1d8e39387 100644 --- a/test.models/bracket32.py +++ b/test.models/bracket32.py @@ -832,7 +832,7 @@ ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Ske # Test reexecution after parameter change Parameter_BPS.setValue(3) model.do() -model.testResultsVolumes(ExtrusionCut_3, [154096.039414040715200826525688171]) +model.testResultsVolumes(ExtrusionCut_3, [154095.923043997521745041012763977]) Parameter_BPS.setValue(6) model.end() @@ -844,6 +844,6 @@ model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.FACE, [70]) model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.EDGE, [326]) model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.VERTEX, [652]) -model.testResultsVolumes(ExtrusionCut_3, [156878.517351274640532210469245911]) +model.testResultsVolumes(ExtrusionCut_3, [156878.400948128226445987820625305]) assert(model.checkPythonDump()) diff --git a/test.models/bushing.py b/test.models/bushing.py index 72785b370..2012270a3 100644 --- a/test.models/bushing.py +++ b/test.models/bushing.py @@ -588,7 +588,7 @@ ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Ske # Test reexecution after parameter change Parameter_H.setValue(14) model.do() -model.testResultsVolumes(ExtrusionCut_2, [10205.25717]) +model.testResultsVolumes(ExtrusionCut_2, [10205.255530970627660281024873257]) Parameter_H.setValue(12) model.end() @@ -598,8 +598,8 @@ model.testNbResults(ExtrusionCut_2, 1) model.testNbSubResults(ExtrusionCut_2, [0]) model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.FACE, [551]) -model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [3481]) -model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [6962]) -model.testResultsVolumes(ExtrusionCut_2, [10362.3368]) +model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [3473]) +model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [6946]) +model.testResultsVolumes(ExtrusionCut_2, [10362.335163650115646305494010448]) assert(model.checkPythonDump()) diff --git a/test.models/case24.py b/test.models/case24.py index c7c7dbbdf..2f089084a 100644 --- a/test.models/case24.py +++ b/test.models/case24.py @@ -795,7 +795,7 @@ ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_4_objects_1, mod # Test reexecution after parameter change Parameter_R.setValue(5) model.do() -model.testResultsVolumes(ExtrusionCut_4, [502616.749082866765093058347702026]) +model.testResultsVolumes(ExtrusionCut_4, [502617.059752906498033553361892700]) Parameter_R.setValue(3) model.end() @@ -807,6 +807,6 @@ model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.FACE, [81]) model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.EDGE, [406]) model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.VERTEX, [812]) -model.testResultsVolumes(ExtrusionCut_4, [502903.236060981987975537776947021]) +model.testResultsVolumes(ExtrusionCut_4, [502903.528831139323301613330841064]) assert(model.checkPythonDump()) diff --git a/test.models/plug.py b/test.models/plug.py index dd50eb01a..9425557af 100644 --- a/test.models/plug.py +++ b/test.models/plug.py @@ -208,7 +208,7 @@ model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [35]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [114]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [228]) -model.testResultsVolumes(Revolution_1, [29055.346994571114919381216168404]) +model.testResultsVolumes(Revolution_1, [29055.379817395245481748133897781]) Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), True) @@ -232,7 +232,7 @@ model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.FACE, [36]) model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [132]) model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [264]) -model.testResultsVolumes(ExtrusionCut_1, [28943.115000463178148493170738220]) +model.testResultsVolumes(ExtrusionCut_1, [28943.145978945081878919154405594]) Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_21][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_20]")], "Fillet1") # check Fillet_1 @@ -242,7 +242,7 @@ model.testNbSubShapes(Fillet_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.FACE, [37]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [136]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [272]) -model.testResultsVolumes(Fillet_1, [28340.280766451105591841042041779]) +model.testResultsVolumes(Fillet_1, [28340.312197727056627627462148666]) Fillet_2 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_31"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_29"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_27"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_25")], "Fillet2") # check Fillet_2 @@ -252,7 +252,7 @@ model.testNbSubShapes(Fillet_2, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_2, GeomAPI_Shape.FACE, [45]) model.testNbSubShapes(Fillet_2, GeomAPI_Shape.EDGE, [168]) model.testNbSubShapes(Fillet_2, GeomAPI_Shape.VERTEX, [336]) -model.testResultsVolumes(Fillet_2, [28339.715350479829794494435191154]) +model.testResultsVolumes(Fillet_2, [28339.746210508856165688484907150]) Fillet_3 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_19")], "Fillet3") # check Fillet_3 @@ -262,7 +262,7 @@ model.testNbSubShapes(Fillet_3, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_3, GeomAPI_Shape.FACE, [47]) model.testNbSubShapes(Fillet_3, GeomAPI_Shape.EDGE, [176]) model.testNbSubShapes(Fillet_3, GeomAPI_Shape.VERTEX, [352]) -model.testResultsVolumes(Fillet_3, [28338.609830057110229972749948502]) +model.testResultsVolumes(Fillet_3, [28338.641671687521011335775256157]) Fillet_4 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_11")], "Fillet3") # check Fillet_4 @@ -272,7 +272,7 @@ model.testNbSubShapes(Fillet_4, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_4, GeomAPI_Shape.FACE, [49]) model.testNbSubShapes(Fillet_4, GeomAPI_Shape.EDGE, [184]) model.testNbSubShapes(Fillet_4, GeomAPI_Shape.VERTEX, [368]) -model.testResultsVolumes(Fillet_4, [28347.280717884430487174540758133]) +model.testResultsVolumes(Fillet_4, [28347.312910383880080189555883408]) Fillet_5 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_9")], "Fillet2") # check Fillet_5 @@ -282,7 +282,7 @@ model.testNbSubShapes(Fillet_5, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.FACE, [51]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [192]) model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [384]) -model.testResultsVolumes(Fillet_5, [28343.655816829603281803429126740]) +model.testResultsVolumes(Fillet_5, [28343.688540020142681896686553955]) ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), "D4_out/2", "D4_out/2", [model.selection("SOLID", "Fillet_5_1")]) Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) @@ -330,7 +330,7 @@ model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.FACE, [55]) model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [214]) model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [428]) -model.testResultsVolumes(ExtrusionCut_2, [28317.789547563083033310249447823]) +model.testResultsVolumes(ExtrusionCut_2, [28317.815904764789593173190951347]) Folder_1 = model.addFolder(Part_1_doc, Fillet_1, Fillet_5) @@ -386,9 +386,9 @@ model.testNbResults(RevolutionCut_1, 1) model.testNbSubResults(RevolutionCut_1, [0]) model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.FACE, [59]) -model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.EDGE, [242]) -model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.VERTEX, [484]) -model.testResultsVolumes(RevolutionCut_1, [28297.246041844206047244369983673]) +model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.EDGE, [240]) +model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.VERTEX, [480]) +model.testResultsVolumes(RevolutionCut_1, [28297.263961183885840000584721565]) RevolutionCut_2 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OX"), 360, 0, [model.selection("SOLID", "RevolutionCut_1_1")]) Sketch_5 = model.addSketch(Part_1_doc, model.standardPlane("XOY")) @@ -420,9 +420,9 @@ model.testNbResults(RevolutionCut_2, 1) model.testNbSubResults(RevolutionCut_2, [0]) model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.FACE, [60]) -model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.EDGE, [246]) -model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.VERTEX, [492]) -model.testResultsVolumes(RevolutionCut_2, [28288.868184623894194373860955238]) +model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.EDGE, [244]) +model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.VERTEX, [488]) +model.testResultsVolumes(RevolutionCut_2, [28288.886350037606462137773633003]) Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 0, False) Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "RevolutionCut_2_1"), model.selection("FACE", "Plane_2")]) @@ -431,8 +431,8 @@ model.testNbResults(Partition_1, 1) model.testNbSubResults(Partition_1, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [2]) model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [127]) -model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [738]) -model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1476]) +model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [736]) +model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1472]) model.testResultsVolumes(Partition_1, [28288.886256640704232268035411835]) Result = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1")) @@ -471,8 +471,8 @@ model.testNbResults(Result, 1) model.testNbSubResults(Result, [0]) model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63]) -model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364]) -model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728]) +model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366]) +model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732]) model.testResultsVolumes(Result, [22968.704503291784931207075715065]) Param_Drill1Loc.setValue(15) @@ -481,8 +481,8 @@ model.testNbResults(Result, 1) model.testNbSubResults(Result, [0]) model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63]) -model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364]) -model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728]) +model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366]) +model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732]) model.testResultsVolumes(Result, [22969.259323538735770853236317635]) Param_Drill1Holder.setValue(16) @@ -490,8 +490,8 @@ model.do() model.testNbSubResults(Result, [0]) model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63]) -model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364]) -model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728]) +model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366]) +model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732]) model.testResultsVolumes(Result, [22969.553506208951148437336087227]) Param_Drill2Loc.setValue(7.5) @@ -500,8 +500,8 @@ model.testNbResults(Result, 1) model.testNbSubResults(Result, [0]) model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63]) -model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364]) -model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728]) +model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366]) +model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732]) model.testResultsVolumes(Result, [22969.986144881491782143712043762]) Param_Drill2Radius.setValue(1.9) @@ -510,8 +510,8 @@ model.testNbResults(Result, 1) model.testNbSubResults(Result, [0]) model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63]) -model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364]) -model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728]) +model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366]) +model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732]) model.testResultsVolumes(Result, [22956.808010807682876475155353546]) Param_Fillet1.setValue(3) diff --git a/test.models/tests.set b/test.models/tests.set new file mode 100644 index 000000000..198d6a522 --- /dev/null +++ b/test.models/tests.set @@ -0,0 +1,42 @@ +# Copyright (C) 2021-2024 CEA, EDF +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +SET(TEST_NAMES + angle30.py + bearing_puller.py + bobine_film_reel.py + bracket32.py + bushing.py + case24.py + clothespin.py + coronavirus.py + CSWA.py + ecran.py + flange.py + gear.py + idler_plate.py + piece_02.py + piece_09.py + piece_12.py + plug.py + sprocket.py + stair_with_cycle.py + visor_support.py + wheel_rim.py +) diff --git a/test.models/visor_support.py b/test.models/visor_support.py index 6bd3b6fd1..4be5eafc6 100644 --- a/test.models/visor_support.py +++ b/test.models/visor_support.py @@ -360,7 +360,7 @@ model.testNbSubShapes(Fillet_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.FACE, [5]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [18]) model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [36]) -model.testResultsVolumes(Fillet_1, [13.34526088678]) +model.testResultsVolumes(Fillet_1, [13.345256419562657512756231881]) Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], model.selection("FACE", "PartSet/YOZ"), keepOriginal = True, keepSubResults = True) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Chamfer_1_1")], [model.selection("COMPOUND", "Symmetry_1_1")], keepSubResults = True) diff --git a/test.models/wheel_rim.py b/test.models/wheel_rim.py index dd35a62f7..9fda02a26 100644 --- a/test.models/wheel_rim.py +++ b/test.models/wheel_rim.py @@ -213,6 +213,6 @@ model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [35]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [162]) model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [324]) -model.testResultsVolumes(Boolean_1, [2052731.260104598477482795715332031]) +model.testResultsVolumes(Boolean_1, [2052720.339581762673333287239074707]) assert(model.checkPythonDump())