]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'V9_2_2_BR'
authorvsr <vsr@opencascade.com>
Tue, 5 Mar 2019 07:29:33 +0000 (10:29 +0300)
committervsr <vsr@opencascade.com>
Tue, 5 Mar 2019 07:29:33 +0000 (10:29 +0300)
2463 files changed:
CMakeCommon/CodeCoverage.cmake
CMakeCommon/Common.cmake
CMakeCommon/FindEclipse.cmake
CMakeCommon/FindPlaneGCS.cmake
CMakeCommon/FindPython.cmake
CMakeCommon/FindSUIT.cmake
CMakeCommon/FindSalome.cmake
CMakeCommon/FindSalomeOpenCASCADE.cmake
CMakeCommon/FindSalomeQt5.cmake
CMakeCommon/FindSolveSpace.cmake
CMakeCommon/FindSphinx.cmake
CMakeCommon/FindTInspector.cmake
CMakeCommon/Logger.cmake
CMakeCommon/PythonAPI.cmake
CMakeCommon/SalomeMacros.cmake
CMakeCommon/UnitTest.cmake
CMakeCommon/UseQtExt.cmake
CMakeCommon/XMLProcessing.cmake
CMakeLists.txt
correction_auto_2.py
doc/CMakeLists.txt
doc/gui/CMakeLists.txt
doc/gui/Introduction.rst
doc/gui/build_index.py
doc/gui/conf.py.in
doc/gui/images/EditToolbar.png [new file with mode: 0644]
doc/gui/images/Toolbars.png [new file with mode: 0644]
doc/gui/images/create_toolbar.png [new file with mode: 0644]
doc/gui/images/delete_toolbar.png [new file with mode: 0644]
doc/gui/images/name_toolbar.png [new file with mode: 0644]
doc/gui/templates/layout.html
doc/gui/tutorial.py
doc/tui/CMakeLists.txt
env.sh
lcov_reports.sh [changed mode: 0644->0755]
salome_pid.py
shaper_test.py [new file with mode: 0644]
src/BuildAPI/BuildAPI.h
src/BuildAPI/BuildAPI.i
src/BuildAPI/BuildAPI_CompSolid.cpp
src/BuildAPI/BuildAPI_CompSolid.h
src/BuildAPI/BuildAPI_Compound.cpp
src/BuildAPI/BuildAPI_Compound.h
src/BuildAPI/BuildAPI_Edge.cpp
src/BuildAPI/BuildAPI_Edge.h
src/BuildAPI/BuildAPI_Face.cpp
src/BuildAPI/BuildAPI_Face.h
src/BuildAPI/BuildAPI_Filling.cpp
src/BuildAPI/BuildAPI_Filling.h
src/BuildAPI/BuildAPI_Interpolation.cpp
src/BuildAPI/BuildAPI_Interpolation.h
src/BuildAPI/BuildAPI_Polyline.cpp
src/BuildAPI/BuildAPI_Polyline.h
src/BuildAPI/BuildAPI_Shell.cpp
src/BuildAPI/BuildAPI_Shell.h
src/BuildAPI/BuildAPI_Solid.cpp
src/BuildAPI/BuildAPI_Solid.h
src/BuildAPI/BuildAPI_SubShapes.cpp
src/BuildAPI/BuildAPI_SubShapes.h
src/BuildAPI/BuildAPI_Vertex.cpp
src/BuildAPI/BuildAPI_Vertex.h
src/BuildAPI/BuildAPI_Wire.cpp
src/BuildAPI/BuildAPI_Wire.h
src/BuildAPI/BuildAPI_swig.h
src/BuildAPI/CMakeLists.txt
src/BuildPlugin/BuildPlugin.h
src/BuildPlugin/BuildPlugin_CompSolid.cpp
src/BuildPlugin/BuildPlugin_CompSolid.h
src/BuildPlugin/BuildPlugin_Compound.cpp
src/BuildPlugin/BuildPlugin_Compound.h
src/BuildPlugin/BuildPlugin_Edge.cpp
src/BuildPlugin/BuildPlugin_Edge.h
src/BuildPlugin/BuildPlugin_Face.cpp
src/BuildPlugin/BuildPlugin_Face.h
src/BuildPlugin/BuildPlugin_Filling.cpp
src/BuildPlugin/BuildPlugin_Filling.h
src/BuildPlugin/BuildPlugin_Interpolation.cpp
src/BuildPlugin/BuildPlugin_Interpolation.h
src/BuildPlugin/BuildPlugin_Plugin.cpp
src/BuildPlugin/BuildPlugin_Plugin.h
src/BuildPlugin/BuildPlugin_Polyline.cpp
src/BuildPlugin/BuildPlugin_Polyline.h
src/BuildPlugin/BuildPlugin_Shape.cpp [new file with mode: 0644]
src/BuildPlugin/BuildPlugin_Shape.h [new file with mode: 0644]
src/BuildPlugin/BuildPlugin_Shell.cpp
src/BuildPlugin/BuildPlugin_Shell.h
src/BuildPlugin/BuildPlugin_Solid.cpp
src/BuildPlugin/BuildPlugin_Solid.h
src/BuildPlugin/BuildPlugin_SubShapes.cpp
src/BuildPlugin/BuildPlugin_SubShapes.h
src/BuildPlugin/BuildPlugin_Validators.cpp
src/BuildPlugin/BuildPlugin_Validators.h
src/BuildPlugin/BuildPlugin_Vertex.cpp
src/BuildPlugin/BuildPlugin_Vertex.h
src/BuildPlugin/BuildPlugin_Wire.cpp
src/BuildPlugin/BuildPlugin_Wire.h
src/BuildPlugin/CMakeLists.txt
src/BuildPlugin/Test/Test1920.py
src/BuildPlugin/Test/Test2398.py
src/BuildPlugin/Test/Test2409.py
src/BuildPlugin/Test/Test2415.py
src/BuildPlugin/Test/Test2439.py
src/BuildPlugin/Test/Test2454.py
src/BuildPlugin/Test/TestCompSolid.py
src/BuildPlugin/Test/TestCompound.py
src/BuildPlugin/Test/TestCompound_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestCompound_History.py [new file with mode: 0644]
src/BuildPlugin/Test/TestEdge.py
src/BuildPlugin/Test/TestEdge_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestFace.py
src/BuildPlugin/Test/TestFace_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestFilling.py [new file with mode: 0644]
src/BuildPlugin/Test/TestFilling_ByEdges.py
src/BuildPlugin/Test/TestFilling_ByWires.py
src/BuildPlugin/Test/TestFilling_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestFilling_Mixed.py
src/BuildPlugin/Test/TestInterpolation.py
src/BuildPlugin/Test/TestPolyline.py
src/BuildPlugin/Test/TestShell.py
src/BuildPlugin/Test/TestSolid.py
src/BuildPlugin/Test/TestSolid_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestSubShapes.py
src/BuildPlugin/Test/TestSubShapes_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestVertex.py
src/BuildPlugin/Test/TestVertex_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/Test/TestWire.py
src/BuildPlugin/Test/TestWire_ErrorMsg.py [new file with mode: 0644]
src/BuildPlugin/compound_widget.xml
src/BuildPlugin/compsolid_widget.xml
src/BuildPlugin/doc/examples/compound.py
src/BuildPlugin/doc/examples/edge.py
src/BuildPlugin/doc/examples/filling.py
src/BuildPlugin/doc/examples/interpolation.py
src/BuildPlugin/doc/examples/polyline.py
src/BuildPlugin/doc/examples/subshapes.py
src/BuildPlugin/doc/examples/vertex.py
src/BuildPlugin/doc/examples/wire.py
src/BuildPlugin/edge_widget.xml
src/BuildPlugin/face_widget.xml
src/BuildPlugin/filling_widget.xml
src/BuildPlugin/interpolation_widget.xml
src/BuildPlugin/plugin-Build.xml
src/BuildPlugin/polyline_widget.xml
src/BuildPlugin/shell_widget.xml
src/BuildPlugin/solid_widget.xml
src/BuildPlugin/subshapes_widget.xml
src/BuildPlugin/vertex_widget.xml
src/BuildPlugin/wire_widget.xml
src/CollectionAPI/CMakeLists.txt
src/CollectionAPI/CollectionAPI.h
src/CollectionAPI/CollectionAPI.i
src/CollectionAPI/CollectionAPI_Field.cpp
src/CollectionAPI/CollectionAPI_Field.h
src/CollectionAPI/CollectionAPI_Group.cpp
src/CollectionAPI/CollectionAPI_Group.h
src/CollectionPlugin/CMakeLists.txt
src/CollectionPlugin/CollectionPlugin.h
src/CollectionPlugin/CollectionPlugin_Field.cpp
src/CollectionPlugin/CollectionPlugin_Field.h
src/CollectionPlugin/CollectionPlugin_Group.cpp
src/CollectionPlugin/CollectionPlugin_Group.h
src/CollectionPlugin/CollectionPlugin_Plugin.cpp
src/CollectionPlugin/CollectionPlugin_Plugin.h
src/CollectionPlugin/CollectionPlugin_Validators.cpp
src/CollectionPlugin/CollectionPlugin_Validators.h
src/CollectionPlugin/CollectionPlugin_WidgetCreator.cpp
src/CollectionPlugin/CollectionPlugin_WidgetCreator.h
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
src/CollectionPlugin/CollectionPlugin_WidgetField.h
src/CollectionPlugin/Test/TestField.py
src/CollectionPlugin/Test/TestGroup.py
src/CollectionPlugin/Test/TestGroup1799.py
src/CollectionPlugin/Test/TestGroup2.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove.py [deleted file]
src/CollectionPlugin/Test/TestGroupMove01.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove02.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove03.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove04.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove05.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove06.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove07.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove08.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove09.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove10.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove11.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove12.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove13.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove14.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove15.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove16.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove17.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove18.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove19.py [new file with mode: 0644]
src/CollectionPlugin/Test/TestGroupMove2.py [deleted file]
src/CollectionPlugin/Test/TestGroupShareTopology.py [new file with mode: 0644]
src/CollectionPlugin/doc/examoles/field.py [deleted file]
src/CollectionPlugin/doc/examoles/group.py [deleted file]
src/CollectionPlugin/doc/examples/field.py [new file with mode: 0644]
src/CollectionPlugin/doc/examples/group.py [new file with mode: 0644]
src/CollectionPlugin/doc/groupFeature.rst
src/CollectionPlugin/doc/images/group_property_panel.png
src/CollectionPlugin/group_widget.xml
src/CollectionPlugin/plugin-Collection.xml
src/Config/CMakeLists.txt
src/Config/ConfigAPI.i
src/Config/Config_AttributeMessage.cpp
src/Config/Config_AttributeMessage.h
src/Config/Config_Common.cpp
src/Config/Config_Common.h
src/Config/Config_DataModelReader.cpp
src/Config/Config_DataModelReader.h [changed mode: 0755->0644]
src/Config/Config_FeatureMessage.cpp
src/Config/Config_FeatureMessage.h
src/Config/Config_FeatureReader.cpp
src/Config/Config_FeatureReader.h
src/Config/Config_Keywords.h
src/Config/Config_ModuleReader.cpp
src/Config/Config_ModuleReader.h
src/Config/Config_PluginMessage.cpp
src/Config/Config_PluginMessage.h
src/Config/Config_PointerMessage.cpp
src/Config/Config_PointerMessage.h
src/Config/Config_Prop.cpp
src/Config/Config_Prop.h
src/Config/Config_PropManager.cpp
src/Config/Config_PropManager.h
src/Config/Config_Translator.cpp
src/Config/Config_Translator.h
src/Config/Config_ValidatorMessage.cpp
src/Config/Config_ValidatorMessage.h
src/Config/Config_ValidatorReader.cpp
src/Config/Config_ValidatorReader.h
src/Config/Config_WidgetAPI.cpp
src/Config/Config_WidgetAPI.h
src/Config/Config_WidgetReader.cpp
src/Config/Config_WidgetReader.h
src/Config/Config_XMLReader.cpp
src/Config/Config_XMLReader.h
src/Config/Config_def.h
src/Config/Config_swig.h
src/Config/Test/TestConfig.py [new file with mode: 0644]
src/Config/dataModel.xml
src/Config/plugins.xml.in
src/ConnectorAPI/CMakeLists.txt
src/ConnectorAPI/ConnectorAPI.h
src/ConnectorAPI/ConnectorAPI.i
src/ConnectorAPI/ConnectorAPI_Connector.cpp
src/ConnectorAPI/ConnectorAPI_Connector.h
src/ConnectorAPI/ConnectorAPI_swig.h
src/ConnectorAPI/Test/CMakeLists.txt [changed mode: 0755->0644]
src/ConnectorAPI/Test/CTestTestfileInstall.cmake
src/ConnectorAPI/Test/TestExportToGEOM.py
src/ConnectorAPI/Test/TestExportToGEOMAllGroupsAndFields.py
src/ConnectorAPI/Test/testme.py
src/ConnectorAPI/Test/tests.set
src/ConnectorPlugin/CMakeLists.txt
src/ConnectorPlugin/ConnectorPlugin.py
src/ConnectorPlugin/ConnectorPlugin_ExportFeature.py
src/ConnectorPlugin/plugin-Connector.xml
src/ConstructionAPI/CMakeLists.txt
src/ConstructionAPI/ConstructionAPI.h
src/ConstructionAPI/ConstructionAPI.i
src/ConstructionAPI/ConstructionAPI_Axis.cpp
src/ConstructionAPI/ConstructionAPI_Axis.h
src/ConstructionAPI/ConstructionAPI_Plane.cpp
src/ConstructionAPI/ConstructionAPI_Plane.h
src/ConstructionAPI/ConstructionAPI_Point.cpp
src/ConstructionAPI/ConstructionAPI_Point.h
src/ConstructionAPI/ConstructionAPI_swig.h
src/ConstructionAPI/Test/TestAxis.py
src/ConstructionAPI/Test/TestPoint.py
src/ConstructionPlugin/CMakeLists.txt
src/ConstructionPlugin/ConstructionPlugin.h
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/ConstructionPlugin/ConstructionPlugin_Axis.h
src/ConstructionPlugin/ConstructionPlugin_Plane.cpp
src/ConstructionPlugin/ConstructionPlugin_Plane.h
src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp
src/ConstructionPlugin/ConstructionPlugin_Plugin.h
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ConstructionPlugin/ConstructionPlugin_Point.h
src/ConstructionPlugin/ConstructionPlugin_Validators.cpp
src/ConstructionPlugin/ConstructionPlugin_Validators.h
src/ConstructionPlugin/Test/TestAxisCreation.py
src/ConstructionPlugin/Test/TestAxis_ErrorMsg.py [new file with mode: 0644]
src/ConstructionPlugin/Test/TestPlane.py
src/ConstructionPlugin/Test/TestPlane_ErrorMsg.py [new file with mode: 0644]
src/ConstructionPlugin/Test/TestPlane_FaceValidator.py [new file with mode: 0644]
src/ConstructionPlugin/Test/TestPointName.py
src/ConstructionPlugin/Test/TestPoint_Edge.py
src/ConstructionPlugin/Test/TestPoint_ErrorMsg.py [new file with mode: 0644]
src/ConstructionPlugin/Test/TestPoint_FiniteValidator.py [new file with mode: 0644]
src/ConstructionPlugin/Test/TestPoint_GeometricalPropertyCenterOfCircle.py
src/ConstructionPlugin/Test/TestPoint_GeometricalPropertyCenterOfGravity.py
src/ConstructionPlugin/Test/TestPoint_IntersectLineAndPlane.py
src/ConstructionPlugin/Test/TestPoint_IntersectLines.py
src/ConstructionPlugin/Test/TestPoint_IntersectPlanes.py
src/ConstructionPlugin/Test/TestPoint_ProjectOnEdge.py
src/ConstructionPlugin/Test/TestPoint_ProjectOnFace.py
src/ConstructionPlugin/Test/TestPoint_VertexSelection.py
src/ConstructionPlugin/Test/TestPoint_XYZ.py
src/ConstructionPlugin/Test/UnitTestAxis.py
src/ConstructionPlugin/axis_widget.xml
src/ConstructionPlugin/doc/examples/plane1.py
src/ConstructionPlugin/doc/examples/plane2.py
src/ConstructionPlugin/doc/examples/point2.py
src/ConstructionPlugin/doc/examples/point4.py
src/ConstructionPlugin/plane_widget.xml
src/ConstructionPlugin/plugin-Construction.xml
src/ConstructionPlugin/point_widget.xml
src/Events/CMakeLists.txt
src/Events/Events.h
src/Events/Events.i
src/Events/Events_InfoMessage.cpp
src/Events/Events_InfoMessage.h
src/Events/Events_Listener.cpp
src/Events/Events_Listener.h
src/Events/Events_LongOp.cpp
src/Events/Events_LongOp.h
src/Events/Events_Loop.cpp
src/Events/Events_Loop.h
src/Events/Events_Message.cpp
src/Events/Events_Message.h
src/Events/Events_MessageGroup.cpp
src/Events/Events_MessageGroup.h
src/ExchangeAPI/CMakeLists.txt
src/ExchangeAPI/ExchangeAPI.h
src/ExchangeAPI/ExchangeAPI.i
src/ExchangeAPI/ExchangeAPI_Export.cpp
src/ExchangeAPI/ExchangeAPI_Export.h
src/ExchangeAPI/ExchangeAPI_Import.cpp
src/ExchangeAPI/ExchangeAPI_Import.h
src/ExchangeAPI/ExchangeAPI_swig.h
src/ExchangeAPI/Test/TestExchange.py
src/ExchangePlugin/CMakeLists.txt
src/ExchangePlugin/ExchangePlugin.h
src/ExchangePlugin/ExchangePlugin_Dump.cpp
src/ExchangePlugin/ExchangePlugin_Dump.h
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ImportFeature.h
src/ExchangePlugin/ExchangePlugin_Plugin.cpp
src/ExchangePlugin/ExchangePlugin_Plugin.h
src/ExchangePlugin/ExchangePlugin_Tools.cpp
src/ExchangePlugin/ExchangePlugin_Tools.h
src/ExchangePlugin/ExchangePlugin_Validators.cpp
src/ExchangePlugin/ExchangePlugin_Validators.h
src/ExchangePlugin/Test/Test2290.py
src/ExchangePlugin/Test/Test2459.py
src/ExchangePlugin/Test/TestExport.py
src/ExchangePlugin/Test/TestExportToXAOWithFields.py [new file with mode: 0644]
src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py
src/ExchangePlugin/Test/TestExport_FiniteValidator.py [new file with mode: 0644]
src/ExchangePlugin/Test/TestImport.py
src/ExchangePlugin/export_widget.xml
src/ExchangePlugin/plugin-Exchange.xml [changed mode: 0755->0644]
src/FeaturesAPI/CMakeLists.txt
src/FeaturesAPI/FeaturesAPI.h
src/FeaturesAPI/FeaturesAPI.i
src/FeaturesAPI/FeaturesAPI_BooleanCommon.cpp
src/FeaturesAPI/FeaturesAPI_BooleanCommon.h
src/FeaturesAPI/FeaturesAPI_BooleanCut.cpp
src/FeaturesAPI/FeaturesAPI_BooleanCut.h
src/FeaturesAPI/FeaturesAPI_BooleanFill.cpp
src/FeaturesAPI/FeaturesAPI_BooleanFill.h
src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp
src/FeaturesAPI/FeaturesAPI_BooleanFuse.h
src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp
src/FeaturesAPI/FeaturesAPI_BooleanSmash.h
src/FeaturesAPI/FeaturesAPI_Extrusion.cpp
src/FeaturesAPI/FeaturesAPI_Extrusion.h
src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp
src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h
src/FeaturesAPI/FeaturesAPI_Fillet.cpp
src/FeaturesAPI/FeaturesAPI_Fillet.h
src/FeaturesAPI/FeaturesAPI_FusionFaces.cpp
src/FeaturesAPI/FeaturesAPI_FusionFaces.h
src/FeaturesAPI/FeaturesAPI_Intersection.cpp
src/FeaturesAPI/FeaturesAPI_Intersection.h
src/FeaturesAPI/FeaturesAPI_Measurement.cpp
src/FeaturesAPI/FeaturesAPI_Measurement.h
src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp
src/FeaturesAPI/FeaturesAPI_MultiRotation.h
src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp
src/FeaturesAPI/FeaturesAPI_MultiTranslation.h
src/FeaturesAPI/FeaturesAPI_Partition.cpp
src/FeaturesAPI/FeaturesAPI_Partition.h
src/FeaturesAPI/FeaturesAPI_Pipe.cpp
src/FeaturesAPI/FeaturesAPI_Pipe.h
src/FeaturesAPI/FeaturesAPI_Placement.cpp
src/FeaturesAPI/FeaturesAPI_Placement.h
src/FeaturesAPI/FeaturesAPI_Recover.cpp
src/FeaturesAPI/FeaturesAPI_Recover.h
src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp
src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h
src/FeaturesAPI/FeaturesAPI_Revolution.cpp
src/FeaturesAPI/FeaturesAPI_Revolution.h
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h
src/FeaturesAPI/FeaturesAPI_Rotation.cpp
src/FeaturesAPI/FeaturesAPI_Rotation.h
src/FeaturesAPI/FeaturesAPI_Scale.cpp
src/FeaturesAPI/FeaturesAPI_Scale.h
src/FeaturesAPI/FeaturesAPI_Symmetry.cpp
src/FeaturesAPI/FeaturesAPI_Symmetry.h
src/FeaturesAPI/FeaturesAPI_Translation.cpp
src/FeaturesAPI/FeaturesAPI_Translation.h
src/FeaturesAPI/FeaturesAPI_Union.cpp
src/FeaturesAPI/FeaturesAPI_Union.h
src/FeaturesAPI/FeaturesAPI_swig.h
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin.h
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.h
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.h
src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanCut.h
src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_BooleanFill.h
src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.h
src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.h
src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp
src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.h
src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp
src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.h
src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h
src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp
src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_ExtrusionFuse.cpp
src/FeaturesPlugin/FeaturesPlugin_ExtrusionFuse.h
src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp
src/FeaturesPlugin/FeaturesPlugin_Fillet.h
src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp
src/FeaturesPlugin/FeaturesPlugin_FusionFaces.h
src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp
src/FeaturesPlugin/FeaturesPlugin_Intersection.h
src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp
src/FeaturesPlugin/FeaturesPlugin_Measurement.h
src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiRotation.h
src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.h
src/FeaturesPlugin/FeaturesPlugin_Partition.cpp [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_Partition.h [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp
src/FeaturesPlugin/FeaturesPlugin_Pipe.h
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.h
src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
src/FeaturesPlugin/FeaturesPlugin_Plugin.h
src/FeaturesPlugin/FeaturesPlugin_Recover.cpp
src/FeaturesPlugin/FeaturesPlugin_Recover.h
src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp
src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.h
src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp
src/FeaturesPlugin/FeaturesPlugin_Revolution.h
src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp
src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h
src/FeaturesPlugin/FeaturesPlugin_RevolutionCut.cpp
src/FeaturesPlugin/FeaturesPlugin_RevolutionCut.h
src/FeaturesPlugin/FeaturesPlugin_RevolutionFuse.cpp
src/FeaturesPlugin/FeaturesPlugin_RevolutionFuse.h
src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_Rotation.h [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_Scale.cpp
src/FeaturesPlugin/FeaturesPlugin_Scale.h
src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp
src/FeaturesPlugin/FeaturesPlugin_Symmetry.h
src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
src/FeaturesPlugin/FeaturesPlugin_Tools.h
src/FeaturesPlugin/FeaturesPlugin_Translation.cpp
src/FeaturesPlugin/FeaturesPlugin_Translation.h
src/FeaturesPlugin/FeaturesPlugin_Union.cpp
src/FeaturesPlugin/FeaturesPlugin_Union.h
src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.h [changed mode: 0755->0644]
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/FeaturesPlugin/FeaturesPlugin_Validators.h
src/FeaturesPlugin/FeaturesPlugin_msg_en.ts
src/FeaturesPlugin/Test/Test1379.py
src/FeaturesPlugin/Test/Test1467.py
src/FeaturesPlugin/Test/Test1816.py
src/FeaturesPlugin/Test/Test1876.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test1915.py
src/FeaturesPlugin/Test/Test1922.py
src/FeaturesPlugin/Test/Test1942.py
src/FeaturesPlugin/Test/Test2023.py
src/FeaturesPlugin/Test/Test2038.py
src/FeaturesPlugin/Test/Test2046.py
src/FeaturesPlugin/Test/Test2172.py
src/FeaturesPlugin/Test/Test2194.py
src/FeaturesPlugin/Test/Test2197_1.py
src/FeaturesPlugin/Test/Test2197_2.py
src/FeaturesPlugin/Test/Test2197_3.py
src/FeaturesPlugin/Test/Test2197_4.py
src/FeaturesPlugin/Test/Test2215.py
src/FeaturesPlugin/Test/Test2222.py
src/FeaturesPlugin/Test/Test2231.py
src/FeaturesPlugin/Test/Test2233.py
src/FeaturesPlugin/Test/Test2240.py
src/FeaturesPlugin/Test/Test2246.py
src/FeaturesPlugin/Test/Test2248.py
src/FeaturesPlugin/Test/Test2251.py
src/FeaturesPlugin/Test/Test2255.py
src/FeaturesPlugin/Test/Test2289.py
src/FeaturesPlugin/Test/Test2304.py
src/FeaturesPlugin/Test/Test2304_2.py
src/FeaturesPlugin/Test/Test2375.py
src/FeaturesPlugin/Test/Test2377.py
src/FeaturesPlugin/Test/Test2394.py
src/FeaturesPlugin/Test/Test2395.py
src/FeaturesPlugin/Test/Test2419_1.py
src/FeaturesPlugin/Test/Test2419_2.py
src/FeaturesPlugin/Test/Test2419_3.py
src/FeaturesPlugin/Test/Test2465.py
src/FeaturesPlugin/Test/Test2495.py
src/FeaturesPlugin/Test/Test2514.py
src/FeaturesPlugin/Test/Test2520.py
src/FeaturesPlugin/Test/Test2545.py
src/FeaturesPlugin/Test/Test2588.py
src/FeaturesPlugin/Test/Test2592.py
src/FeaturesPlugin/Test/Test2596.py
src/FeaturesPlugin/Test/Test2617.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2631.py
src/FeaturesPlugin/Test/Test2636.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2650.py
src/FeaturesPlugin/Test/Test2681.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2686.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2689.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2692.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2693.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2698.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2701.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2724.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2729.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2738.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2751.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2826.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2854.py [new file with mode: 0644]
src/FeaturesPlugin/Test/Test2878.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBoolean.py [deleted file]
src/FeaturesPlugin/Test/TestBoolean1.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBoolean2.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBoolean3.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_CompSolidCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Face.py
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolidCompound_Shell.py
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_CompSolid.py
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Face.py
src/FeaturesPlugin/Test/TestBooleanCommon_CompSolid_Shell.py
src/FeaturesPlugin/Test/TestBooleanCommon_EdgeCompound_EdgeCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Edge_Edge.py
src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_FaceCompound_FaceCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Face_Face.py
src/FeaturesPlugin/Test/TestBooleanCommon_Face_Plane.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_ShellCompound_ShellCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Shell_Shell.py
src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Face.py
src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_Shell.py
src/FeaturesPlugin/Test/TestBooleanCommon_SolidCompound_SolidCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Face.py
src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Shell.py
src/FeaturesPlugin/Test/TestBooleanCommon_Solid_Solid.py
src/FeaturesPlugin/Test/TestBooleanCommon_SolidsHistory.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_SubCompound_Solid.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_SubSolid_Solid.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCommon_VertexCompound_VertexCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Vertex_Vertex.py
src/FeaturesPlugin/Test/TestBooleanCommon_WireCompound_WireCompound.py
src/FeaturesPlugin/Test/TestBooleanCommon_Wire_Wire.py
src/FeaturesPlugin/Test/TestBooleanCompSolids.py
src/FeaturesPlugin/Test/TestBooleanCut_CompSolidCompound_CompSolidCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_CompSolid_CompSolid.py
src/FeaturesPlugin/Test/TestBooleanCut_Compound_Solid.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_EdgeCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_EdgeCompound_Solid.py
src/FeaturesPlugin/Test/TestBooleanCut_Edge_Edge.py
src/FeaturesPlugin/Test/TestBooleanCut_Edge_Face.py
src/FeaturesPlugin/Test/TestBooleanCut_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCut_FaceCompound_FaceCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_Face_Face.py
src/FeaturesPlugin/Test/TestBooleanCut_Face_Solid.py
src/FeaturesPlugin/Test/TestBooleanCut_ShellCompound_ShellCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_Shell_Shell.py
src/FeaturesPlugin/Test/TestBooleanCut_SolidCompound_SolidCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_Solid_Solid.py
src/FeaturesPlugin/Test/TestBooleanCut_SolidsHistory.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_Solid.py
src/FeaturesPlugin/Test/TestBooleanCut_VertexCompound_VertexCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_Vertex_Vertex.py
src/FeaturesPlugin/Test/TestBooleanCut_WireCompound_WireCompound.py
src/FeaturesPlugin/Test/TestBooleanCut_Wire_Face.py
src/FeaturesPlugin/Test/TestBooleanCut_Wire_Wire.py
src/FeaturesPlugin/Test/TestBooleanFill.py
src/FeaturesPlugin/Test/TestBooleanFillWithPlane.py
src/FeaturesPlugin/Test/TestBooleanFill_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanFuse_CompSolidCompound_CompSolidCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_CompSolid.py
src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_Face.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanFuse_EdgeCompound_EdgeCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Edge_Edge.py
src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanFuse_FaceCompound_FaceCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Face_Face.py
src/FeaturesPlugin/Test/TestBooleanFuse_RemoveEdges.py
src/FeaturesPlugin/Test/TestBooleanFuse_ShellCompound_ShellCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Shell_Shell.py
src/FeaturesPlugin/Test/TestBooleanFuse_SimpleMode.py
src/FeaturesPlugin/Test/TestBooleanFuse_SolidCompound_SolidCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Solid_Solid.py
src/FeaturesPlugin/Test/TestBooleanFuse_SolidsHistory.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanFuse_VertexCompound_VertexCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Vertex_Vertex.py
src/FeaturesPlugin/Test/TestBooleanFuse_WireCompound_WireCompound.py
src/FeaturesPlugin/Test/TestBooleanFuse_Wire_Wire.py
src/FeaturesPlugin/Test/TestBooleanSmash.py
src/FeaturesPlugin/Test/TestBooleanSmash_CompSolid_Solid.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanSmash_Face_Face.py
src/FeaturesPlugin/Test/TestBooleanSmash_SolidsHistory.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBooleanSmash_SubSolid_Solid.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestCompositeFeaturesOnCompSolids.py
src/FeaturesPlugin/Test/TestExtrusion.py
src/FeaturesPlugin/Test/TestExtrusionCut.py
src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusionCut_BySize.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusionFuse.py
src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusionFuse_BySize.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusionOfCompound.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestExtrusion_ZeroOffsetError.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFillCompFaceSolid.py
src/FeaturesPlugin/Test/TestFillCompsolidPlane.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFillEdgeEdge.py
src/FeaturesPlugin/Test/TestFillEdgeEdgeIntersected.py
src/FeaturesPlugin/Test/TestFillEdgeFace.py
src/FeaturesPlugin/Test/TestFillEdgeShell.py
src/FeaturesPlugin/Test/TestFillEdgeSolid.py
src/FeaturesPlugin/Test/TestFillEdgeSolidIntersected.py
src/FeaturesPlugin/Test/TestFillEdgeVertex.py
src/FeaturesPlugin/Test/TestFillEdgeWire.py
src/FeaturesPlugin/Test/TestFillFaceEdge.py
src/FeaturesPlugin/Test/TestFillFaceEdgeInside.py
src/FeaturesPlugin/Test/TestFillFaceEdgePerpendicular.py
src/FeaturesPlugin/Test/TestFillFaceFace.py
src/FeaturesPlugin/Test/TestFillFaceShell.py
src/FeaturesPlugin/Test/TestFillFaceSolid.py
src/FeaturesPlugin/Test/TestFillFaceVertex.py
src/FeaturesPlugin/Test/TestFillFaceWire.py
src/FeaturesPlugin/Test/TestFillShellConstrPlane.py
src/FeaturesPlugin/Test/TestFillShellEdge.py
src/FeaturesPlugin/Test/TestFillShellFace.py
src/FeaturesPlugin/Test/TestFillShellShell.py
src/FeaturesPlugin/Test/TestFillShellSolid.py
src/FeaturesPlugin/Test/TestFillShellVertex.py
src/FeaturesPlugin/Test/TestFillShellWire.py
src/FeaturesPlugin/Test/TestFillSolid2ConstructionPlanes.py
src/FeaturesPlugin/Test/TestFillSolidCompFace.py
src/FeaturesPlugin/Test/TestFillSolidCompShell.py
src/FeaturesPlugin/Test/TestFillSolidEdge.py
src/FeaturesPlugin/Test/TestFillSolidFace.py
src/FeaturesPlugin/Test/TestFillSolidShell.py
src/FeaturesPlugin/Test/TestFillWireEdge.py
src/FeaturesPlugin/Test/TestFillWireFace.py
src/FeaturesPlugin/Test/TestFillWireShell.py
src/FeaturesPlugin/Test/TestFillWireSolid.py
src/FeaturesPlugin/Test/TestFillWireVertex.py
src/FeaturesPlugin/Test/TestFillWireWire.py
src/FeaturesPlugin/Test/TestFillet.py
src/FeaturesPlugin/Test/TestFillet1.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFillet_History.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestFusionFaces.py
src/FeaturesPlugin/Test/TestFusionFaces2697.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestIntersection.py
src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestMeasurementAngle.py
src/FeaturesPlugin/Test/TestMeasurementAngle3Points.py
src/FeaturesPlugin/Test/TestMeasurementDistance.py
src/FeaturesPlugin/Test/TestMeasurementLength.py
src/FeaturesPlugin/Test/TestMeasurementPresentation.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestMeasurementRadius.py
src/FeaturesPlugin/Test/TestMultiBoolean.py
src/FeaturesPlugin/Test/TestMultiRotation_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestMultiRotation_Part.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestMultiTranslation_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestMultiTranslation_Part.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPartition.py
src/FeaturesPlugin/Test/TestPartition2Faces.py
src/FeaturesPlugin/Test/TestPartition2Solids.py
src/FeaturesPlugin/Test/TestPartition2Wires.py
src/FeaturesPlugin/Test/TestPartitionArgsUpdate.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPartitionBox4Planes.py
src/FeaturesPlugin/Test/TestPartitionEdgeSolid.py
src/FeaturesPlugin/Test/TestPartitionFace2Solid.py
src/FeaturesPlugin/Test/TestPartitionFaceSolid.py
src/FeaturesPlugin/Test/TestPartitionFaceWire.py
src/FeaturesPlugin/Test/TestPartitionInclinedFaceSolid.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid1.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid2.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithCompSolid3.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace1.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace2.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace3.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace4.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithFace5.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane1.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane2.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane3.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane4.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithPlane5.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid1.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid2.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid3.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid4.py
src/FeaturesPlugin/Test/TestPartitionSubCompsolidWithSolid5.py
src/FeaturesPlugin/Test/TestPartitionWireFaceSolid.py
src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPartition_SolidsHistory.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPipe.py
src/FeaturesPlugin/Test/TestPipe_Compound.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPipe_Edge.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPipe_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPipe_Wire.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement.py [deleted file]
src/FeaturesPlugin/Test/TestPlacement_BodyShapesValidator.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Complex.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Edge_Edge.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Edge_Vertex.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Face_Edge.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Face_Face.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Face_Vertex.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Part_Part.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestPlacement_Vertex_Vertex.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRecover.py
src/FeaturesPlugin/Test/TestRecover1798.py
src/FeaturesPlugin/Test/TestRemoveSubShapes.py
src/FeaturesPlugin/Test/TestRemoveSubShapes2.py
src/FeaturesPlugin/Test/TestRemoveSubShapes3.py
src/FeaturesPlugin/Test/TestRemoveSubShapes4.py
src/FeaturesPlugin/Test/TestRemoveSubShapes5.py
src/FeaturesPlugin/Test/TestRemoveSubShapes6.py
src/FeaturesPlugin/Test/TestRevolution.py
src/FeaturesPlugin/Test/TestRevolutionCut.py
src/FeaturesPlugin/Test/TestRevolutionCut_ByAngle.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionCut_ByPlanesAndOffsets.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionFuse.py
src/FeaturesPlugin/Test/TestRevolutionFuse_ByAngle.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionOfCompound.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionOfEdge.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolutionOfPoint.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRevolution_ByAngle.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRotation.py
src/FeaturesPlugin/Test/TestRotation_ByAxis.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRotation_ByPoints.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestRotation_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestScale1.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestScale2.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestSerialBoolean.py
src/FeaturesPlugin/Test/TestSymmetry_Part.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestTranslation.py
src/FeaturesPlugin/Test/TestTranslation_Part.py [new file with mode: 0644]
src/FeaturesPlugin/Test/TestUnion.py
src/FeaturesPlugin/Test/TestUnion4CurvedFaces.py
src/FeaturesPlugin/Test/TestUnion4CurvedFaces_2.py
src/FeaturesPlugin/Test/TestUnion4Faces.py
src/FeaturesPlugin/Test/TestUnionFaces.py
src/FeaturesPlugin/Test/TestUnionOfUnion.py
src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py [new file with mode: 0644]
src/FeaturesPlugin/boolean_common_widget.xml
src/FeaturesPlugin/boolean_fill_widget.xml
src/FeaturesPlugin/boolean_fuse_widget.xml
src/FeaturesPlugin/boolean_smash_widget.xml
src/FeaturesPlugin/boolean_widget.xml
src/FeaturesPlugin/doc/examples/fillet1.py
src/FeaturesPlugin/doc/examples/fillet2.py
src/FeaturesPlugin/doc/examples/fuse_faces.py
src/FeaturesPlugin/doc/examples/pipe_binormal.py
src/FeaturesPlugin/doc/examples/pipe_locations.py
src/FeaturesPlugin/doc/examples/pipe_simple.py
src/FeaturesPlugin/doc/examples/placement.py
src/FeaturesPlugin/doc/examples/revolution_cut_by_angles.py
src/FeaturesPlugin/doc/examples/revolution_cut_by_bounding_planes.py
src/FeaturesPlugin/doc/examples/revolution_fuse_by_angles.py
src/FeaturesPlugin/doc/examples/revolution_fuse_by_bounding_planes.py
src/FeaturesPlugin/doc/examples/rotation2.py
src/FeaturesPlugin/doc/examples/symmetryaxis.py
src/FeaturesPlugin/doc/examples/translation2points.py
src/FeaturesPlugin/doc/examples/translationvector.py
src/FeaturesPlugin/doc/examples/union.py
src/FeaturesPlugin/extrusion_widget.xml
src/FeaturesPlugin/extrusioncut_widget.xml [changed mode: 0755->0644]
src/FeaturesPlugin/extrusionfuse_widget.xml
src/FeaturesPlugin/fillet_widget.xml
src/FeaturesPlugin/fusion_faces_widget.xml
src/FeaturesPlugin/intersection_widget.xml
src/FeaturesPlugin/measurement_widget.xml
src/FeaturesPlugin/multirotation_widget.xml
src/FeaturesPlugin/multitranslation_widget.xml
src/FeaturesPlugin/partition_widget.xml [changed mode: 0755->0644]
src/FeaturesPlugin/pipe_widget.xml
src/FeaturesPlugin/placement_widget.xml
src/FeaturesPlugin/plugin-Features.xml
src/FeaturesPlugin/recover_widget.xml
src/FeaturesPlugin/remove_subshapes_widget.xml
src/FeaturesPlugin/revolution_widget.xml
src/FeaturesPlugin/revolutioncut_widget.xml
src/FeaturesPlugin/revolutionfuse_widget.xml
src/FeaturesPlugin/rotation_widget.xml [changed mode: 0755->0644]
src/FeaturesPlugin/scale_widget.xml
src/FeaturesPlugin/symmetry_widget.xml
src/FeaturesPlugin/translation_widget.xml
src/FeaturesPlugin/union_widget.xml
src/GDMLAPI/CMakeLists.txt
src/GDMLAPI/GDMLAPI.h
src/GDMLAPI/GDMLAPI.i
src/GDMLAPI/GDMLAPI_ConeSegment.cpp
src/GDMLAPI/GDMLAPI_ConeSegment.h
src/GDMLAPI/GDMLAPI_Ellipsoid.cpp
src/GDMLAPI/GDMLAPI_Ellipsoid.h
src/GDMLAPI/GDMLAPI_swig.h
src/GDMLPlugin/CMakeLists.txt
src/GDMLPlugin/GDMLPlugin.h
src/GDMLPlugin/GDMLPlugin_ConeSegment.cpp
src/GDMLPlugin/GDMLPlugin_ConeSegment.h
src/GDMLPlugin/GDMLPlugin_Ellipsoid.cpp
src/GDMLPlugin/GDMLPlugin_Ellipsoid.h
src/GDMLPlugin/GDMLPlugin_Plugin.cpp
src/GDMLPlugin/GDMLPlugin_Plugin.h
src/GDMLPlugin/Test/TestCone.py [new file with mode: 0644]
src/GDMLPlugin/Test/TestEllipsoid.py [new file with mode: 0644]
src/GDMLPlugin/conesegment_widget.xml
src/GDMLPlugin/ellipsoid_widget.xml
src/GDMLPlugin/plugin-GDML.xml
src/GeomAPI/CMakeLists.txt
src/GeomAPI/GeomAPI.h
src/GeomAPI/GeomAPI.i
src/GeomAPI/GeomAPI_AISObject.cpp
src/GeomAPI/GeomAPI_AISObject.h
src/GeomAPI/GeomAPI_Angle.cpp
src/GeomAPI/GeomAPI_Angle.h
src/GeomAPI/GeomAPI_Angle2d.cpp
src/GeomAPI/GeomAPI_Angle2d.h
src/GeomAPI/GeomAPI_Ax1.cpp
src/GeomAPI/GeomAPI_Ax1.h
src/GeomAPI/GeomAPI_Ax2.cpp
src/GeomAPI/GeomAPI_Ax2.h
src/GeomAPI/GeomAPI_Ax3.cpp
src/GeomAPI/GeomAPI_Ax3.h
src/GeomAPI/GeomAPI_Box.cpp
src/GeomAPI/GeomAPI_Box.h
src/GeomAPI/GeomAPI_Circ.cpp
src/GeomAPI/GeomAPI_Circ.h
src/GeomAPI/GeomAPI_Circ2d.cpp
src/GeomAPI/GeomAPI_Circ2d.h
src/GeomAPI/GeomAPI_Cone.cpp
src/GeomAPI/GeomAPI_Cone.h
src/GeomAPI/GeomAPI_Curve.cpp
src/GeomAPI/GeomAPI_Curve.h
src/GeomAPI/GeomAPI_Cylinder.cpp
src/GeomAPI/GeomAPI_Cylinder.h
src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.cpp
src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h
src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp
src/GeomAPI/GeomAPI_DataMapOfShapeShape.h
src/GeomAPI/GeomAPI_Dir.cpp
src/GeomAPI/GeomAPI_Dir.h
src/GeomAPI/GeomAPI_Dir2d.cpp
src/GeomAPI/GeomAPI_Dir2d.h
src/GeomAPI/GeomAPI_Edge.cpp
src/GeomAPI/GeomAPI_Edge.h
src/GeomAPI/GeomAPI_Ellipse.cpp
src/GeomAPI/GeomAPI_Ellipse.h
src/GeomAPI/GeomAPI_Ellipse2d.cpp
src/GeomAPI/GeomAPI_Ellipse2d.h
src/GeomAPI/GeomAPI_Face.cpp
src/GeomAPI/GeomAPI_Face.h
src/GeomAPI/GeomAPI_ICustomPrs.cpp
src/GeomAPI/GeomAPI_ICustomPrs.h
src/GeomAPI/GeomAPI_IPresentable.cpp
src/GeomAPI/GeomAPI_IPresentable.h
src/GeomAPI/GeomAPI_IScreenParams.h
src/GeomAPI/GeomAPI_Interface.cpp
src/GeomAPI/GeomAPI_Interface.h
src/GeomAPI/GeomAPI_Lin.cpp
src/GeomAPI/GeomAPI_Lin.h
src/GeomAPI/GeomAPI_Lin2d.cpp
src/GeomAPI/GeomAPI_Lin2d.h
src/GeomAPI/GeomAPI_PlanarEdges.cpp
src/GeomAPI/GeomAPI_PlanarEdges.h
src/GeomAPI/GeomAPI_Pln.cpp
src/GeomAPI/GeomAPI_Pln.h
src/GeomAPI/GeomAPI_Pnt.cpp
src/GeomAPI/GeomAPI_Pnt.h
src/GeomAPI/GeomAPI_Pnt2d.cpp
src/GeomAPI/GeomAPI_Pnt2d.h
src/GeomAPI/GeomAPI_Shape.cpp
src/GeomAPI/GeomAPI_Shape.h
src/GeomAPI/GeomAPI_ShapeExplorer.cpp
src/GeomAPI/GeomAPI_ShapeExplorer.h
src/GeomAPI/GeomAPI_ShapeIterator.cpp
src/GeomAPI/GeomAPI_ShapeIterator.h
src/GeomAPI/GeomAPI_Shell.cpp
src/GeomAPI/GeomAPI_Shell.h
src/GeomAPI/GeomAPI_Solid.cpp
src/GeomAPI/GeomAPI_Solid.h
src/GeomAPI/GeomAPI_Sphere.cpp
src/GeomAPI/GeomAPI_Sphere.h
src/GeomAPI/GeomAPI_Tools.cpp
src/GeomAPI/GeomAPI_Tools.h
src/GeomAPI/GeomAPI_Torus.cpp
src/GeomAPI/GeomAPI_Torus.h
src/GeomAPI/GeomAPI_Trsf.cpp
src/GeomAPI/GeomAPI_Trsf.h
src/GeomAPI/GeomAPI_Vertex.cpp
src/GeomAPI/GeomAPI_Vertex.h
src/GeomAPI/GeomAPI_Wire.cpp
src/GeomAPI/GeomAPI_Wire.h
src/GeomAPI/GeomAPI_XY.cpp
src/GeomAPI/GeomAPI_XY.h
src/GeomAPI/GeomAPI_XYZ.cpp
src/GeomAPI/GeomAPI_XYZ.h
src/GeomAPI/GeomAPI_swig.h
src/GeomAPI/Test/Test2675.py
src/GeomAPI/Test/Test2879.py [new file with mode: 0644]
src/GeomAPI/Test/TestAx123.py [new file with mode: 0644]
src/GeomAPI/Test/TestBox.py
src/GeomAPI/Test/TestBuilders.py [new file with mode: 0644]
src/GeomAPI/Test/TestCone.py
src/GeomAPI/Test/TestCylinder.py
src/GeomAPI/Test/TestEllipse2d.py [new file with mode: 0644]
src/GeomAPI/Test/TestLine.py [new file with mode: 0644]
src/GeomAPI/Test/TestPlanarEdge.py [new file with mode: 0644]
src/GeomAPI/Test/TestPolygon.py
src/GeomAPI/Test/TestSphere.py
src/GeomAPI/Test/TestTorus.py
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/GeomAlgoAPI.h
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_BREPExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_BREPExport.h
src/GeomAlgoAPI/GeomAlgoAPI_BREPImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_BREPImport.h
src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h
src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Box.h
src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Circ2dBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_Cone.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Cone.h
src/GeomAlgoAPI/GeomAlgoAPI_ConeSegment.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ConeSegment.h
src/GeomAlgoAPI/GeomAlgoAPI_Copy.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Copy.h
src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_Cylinder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Cylinder.h
src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.cpp
src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.h
src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_Ellipsoid.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Ellipsoid.h
src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp [changed mode: 0755->0644]
src/GeomAlgoAPI/GeomAlgoAPI_Exception.h
src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_Fillet.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Fillet.h
src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Filling.h
src/GeomAlgoAPI/GeomAlgoAPI_IGESExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_IGESExport.h
src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.h
src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Intersection.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeCustom.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeCustom.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeSweep.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeSweep.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeVolume.h
src/GeomAlgoAPI/GeomAlgoAPI_NExplode.cpp
src/GeomAlgoAPI/GeomAlgoAPI_NExplode.h
src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Partition.h
src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp
src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.h
src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Pipe.h
src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Placement.h
src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Prism.h
src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h
src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Rotation.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.h
src/GeomAlgoAPI/GeomAlgoAPI_Scale.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Scale.h
src/GeomAlgoAPI/GeomAlgoAPI_Sewing.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Sewing.h
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h
src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.cpp
src/GeomAlgoAPI/GeomAlgoAPI_SortListOfShapes.h
src/GeomAlgoAPI/GeomAlgoAPI_Sphere.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Sphere.h
src/GeomAlgoAPI/GeomAlgoAPI_Symmetry.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Symmetry.h
src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Tools.h
src/GeomAlgoAPI/GeomAlgoAPI_Torus.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Torus.h
src/GeomAlgoAPI/GeomAlgoAPI_Transform.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Transform.h
src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Translation.h
src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp
src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.h
src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h
src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.h
src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_XAOImport.h
src/GeomAlgoAPI/GeomAlgoAPI_swig.h
src/GeomAlgoImpl/CMakeLists.txt
src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx [changed mode: 0755->0644]
src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx
src/GeomAlgoImpl/GeomAlgoImpl.h
src/GeomData/CMakeLists.txt
src/GeomData/GeomData.h
src/GeomData/GeomData_Dir.cpp
src/GeomData/GeomData_Dir.h
src/GeomData/GeomData_Point.cpp
src/GeomData/GeomData_Point.h
src/GeomData/GeomData_Point2D.cpp
src/GeomData/GeomData_Point2D.h
src/GeomDataAPI/CMakeLists.txt
src/GeomDataAPI/GeomDataAPI.h
src/GeomDataAPI/GeomDataAPI.i
src/GeomDataAPI/GeomDataAPI_Dir.cpp
src/GeomDataAPI/GeomDataAPI_Dir.h
src/GeomDataAPI/GeomDataAPI_Point.cpp
src/GeomDataAPI/GeomDataAPI_Point.h
src/GeomDataAPI/GeomDataAPI_Point2D.cpp
src/GeomDataAPI/GeomDataAPI_Point2D.h
src/GeomDataAPI/GeomDataAPI_swig.h
src/GeomDataAPI/Test/TestConstants.py
src/GeomValidators/CMakeLists.txt
src/GeomValidators/GeomValidators.h
src/GeomValidators/GeomValidators_BodyShapes.cpp
src/GeomValidators/GeomValidators_BodyShapes.h
src/GeomValidators/GeomValidators_ConstructionComposite.cpp
src/GeomValidators/GeomValidators_ConstructionComposite.h
src/GeomValidators/GeomValidators_Different.cpp
src/GeomValidators/GeomValidators_Different.h
src/GeomValidators/GeomValidators_DifferentShapes.cpp
src/GeomValidators/GeomValidators_DifferentShapes.h
src/GeomValidators/GeomValidators_Face.cpp
src/GeomValidators/GeomValidators_Face.h
src/GeomValidators/GeomValidators_FeatureKind.cpp [changed mode: 0755->0644]
src/GeomValidators/GeomValidators_FeatureKind.h [changed mode: 0755->0644]
src/GeomValidators/GeomValidators_Finite.cpp [changed mode: 0755->0644]
src/GeomValidators/GeomValidators_Finite.h [changed mode: 0755->0644]
src/GeomValidators/GeomValidators_Intersected.cpp
src/GeomValidators/GeomValidators_Intersected.h
src/GeomValidators/GeomValidators_IntersectionSelection.cpp
src/GeomValidators/GeomValidators_MinObjectsSelected.cpp
src/GeomValidators/GeomValidators_MinObjectsSelected.h
src/GeomValidators/GeomValidators_NotSelfIntersected.cpp
src/GeomValidators/GeomValidators_NotSelfIntersected.h
src/GeomValidators/GeomValidators_PartitionArguments.cpp [deleted file]
src/GeomValidators/GeomValidators_PartitionArguments.h [deleted file]
src/GeomValidators/GeomValidators_Plugin.cpp
src/GeomValidators/GeomValidators_Plugin.h
src/GeomValidators/GeomValidators_Positive.cpp
src/GeomValidators/GeomValidators_Positive.h
src/GeomValidators/GeomValidators_ShapeType.cpp [changed mode: 0755->0644]
src/GeomValidators/GeomValidators_ShapeType.h
src/GeomValidators/GeomValidators_Tools.cpp
src/GeomValidators/GeomValidators_Tools.h
src/GeomValidators/GeomValidators_ValueOrder.cpp
src/GeomValidators/GeomValidators_ValueOrder.h
src/GeomValidators/GeomValidators_ZeroOffset.cpp
src/GeomValidators/GeomValidators_ZeroOffset.h
src/InitializationPlugin/CMakeLists.txt
src/InitializationPlugin/InitializationPlugin.h
src/InitializationPlugin/InitializationPlugin_EvalListener.cpp
src/InitializationPlugin/InitializationPlugin_EvalListener.h
src/InitializationPlugin/InitializationPlugin_Plugin.cpp
src/InitializationPlugin/InitializationPlugin_Plugin.h
src/InitializationPlugin/InitializationPlugin_PyInterp.cpp
src/InitializationPlugin/InitializationPlugin_PyInterp.h
src/Model/CMakeLists.txt
src/Model/Model.h
src/Model/Model_Application.cpp
src/Model/Model_Application.h
src/Model/Model_AttributeBoolean.cpp
src/Model/Model_AttributeBoolean.h
src/Model/Model_AttributeDocRef.cpp
src/Model/Model_AttributeDocRef.h
src/Model/Model_AttributeDouble.cpp
src/Model/Model_AttributeDouble.h
src/Model/Model_AttributeDoubleArray.cpp
src/Model/Model_AttributeDoubleArray.h
src/Model/Model_AttributeIntArray.cpp
src/Model/Model_AttributeIntArray.h
src/Model/Model_AttributeInteger.cpp
src/Model/Model_AttributeInteger.h
src/Model/Model_AttributeRefAttr.cpp
src/Model/Model_AttributeRefAttr.h
src/Model/Model_AttributeRefAttrList.cpp [changed mode: 0755->0644]
src/Model/Model_AttributeRefAttrList.h [changed mode: 0755->0644]
src/Model/Model_AttributeRefList.cpp
src/Model/Model_AttributeRefList.h
src/Model/Model_AttributeReference.cpp
src/Model/Model_AttributeReference.h
src/Model/Model_AttributeSelection.cpp
src/Model/Model_AttributeSelection.h
src/Model/Model_AttributeSelectionList.cpp
src/Model/Model_AttributeSelectionList.h
src/Model/Model_AttributeString.cpp
src/Model/Model_AttributeString.h
src/Model/Model_AttributeStringArray.cpp
src/Model/Model_AttributeStringArray.h
src/Model/Model_AttributeTables.cpp
src/Model/Model_AttributeTables.h
src/Model/Model_AttributeValidator.cpp
src/Model/Model_AttributeValidator.h
src/Model/Model_BodyBuilder.cpp [changed mode: 0755->0644]
src/Model/Model_BodyBuilder.h [changed mode: 0755->0644]
src/Model/Model_Data.cpp
src/Model/Model_Data.h
src/Model/Model_Document.cpp [changed mode: 0755->0644]
src/Model/Model_Document.h
src/Model/Model_Events.cpp
src/Model/Model_Events.h
src/Model/Model_Expression.cpp
src/Model/Model_Expression.h
src/Model/Model_FeatureValidator.cpp
src/Model/Model_FeatureValidator.h
src/Model/Model_Objects.cpp
src/Model/Model_Objects.h
src/Model/Model_ResultBody.cpp
src/Model/Model_ResultBody.h
src/Model/Model_ResultConstruction.cpp
src/Model/Model_ResultConstruction.h
src/Model/Model_ResultField.cpp
src/Model/Model_ResultField.h
src/Model/Model_ResultGroup.cpp
src/Model/Model_ResultGroup.h
src/Model/Model_ResultParameter.cpp
src/Model/Model_ResultParameter.h
src/Model/Model_ResultPart.cpp
src/Model/Model_ResultPart.h
src/Model/Model_SelectionNaming.cpp [deleted file]
src/Model/Model_SelectionNaming.h [deleted file]
src/Model/Model_Session.cpp
src/Model/Model_Session.h
src/Model/Model_Update.cpp [changed mode: 0755->0644]
src/Model/Model_Update.h
src/Model/Model_Validator.cpp
src/Model/Model_Validator.h
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI.h
src/ModelAPI/ModelAPI.i
src/ModelAPI/ModelAPI_Attribute.cpp
src/ModelAPI/ModelAPI_Attribute.h
src/ModelAPI/ModelAPI_AttributeBoolean.cpp
src/ModelAPI/ModelAPI_AttributeBoolean.h
src/ModelAPI/ModelAPI_AttributeDocRef.cpp
src/ModelAPI/ModelAPI_AttributeDocRef.h
src/ModelAPI/ModelAPI_AttributeDouble.cpp
src/ModelAPI/ModelAPI_AttributeDouble.h
src/ModelAPI/ModelAPI_AttributeDoubleArray.cpp
src/ModelAPI/ModelAPI_AttributeDoubleArray.h
src/ModelAPI/ModelAPI_AttributeIntArray.cpp
src/ModelAPI/ModelAPI_AttributeIntArray.h
src/ModelAPI/ModelAPI_AttributeInteger.cpp
src/ModelAPI/ModelAPI_AttributeInteger.h
src/ModelAPI/ModelAPI_AttributeRefAttr.cpp
src/ModelAPI/ModelAPI_AttributeRefAttr.h
src/ModelAPI/ModelAPI_AttributeRefAttrList.cpp [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_AttributeRefAttrList.h [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_AttributeRefList.cpp
src/ModelAPI/ModelAPI_AttributeRefList.h
src/ModelAPI/ModelAPI_AttributeReference.cpp
src/ModelAPI/ModelAPI_AttributeReference.h
src/ModelAPI/ModelAPI_AttributeSelection.cpp
src/ModelAPI/ModelAPI_AttributeSelection.h
src/ModelAPI/ModelAPI_AttributeSelectionList.cpp
src/ModelAPI/ModelAPI_AttributeSelectionList.h
src/ModelAPI/ModelAPI_AttributeString.cpp
src/ModelAPI/ModelAPI_AttributeString.h
src/ModelAPI/ModelAPI_AttributeStringArray.cpp
src/ModelAPI/ModelAPI_AttributeStringArray.h
src/ModelAPI/ModelAPI_AttributeTables.cpp
src/ModelAPI/ModelAPI_AttributeTables.h
src/ModelAPI/ModelAPI_AttributeValidator.cpp
src/ModelAPI/ModelAPI_AttributeValidator.h
src/ModelAPI/ModelAPI_BodyBuilder.cpp [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_BodyBuilder.h [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_CompositeFeature.cpp
src/ModelAPI/ModelAPI_CompositeFeature.h
src/ModelAPI/ModelAPI_Data.cpp
src/ModelAPI/ModelAPI_Data.h
src/ModelAPI/ModelAPI_Document.cpp
src/ModelAPI/ModelAPI_Document.h
src/ModelAPI/ModelAPI_Entity.h
src/ModelAPI/ModelAPI_EventReentrantMessage.cpp
src/ModelAPI/ModelAPI_EventReentrantMessage.h
src/ModelAPI/ModelAPI_Events.cpp
src/ModelAPI/ModelAPI_Events.h
src/ModelAPI/ModelAPI_Expression.cpp
src/ModelAPI/ModelAPI_Expression.h
src/ModelAPI/ModelAPI_Feature.cpp
src/ModelAPI/ModelAPI_Feature.h
src/ModelAPI/ModelAPI_FeatureValidator.cpp
src/ModelAPI/ModelAPI_FeatureValidator.h
src/ModelAPI/ModelAPI_Folder.cpp
src/ModelAPI/ModelAPI_Folder.h
src/ModelAPI/ModelAPI_IReentrant.cpp
src/ModelAPI/ModelAPI_IReentrant.h
src/ModelAPI/ModelAPI_Object.cpp
src/ModelAPI/ModelAPI_Object.h
src/ModelAPI/ModelAPI_Plugin.cpp
src/ModelAPI/ModelAPI_Plugin.h
src/ModelAPI/ModelAPI_Result.cpp
src/ModelAPI/ModelAPI_Result.h
src/ModelAPI/ModelAPI_ResultBody.cpp
src/ModelAPI/ModelAPI_ResultBody.h
src/ModelAPI/ModelAPI_ResultConstruction.cpp
src/ModelAPI/ModelAPI_ResultConstruction.h
src/ModelAPI/ModelAPI_ResultField.cpp
src/ModelAPI/ModelAPI_ResultField.h
src/ModelAPI/ModelAPI_ResultGroup.cpp
src/ModelAPI/ModelAPI_ResultGroup.h
src/ModelAPI/ModelAPI_ResultParameter.cpp
src/ModelAPI/ModelAPI_ResultParameter.h
src/ModelAPI/ModelAPI_ResultPart.cpp
src/ModelAPI/ModelAPI_ResultPart.h
src/ModelAPI/ModelAPI_Session.cpp
src/ModelAPI/ModelAPI_Session.h
src/ModelAPI/ModelAPI_Tools.cpp [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_Tools.h [changed mode: 0755->0644]
src/ModelAPI/ModelAPI_Validator.h
src/ModelAPI/ModelAPI_swig.h
src/ModelAPI/Test/Test1064.py
src/ModelAPI/Test/Test1512.py [changed mode: 0755->0644]
src/ModelAPI/Test/Test1562.py [new file with mode: 0644]
src/ModelAPI/Test/Test1757.py
src/ModelAPI/Test/Test1995.py
src/ModelAPI/Test/Test1998.py
src/ModelAPI/Test/Test2170.py
src/ModelAPI/Test/Test2228.py
src/ModelAPI/Test/Test2241.py
src/ModelAPI/Test/Test2252.py
src/ModelAPI/Test/Test2276.py
src/ModelAPI/Test/Test2358_1.py
src/ModelAPI/Test/Test2358_2.py
src/ModelAPI/Test/Test2389.py
src/ModelAPI/Test/Test2391.py
src/ModelAPI/Test/Test2396.py
src/ModelAPI/Test/Test2401.py
src/ModelAPI/Test/Test2413.py
src/ModelAPI/Test/Test2491.py [new file with mode: 0644]
src/ModelAPI/Test/Test2493.py [new file with mode: 0644]
src/ModelAPI/Test/Test2496.py
src/ModelAPI/Test/Test2510.py
src/ModelAPI/Test/Test2607.py
src/ModelAPI/Test/Test2627.py [new file with mode: 0644]
src/ModelAPI/Test/Test2685.py [new file with mode: 0644]
src/ModelAPI/Test/Test2828.py [new file with mode: 0644]
src/ModelAPI/Test/Test2859.py [new file with mode: 0644]
src/ModelAPI/Test/Test2873.py [new file with mode: 0644]
src/ModelAPI/Test/TestBlockRecalculation.py
src/ModelAPI/Test/TestConstants.py
src/ModelAPI/Test/TestContainerSelector.py [new file with mode: 0644]
src/ModelAPI/Test/TestCustomName_BooleanCut.py
src/ModelAPI/Test/TestCustomName_CommonCompSolid.py
src/ModelAPI/Test/TestCustomName_CutCompSolid.py
src/ModelAPI/Test/TestCustomName_CutGroup.py
src/ModelAPI/Test/TestCustomName_DefaultName.py
src/ModelAPI/Test/TestCustomName_ExtrudeFace.py
src/ModelAPI/Test/TestCustomName_ExtrusionCut.py
src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py
src/ModelAPI/Test/TestCustomName_MultiTranslation.py
src/ModelAPI/Test/TestCustomName_Partition.py
src/ModelAPI/Test/TestCustomName_Placement.py
src/ModelAPI/Test/TestCustomName_Recover.py
src/ModelAPI/Test/TestCustomName_Rename.py
src/ModelAPI/Test/TestCustomName_RotateGroup.py
src/ModelAPI/Test/TestCustomName_Translation.py
src/ModelAPI/Test/TestDocument.py
src/ModelAPI/Test/TestDoubleArray.py
src/ModelAPI/Test/TestExternalConstruction.py
src/ModelAPI/Test/TestFeatureSelection_1.py
src/ModelAPI/Test/TestFeatureSelection_2.py
src/ModelAPI/Test/TestFolder_Create.py
src/ModelAPI/Test/TestFolder_CustomName.py
src/ModelAPI/Test/TestFolder_Empty.py [new file with mode: 0644]
src/ModelAPI/Test/TestFolder_Remove.py
src/ModelAPI/Test/TestFolder_Sketch.py
src/ModelAPI/Test/TestFolder_Stability.py
src/ModelAPI/Test/TestFolder_Update.py
src/ModelAPI/Test/TestGeomNamingBoxWithFillet.py [new file with mode: 0644]
src/ModelAPI/Test/TestGeomNamingEdgeByFilter.py [new file with mode: 0644]
src/ModelAPI/Test/TestGeomNamingPlacement.py [new file with mode: 0644]
src/ModelAPI/Test/TestGeomNamingRevolution.py [new file with mode: 0644]
src/ModelAPI/Test/TestGeomNamingSketchPlane.py [new file with mode: 0644]
src/ModelAPI/Test/TestIntArray.py [changed mode: 0755->0644]
src/ModelAPI/Test/TestResults.py [changed mode: 0755->0644]
src/ModelAPI/Test/TestSaveOpen1.py [new file with mode: 0644]
src/ModelAPI/Test/TestSaveOpen2.py [new file with mode: 0644]
src/ModelAPI/Test/TestSelectionInitialization.py [new file with mode: 0644]
src/ModelAPI/Test/TestSelectionRestore.py [new file with mode: 0644]
src/ModelAPI/Test/TestSelectionScope.py
src/ModelAPI/Test/TestSelectorShell.py [new file with mode: 0644]
src/ModelAPI/Test/TestUndoRedo.py
src/ModelAPI/Test/TestWeakNaming2125.py
src/ModelAPI/Test/TestWeakNaming2222.py
src/ModelAPI/Test/TestWeakNaming2245.py
src/ModelAPI/Test/TestWeakNaming2247.py
src/ModelAPI/Test/TestWeakNaming2248.py
src/ModelAPI/Test/TestWeakNaming2261.py
src/ModelAPI/Test/TestWeakNaming2291.py
src/ModelAPI/Test/TestWeakNaming2335.py
src/ModelAPI/Test/TestWeakNaming2375.py
src/ModelAPI/Test/TestWeakNaming2437.py
src/ModelAPI/Test/TestWeakNaming2445.py
src/ModelAPI/Test/TestWeakNaming2446.py
src/ModelAPI/Test/TestWeakNaming2452.py
src/ModelAPI/Test/TestWeakNamingSortOrder.py [new file with mode: 0644]
src/ModelGeomAlgo/CMakeLists.txt [changed mode: 0755->0644]
src/ModelGeomAlgo/ModelGeomAlgo.h [changed mode: 0755->0644]
src/ModelGeomAlgo/ModelGeomAlgo.i [changed mode: 0755->0644]
src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp [changed mode: 0755->0644]
src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h [changed mode: 0755->0644]
src/ModelGeomAlgo/ModelGeomAlgo_Shape.cpp
src/ModelGeomAlgo/ModelGeomAlgo_Shape.h
src/ModelGeomAlgo/ModelGeomAlgo_swig.h [changed mode: 0755->0644]
src/ModelGeomAlgo/Test/TestPoint2D.py [changed mode: 0755->0644]
src/ModelHighAPI/CMakeLists.txt
src/ModelHighAPI/ModelHighAPI.h
src/ModelHighAPI/ModelHighAPI.i
src/ModelHighAPI/ModelHighAPI_Double.cpp
src/ModelHighAPI/ModelHighAPI_Double.h
src/ModelHighAPI/ModelHighAPI_Dumper.cpp
src/ModelHighAPI/ModelHighAPI_Dumper.h
src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp
src/ModelHighAPI/ModelHighAPI_FeatureStore.h
src/ModelHighAPI/ModelHighAPI_Folder.cpp
src/ModelHighAPI/ModelHighAPI_Folder.h
src/ModelHighAPI/ModelHighAPI_Integer.cpp
src/ModelHighAPI/ModelHighAPI_Integer.h
src/ModelHighAPI/ModelHighAPI_Interface.cpp
src/ModelHighAPI/ModelHighAPI_Interface.h
src/ModelHighAPI/ModelHighAPI_Macro.h
src/ModelHighAPI/ModelHighAPI_RefAttr.cpp
src/ModelHighAPI/ModelHighAPI_RefAttr.h
src/ModelHighAPI/ModelHighAPI_Reference.cpp
src/ModelHighAPI/ModelHighAPI_Reference.h
src/ModelHighAPI/ModelHighAPI_Selection.cpp
src/ModelHighAPI/ModelHighAPI_Selection.h
src/ModelHighAPI/ModelHighAPI_Services.cpp
src/ModelHighAPI/ModelHighAPI_Services.h
src/ModelHighAPI/ModelHighAPI_Tools.cpp
src/ModelHighAPI/ModelHighAPI_Tools.h
src/ModelHighAPI/ModelHighAPI_swig.h
src/ModelHighAPI/Test/Test2488.py
src/ModelHighAPI/Test/TestDeflectionDump.py
src/ModelHighAPI/Test/TestDouble.py
src/ModelHighAPI/Test/TestInteger.py
src/ModelHighAPI/Test/TestRefAttr.py
src/ModelHighAPI/Test/TestReference.py
src/ModelHighAPI/Test/TestUndoRedo.py [new file with mode: 0644]
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase.h
src/ModuleBase/ModuleBase_ActionInfo.cpp
src/ModuleBase/ModuleBase_ActionInfo.h
src/ModuleBase/ModuleBase_ActionIntParameter.h
src/ModuleBase/ModuleBase_ActionParameter.h
src/ModuleBase/ModuleBase_ActionType.h
src/ModuleBase/ModuleBase_BRepOwner.cpp
src/ModuleBase/ModuleBase_BRepOwner.h
src/ModuleBase/ModuleBase_ChoiceCtrl.cpp
src/ModuleBase/ModuleBase_ChoiceCtrl.h
src/ModuleBase/ModuleBase_Definitions.h
src/ModuleBase/ModuleBase_Dialog.cpp
src/ModuleBase/ModuleBase_Dialog.h
src/ModuleBase/ModuleBase_DoubleSpinBox.cpp
src/ModuleBase/ModuleBase_DoubleSpinBox.h
src/ModuleBase/ModuleBase_Events.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_Filter.cpp
src/ModuleBase/ModuleBase_Filter.h
src/ModuleBase/ModuleBase_FilterValidated.cpp
src/ModuleBase/ModuleBase_FilterValidated.h
src/ModuleBase/ModuleBase_IErrorMgr.cpp
src/ModuleBase/ModuleBase_IErrorMgr.h
src/ModuleBase/ModuleBase_IModule.cpp
src/ModuleBase/ModuleBase_IModule.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_IPrefMgr.cpp
src/ModuleBase/ModuleBase_IPrefMgr.h
src/ModuleBase/ModuleBase_IPropertyPanel.cpp
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/ModuleBase/ModuleBase_ISelection.cpp
src/ModuleBase/ModuleBase_ISelection.h
src/ModuleBase/ModuleBase_ISelectionActivate.h
src/ModuleBase/ModuleBase_ITreeNode.h
src/ModuleBase/ModuleBase_IViewWindow.cpp
src/ModuleBase/ModuleBase_IViewWindow.h
src/ModuleBase/ModuleBase_IViewer.cpp
src/ModuleBase/ModuleBase_IViewer.h
src/ModuleBase/ModuleBase_IWidgetCreator.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_IWidgetCreator.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_IWorkshop.cpp
src/ModuleBase/ModuleBase_IWorkshop.h
src/ModuleBase/ModuleBase_IconFactory.cpp
src/ModuleBase/ModuleBase_IconFactory.h
src/ModuleBase/ModuleBase_IntSpinBox.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_IntSpinBox.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_LabelValue.cpp
src/ModuleBase/ModuleBase_LabelValue.h
src/ModuleBase/ModuleBase_ListView.cpp
src/ModuleBase/ModuleBase_ListView.h
src/ModuleBase/ModuleBase_ModelDialogWidget.h
src/ModuleBase/ModuleBase_ModelWidget.cpp
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_OperationAction.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_OperationAction.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_OperationDescription.cpp
src/ModuleBase/ModuleBase_OperationDescription.h
src/ModuleBase/ModuleBase_OperationFeature.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_OperationFeature.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_PageBase.cpp
src/ModuleBase/ModuleBase_PageBase.h
src/ModuleBase/ModuleBase_PageGroupBox.cpp
src/ModuleBase/ModuleBase_PageGroupBox.h
src/ModuleBase/ModuleBase_PageWidget.cpp
src/ModuleBase/ModuleBase_PageWidget.h
src/ModuleBase/ModuleBase_PagedContainer.cpp
src/ModuleBase/ModuleBase_PagedContainer.h
src/ModuleBase/ModuleBase_ParamIntSpinBox.cpp
src/ModuleBase/ModuleBase_ParamIntSpinBox.h
src/ModuleBase/ModuleBase_ParamSpinBox.cpp
src/ModuleBase/ModuleBase_ParamSpinBox.h
src/ModuleBase/ModuleBase_Preferences.cpp
src/ModuleBase/ModuleBase_Preferences.h
src/ModuleBase/ModuleBase_ResultPrs.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_ResultPrs.h
src/ModuleBase/ModuleBase_SelectionValidator.cpp
src/ModuleBase/ModuleBase_SelectionValidator.h
src/ModuleBase/ModuleBase_ToolBox.cpp
src/ModuleBase/ModuleBase_ToolBox.h
src/ModuleBase/ModuleBase_Tools.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_Tools.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_ViewerFilters.cpp
src/ModuleBase/ModuleBase_ViewerFilters.h
src/ModuleBase/ModuleBase_ViewerPrs.cpp
src/ModuleBase/ModuleBase_ViewerPrs.h
src/ModuleBase/ModuleBase_WidgetAction.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetAction.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetBoolValue.cpp
src/ModuleBase/ModuleBase_WidgetBoolValue.h
src/ModuleBase/ModuleBase_WidgetChoice.cpp
src/ModuleBase/ModuleBase_WidgetChoice.h
src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp
src/ModuleBase/ModuleBase_WidgetConcealedObjects.h
src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetCreatorFactory.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
src/ModuleBase/ModuleBase_WidgetDoubleValue.h
src/ModuleBase/ModuleBase_WidgetEditor.cpp
src/ModuleBase/ModuleBase_WidgetEditor.h
src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
src/ModuleBase/ModuleBase_WidgetExprEditor.h
src/ModuleBase/ModuleBase_WidgetFactory.cpp
src/ModuleBase/ModuleBase_WidgetFactory.h
src/ModuleBase/ModuleBase_WidgetFeatureSelector.cpp
src/ModuleBase/ModuleBase_WidgetFeatureSelector.h
src/ModuleBase/ModuleBase_WidgetFileSelector.cpp
src/ModuleBase/ModuleBase_WidgetFileSelector.h
src/ModuleBase/ModuleBase_WidgetIntValue.cpp
src/ModuleBase/ModuleBase_WidgetIntValue.h
src/ModuleBase/ModuleBase_WidgetLabel.cpp
src/ModuleBase/ModuleBase_WidgetLabel.h
src/ModuleBase/ModuleBase_WidgetLabelValue.cpp
src/ModuleBase/ModuleBase_WidgetLabelValue.h
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
src/ModuleBase/ModuleBase_WidgetLineEdit.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetMultiSelector.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetNameEdit.cpp
src/ModuleBase/ModuleBase_WidgetNameEdit.h
src/ModuleBase/ModuleBase_WidgetOptionalBox.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetOptionalBox.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetPointInput.cpp
src/ModuleBase/ModuleBase_WidgetPointInput.h
src/ModuleBase/ModuleBase_WidgetRadiobox.cpp
src/ModuleBase/ModuleBase_WidgetRadiobox.h
src/ModuleBase/ModuleBase_WidgetSelector.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetSelector.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetSelectorStore.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetSelectorStore.h [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/ModuleBase/ModuleBase_WidgetSwitch.cpp
src/ModuleBase/ModuleBase_WidgetSwitch.h
src/ModuleBase/ModuleBase_WidgetToolbox.cpp
src/ModuleBase/ModuleBase_WidgetToolbox.h
src/ModuleBase/ModuleBase_WidgetValidated.cpp
src/ModuleBase/ModuleBase_WidgetValidated.h
src/ModuleBase/ModuleBase_WidgetValidator.cpp [changed mode: 0755->0644]
src/ModuleBase/ModuleBase_WidgetValidator.h [changed mode: 0755->0644]
src/ParametersAPI/CMakeLists.txt
src/ParametersAPI/ParametersAPI.h
src/ParametersAPI/ParametersAPI.i
src/ParametersAPI/ParametersAPI_Parameter.cpp
src/ParametersAPI/ParametersAPI_Parameter.h
src/ParametersAPI/ParametersAPI_swig.h
src/ParametersPlugin/CMakeLists.txt
src/ParametersPlugin/ParametersPlugin.h
src/ParametersPlugin/ParametersPlugin_EvalListener.cpp
src/ParametersPlugin/ParametersPlugin_EvalListener.h
src/ParametersPlugin/ParametersPlugin_Parameter.cpp
src/ParametersPlugin/ParametersPlugin_Parameter.h
src/ParametersPlugin/ParametersPlugin_ParametersMgr.cpp
src/ParametersPlugin/ParametersPlugin_ParametersMgr.h
src/ParametersPlugin/ParametersPlugin_Plugin.cpp
src/ParametersPlugin/ParametersPlugin_Plugin.h
src/ParametersPlugin/ParametersPlugin_Validators.cpp
src/ParametersPlugin/ParametersPlugin_Validators.h
src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp
src/ParametersPlugin/ParametersPlugin_WidgetCreator.h
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h
src/ParametersPlugin/ParametersPlugin_msg_en.ts [changed mode: 0755->0644]
src/ParametersPlugin/Test/Test1806.py
src/ParametersPlugin/Test/Test2392.py
src/ParametersPlugin/Test/Test2474.py
src/ParametersPlugin/Test/TestParameterChangeValue.py
src/ParametersPlugin/Test/TestParameterCreation.py
src/ParametersPlugin/Test/TestParameterDelete.py [new file with mode: 0644]
src/ParametersPlugin/Test/TestParameterErrorMsg.py [new file with mode: 0644]
src/ParametersPlugin/Test/TestParameterRename.py
src/ParametersPlugin/Test/TestParametersMgr.py [new file with mode: 0644]
src/ParametersPlugin/doc/TUI_parameterFeature.rst [changed mode: 0755->0644]
src/ParametersPlugin/doc/examples/parameter.py [changed mode: 0755->0644]
src/ParametersPlugin/plugin-Parameters.xml
src/PartSet/CMakeLists.txt
src/PartSet/PartSet.h
src/PartSet/PartSet_CenterPrs.cpp
src/PartSet/PartSet_CenterPrs.h
src/PartSet/PartSet_Constants.h
src/PartSet/PartSet_CustomPrs.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_CustomPrs.h [changed mode: 0755->0644]
src/PartSet/PartSet_DataModel.cpp
src/PartSet/PartSet_DataModel.h
src/PartSet/PartSet_ExternalObjectsMgr.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_ExternalObjectsMgr.h [changed mode: 0755->0644]
src/PartSet/PartSet_ExternalPointsMgr.cpp
src/PartSet/PartSet_ExternalPointsMgr.h
src/PartSet/PartSet_FilterInfinite.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_FilterInfinite.h [changed mode: 0755->0644]
src/PartSet/PartSet_Filters.cpp
src/PartSet/PartSet_Filters.h
src/PartSet/PartSet_IconFactory.cpp
src/PartSet/PartSet_IconFactory.h
src/PartSet/PartSet_MenuMgr.cpp
src/PartSet/PartSet_MenuMgr.h
src/PartSet/PartSet_Module.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_Module.h [changed mode: 0755->0644]
src/PartSet/PartSet_MouseProcessor.h [changed mode: 0755->0644]
src/PartSet/PartSet_OperationPrs.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_OperationPrs.h [changed mode: 0755->0644]
src/PartSet/PartSet_OverconstraintListener.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_OverconstraintListener.h [changed mode: 0755->0644]
src/PartSet/PartSet_PreviewPlanes.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_PreviewPlanes.h [changed mode: 0755->0644]
src/PartSet/PartSet_PreviewSketchPlane.cpp
src/PartSet/PartSet_PreviewSketchPlane.h
src/PartSet/PartSet_ResultSketchPrs.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_ResultSketchPrs.h [changed mode: 0755->0644]
src/PartSet/PartSet_SketcherMgr.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/PartSet/PartSet_SketcherReentrantMgr.h
src/PartSet/PartSet_Tools.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_Tools.h [changed mode: 0755->0644]
src/PartSet/PartSet_TreeNodes.cpp
src/PartSet/PartSet_TreeNodes.h
src/PartSet/PartSet_Validators.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_Validators.h
src/PartSet/PartSet_WidgetEditor.cpp
src/PartSet/PartSet_WidgetEditor.h
src/PartSet/PartSet_WidgetFeaturePointSelector.cpp
src/PartSet/PartSet_WidgetFeaturePointSelector.h
src/PartSet/PartSet_WidgetFileSelector.cpp
src/PartSet/PartSet_WidgetFileSelector.h
src/PartSet/PartSet_WidgetMultiSelector.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_WidgetMultiSelector.h
src/PartSet/PartSet_WidgetPoint2DFlyout.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_WidgetPoint2DFlyout.h [changed mode: 0755->0644]
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h [changed mode: 0755->0644]
src/PartSet/PartSet_WidgetShapeSelector.cpp [changed mode: 0755->0644]
src/PartSet/PartSet_WidgetShapeSelector.h
src/PartSet/PartSet_WidgetSketchCreator.cpp
src/PartSet/PartSet_WidgetSketchCreator.h
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h
src/PartSetAPI/CMakeLists.txt
src/PartSetAPI/PartSetAPI.h
src/PartSetAPI/PartSetAPI.i
src/PartSetAPI/PartSetAPI_Part.cpp
src/PartSetAPI/PartSetAPI_Part.h
src/PartSetAPI/PartSetAPI_swig.h
src/PartSetAPI/Test/TestRemoveDuplicate.py
src/PartSetPlugin/CMakeLists.txt
src/PartSetPlugin/PartSetPlugin.h
src/PartSetPlugin/PartSetPlugin_Duplicate.cpp
src/PartSetPlugin/PartSetPlugin_Duplicate.h
src/PartSetPlugin/PartSetPlugin_Part.cpp
src/PartSetPlugin/PartSetPlugin_Part.h
src/PartSetPlugin/PartSetPlugin_Plugin.cpp
src/PartSetPlugin/PartSetPlugin_Plugin.h
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/PartSetPlugin/PartSetPlugin_Remove.h
src/PartSetPlugin/plugin-PartSet.xml
src/PrimitivesAPI/CMakeLists.txt
src/PrimitivesAPI/PrimitivesAPI.h
src/PrimitivesAPI/PrimitivesAPI.i
src/PrimitivesAPI/PrimitivesAPI_Box.cpp
src/PrimitivesAPI/PrimitivesAPI_Box.h
src/PrimitivesAPI/PrimitivesAPI_Cone.cpp
src/PrimitivesAPI/PrimitivesAPI_Cone.h
src/PrimitivesAPI/PrimitivesAPI_Cylinder.cpp
src/PrimitivesAPI/PrimitivesAPI_Cylinder.h
src/PrimitivesAPI/PrimitivesAPI_Sphere.cpp
src/PrimitivesAPI/PrimitivesAPI_Sphere.h
src/PrimitivesAPI/PrimitivesAPI_Torus.cpp
src/PrimitivesAPI/PrimitivesAPI_Torus.h
src/PrimitivesAPI/PrimitivesAPI_swig.h
src/PrimitivesPlugin/CMakeLists.txt
src/PrimitivesPlugin/PrimitivesPlugin.h
src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Box.h
src/PrimitivesPlugin/PrimitivesPlugin_Cone.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Cone.h
src/PrimitivesPlugin/PrimitivesPlugin_Cylinder.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Cylinder.h
src/PrimitivesPlugin/PrimitivesPlugin_Plugin.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Plugin.h
src/PrimitivesPlugin/PrimitivesPlugin_Sphere.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h
src/PrimitivesPlugin/PrimitivesPlugin_Torus.cpp
src/PrimitivesPlugin/PrimitivesPlugin_Torus.h
src/PrimitivesPlugin/box_widget.xml
src/PrimitivesPlugin/cone_widget.xml
src/PrimitivesPlugin/cylinder_widget.xml
src/PrimitivesPlugin/doc/examples/torus.py [changed mode: 0755->0644]
src/PrimitivesPlugin/plugin-Primitives.xml
src/PrimitivesPlugin/sphere_widget.xml
src/PrimitivesPlugin/torus_widget.xml
src/PythonAPI/CMakeLists.txt
src/PythonAPI/Test/Test2044.py
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/Test/TestFeaturesExtrusion.py
src/PythonAPI/Test/TestFeaturesRevolution.py
src/PythonAPI/Test/TestMakeBrick1.py
src/PythonAPI/Test/TestMakeBrick2.py
src/PythonAPI/Test/TestModel.py
src/PythonAPI/Test/TestPlatine.py
src/PythonAPI/Test/TestPrimitivesBox.py
src/PythonAPI/Test/TestPythonAPI.py
src/PythonAPI/Test/TestSketcher.py
src/PythonAPI/Test/TestSketcherAddArc.py
src/PythonAPI/Test/TestSketcherAddCircle.py
src/PythonAPI/Test/TestSketcherAddLine.py
src/PythonAPI/Test/TestSketcherAddMirror.py
src/PythonAPI/Test/TestSketcherAddPoint.py
src/PythonAPI/Test/TestSketcherSetAngle.py
src/PythonAPI/Test/TestSketcherSetCoincident.py
src/PythonAPI/Test/TestSketcherSetEqual.py
src/PythonAPI/Test/TestSketcherSetFillet.py
src/PythonAPI/Test/TestSketcherSetFixed.py
src/PythonAPI/Test/TestSketcherSetHorizontal.py
src/PythonAPI/Test/TestSketcherSetLength.py
src/PythonAPI/Test/TestSketcherSetParallel.py
src/PythonAPI/Test/TestSketcherSetPerpendicular.py
src/PythonAPI/Test/TestSketcherSetRadius.py
src/PythonAPI/Test/TestSketcherSetTangent.py
src/PythonAPI/Test/TestSketcherSetVertical.py
src/PythonAPI/__init__.py
src/PythonAPI/doc/source/conf.py
src/PythonAPI/examples/MakeBrick1.py
src/PythonAPI/examples/MakeBrick2.py
src/PythonAPI/examples/Platine.py
src/PythonAPI/geom/__init__.py
src/PythonAPI/initConfig.py
src/PythonAPI/model/__init__.py
src/PythonAPI/model/build/__init__.py
src/PythonAPI/model/collection/__init__.py
src/PythonAPI/model/connection/__init__.py
src/PythonAPI/model/construction/__init__.py
src/PythonAPI/model/dump/DumpAssistant.py
src/PythonAPI/model/dump/__init__.py
src/PythonAPI/model/exchange/__init__.py
src/PythonAPI/model/features/__init__.py
src/PythonAPI/model/gdml/__init__.py
src/PythonAPI/model/parameter/__init__.py
src/PythonAPI/model/partset/__init__.py
src/PythonAPI/model/primitives/__init__.py
src/PythonAPI/model/roots.py
src/PythonAPI/model/services/__init__.py
src/PythonAPI/model/sketcher/__init__.py
src/PythonAPI/model/sketcher/tests.py
src/PythonAPI/model/sketcher/tools.py
src/PythonAPI/model/tests/__init__.py
src/PythonAPI/model/tests/tests.py
src/PythonAddons/CMakeLists.txt
src/PythonAddons/Test/TestRectangle.py
src/PythonAddons/__init__.py
src/PythonAddons/addons_Features.py
src/PythonAddons/doc/examples/box/feature.py
src/PythonAddons/doc/examples/box/widget.xml
src/PythonAddons/doc/examples/rectangle/feature.py
src/PythonAddons/doc/examples/rectangle/widget.xml
src/PythonAddons/macros/__init__.py
src/PythonAddons/macros/box/__init__.py
src/PythonAddons/macros/box/feature.py
src/PythonAddons/macros/box/widget.xml
src/PythonAddons/macros/rectangle/__init__.py
src/PythonAddons/macros/rectangle/feature.py
src/PythonAddons/macros/rectangle/widget.xml
src/SHAPERGUI/CMakeLists.txt
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/SHAPERGUI.h
src/SHAPERGUI/SHAPERGUI_DataModel.cpp
src/SHAPERGUI/SHAPERGUI_DataModel.h
src/SHAPERGUI/SHAPERGUI_NestedButton.cpp
src/SHAPERGUI/SHAPERGUI_NestedButton.h
src/SHAPERGUI/SHAPERGUI_OCCSelector.cpp
src/SHAPERGUI/SHAPERGUI_OCCSelector.h
src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp
src/SHAPERGUI/SHAPERGUI_SalomeViewer.h
src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.cpp [new file with mode: 0644]
src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.h [new file with mode: 0644]
src/SHAPERGUI/SHAPER_SHAPERGUI.h
src/SHAPERGUI/resources/LightApp.xml.in
src/SHAPERGUI/resources/SalomeApp.xml [new file with mode: 0644]
src/SHAPERGUI/resources/SalomeApp.xml.in [deleted file]
src/SamplePanelPlugin/CMakeLists.txt [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Feature.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Feature.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_ModelWidget.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_ModelWidget.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_ModelWidgetCreator.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_ModelWidgetCreator.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Panel.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Panel.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Plugin.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_Plugin.h [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_WidgetCreator.cpp [changed mode: 0755->0644]
src/SamplePanelPlugin/SamplePanelPlugin_WidgetCreator.h [changed mode: 0755->0644]
src/SamplePanelPlugin/plugin-SamplePanel.xml [changed mode: 0755->0644]
src/Selector/CMakeLists.txt [new file with mode: 0644]
src/Selector/Selector.h [new file with mode: 0644]
src/Selector/Selector_Algo.cpp [new file with mode: 0644]
src/Selector/Selector_Algo.h [new file with mode: 0644]
src/Selector/Selector_AlgoWithSubs.cpp [new file with mode: 0644]
src/Selector/Selector_AlgoWithSubs.h [new file with mode: 0644]
src/Selector/Selector_Container.cpp [new file with mode: 0644]
src/Selector/Selector_Container.h [new file with mode: 0644]
src/Selector/Selector_FilterByNeighbors.cpp [new file with mode: 0644]
src/Selector/Selector_FilterByNeighbors.h [new file with mode: 0644]
src/Selector/Selector_Intersect.cpp [new file with mode: 0644]
src/Selector/Selector_Intersect.h [new file with mode: 0644]
src/Selector/Selector_Modify.cpp [new file with mode: 0644]
src/Selector/Selector_Modify.h [new file with mode: 0644]
src/Selector/Selector_NExplode.cpp [new file with mode: 0644]
src/Selector/Selector_NExplode.h [new file with mode: 0644]
src/Selector/Selector_NameGenerator.cpp [new file with mode: 0644]
src/Selector/Selector_NameGenerator.h [new file with mode: 0644]
src/Selector/Selector_Primitive.cpp [new file with mode: 0644]
src/Selector/Selector_Primitive.h [new file with mode: 0644]
src/Selector/Selector_Selector.cpp [new file with mode: 0644]
src/Selector/Selector_Selector.h [new file with mode: 0644]
src/Selector/Selector_WeakName.cpp [new file with mode: 0644]
src/Selector/Selector_WeakName.h [new file with mode: 0644]
src/SketchAPI/CMakeLists.txt
src/SketchAPI/SketchAPI.h
src/SketchAPI/SketchAPI.i
src/SketchAPI/SketchAPI_Arc.cpp
src/SketchAPI/SketchAPI_Arc.h
src/SketchAPI/SketchAPI_Circle.cpp
src/SketchAPI/SketchAPI_Circle.h
src/SketchAPI/SketchAPI_Constraint.cpp
src/SketchAPI/SketchAPI_Constraint.h
src/SketchAPI/SketchAPI_ConstraintAngle.cpp [new file with mode: 0644]
src/SketchAPI/SketchAPI_ConstraintAngle.h [new file with mode: 0644]
src/SketchAPI/SketchAPI_IntersectionPoint.cpp
src/SketchAPI/SketchAPI_IntersectionPoint.h
src/SketchAPI/SketchAPI_Line.cpp
src/SketchAPI/SketchAPI_Line.h
src/SketchAPI/SketchAPI_MacroArc.cpp
src/SketchAPI/SketchAPI_MacroArc.h
src/SketchAPI/SketchAPI_MacroCircle.cpp
src/SketchAPI/SketchAPI_MacroCircle.h
src/SketchAPI/SketchAPI_Mirror.cpp
src/SketchAPI/SketchAPI_Mirror.h
src/SketchAPI/SketchAPI_Point.cpp
src/SketchAPI/SketchAPI_Point.h
src/SketchAPI/SketchAPI_Projection.cpp
src/SketchAPI/SketchAPI_Projection.h
src/SketchAPI/SketchAPI_Rectangle.cpp
src/SketchAPI/SketchAPI_Rectangle.h
src/SketchAPI/SketchAPI_Rotation.cpp
src/SketchAPI/SketchAPI_Rotation.h
src/SketchAPI/SketchAPI_Sketch.cpp
src/SketchAPI/SketchAPI_Sketch.h
src/SketchAPI/SketchAPI_SketchEntity.cpp
src/SketchAPI/SketchAPI_SketchEntity.h
src/SketchAPI/SketchAPI_Translation.cpp
src/SketchAPI/SketchAPI_Translation.h
src/SketchAPI/SketchAPI_swig.h
src/SketchAPI/Test/TestSketch.py
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/SketchPlugin.h
src/SketchPlugin/SketchPlugin_Arc.cpp
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_Constraint.cpp
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp
src/SketchPlugin/SketchPlugin_ConstraintAngle.h
src/SketchPlugin/SketchPlugin_ConstraintBase.cpp [deleted file]
src/SketchPlugin/SketchPlugin_ConstraintBase.h
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchPlugin/SketchPlugin_ConstraintCollinear.cpp
src/SketchPlugin/SketchPlugin_ConstraintCollinear.h
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintDistanceAlongDir.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistanceAlongDir.h
src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.h
src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.h
src/SketchPlugin/SketchPlugin_ConstraintEqual.cpp
src/SketchPlugin/SketchPlugin_ConstraintEqual.h
src/SketchPlugin/SketchPlugin_ConstraintHorizontal.cpp
src/SketchPlugin/SketchPlugin_ConstraintHorizontal.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.h
src/SketchPlugin/SketchPlugin_ConstraintMiddle.cpp
src/SketchPlugin/SketchPlugin_ConstraintMiddle.h
src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp [changed mode: 0755->0644]
src/SketchPlugin/SketchPlugin_ConstraintMirror.h
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.h
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.h
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.h
src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp
src/SketchPlugin/SketchPlugin_ConstraintRigid.h
src/SketchPlugin/SketchPlugin_ConstraintTangent.cpp
src/SketchPlugin/SketchPlugin_ConstraintTangent.h
src/SketchPlugin/SketchPlugin_ConstraintVertical.cpp
src/SketchPlugin/SketchPlugin_ConstraintVertical.h
src/SketchPlugin/SketchPlugin_Ellipse.cpp
src/SketchPlugin/SketchPlugin_Ellipse.h
src/SketchPlugin/SketchPlugin_ExternalValidator.cpp
src/SketchPlugin/SketchPlugin_ExternalValidator.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchPlugin/SketchPlugin_Fillet.cpp
src/SketchPlugin/SketchPlugin_Fillet.h
src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp
src/SketchPlugin/SketchPlugin_IntersectionPoint.h
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_MacroArc.cpp
src/SketchPlugin/SketchPlugin_MacroArc.h
src/SketchPlugin/SketchPlugin_MacroArcReentrantMessage.h
src/SketchPlugin/SketchPlugin_MacroCircle.cpp
src/SketchPlugin/SketchPlugin_MacroCircle.h
src/SketchPlugin/SketchPlugin_MacroEllipse.cpp
src/SketchPlugin/SketchPlugin_MacroEllipse.h
src/SketchPlugin/SketchPlugin_MultiRotation.cpp [changed mode: 0755->0644]
src/SketchPlugin/SketchPlugin_MultiRotation.h
src/SketchPlugin/SketchPlugin_MultiTranslation.cpp [changed mode: 0755->0644]
src/SketchPlugin/SketchPlugin_MultiTranslation.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Plugin.h
src/SketchPlugin/SketchPlugin_Point.cpp
src/SketchPlugin/SketchPlugin_Point.h
src/SketchPlugin/SketchPlugin_Projection.cpp
src/SketchPlugin/SketchPlugin_Projection.h
src/SketchPlugin/SketchPlugin_Sketch.cpp [changed mode: 0755->0644]
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchPlugin/SketchPlugin_SketchDrawer.cpp [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_SketchDrawer.h [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_SketchEntity.cpp
src/SketchPlugin/SketchPlugin_SketchEntity.h
src/SketchPlugin/SketchPlugin_Split.cpp
src/SketchPlugin/SketchPlugin_Split.h
src/SketchPlugin/SketchPlugin_Tools.cpp
src/SketchPlugin/SketchPlugin_Tools.h
src/SketchPlugin/SketchPlugin_Trim.cpp
src/SketchPlugin/SketchPlugin_Trim.h
src/SketchPlugin/SketchPlugin_Validators.cpp [changed mode: 0755->0644]
src/SketchPlugin/SketchPlugin_Validators.h
src/SketchPlugin/SketchPlugin_msg_en.ts [changed mode: 0755->0644]
src/SketchPlugin/Test/Test1061.py
src/SketchPlugin/Test/Test1577.py
src/SketchPlugin/Test/Test1578.py
src/SketchPlugin/Test/Test1673.py
src/SketchPlugin/Test/Test1779.py
src/SketchPlugin/Test/Test1924.py
src/SketchPlugin/Test/Test1963.py
src/SketchPlugin/Test/Test1966.py
src/SketchPlugin/Test/Test1967.py
src/SketchPlugin/Test/Test2018.py
src/SketchPlugin/Test/Test2034_1.py
src/SketchPlugin/Test/Test2034_2.py
src/SketchPlugin/Test/Test2034_3.py
src/SketchPlugin/Test/Test2062.py
src/SketchPlugin/Test/Test2095.py
src/SketchPlugin/Test/Test2115.py
src/SketchPlugin/Test/Test2119.py
src/SketchPlugin/Test/Test2134.py
src/SketchPlugin/Test/Test2157.py
src/SketchPlugin/Test/Test2157_2.py
src/SketchPlugin/Test/Test2224.py
src/SketchPlugin/Test/Test2229.py
src/SketchPlugin/Test/Test2239.py
src/SketchPlugin/Test/Test2273.py
src/SketchPlugin/Test/Test2280.py
src/SketchPlugin/Test/Test2287.py
src/SketchPlugin/Test/Test2341.py
src/SketchPlugin/Test/Test2376.py
src/SketchPlugin/Test/Test2390.py
src/SketchPlugin/Test/Test2393.py
src/SketchPlugin/Test/Test2425.py
src/SketchPlugin/Test/Test2427.py
src/SketchPlugin/Test/Test2440.py
src/SketchPlugin/Test/Test2481.py
src/SketchPlugin/Test/Test2654.py
src/SketchPlugin/Test/Test2711.py
src/SketchPlugin/Test/Test2741.py [new file with mode: 0644]
src/SketchPlugin/Test/Test2810.py [new file with mode: 0644]
src/SketchPlugin/Test/Test2824.py [new file with mode: 0644]
src/SketchPlugin/Test/Test2860.py [new file with mode: 0644]
src/SketchPlugin/Test/TestArcBehavior.py
src/SketchPlugin/Test/TestConstraintAngle.py
src/SketchPlugin/Test/TestConstraintCoincidence.py
src/SketchPlugin/Test/TestConstraintCollinear.py
src/SketchPlugin/Test/TestConstraintDistance.py
src/SketchPlugin/Test/TestConstraintDistanceBehavior.py
src/SketchPlugin/Test/TestConstraintDistanceHorizontal.py
src/SketchPlugin/Test/TestConstraintDistanceVertical.py
src/SketchPlugin/Test/TestConstraintEqual.py
src/SketchPlugin/Test/TestConstraintFixed.py
src/SketchPlugin/Test/TestConstraintHorizontal.py
src/SketchPlugin/Test/TestConstraintHorizontalValidator.py
src/SketchPlugin/Test/TestConstraintLength.py
src/SketchPlugin/Test/TestConstraintMiddlePoint.py
src/SketchPlugin/Test/TestConstraintParallel.py
src/SketchPlugin/Test/TestConstraintPerpendicular.py
src/SketchPlugin/Test/TestConstraintRadius.py
src/SketchPlugin/Test/TestConstraintRadiusFailure.py [new file with mode: 0644]
src/SketchPlugin/Test/TestConstraintTangent.py
src/SketchPlugin/Test/TestConstraintVertical.py
src/SketchPlugin/Test/TestCreateArcByCenterStartEnd.py
src/SketchPlugin/Test/TestCreateArcByTangentEdge.py
src/SketchPlugin/Test/TestCreateArcByThreePoints.py
src/SketchPlugin/Test/TestCreateArcChangeType.py
src/SketchPlugin/Test/TestCreateCircleByCenterAndPassed.py
src/SketchPlugin/Test/TestCreateCircleByThreePoints.py
src/SketchPlugin/Test/TestCreateCircleChangeType.py
src/SketchPlugin/Test/TestDegeneratedGeometry.py
src/SketchPlugin/Test/TestDistanceDump.py
src/SketchPlugin/Test/TestDistanceSignedVsUnsigned01.py
src/SketchPlugin/Test/TestDistanceSignedVsUnsigned02.py
src/SketchPlugin/Test/TestDistanceSignedVsUnsigned03.py
src/SketchPlugin/Test/TestDistanceSignedVsUnsigned04.py
src/SketchPlugin/Test/TestDistanceSignedVsUnsigned05.py
src/SketchPlugin/Test/TestEdgesOrder.py
src/SketchPlugin/Test/TestFillet.py
src/SketchPlugin/Test/TestFilletAfterFolder.py
src/SketchPlugin/Test/TestFilletInteracting.py
src/SketchPlugin/Test/TestHighload.py
src/SketchPlugin/Test/TestIntersectionChangeEdge.py
src/SketchPlugin/Test/TestIntersectionWithCircle.py
src/SketchPlugin/Test/TestIntersectionWithLine.py
src/SketchPlugin/Test/TestIntersectionWithSpline.py
src/SketchPlugin/Test/TestMirror.py
src/SketchPlugin/Test/TestMoveArc.py
src/SketchPlugin/Test/TestMoveCircle.py
src/SketchPlugin/Test/TestMoveLine.py
src/SketchPlugin/Test/TestMovePoint.py
src/SketchPlugin/Test/TestMovementComplex.py
src/SketchPlugin/Test/TestMultiRotation.py
src/SketchPlugin/Test/TestMultiRotation01.py
src/SketchPlugin/Test/TestMultiRotation02.py
src/SketchPlugin/Test/TestMultiRotation03.py
src/SketchPlugin/Test/TestMultiRotation04.py
src/SketchPlugin/Test/TestMultiRotation05.py
src/SketchPlugin/Test/TestMultiRotationWithParameter.py
src/SketchPlugin/Test/TestMultiTranslation.py
src/SketchPlugin/Test/TestPresentation.py [new file with mode: 0644]
src/SketchPlugin/Test/TestProjection.py
src/SketchPlugin/Test/TestProjectionIntoResult.py
src/SketchPlugin/Test/TestProjectionUpdate.py
src/SketchPlugin/Test/TestRectangle.py
src/SketchPlugin/Test/TestRemoveSketch.py
src/SketchPlugin/Test/TestSignedDistancePointLine.py
src/SketchPlugin/Test/TestSignedDistancePointPoint.py
src/SketchPlugin/Test/TestSketchDrawer.py [new file with mode: 0644]
src/SketchPlugin/Test/TestSketchPointLine.py
src/SketchPlugin/Test/TestSnowflake.py
src/SketchPlugin/Test/TestSplit.py
src/SketchPlugin/Test/TestSplitLine.py [new file with mode: 0644]
src/SketchPlugin/Test/TestSplitPreview.py [new file with mode: 0644]
src/SketchPlugin/Test/TestTrimArc01.py
src/SketchPlugin/Test/TestTrimArc02.py
src/SketchPlugin/Test/TestTrimArc03.py
src/SketchPlugin/Test/TestTrimArc04.py
src/SketchPlugin/Test/TestTrimArc05.py
src/SketchPlugin/Test/TestTrimArc06.py
src/SketchPlugin/Test/TestTrimArc07.py
src/SketchPlugin/Test/TestTrimArc08.py [new file with mode: 0644]
src/SketchPlugin/Test/TestTrimCircle01.py
src/SketchPlugin/Test/TestTrimCircle02.py
src/SketchPlugin/Test/TestTrimCircle03.py
src/SketchPlugin/Test/TestTrimCircle04.py
src/SketchPlugin/Test/TestTrimCircle05.py
src/SketchPlugin/Test/TestTrimCircleAndArc01.py
src/SketchPlugin/Test/TestTrimLine01.py
src/SketchPlugin/Test/TestTrimLine02.py
src/SketchPlugin/Test/TestTrimLine03.py [new file with mode: 0644]
src/SketchPlugin/Test/TestTrimPreview.py [new file with mode: 0644]
src/SketchPlugin/Test/TestUpdateSketch.py [new file with mode: 0644]
src/SketchPlugin/doc/SketchPlugin.rst
src/SketchPlugin/doc/images/SketchDrawer.png [new file with mode: 0644]
src/SketchPlugin/doc/images/SketchDrawer_panel.png [new file with mode: 0644]
src/SketchPlugin/doc/images/SketchDrawer_res.png [new file with mode: 0644]
src/SketchPlugin/doc/sketchDrawer.rst [new file with mode: 0644]
src/SketchPlugin/icons/drawer.png [new file with mode: 0644]
src/SketchPlugin/plugin-Sketch.xml
src/SketchPlugin/plugin-SketchDrawer.xml [new file with mode: 0644]
src/SketchSolver/CMakeLists.txt
src/SketchSolver/PlaneGCSSolver/CMakeLists.txt
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AngleWrapper.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AngleWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_AttributeBuilder.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ConstraintWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Defs.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EdgeWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityBuilder.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityDestroyer.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_FeatureBuilder.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_ScalarWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Update.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateFeature.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateFeature.h
src/SketchSolver/SketchSolver_Constraint.cpp
src/SketchSolver/SketchSolver_Constraint.h
src/SketchSolver/SketchSolver_ConstraintAngle.cpp
src/SketchSolver/SketchSolver_ConstraintAngle.h
src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp
src/SketchSolver/SketchSolver_ConstraintCoincidence.h
src/SketchSolver/SketchSolver_ConstraintCollinear.cpp
src/SketchSolver/SketchSolver_ConstraintCollinear.h
src/SketchSolver/SketchSolver_ConstraintDistance.cpp
src/SketchSolver/SketchSolver_ConstraintDistance.h
src/SketchSolver/SketchSolver_ConstraintEqual.cpp
src/SketchSolver/SketchSolver_ConstraintEqual.h
src/SketchSolver/SketchSolver_ConstraintFixed.cpp
src/SketchSolver/SketchSolver_ConstraintFixed.h
src/SketchSolver/SketchSolver_ConstraintLength.cpp
src/SketchSolver/SketchSolver_ConstraintLength.h
src/SketchSolver/SketchSolver_ConstraintMiddle.cpp
src/SketchSolver/SketchSolver_ConstraintMiddle.h
src/SketchSolver/SketchSolver_ConstraintMirror.cpp
src/SketchSolver/SketchSolver_ConstraintMirror.h
src/SketchSolver/SketchSolver_ConstraintMovement.cpp
src/SketchSolver/SketchSolver_ConstraintMovement.h
src/SketchSolver/SketchSolver_ConstraintMulti.cpp
src/SketchSolver/SketchSolver_ConstraintMulti.h
src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp
src/SketchSolver/SketchSolver_ConstraintMultiRotation.h
src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp
src/SketchSolver/SketchSolver_ConstraintMultiTranslation.h
src/SketchSolver/SketchSolver_ConstraintTangent.cpp
src/SketchSolver/SketchSolver_ConstraintTangent.h
src/SketchSolver/SketchSolver_Error.h
src/SketchSolver/SketchSolver_Group.cpp
src/SketchSolver/SketchSolver_Group.h
src/SketchSolver/SketchSolver_Manager.cpp
src/SketchSolver/SketchSolver_Manager.h
src/SketchSolver/SketchSolver_Storage.cpp
src/SketchSolver/SketchSolver_Storage.h
src/SketchSolver/SketchSolver_msg_en.ts [changed mode: 0755->0644]
src/SketchSolver/SolveSpaceSolver/CMakeLists.txt
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintType.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_EntityWrapper.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_EntityWrapper.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.h
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp
src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.h
src/SketcherPrs/CMakeLists.txt
src/SketcherPrs/SketcherPrs.h
src/SketcherPrs/SketcherPrs_Angle.cpp
src/SketcherPrs/SketcherPrs_Angle.h
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Coincident.h
src/SketcherPrs/SketcherPrs_Collinear.cpp [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_Collinear.h [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_DimensionStyleListener.h [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_Equal.cpp
src/SketcherPrs/SketcherPrs_Equal.h
src/SketcherPrs/SketcherPrs_Factory.cpp
src/SketcherPrs/SketcherPrs_Factory.h
src/SketcherPrs/SketcherPrs_HVDirection.cpp
src/SketcherPrs/SketcherPrs_HVDirection.h
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/SketcherPrs/SketcherPrs_LengthDimension.h
src/SketcherPrs/SketcherPrs_Middle.cpp [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_Middle.h [changed mode: 0755->0644]
src/SketcherPrs/SketcherPrs_Mirror.cpp
src/SketcherPrs/SketcherPrs_Mirror.h
src/SketcherPrs/SketcherPrs_Parallel.cpp
src/SketcherPrs/SketcherPrs_Parallel.h
src/SketcherPrs/SketcherPrs_Perpendicular.cpp
src/SketcherPrs/SketcherPrs_Perpendicular.h
src/SketcherPrs/SketcherPrs_PositionMgr.cpp
src/SketcherPrs/SketcherPrs_PositionMgr.h
src/SketcherPrs/SketcherPrs_Radius.cpp
src/SketcherPrs/SketcherPrs_Radius.h
src/SketcherPrs/SketcherPrs_Rigid.cpp
src/SketcherPrs/SketcherPrs_Rigid.h
src/SketcherPrs/SketcherPrs_SensitivePoint.cpp
src/SketcherPrs/SketcherPrs_SensitivePoint.h
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.h
src/SketcherPrs/SketcherPrs_Tangent.cpp
src/SketcherPrs/SketcherPrs_Tangent.h
src/SketcherPrs/SketcherPrs_Tools.cpp
src/SketcherPrs/SketcherPrs_Tools.h
src/SketcherPrs/SketcherPrs_Transformation.cpp
src/SketcherPrs/SketcherPrs_Transformation.h
src/XAO/XAO.hxx [changed mode: 0755->0644]
src/XAO/XAO_BooleanField.cxx
src/XAO/XAO_BooleanField.hxx
src/XAO/XAO_BooleanStep.cxx
src/XAO/XAO_BooleanStep.hxx
src/XAO/XAO_BrepGeometry.cxx
src/XAO/XAO_BrepGeometry.hxx
src/XAO/XAO_DoubleField.cxx
src/XAO/XAO_DoubleField.hxx
src/XAO/XAO_DoubleStep.cxx
src/XAO/XAO_DoubleStep.hxx
src/XAO/XAO_Exception.hxx
src/XAO/XAO_Field.cxx
src/XAO/XAO_Field.hxx
src/XAO/XAO_GeometricElement.cxx
src/XAO/XAO_GeometricElement.hxx
src/XAO/XAO_Geometry.cxx
src/XAO/XAO_Geometry.hxx
src/XAO/XAO_Group.cxx
src/XAO/XAO_Group.hxx
src/XAO/XAO_IntegerField.cxx
src/XAO/XAO_IntegerField.hxx
src/XAO/XAO_IntegerStep.cxx
src/XAO/XAO_IntegerStep.hxx
src/XAO/XAO_Step.cxx
src/XAO/XAO_Step.hxx
src/XAO/XAO_StringField.cxx
src/XAO/XAO_StringField.hxx
src/XAO/XAO_StringStep.cxx
src/XAO/XAO_StringStep.hxx
src/XAO/XAO_Xao.cxx
src/XAO/XAO_Xao.hxx
src/XAO/XAO_XaoExporter.cxx
src/XAO/XAO_XaoExporter.hxx
src/XAO/XAO_XaoUtils.cxx
src/XAO/XAO_XaoUtils.hxx
src/XAO/tests/BrepGeometryTest.cxx
src/XAO/tests/BrepGeometryTest.hxx
src/XAO/tests/FieldTest.cxx
src/XAO/tests/FieldTest.hxx
src/XAO/tests/GeometryTest.cxx
src/XAO/tests/GeometryTest.hxx
src/XAO/tests/GroupTest.cxx
src/XAO/tests/GroupTest.hxx
src/XAO/tests/ImportExportTest.cxx
src/XAO/tests/ImportExportTest.hxx
src/XAO/tests/MainTest.hxx
src/XAO/tests/TestUtils.hxx
src/XAO/tests/XAOTests.cxx
src/XAO/tests/XaoTest.cxx
src/XAO/tests/XaoTest.hxx
src/XAO/tests/XaoUtilsTest.cxx
src/XAO/tests/XaoUtilsTest.hxx
src/XAO/tests/coverage_report.sh
src/XGUI/CMakeLists.txt
src/XGUI/SHAPER.xml
src/XGUI/XGUI.h
src/XGUI/XGUI_ActionsMgr.cpp
src/XGUI/XGUI_ActionsMgr.h
src/XGUI/XGUI_ActiveControlMgr.cpp
src/XGUI/XGUI_ActiveControlMgr.h
src/XGUI/XGUI_ActiveControlSelector.h
src/XGUI/XGUI_ColorDialog.cpp
src/XGUI/XGUI_ColorDialog.h
src/XGUI/XGUI_CompressFiles.cpp
src/XGUI/XGUI_CompressFiles.h
src/XGUI/XGUI_ContextMenuMgr.cpp
src/XGUI/XGUI_ContextMenuMgr.h
src/XGUI/XGUI_CustomPrs.cpp
src/XGUI/XGUI_CustomPrs.h
src/XGUI/XGUI_DataModel.cpp
src/XGUI/XGUI_DataModel.h
src/XGUI/XGUI_DeflectionDialog.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_DeflectionDialog.h [changed mode: 0755->0644]
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_ErrorDialog.cpp
src/XGUI/XGUI_ErrorDialog.h
src/XGUI/XGUI_ErrorMgr.cpp
src/XGUI/XGUI_ErrorMgr.h
src/XGUI/XGUI_FacesPanel.cpp
src/XGUI/XGUI_FacesPanel.h
src/XGUI/XGUI_FacesPanelSelector.cpp
src/XGUI/XGUI_FacesPanelSelector.h
src/XGUI/XGUI_HistoryMenu.cpp
src/XGUI/XGUI_HistoryMenu.h
src/XGUI/XGUI_InspectionPanel.cpp
src/XGUI/XGUI_InspectionPanel.h
src/XGUI/XGUI_MenuGroup.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_MenuGroup.h [changed mode: 0755->0644]
src/XGUI/XGUI_MenuMgr.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_MenuMgr.h [changed mode: 0755->0644]
src/XGUI/XGUI_MenuWorkbench.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_MenuWorkbench.h [changed mode: 0755->0644]
src/XGUI/XGUI_ModuleConnector.cpp
src/XGUI/XGUI_ModuleConnector.h
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h [changed mode: 0755->0644]
src/XGUI/XGUI_PropertyDialog.cpp
src/XGUI/XGUI_PropertyDialog.h
src/XGUI/XGUI_PropertyPanel.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_PropertyPanelSelector.cpp
src/XGUI/XGUI_PropertyPanelSelector.h
src/XGUI/XGUI_QtEvents.cpp
src/XGUI/XGUI_QtEvents.h
src/XGUI/XGUI_SalomeConnector.cpp
src/XGUI/XGUI_SalomeConnector.h
src/XGUI/XGUI_Selection.cpp
src/XGUI/XGUI_Selection.h
src/XGUI/XGUI_SelectionActivate.cpp
src/XGUI/XGUI_SelectionActivate.h
src/XGUI/XGUI_SelectionFilterType.h
src/XGUI/XGUI_SelectionMgr.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_SelectionMgr.h
src/XGUI/XGUI_Tools.cpp
src/XGUI/XGUI_Tools.h
src/XGUI/XGUI_TransparencyWidget.cpp
src/XGUI/XGUI_TransparencyWidget.h
src/XGUI/XGUI_ViewerProxy.cpp
src/XGUI/XGUI_ViewerProxy.h
src/XGUI/XGUI_Workshop.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_Workshop.h [changed mode: 0755->0644]
src/XGUI/XGUI_WorkshopListener.cpp [changed mode: 0755->0644]
src/XGUI/XGUI_WorkshopListener.h [changed mode: 0755->0644]
src/XGUI/XGUI_pictures.qrc
src/XGUI/pictures/arrow-down.png [new file with mode: 0644]
src/XGUI/pictures/arrow-left.png [new file with mode: 0644]
src/XGUI/pictures/arrow-right.png [new file with mode: 0644]
src/XGUI/pictures/arrow-up.png [new file with mode: 0644]
src/XGUI/pictures/configure_toolbars.png [new file with mode: 0644]
test.API/SHAPER/CMakeLists.txt
test.API/SHAPER/GDML/TestAPI_ConeSegment.py
test.API/SHAPER/GDML/TestConeSegment.py
test.API/SHAPER/Primitives/TestAPI_Box.py
test.API/SHAPER/Primitives/TestAPI_Cone.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestAPI_Cylinder.py
test.API/SHAPER/Primitives/TestAPI_Sphere.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestAPI_Torus.py [new file with mode: 0644]
test.API/SHAPER/Primitives/TestBox.py
test.API/SHAPER/Primitives/TestCone.py
test.API/SHAPER/Primitives/TestCylinder.py
test.API/SHAPER/Primitives/TestSphere.py
test.API/SHAPER/Primitives/TestTorus.py
test.API/SHAPER/Transformations/TestAPI_MultiRotation.py [new file with mode: 0644]
test.API/SHAPER/Transformations/TestAPI_MultiTranslation.py
test.API/SHAPER/Transformations/TestAPI_Rotation.py
test.API/SHAPER/Transformations/TestAPI_Scale.py
test.API/SHAPER/Transformations/TestAPI_Symmetry.py
test.API/SHAPER/Transformations/TestAPI_Translation.py
test.API/SHAPER/Transformations/TestMultiRotation.py
test.API/SHAPER/Transformations/TestMultiTranslation.py
test.API/SHAPER/Transformations/TestRotation.py
test.API/SHAPER/Transformations/TestScale.py
test.API/SHAPER/Transformations/TestSymmetry.py
test.API/SHAPER/Transformations/TestTranslation.py
test.API/SHAPER/Transformations/TestTranslation_1.py
test.API/SHAPER/Transformations/TestTranslation_2.py
test.API/SHAPER/Transformations/TestTranslation_3.py
test.API/SHAPER/Transformations/TestTranslation_4.py
test.API/SHAPER/Transformations/TestTranslation_5.py
test.models/CMakeLists.txt
test.models/CSWA.py
test.models/angle30.py
test.models/bearing_puller.py
test.models/bobine_film_reel.py
test.models/bracket32.py
test.models/bushing.py
test.models/case24.py
test.models/clothespin.py
test.models/ecran.py
test.models/flange.py
test.models/gear.py
test.models/idler_plate.py
test.models/piece_02.py
test.models/piece_09.py
test.models/piece_12.py
test.models/plug.py
test.models/sprocket.py
test.models/wheel_rim.py
test.squish/shared/scripts/common.py
test.squish/shared/testdata/SalomeApp.xml
test.squish/shared/testdata/exchange/xao [deleted symlink]
test.squish/suite_ERROR_NOTIFICATION/tst_679/test.py
test.squish/suite_FEATURE_BOOLEAN/tst_boolean_001/test.py
test.squish/suite_FEATURE_BOOLEAN/tst_boolean_002/test.py
test.squish/suite_FEATURE_BOOLEAN/tst_boolean_003/test.py
test.squish/suite_FEATURE_CONSTRUCTION/tst_construction_001/test.py
test.squish/suite_FEATURE_EXCHANGE/tst_XAO-export/test.py
test.squish/suite_FEATURE_EXCHANGE/tst_XAO-import/test.py
test.squish/suite_FEATURE_EXTRUSION/tst_extrusion_001/test.py
test.squish/suite_FEATURE_EXTRUSION/tst_extrusion_002/test.py
test.squish/suite_FEATURE_EXTRUSION/tst_extrusion_003/test.py
test.squish/suite_FEATURE_EXTRUSION/tst_extrusion_004/test.py
test.squish/suite_FEATURE_EXTRUSION/tst_extrusion_006/test.py
test.squish/suite_FEATURE_PARAMETERS/shared/scripts/bdd_hooks.py
test.squish/suite_FEATURE_PARAMETERS/shared/steps/steps.py
test.squish/suite_FEATURE_PARAMETERS/tst_1127/test.py
test.squish/suite_FEATURE_PARAMETERS/tst_1157/test.py
test.squish/suite_FEATURE_PARAMETERS/tst_474/test.py
test.squish/suite_FEATURE_PARAMETERS/tst_576/test.py
test.squish/suite_FEATURE_PARAMETERS/tst_903/test.py
test.squish/suite_FEATURE_PARTITION/tst_partition_001/test.py
test.squish/suite_FEATURE_REVOLUTION/tst_revolution_001/test.py
test.squish/suite_FEATURE_REVOLUTION/tst_revolution_003/test.py
test.squish/suite_FEATURE_REVOLUTION/tst_revolution_004/test.py
test.squish/suite_FEATURE_REVOLUTION/tst_revolution_005/test.py
test.squish/suite_FEATURE_REVOLUTION/tst_revolution_006/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_001/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_002/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_003/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_004/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_005/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_006/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_007/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_008/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_009/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_010/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_011/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_012/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_013/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_014/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_015/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_016/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_017/test.py
test.squish/suite_FEATURE_SKETCH/tst_sketch_018/test.py
test.squish/suite_ISSUES_SALOME/tst_532/test.py
test.squish/suite_OBJECT_BROWSER/tst_ACTIVE_DOC_MANAGEMENT/test.py
test.squish/suite_PYTHONAPI_SALOME/tst_Platine/test.py
test.squish/suite_STANDALONE/shared/scripts/common.py
test.squish/suite_STANDALONE/tst_532/test.py
test.squish/suite_STANDALONE/tst_818/test.py
test.squish/suite_STANDALONE/tst_BASE/test.py
test.squish/suite_STANDALONE/tst_DISTANCE/test.py
test.squish/suite_STANDALONE/tst_PARALLEL_1/test.py
test.squish/suite_STANDALONE/tst_PARALLEL_2/test.py
test.squish/suite_STANDALONE/tst_PERPENDICULAR_1/test.py
test.squish/suite_STANDALONE/tst_RADIUS/test.py
test.squish/suite_STANDALONE/tst_c/test.py
test.squish/suite_STANDALONE/tst_common_1/test.py
test.squish/suite_STANDALONE/tst_crash_1/test.py
utils.py

index 0299026159012bc9237c34ef934d5856f3eb8be7..6a2b98933d5724dee14b2cfa5dbc23390dde5bc6 100644 (file)
@@ -1,5 +1,32 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
+# Copyright (c) 2012 - 2013, Lars Bilke
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+#    list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors
+#    may be used to endorse or promote products derived from this software without
+#    specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# CHANGES:
 #
 # 2012-01-31, Lars Bilke
 # - Enable Code Coverage
index 3e5d6abb3f82b7ffecf2bd9148fc3d9b1b44f108..849d1c6d7817d7a8627df108607ed21de860f10a 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 cmake_minimum_required (VERSION 2.6)
 cmake_policy(SET CMP0011 NEW)
index 5171af29f4d8d5519da8157cd8b47b5445d936cf..6b3237ce18ab93d37ce8c8b4aa2fbe707c8f7aee 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 IF (CMAKE_GENERATOR MATCHES "NMake Makefiles")
   IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
index 7e51104dd4c0784d84cc51f89ecb0794919a9656..ed0ed87340cb83d7d6b61a8b1bc48f6365a3a53b 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
 # - Try to  find PlaneGCS (sketcher part of FreeCAD)
 # Once done this will define
 #
@@ -5,10 +24,6 @@
 #  PLANEGCS_INCLUDE_DIRS - the Plaine include directory
 #  PLANEGCS_LIBRARIES - Link these to use PlaneGCS
 
-#=============================================================================
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#=============================================================================
-
 IF(NOT PLANEGCS_FIND_QUIETLY)
   MESSAGE(STATUS "Try to find PlainGCS at $ENV{PLANEGCS_ROOT_DIR}...")
 ENDIF()
index da2a36152e70def816363c3e38da7ed3481dc027..4d88da8a10bcc022f8d02170e370bd0fff234da1 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 UNSET(PYTHON_INCLUDE_DIRS)
 UNSET(PYTHON_LIBRARIES)
index 3d6400c5323908cfe9618875ad987976ee59c473..dcb58c0cf3fdae8dc75701529331f85e98d6e9fb 100644 (file)
@@ -1,5 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 IF(HAVE_SALOME)
   SET(SUIT_INCLUDE ${SALOME_GUI_INCLUDE})
index 47e23a7e56f31121a1df948bfef313f87aa48c73..91d2ea82098cc5ee6ebadc331a51609573f39c0f 100644 (file)
@@ -1,6 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL directory")
 SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI directory")
index 8c326e93d1b80c259bc65b02ada02faa8679c6ce..cd697ddcff585db8bbec2e8f1c577cfaa3f7091c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 8a4f48ee0fb4c28eddbab53cd944685a5fccbc8f..76d12e43281ee41c8b2b6e71072d78db65fef9d9 100644 (file)
@@ -1,91 +1,91 @@
-# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE\r
-#\r
-# This library is free software; you can redistribute it and/or\r
-# modify it under the terms of the GNU Lesser General Public\r
-# License as published by the Free Software Foundation; either\r
-# version 2.1 of the License, or (at your option) any later version.\r
-#\r
-# This library is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-# Lesser General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU Lesser General Public\r
-# License along with this library; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
-#\r
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
-#\r
-# Author: Adrien Bruneton\r
-#\r
-\r
-# Qt5 detection for Salome\r
-#\r
-#  !! Please read the generic detection procedure in SalomeMacros.cmake !!\r
-#\r
-\r
-# Qt5_FIND_COMPONENTS variable is set here to prevent ParaView to reset list of Qt5 modules,\r
-# just to avoid extra dependencies\r
-\r
-SET(QT_INCLUDES)\r
-SET(QT_DEFINITIONS)\r
-SET(QT_LIBRARIES)\r
-# Find Qt5Core to get Qt version\r
-SET(Qt5_FIND_COMPONENTS QtCore)\r
-SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)\r
-IF(Qt5Core_FOUND)\r
-  LIST(APPEND QT_INCLUDES    ${Qt5Core_INCLUDE_DIRS})\r
-  LIST(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS})\r
-  LIST(APPEND QT_LIBRARIES   ${Qt5Core_LIBRARIES})\r
-  SET(QT_VERSION "${Qt5Core_VERSION}")\r
-ENDIF()\r
-\r
-SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools)\r
-\r
-IF ("${QT_VERSION}" VERSION_LESS "5.6.0")\r
-  LIST(APPEND Qt5_FIND_COMPONENTS WebKit WebKitWidgets)\r
-ELSE()\r
-  LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngine WebEngineWidgets)\r
-ENDIF()\r
-\r
-IF(NOT WIN32)\r
-  LIST(APPEND Qt5_FIND_COMPONENTS X11Extras)\r
-ENDIF()\r
-\r
-FOREACH(_Qt5_COMPONENT_ ${Qt5_FIND_COMPONENTS} ${Qt5_OPTIONAL_COMPONENTS})\r
-  SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT_})\r
-  LIST(FIND Qt5_OPTIONAL_COMPONENTS ${_Qt5_COMPONENT_} idx)\r
-  IF(${idx} GREATER -1)\r
-   SET(Salome${_Qt5_COMPONENT}_FIND_QUIETLY TRUE)\r
-  ENDIF()\r
-  SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(${_Qt5_COMPONENT} ${_Qt5_COMPONENT}_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)\r
-  LIST(APPEND QT_INCLUDES    ${${_Qt5_COMPONENT}_INCLUDE_DIRS})\r
-  LIST(APPEND QT_DEFINITIONS ${${_Qt5_COMPONENT}_DEFINITIONS})\r
-  LIST(APPEND QT_LIBRARIES   ${${_Qt5_COMPONENT}_LIBRARIES})\r
-ENDFOREACH()\r
-\r
-FIND_PACKAGE(Qt5LinguistTools)\r
-GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)\r
-MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)\r
-\r
-GET_FILENAME_COMPONENT(QT_BINARY_DIR ${QT_LRELEASE_EXECUTABLE} DIRECTORY)\r
-MARK_AS_ADVANCED(QT_BINARY_DIR)\r
-\r
-# This is only needed to correctly detect Qt help generator tool, to workaround an error \r
-# coming from ParaView detection procedure\r
-FIND_PROGRAM(QT_HELP_GENERATOR\r
-    qhelpgenerator\r
-    PATHS "${QT_BINARY_DIR}"\r
-    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH\r
-    DOC "qhelpgenerator used to compile Qt help project files")\r
-MARK_AS_ADVANCED(QT_HELP_GENERATOR)\r
-\r
-IF(Qt5Core_FOUND) \r
-  SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)\r
-  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LINGUIST_PATH})\r
-  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Qt5Core_LIBRARIES})\r
-  GET_FILENAME_COMPONENT(Qt5_DIR ${Qt5Core_DIR} PATH)\r
-  FILE(TO_NATIVE_PATH "${Qt5_DIR}/Qt5" Qt5_DIR)\r
-  SET(SalomeQt5_COMPONENTS ${Qt5_FIND_COMPONENTS})\r
-  MESSAGE(STATUS "Qt version is ${QT_VERSION}")\r
-ENDIF()\r
+# Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+# Author: Adrien Bruneton
+#
+
+# Qt5 detection for Salome
+#
+#  !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+# Qt5_FIND_COMPONENTS variable is set here to prevent ParaView to reset list of Qt5 modules,
+# just to avoid extra dependencies
+
+SET(QT_INCLUDES)
+SET(QT_DEFINITIONS)
+SET(QT_LIBRARIES)
+# Find Qt5Core to get Qt version
+SET(Qt5_FIND_COMPONENTS QtCore)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+IF(Qt5Core_FOUND)
+  LIST(APPEND QT_INCLUDES    ${Qt5Core_INCLUDE_DIRS})
+  LIST(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS})
+  LIST(APPEND QT_LIBRARIES   ${Qt5Core_LIBRARIES})
+  SET(QT_VERSION "${Qt5Core_VERSION}")
+ENDIF()
+
+SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools)
+
+IF ("${QT_VERSION}" VERSION_LESS "5.6.0")
+  LIST(APPEND Qt5_FIND_COMPONENTS WebKit WebKitWidgets)
+ELSE()
+  LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngine WebEngineWidgets)
+ENDIF()
+
+IF(NOT WIN32)
+  LIST(APPEND Qt5_FIND_COMPONENTS X11Extras)
+ENDIF()
+
+FOREACH(_Qt5_COMPONENT_ ${Qt5_FIND_COMPONENTS} ${Qt5_OPTIONAL_COMPONENTS})
+  SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT_})
+  LIST(FIND Qt5_OPTIONAL_COMPONENTS ${_Qt5_COMPONENT_} idx)
+  IF(${idx} GREATER -1)
+   SET(Salome${_Qt5_COMPONENT}_FIND_QUIETLY TRUE)
+  ENDIF()
+  SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(${_Qt5_COMPONENT} ${_Qt5_COMPONENT}_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+  LIST(APPEND QT_INCLUDES    ${${_Qt5_COMPONENT}_INCLUDE_DIRS})
+  LIST(APPEND QT_DEFINITIONS ${${_Qt5_COMPONENT}_DEFINITIONS})
+  LIST(APPEND QT_LIBRARIES   ${${_Qt5_COMPONENT}_LIBRARIES})
+ENDFOREACH()
+
+FIND_PACKAGE(Qt5LinguistTools)
+GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)
+MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)
+
+GET_FILENAME_COMPONENT(QT_BINARY_DIR ${QT_LRELEASE_EXECUTABLE} DIRECTORY)
+MARK_AS_ADVANCED(QT_BINARY_DIR)
+
+# This is only needed to correctly detect Qt help generator tool, to workaround an error 
+# coming from ParaView detection procedure
+FIND_PROGRAM(QT_HELP_GENERATOR
+    qhelpgenerator
+    PATHS "${QT_BINARY_DIR}"
+    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
+    DOC "qhelpgenerator used to compile Qt help project files")
+MARK_AS_ADVANCED(QT_HELP_GENERATOR)
+
+IF(Qt5Core_FOUND) 
+  SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LINGUIST_PATH})
+  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Qt5Core_LIBRARIES})
+  GET_FILENAME_COMPONENT(Qt5_DIR ${Qt5Core_DIR} PATH)
+  FILE(TO_NATIVE_PATH "${Qt5_DIR}/Qt5" Qt5_DIR)
+  SET(SalomeQt5_COMPONENTS ${Qt5_FIND_COMPONENTS})
+  MESSAGE(STATUS "Qt version is ${QT_VERSION}")
+ENDIF()
index 6e32fc802eca6a884bab53d9809150bdf3957f23..4a22628cf384a63fbf190e3c0165db30414b8471 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
 # - Try to  find SolveSpace
 # Once done this will define
 #
@@ -5,10 +24,6 @@
 #  SOLVESPACE_INCLUDE_DIRS - the SolveSpace include directory
 #  SOLVESPACE_LIBRARIES - Link these to use SolveSpace
 
-#=============================================================================
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#=============================================================================
-
 IF(NOT SOLVESPACE_FIND_QUIETLY)
   MESSAGE(STATUS "Try to find SolveSpace at $ENV{SOLVESPACE_ROOT_DIR}...")
 ENDIF()
index cf0242aa165e2f57940e567ce1b6fbe5db7af2e8..6035307c0f744967638178ff7d2ceab9ab1c7871 100644 (file)
@@ -5,10 +5,7 @@
 #   SPHINX_PYTHONPATH - path to the Sphinx Python modules
 #
 ###########################################################################
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 82e2a4655c541787d1aa355af18fbb32024524ab..703a3296b0869acd439c7fa1267293a4f9fefcdf 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
 # - Try to  find TInspector
 # Once done this will define
 #
@@ -5,10 +24,6 @@
 #  TINSPECTOR_INCLUDE_DIRS - the tool inspector include directory
 #  TINSPECTOR_LIBRARIES - Link these to use TInspector
 
-#=============================================================================
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-#=============================================================================
-
 SET(TINSPECTOR_ROOT_DIR $ENV{TINSPECTOR_ROOT_DIR} CACHE PATH "Path to the TInspector directory")
 IF(EXISTS ${TINSPECTOR_ROOT_DIR})
   SET(TINSPECTOR_INCLUDE_DIR "${TINSPECTOR_ROOT_DIR}/inc")
index fa90460de2d822731b029e3e90198b771e9dbd37..27a464c507330d12322bbbf8a5cee52585ce3425 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # /*   C++ comment style not allowed   */
 
index c6f311bac7a047af8f878a221d38850a15b2bb2a..9feb6e96e558c025dc7eb0b4d81fe61ae8826012 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 find_package(SWIG REQUIRED)
 include(${SWIG_USE_FILE})
index 4c2200c46e6cb867210907d67e2e240a6dc2f69a..5d08baa30f68152c8257233f76d275c647d5f758 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index eb63e6bf712e3f07414dd2a55be1bbe01492466c..30a59c0ff221c02695682903d804a780049bd4b0 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #
 # SHAPER unit test system
index 36d7da13f9a3b362e0ef4b1fa6a2c1648c9e125b..26808a4da92f0901ad582bf71b0663c4a10f9f3d 100644 (file)
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE\r
-#\r
-# This library is free software; you can redistribute it and/or\r
-# modify it under the terms of the GNU Lesser General Public\r
-# License as published by the Free Software Foundation; either\r
-# version 2.1 of the License, or (at your option) any later version.\r
-#\r
-# This library is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-# Lesser General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU Lesser General Public\r
-# License along with this library; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
-#\r
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
-#\r
-\r
-IF (QT_VERSION VERSION_LESS "5.0")\r
-  INCLUDE(${QT_USE_FILE})\r
-ENDIF()\r
-\r
-# This MACRO uses the following vars\r
-# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)\r
-#\r
-# tsfiles containing all ts files to be compiled.\r
-# installdir contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.\r
-MACRO(QT_INSTALL_TS_RESOURCES tsfiles installdir)\r
-  FOREACH(_input ${tsfiles})\r
-    GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)\r
-    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_name}.qm)\r
-    SET(_cmd_${_name} ${QT_LRELEASE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} -qm ${_output})\r
-    ADD_CUSTOM_TARGET(QT_INSTALL_TS_RESOURCES_${_name} ALL COMMAND ${_cmd_${_name}} DEPENDS ${_input})\r
-    INSTALL(FILES ${_output} DESTINATION ${installdir})\r
-  ENDFOREACH()\r
-ENDMACRO(QT_INSTALL_TS_RESOURCES)\r
-\r
-MACRO(QT_WRAP_MOC)\r
-IF (QT_VERSION VERSION_LESS "5.0")\r
-  QT4_WRAP_CPP(${ARGN})\r
-ELSE()\r
-  QT5_WRAP_CPP(${ARGN})  \r
-  # Workaround to avoid problem with bug in moc preprocessor:\r
-  # The problem is reproduced on Linux in case if native system Qt is installed\r
-  # and "-I/usr/include" parameter is presented in the moc command line before\r
-  # custom Qt includes. This bug takes place in Qt-5.6.0 and newer. To avoid this\r
-  # bug move "-I/usr/include" parameter in the "moc parameters" file to the end\r
-  # of the "include section".\r
-  IF (NOT WIN32)\r
-    FOREACH(IT ${ARGN})\r
-      GET_FILENAME_COMPONENT(IT ${IT} ABSOLUTE)\r
-      GET_FILENAME_COMPONENT(PFILE ${IT} NAME_WE)\r
-      SET(OUTFILE ${CMAKE_CURRENT_BINARY_DIR}/moc_${PFILE}.cpp_parameters)\r
-      IF(EXISTS ${OUTFILE})      \r
-        SET(NEW_CONTENT)\r
-       SET(IS_INCLUDE_SECTION TRUE)\r
-       SET(HAS_SYSTEM_INC FALSE)\r
-        FILE(READ ${OUTFILE} CONTENT)\r
-       STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")\r
-       list(REMOVE_DUPLICATES CONTENT)\r
-        FOREACH(S ${CONTENT})\r
-          IF("${S}" MATCHES "^-I")\r
-           IF("${S}" STREQUAL "-I/usr/include")\r
-             SET(HAS_SYSTEM_INC TRUE)\r
-           ELSE()\r
-             SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")\r
-           ENDIF()\r
-         ELSE()\r
-           SET(IS_INCLUDE_SECTION FALSE)\r
-         ENDIF()\r
-         IF(NOT IS_INCLUDE_SECTION)\r
-           IF(HAS_SYSTEM_INC)\r
-             SET(NEW_CONTENT ${NEW_CONTENT} "-I/usr/include\n")\r
-             SET(HAS_SYSTEM_INC FALSE)\r
-           ENDIF()\r
-           SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")\r
-         ENDIF()\r
-        ENDFOREACH()\r
-        FILE(WRITE ${OUTFILE} ${NEW_CONTENT})  \r
-      ENDIF()\r
-    ENDFOREACH()\r
-  ENDIF()\r
-ENDIF()\r
-ENDMACRO(QT_WRAP_MOC)\r
-\r
-MACRO(QT_WRAP_UIC)\r
-IF (QT_VERSION VERSION_LESS "5.0")\r
-  QT4_WRAP_UI(${ARGN})\r
-ELSE()\r
-  QT5_WRAP_UI(${ARGN})\r
-ENDIF()\r
-ENDMACRO(QT_WRAP_UIC)\r
-\r
-MACRO(QT_ADD_RESOURCES)\r
-IF (QT_VERSION VERSION_LESS "5.0")\r
-  QT4_ADD_RESOURCES(${ARGN})\r
-ELSE()\r
-  QT5_ADD_RESOURCES(${ARGN})\r
-ENDIF()\r
-ENDMACRO(QT_ADD_RESOURCES)\r
+# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+
+IF (QT_VERSION VERSION_LESS "5.0")
+  INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# This MACRO uses the following vars
+# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)
+#
+# tsfiles containing all ts files to be compiled.
+# installdir contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.
+MACRO(QT_INSTALL_TS_RESOURCES tsfiles installdir)
+  FOREACH(_input ${tsfiles})
+    GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
+    SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_name}.qm)
+    SET(_cmd_${_name} ${QT_LRELEASE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} -qm ${_output})
+    ADD_CUSTOM_TARGET(QT_INSTALL_TS_RESOURCES_${_name} ALL COMMAND ${_cmd_${_name}} DEPENDS ${_input})
+    INSTALL(FILES ${_output} DESTINATION ${installdir})
+  ENDFOREACH()
+ENDMACRO(QT_INSTALL_TS_RESOURCES)
+
+MACRO(QT_WRAP_MOC)
+IF (QT_VERSION VERSION_LESS "5.0")
+  QT4_WRAP_CPP(${ARGN})
+ELSE()
+  QT5_WRAP_CPP(${ARGN})  
+  # Workaround to avoid problem with bug in moc preprocessor:
+  # The problem is reproduced on Linux in case if native system Qt is installed
+  # and "-I/usr/include" parameter is presented in the moc command line before
+  # custom Qt includes. This bug takes place in Qt-5.6.0 and newer. To avoid this
+  # bug move "-I/usr/include" parameter in the "moc parameters" file to the end
+  # of the "include section".
+  IF (NOT WIN32)
+    FOREACH(IT ${ARGN})
+      GET_FILENAME_COMPONENT(IT ${IT} ABSOLUTE)
+      GET_FILENAME_COMPONENT(PFILE ${IT} NAME_WE)
+      SET(OUTFILE ${CMAKE_CURRENT_BINARY_DIR}/moc_${PFILE}.cpp_parameters)
+      IF(EXISTS ${OUTFILE})      
+        SET(NEW_CONTENT)
+       SET(IS_INCLUDE_SECTION TRUE)
+       SET(HAS_SYSTEM_INC FALSE)
+        FILE(READ ${OUTFILE} CONTENT)
+       STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")
+       list(REMOVE_DUPLICATES CONTENT)
+        FOREACH(S ${CONTENT})
+          IF("${S}" MATCHES "^-I")
+           IF("${S}" STREQUAL "-I/usr/include")
+             SET(HAS_SYSTEM_INC TRUE)
+           ELSE()
+             SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")
+           ENDIF()
+         ELSE()
+           SET(IS_INCLUDE_SECTION FALSE)
+         ENDIF()
+         IF(NOT IS_INCLUDE_SECTION)
+           IF(HAS_SYSTEM_INC)
+             SET(NEW_CONTENT ${NEW_CONTENT} "-I/usr/include\n")
+             SET(HAS_SYSTEM_INC FALSE)
+           ENDIF()
+           SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")
+         ENDIF()
+        ENDFOREACH()
+        FILE(WRITE ${OUTFILE} ${NEW_CONTENT})  
+      ENDIF()
+    ENDFOREACH()
+  ENDIF()
+ENDIF()
+ENDMACRO(QT_WRAP_MOC)
+
+MACRO(QT_WRAP_UIC)
+IF (QT_VERSION VERSION_LESS "5.0")
+  QT4_WRAP_UI(${ARGN})
+ELSE()
+  QT5_WRAP_UI(${ARGN})
+ENDIF()
+ENDMACRO(QT_WRAP_UIC)
+
+MACRO(QT_ADD_RESOURCES)
+IF (QT_VERSION VERSION_LESS "5.0")
+  QT4_ADD_RESOURCES(${ARGN})
+ELSE()
+  QT5_ADD_RESOURCES(${ARGN})
+ENDIF()
+ENDMACRO(QT_ADD_RESOURCES)
index c47a308953137b418ed297b6070ac9bbbc6e90f8..a71c3ea69fb61c1de429afc47e50412b344fe06f 100644 (file)
@@ -1,4 +1,21 @@
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
 INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
index 87fd0a73818e6937a38fd9a4d637d8cb2d99857f..112c31420d3982f8a6367a1e5382864283baaf91 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
 
@@ -101,6 +100,8 @@ IF(${HAVE_SALOME})
     SET(SHAPER_INSTALL_GUI_DOC share/doc/salome/gui/SHAPER CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_TUI_DOC share/doc/salome/tui/SHAPER CACHE INTERNAL "" FORCE)
     # without SALOME there is another kind of documentation, separated one
+
+    SALOME_INSTALL_SCRIPTS("shaper_test.py" ${SHAPER_INSTALL_PYTHON_FILES})
 ELSE(${HAVE_SALOME})
     SET(SHAPER_INSTALL_ADDONS addons CACHE INTERNAL "" FORCE)
     SET(SHAPER_INSTALL_BIN bin CACHE INTERNAL "" FORCE)
@@ -118,6 +119,7 @@ SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE TRUE)
 
 ADD_SUBDIRECTORY (src/Config)
 ADD_SUBDIRECTORY (src/Events)
+ADD_SUBDIRECTORY (src/Selector)
 ADD_SUBDIRECTORY (src/Model)
 ADD_SUBDIRECTORY (src/XAO)
 ADD_SUBDIRECTORY (src/GeomAPI)
index 477303a4779b06f097143c9a6b7a08ecc3959b55..2b07d6628463c96c940c731d36df951b8bd46b1c 100644 (file)
@@ -1,24 +1,23 @@
 # coding: utf-8
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 
 import os, os.path, sys, re, argparse
index d84d2e2fc0ab31b3808d8efdfd2fd5337c9113fe..12d78cc58e82c384bbcdb811405dcc3b2f7381ae 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ADD_SUBDIRECTORY(gui)
 ADD_SUBDIRECTORY(tui)
index 2a40cf7121e179444fc9c45d19c3f220bad23eb9..ece23f47e3ce05cc6229d173886f91ae625426a9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(input ${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in)
 
index f1163d65a6c50a4f440eab12f9fe2b15ee3bce82..2a8d9015c1f987455b3d7d03ef0021360d50f5c9 100644 (file)
@@ -241,7 +241,7 @@ Each feature, result, construction, group, field, parameter can be renamed using
 .. centered::\r
    Construction pop-up menu\r
 \r
-The order of features can be changed using *Move to the end* pop-up menu command. The selected feature will be moved to the end of feature list.\r
+The order of features can be changed using *Move to the end* pop-up menu command. It works only for Group features. The selected group will be moved to the end of features list.\r
 \r
 Folders can be used to arrange long Tree View for features.\r
 \r
@@ -411,6 +411,7 @@ Parameters
 Model parametrization can be done using parameters.\r
 \r
 A parameter can be created in the active partset or part by:\r
+\r
 - :ref:`parameter`;\r
 - :ref:`parameters`;\r
 - :ref:`parameter_expression`.\r
@@ -600,3 +601,88 @@ Viewer tab defines selection in OCC 3D viewer properties.
 \r
   - **Vertex** defines selection  sensitivity for vertices; \r
   - **Edge**  defines selection  sensitivity for edges.  \r
+\r
+\r
+.. _toolbars_management:\r
+\r
+Toolbars management\r
+-------------------\r
+\r
+.. _toolbars_dialog:\r
+\r
+**Toolbars** dialog box\r
+^^^^^^^^^^^^^^^^^^^^^^^\r
+To edit the current tool bars structure select in the Main Menu *Edit - > Edit toolbars* item. \r
+The following dialog box with existing toolbars appears:\r
+\r
+.. image:: images/Toolbars.png\r
+   :align: center\r
+\r
+.. centered::\r
+   **Toolbars** dialog box\r
+\r
+**Input fields**:\r
+\r
+- **Toolbars** window contains list of toolbars names. Number of commands in each tool bar is shown in brackets.\r
+- **Add** button creates a new toolbar. Click on **Add** button opens :ref:`create_toolbar`;\r
+- **Edit**  button  calls :ref:`edit_toolbar` for currently selected tool bar;\r
+- **Delete** button removes currently selected tool bar. Click on **Delete** button opens warning dialog box. After confirmation by click **Yes** button the selected toolbar is deleted. Click **No** button cancels removing of the selected toolbar;\r
+- **Reset** button restores modified tool bars structure to default state;\r
+- **OK** button closes the dialog box, stores result of tool bars edition and updates Shaper tool bars;\r
+- **Cancel** button closes the dialog box without modification of tool bars.\r
+\r
+.. image:: images/delete_toolbar.png\r
+   :align: center\r
+\r
+.. centered::\r
+    Warning dialog box\r
+\r
+   \r
+.. _create_toolbar:\r
+\r
+**Create toolbar** dialog box\r
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
+\r
+**Input fields** of **Create toolbar** dialog box:\r
+\r
+.. image:: images/create_toolbar.png\r
+   :align: center\r
+\r
+.. centered::\r
+   **Create toolbar** dialog box\r
+\r
+- **Name of a new toolbar** defines name of the new tool bar. The name of tool bar has to be unique. If user defines a not unique name then a warning appears and a new tooolbar with not unique name is not created;\r
+- **Ok** button closes the dialog box and add a new tool bar of the module into  **Toolbars** window;\r
+- **Cancel** button closes the dialog box without addition of a new tool bar.\r
+\r
+.. image:: images/name_toolbar.png\r
+   :align: center\r
+\r
+.. centered::\r
+   **Warning** dialog box\r
+   \r
+\r
+.. _edit_toolbar:\r
+\r
+**Edit toolbar** dialog box\r
+^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
+\r
+**Input fields** of **Edit toolbar** dialog box:\r
+\r
+.. image:: images/EditToolbar.png\r
+   :align: center\r
+\r
+.. centered::\r
+   **Edit toolbar** dialog box\r
+\r
+- **Toolbar name** non-editable field displays  name of modified tool bar;\r
+- **Out of toolbars** window contains list of commands which are not included into any tool bar and separator definition "------";\r
+- **In the toolbar** window contains list of commands which are defined in the current tool bar. Items in this window are listed according to order of commands in the toolbar; \r
+- **Right arrow** button transfers currently selected item from  **Out of toolbars** window to **In the toolbar** window and puts new item before the selected item in **In the toolbar** window.\r
+    If there is no selected item in **In the toolbar**  window then new item will be added at the end of items list. In order to clear current selection it is necessary to click in empty space of the window.\r
+- **Left arrow** button transfers currently selected item from **In the toolbar** window into **Out of toolbars** window;\r
+- **Up** and **Down** buttons  change position of selected command in **In the toolbar** window;\r
+- **Ok** button closes the dialog box, stores result of edition;\r
+- **Cancel**  button closes the dialog box without modification of tool bar content.\r
+\r
+\r
index 155db3582d59ce226b4f6c9fa3d67bc9ebf144c5..1f7f74d51ba0c6ab2eeab277e877f8a8d128ee74 100755 (executable)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ###
 ## The script collects information about help documents in plugins
index 8d222a1d755a8e16d3a5aa5aab1f008d7d65e9c6..b02b59b3f3e5686d86b1aa25dad80846082246ff 100644 (file)
@@ -51,7 +51,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = u'SHAPER'
-copyright = u'2014-2017  CEA/DEN, EDF R&D'
+copyright = u'2014-2019  CEA/DEN, EDF R&D'
 
 # Copyright is shown via custom footer
 html_show_copyright = False
@@ -61,9 +61,9 @@ html_show_copyright = False
 # built documents.
 #
 # The short X.Y version.
-version = u'3.0.0'
+version = u'9.2.0'
 # The full version, including alpha/beta/rc tags.
-release = u'3.0.0'
+release = u'9.2.0'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/doc/gui/images/EditToolbar.png b/doc/gui/images/EditToolbar.png
new file mode 100644 (file)
index 0000000..72a45c6
Binary files /dev/null and b/doc/gui/images/EditToolbar.png differ
diff --git a/doc/gui/images/Toolbars.png b/doc/gui/images/Toolbars.png
new file mode 100644 (file)
index 0000000..032e6bc
Binary files /dev/null and b/doc/gui/images/Toolbars.png differ
diff --git a/doc/gui/images/create_toolbar.png b/doc/gui/images/create_toolbar.png
new file mode 100644 (file)
index 0000000..a41c811
Binary files /dev/null and b/doc/gui/images/create_toolbar.png differ
diff --git a/doc/gui/images/delete_toolbar.png b/doc/gui/images/delete_toolbar.png
new file mode 100644 (file)
index 0000000..316ed85
Binary files /dev/null and b/doc/gui/images/delete_toolbar.png differ
diff --git a/doc/gui/images/name_toolbar.png b/doc/gui/images/name_toolbar.png
new file mode 100644 (file)
index 0000000..a086945
Binary files /dev/null and b/doc/gui/images/name_toolbar.png differ
index 94d467b51c136add1274f74dabca382d70ede46a..2a2d42ae8a93d488abe417fee33b76e55d762089 100644 (file)
@@ -22,9 +22,7 @@ include "searchbox.html"
 
 {%- block footer %}
  <div class="footer">
-         &copy; Copyright 2007-2017, CEA/DEN, EDF R&amp;D, OPEN CASCADE
-         <br>
-         &copy; Copyright 2003-2007, OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS.
+         Copyright &copy; 2014-2019  CEA/DEN, EDF R&amp;D
  </div>
  {{ super() }}
 {%- endblock %}
index 64e0c404e5fddd1c82b72124d4280db17e1332b0..0af565892d7acaaefa532884660a53a9befeeaf7 100644 (file)
@@ -64,9 +64,9 @@ Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Polyline_1_1")])
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 
 # Step5. Extrusion.
-Wire = model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r")
-To = model.selection("FACE", "Revolution_1_1/Generated_Face_6")
-From = model.selection("FACE", "Revolution_1_1/Generated_Face_1")
+Wire = model.selection("WIRE", "Sketch_1/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_1r_wire")
+To = model.selection("FACE", "Revolution_1_1/Generated_Face&Face_1_1/Edge_2")
+From = model.selection("FACE", "Revolution_1_1/Generated_Face&Face_1_1/Edge_7")
 
 Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "PartSet/OZ"), To, 0, From, 0)
 
@@ -74,7 +74,7 @@ Extrusion_1 = model.addExtrusion(Part_1_doc, [Wire], model.selection("EDGE", "Pa
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("SOLID", "Extrusion_1_1")])
 
 # Step7. Fillet.
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Common_1_1/Modified_Face_11")], 10)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Face_1_1/Edge_3][Common_1_1/Modified_Face&Face_1_1/Edge_4]")], 10)
 
 # Step8. Box.
 Box_1 = model.addBox(Part_1_doc, 20, 120, 20)
index 2fe79fbd025c700f393dd95351a05df7229779ea..ef4995e03dbb409042e19ec069628fab0d106513 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 IF (WIN32)
   FIND_PROGRAM(DOXYGEN_EXECUTABLE Doxygen)
diff --git a/env.sh b/env.sh
index f3aa50d1ce92e8f891baa1726cb61734d2fc0120..f1c6d47d393be85ec7c62cf4b13f3168373f2721 100644 (file)
--- a/env.sh
+++ b/env.sh
@@ -1,7 +1,6 @@
 #!/bin/bash -x
 
-export SALOME_DIR=/dn46/SALOME/series9x/current-2018-09-28
-
+export SALOME_DIR=/dn46/SALOME/stable/V9_2_0
 
 # Path to sources
 export SOURCES_DIR=$(pwd)
old mode 100644 (file)
new mode 100755 (executable)
index ff376c9..311ff61
@@ -4,33 +4,30 @@ source env.sh
 
 cd ${BUILD_DIR}
 
-lcov --capture --directory /data/mpv/build --no-external --base-directory=/data/mpv/sources --output-file coverage.info.noext -q
+lcov --capture --directory ${BUILD_DIR} --no-external --base-directory ${SOURCES_DIR} --output-file coverage.info.noext -q
 
 # make a working copy of report
 cp -f coverage.info.noext covfile
 # remove all reports of GUI and external parts (for all the next kinds of reports)
-for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' 'Primitives*' '*Widget*' '*Splitter*'; do
+# RefAttrList is unused type of attribute for now
+for MASK in '*wrap*' 'moc_*' 'XAO_*' 'SketcherPrs_*' 'GeomAlgoImpl_*' 'ModuleBase_*' '*Widget*' '*Splitter*' '*RefAttrList*'; do
 lcov -r covfile ${MASK} --output-file covfile_res -q
 mv -f covfile_res covfile
 done
 
+ALL='BuildPlugin CollectionPlugin ConstructionPlugin ExchangePlugin FeaturesPlugin GDMLPlugin PrimitivesPlugin InitializationPlugin ParametersPlugin PartSetPlugin SketchPlugin'
+ALL+=' GDMLAPI PrimitivesAPI BuilderAPI CollectionAPI ConnectorAPI ConstructionAPI ModelAPI ExchangeAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI SketchAPI BuildAPI GeomDataAPI GeomAPI GeomAlgoAPI'
+ALL+=' Config Events GeomValidators Model_ ModelGeomAlgo Selector SketchSolver GeomData'
 
 # prepare API report
 cp -f covfile covAPI
-# remove plugins
-for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do
-lcov -r covAPI *${MASK}Plugin* --output-file covAPI_res -q
-mv -f covAPI_res covAPI
-done
-# remove low level API
-for MASK in 'GDML' 'Geom' 'GeomAlgo' 'GeomData' 'Model'; do
-lcov -r covAPI *${MASK}API* --output-file covAPI_res -q
-mv -f covAPI_res covAPI
-done
-# remove others
-for MASK in 'Config' 'Events' 'GeomData' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver'; do
-lcov -r covAPI *${MASK}* --output-file covAPI_res -q
-mv -f covAPI_res covAPI
+# remove all plugins data except the needed
+NEED='BuildAPI CollectionAPI ConnectorAPI ConstructionAPI ExchangeAPI FeaturesAPI ModelHighAPI ParametersAPI PartSetAPI PrimitivesAPI SketchAPI'
+for MASK in $ALL; do
+  if ! [[ " $NEED " =~ " $MASK " ]]; then
+    lcov -r covAPI *${MASK}* --output-file covAPI_res -q
+    mv -f covAPI_res covAPI
+  fi
 done
 rm -rf lcov_htmlAPI
 genhtml covAPI --output-directory lcov_htmlAPI -q
@@ -38,42 +35,41 @@ genhtml covAPI --output-directory lcov_htmlAPI -q
 
 # prepare Direct report
 cp -f covfile covDirect
-# remove plugins
-for MASK in 'Build' 'Collection' 'Construction' 'Exchange' 'Features' 'GDML' 'Initialization' 'Parameters' 'PartSet' 'Sketch'; do
-str=$startmask$MASK$endmask
-lcov -r covDirect *${MASK}Plugin* --output-file covDirect_res -q
-mv -f covDirect_res covDirect
+# remove all plugins data except the needed
+NEED='GeomAlgoAPI GeomAPI'
+for MASK in $ALL; do
+  if ! [[ " $NEED " =~ " $MASK " ]]; then
+    lcov -r covDirect *${MASK}* --output-file covDirect_res -q
+    mv -f covDirect_res covDirect
+  fi
 done
-# remove low level API
-for MASK in 'GDML' 'Builder' 'Collection' 'Connector' 'Construction' 'Model' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build' 'GeomData'; do
-lcov -r covDirect *${MASK}API* --output-file covDirect_res -q
+# exclude GeomAPI_AISObject as GUI-related object
+lcov -r covDirect GeomAPI_AISObject* --output-file covDirect_res -q
 mv -f covDirect_res covDirect
-done
-# remove others
-for MASK in 'Config' 'Events' 'GeomValidators' 'Model_' 'ModelGeomAlgo' 'SketchSolver' 'GeomData'; do
-lcov -r covDirect *${MASK}* --output-file covDirect_res -q
+# exclude coverage of algorithms related to GDML plugin
+lcov -r covDirect GeomAlgoAPI_ConeSegment* --output-file covDirect_res -q
+mv -f covDirect_res covDirect
+lcov -r covDirect GeomAlgoAPI_Ellipsoid* --output-file covDirect_res -q
 mv -f covDirect_res covDirect
-done
 rm -rf lcov_htmlDirect
 genhtml covDirect --output-directory lcov_htmlDirect -q
 
 
 # prepare Else report
 cp -f covfile covElse
-# remove plugins
-for MASK in 'GDML'; do
-str=$startmask$MASK$endmask
-lcov -r covElse *${MASK}Plugin* --output-file covElse_res -q
-mv -f covElse_res covElse
+# remove all plugins data except the needed
+NEED='BuildPlugin CollectionPlugin Config ConstructionPlugin Events ExchangePlugin FeaturesPlugin GeomData GeomDataAPI GeomValidators InitializationPlugin Model_ ModelAPI ModelGeomAlgo ParametersPlugin PartSetPlugin PrimitivesPlugin Selector SketchPlugin SketchSolver'
+for MASK in $ALL; do
+  if ! [[ " $NEED " =~ " $MASK " ]]; then
+    lcov -r covElse *${MASK}* --output-file covElse_res -q
+    mv -f covElse_res covElse
+  fi
 done
-# remove low level API
-for MASK in 'Geom' 'GeomAlgo' 'GDML' 'Builder' 'Collection' 'Connector' 'Construction' 'Exchange' 'Features' 'ModelHigh' 'Parameters' 'PartSet' 'Sketch' 'Build'; do
-lcov -r covElse *${MASK}API* --output-file covElse_res -q
+# remove SketchPlugin's Ellipse feature (unsupported yet)
+lcov -r covElse SketchPlugin*Ellipse* --output-file covElse_res -q
 mv -f covElse_res covElse
-done
 rm -rf lcov_htmlElse
 genhtml covElse --output-directory lcov_htmlElse -q
 
-
 # go back
 cd ${SOURCES_DIR}
index ca879e5a8c44bf4462220637dc1b839fa484b45f..1b8163eab984bfb0c92f75244a6e064675b584e4 100755 (executable)
@@ -1,24 +1,23 @@
 #!/bin/env python
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import sys, pickle
 from killSalome import *
diff --git a/shaper_test.py b/shaper_test.py
new file mode 100644 (file)
index 0000000..dcbb2a1
--- /dev/null
@@ -0,0 +1,83 @@
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+
+import unittest
+
+class TestShaper(unittest.TestCase):
+
+    def setUp(self):
+        import salome
+        salome.salome_init()
+
+    def test_shaper(self):
+        """Quick test for Shaper module"""
+
+        print()
+        print('Testing Shaper module')
+
+        from SketchAPI import SketchAPI_Point
+
+        from salome.shaper import model
+
+        model.begin()
+        print('... Create Part document')
+        partSet = model.moduleDocument()
+        Part_1 = model.addPart(partSet)
+        Part_1_doc = Part_1.document()
+        self.assertIsNotNone(Part_1_doc)
+
+        print('... Create Sketch')
+        Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+        self.assertIsNotNone(Sketch_1)
+        SketchLine_1 = Sketch_1.addLine(10, 10, -10, 10)
+        SketchLine_2 = Sketch_1.addLine(-10, 10, -10, 30)
+        SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+        SketchArc_1 = Sketch_1.addArc(10, 30, 10, 10, -10, 30, False)
+        SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.startPoint())
+        SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.endPoint())
+        SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_1.result())
+        SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_2.result(), SketchArc_1.results()[1])
+        SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_2.result())
+        SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 20)
+        SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+        SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+        SketchPoint_1 = SketchProjection_1.createdFeature()
+        SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_1.endPoint(), 10)
+        SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_1.endPoint(), SketchAPI_Point(SketchPoint_1).coordinates(), 10)
+        model.do()
+        self.assertEqual(len(Sketch_1.results()), 1)
+
+        print('... Create Extrusion')
+        Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+        model.do()
+        self.assertIsNotNone(Extrusion_1)
+        self.assertEqual(len(Extrusion_1.results()), 1)
+        self.assertEqual(Extrusion_1.result().shapeType(), 'SOLID')
+
+        print('... Create Partition')
+        Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "PartSet/YOZ")])
+        model.end()
+        self.assertIsNotNone(Partition_1)
+        self.assertEqual(len(Partition_1.results()), 1)
+        self.assertEqual(Partition_1.result().shapeType(), 'COMPSOLID')
+        self.assertEqual(Partition_1.result().numberOfSubs(), 2)
+
+if __name__ == '__main__':
+    unittest.main()
index a273e1dce7d0c224233f635a0a2e4688570aa69f..e9abb358789af37392da7160436ba93cd5bce1d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BUILDAPI_H
index dc38f1904192e267f6b0f7059123fb2cb37dd518..50fb39f331deebb954922cf9724c5a52ff342978 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* FeaturesAPI.i */
index fbe84fc2569837a58b5d1926bbfa257d464a2821..85fa6d182c6e328577d982d06eeb5e4b75dc2172 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_CompSolid.h"
index c3652e5494e281fb042921430a0982678b6b4513..e48099d2b50929228dfaf3d68bbe2df78fd7e731 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_CompSolid_H_
index 5f036566aa3f05c24a00d96387176d1a8a2847ad..ca32ec2fe28b32fafbf637cca188d3f8824bc00f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Compound.h"
index 80daee6f86d910079240f5aca8bebc7d5c2d8d54..1060058f1e24cb089339a3fbd61e97f996632371 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Compound_H_
index c5dbc1782e61a68bf8d35e15315db319c9394a0b..cd8052f300cdc27a8cc61ebd00c04399940eb743 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Edge.h"
index 569d35f87f243026cbb9e33341a13e27f5e38f45..d5c016399627118841046e3aa8833ce227acd36b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Edge_H_
index 419281b7aba9e268e37d44355860432322750b4a..6ae37bb3761cee3cc7e4b15917adff10dc22b404 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Face.h"
index 16ff7c28a6d8528ae9d7e72876a563f8ed35ce6e..42e269d4256c2498b5fe54fa3de1adeebefd70ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Face_H_
index 8951bd8d43ef2f03dbcebccf152d9443a73f864e..4708d11ebd047cbd79448b8ce731cfe5a7a33db2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Filling.h"
@@ -33,8 +32,10 @@ BuildAPI_Filling::BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theF
                                    const std::list<ModelHighAPI_Selection>& theBaseObjects)
   : ModelHighAPI_Interface(theFeature)
 {
-  if(initialize())
+  if (initialize()) {
+    setAdvancedOptions(false);
     setBase(theBaseObjects);
+  }
 }
 
 BuildAPI_Filling::BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theFeature,
@@ -48,7 +49,7 @@ BuildAPI_Filling::BuildAPI_Filling(const std::shared_ptr<ModelAPI_Feature>& theF
                                    const bool theApproximate)
   : ModelHighAPI_Interface(theFeature)
 {
-  if(initialize()) {
+  if (initialize()) {
     setOrientationMethod(theOrientCorrection);
     setMinDegree(theMinDegree);
     setMaxDegree(theMaxDegree);
@@ -133,9 +134,9 @@ void BuildAPI_Filling::setApproximation(const bool theApproximate)
   execIfBaseNotEmpty();
 }
 
-void BuildAPI_Filling::setAdvancedOptions()
+void BuildAPI_Filling::setAdvancedOptions(bool isEnabled)
 {
-  feature()->string(BuildPlugin_Filling::ADVANCED_OPTIONS_ID())->setValue("true");
+  feature()->string(BuildPlugin_Filling::ADVANCED_OPTIONS_ID())->setValue(isEnabled ? "true" : "");
 }
 
 void BuildAPI_Filling::dump(ModelHighAPI_Dumper& theDumper) const
index 8ccab1feedc18603db06367f702d1e4c830293d2..79e0ac14033ec8497b8aebd1ad367139b8810f40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Filling_H_
@@ -114,7 +113,7 @@ public:
 
 private:
   void execIfBaseNotEmpty();
-  void setAdvancedOptions();
+  void setAdvancedOptions(bool isEnabled = true);
 };
 
 /// Pointer on Face object.
index 6333fa0ae6e345bf6cd8a095541c6d5993d6c7ef..4c358cc4bdd8e4bb09e01db5c7b7327504695832 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Interpolation.h"
index e6b5b090b98ceb433dbc70b3f043eb25d9c1cea8..2bbf23aaf856fb070dfe044dc74b024a9b61881d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Interpolation_H_
index 784d8f91ece15311a129eaccea192b06b12f63f9..e44117784e39573e406ae3ca2fbdcad3179f84b3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Polyline.h"
index db4e3dc547bface03515fccca77c878c82a91b27..7ba8e95f45a64ad0887f93216eb7cfd488e027c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Polyline_H_
index 824392de357902dab9f49cef27ca96b0bc46ab4b..c8161c41488fd97c241d94037c3dbd60eeeb64a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Shell.h"
index 7e84d9155676159ccfb6d4ffa5d5db5dd47b0a66..9eb8b2981ca5c4aaf3d7873b4f0b74a9b6c2f2ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Shell_H_
index a2c7892a1b1c4e7d4a6cef00e24f147ad35775c9..5ab8d4ca4bd9201284eb69db8d6d24c7a9d8648b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Solid.h"
index 1ab00044bb0a8558cc340654a41b3cedfc9f46b2..c8d1d53622f0deca84834daa9503463ece341e6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Solid_H_
index ac2e793241b7df1faedb745fd701e0570d7f3e09..a0e032d5d2c8c6173cf6f02508e3ada3e3fcf464 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_SubShapes.h"
index 4ea7d96ef4f0aef0f599a7687247d5d35d807eed..1c7081c2f5ae9754a1fff2fb31372cb6bfb5faa9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_SubShapes_H_
index f041352aab966b0cad31ea02ebf7bb131f7f4a10..327a2d2905d2b856c9dd346db41f294612eb17e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Vertex.h"
index cac837ba4b57b1588e50c4767f08184e023ad01a..6a96640a488d964b798e75a09b581abe1f85bb23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Vertex_H_
index 474202824a097e944187a9e7fd9042982f16ba70..69c68be456a41276cedec0da4e09edd495713355 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildAPI_Wire.h"
index f30d829ed06b4fa1cc3b4a32c5bdc25295f996aa..4934943d7b3c8abab6fd0b8a6c370598e02938ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildAPI_Wire_H_
index 75cfeba295b27462c095c973d42fbad1aa395824..d4d6405d1c574e103414d30b16a3eed6ec577757 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_swig_H_
index af4f32b1d58f4673816f0dfc2411ceb8eae67b6d..8e5aab018f9499c23e0c21443e99e46a3f18a063 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 745be01b29d9d13aaf6e6d6a2dc6ef1217472b6a..d841511ddd194fad03631651b17bc1446221bb99 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_H_
index 0fdb399fa31098b109dc1c4aa34577bb503dfd9c..c45eeb23eb3f4e396f98154ea26d8d8775e27daf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_CompSolid.h"
@@ -33,25 +32,3 @@ void BuildPlugin_CompSolid::initAttributes()
 {
   data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
 }
-
-//=================================================================================================
-void BuildPlugin_CompSolid::execute()
-{
-  // all the needed checkings are in validator, so, here just make and store result
-  ListOfShape anOriginalShapes;
-  AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
-  for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
-    AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
-    GeomShapePtr aShape = aSelection->value();
-    if (!aShape.get())
-      aShape = aSelection->context()->shape();
-    anOriginalShapes.push_back(aShape);
-  }
-  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
-    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
-  GeomShapePtr aVolumeRes = anAlgo->shape();
-
-  // check and process result of volume maker
-  GeomShapePtr aResShape = getSingleSubshape(aVolumeRes);
-  storeResult(anOriginalShapes, aResShape, anAlgo);
-}
index e31865a13e8c55ba78c61e0a0198e8a1eba10dc5..bf6b9c5dc742e32a93db5bfc65bd8c36532d289e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_CompSolid_H_
@@ -56,9 +55,6 @@ public:
 
   /// Request for initialization of data model of the feature: adding all attributes.
   BUILDPLUGIN_EXPORT virtual void initAttributes();
-
-  /// Creates a new part document if needed.
-  BUILDPLUGIN_EXPORT virtual void execute();
 };
 
 #endif
index 69c8551bbbc6ee15bb9625feb7433c0858631ea6..7aa9a81641d78c6c47d0f58ae41f17c78968e6d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Compound.h"
@@ -70,24 +69,16 @@ void BuildPlugin_Compound::execute()
   // Build compound.
   GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(anOriginalShapes);
   // Copy shape.
-  GeomAlgoAPI_Copy aCopyAlgo(aCompound);
-  GeomShapePtr aCopyCompound = aCopyAlgo.shape();
+  GeomMakeShapePtr aCopyAlgo(new GeomAlgoAPI_Copy(aCompound));
+  GeomShapePtr aCopyCompound = aCopyAlgo->shape();
 
   int anIndexToRemove = 0;
   if (aCopyCompound) {
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = aCopyAlgo.mapOfSubShapes();
-
     ResultBodyPtr aResultBody = document()->createBody(data(), anIndexToRemove++);
-    aResultBody->store(aCopyCompound);
-    aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aCompound, GeomAPI_Shape::VERTEX,
-                                              1, "Modified_Vertex", *aMapOfShapes.get(),
-                                              true, false, true);
-    aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aCompound, GeomAPI_Shape::EDGE,
-                                              100000, "Modified_Edge", *aMapOfShapes.get(),
-                                              true, false, true);
-    aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aCompound, GeomAPI_Shape::FACE,
-                                              200000, "Modified_Face", *aMapOfShapes.get(),
-                                              true, false, true);
+    aResultBody->storeModified(anOriginalShapes, aCopyCompound, aCopyAlgo);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::VERTEX);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::EDGE);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::FACE);
     setResult(aResultBody);
   }
   removeResults(anIndexToRemove);
index 5a014314c34c2a254b985392678233e850234246..7bfce3327ba7e6c5a3572249a4a8d88edf0b47e7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Compound_H_
index 253de35b573f465e337c72eac1e9af642759c138..c7928d083dcad5eb5bb818763d8baaf65148a8f2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Edge.h"
@@ -24,6 +23,7 @@
 #include <ModelAPI_ResultBody.h>
 
 #include <GeomAlgoAPI_Copy.h>
+#include <GeomAlgoAPI_Tools.h>
 
 //=================================================================================================
 BuildPlugin_Edge::BuildPlugin_Edge()
@@ -76,35 +76,21 @@ void BuildPlugin_Edge::execute()
     }
 
     // Copy shape.
-    GeomAlgoAPI_Copy aCopyAlgo(aShape);
+    GeomMakeShapePtr aCopyAlgo(new GeomAlgoAPI_Copy(aShape));
 
-    // Check that algo is done.
-    if(!aCopyAlgo.isDone()) {
-      setError("Error: " + getKind() + " algorithm failed.");
-      return;
-    }
-
-    // Check if shape is not null.
-    if(!aCopyAlgo.shape().get() || aCopyAlgo.shape()->isNull()) {
-      setError("Error: Resulting shape is null.");
-      return;
-    }
-
-    // Check that resulting shape is valid.
-    if(!aCopyAlgo.isValid()) {
-      setError("Error: Resulting shape is not valid.");
+    std::string anError;
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCopyAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     // Store result.
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    aResultBody->storeModified(aShape, aCopyAlgo.shape());
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = aCopyAlgo.mapOfSubShapes();
-    int aModVertexTag = 1;
-    std::string aModVertexName = "Modified_Vertex";
-    aResultBody->loadAndOrientModifiedShapes(&aCopyAlgo, aShape, GeomAPI_Shape::VERTEX,
-                                             aModVertexTag, aModVertexName, *aSubShapes.get(),
-                                             true);
+
+    ListOfShape aBaseShapes;
+    aBaseShapes.push_back(aShape);
+    aResultBody->storeModified(aBaseShapes, aCopyAlgo->shape(), aCopyAlgo);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::VERTEX);
 
     setResult(aResultBody, aResultIndex);
     ++aResultIndex;
index f22df477d30357f3e39c4b6c351901e0b77e8ffd..e1f7594dcfa9c55cd939212196984054d51a9c4a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Edge_H_
index 391ea4bd908365dd7bfc51564660f58fe3686c1a..022865abdd3682773a3b4a0a1cee2e70858ea434 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Face.h"
@@ -28,6 +27,7 @@
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_ShapeExplorer.h>
 
+#include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 #include <GeomAlgoAPI_SketchBuilder.h>
 #include <GeomAlgoAPI_Copy.h>
@@ -60,6 +60,9 @@ void BuildPlugin_Face::execute()
   // Collect base shapes.
   ListOfShape anEdges;
   ListOfShape anOriginalFaces;
+  ListOfShape aContexts;
+  getOriginalShapesAndContexts(BASE_OBJECTS_ID(), anOriginalFaces, aContexts);
+  anOriginalFaces.clear();
   std::list< std::shared_ptr<GeomAPI_Dir> > aListOfNormals;
   for(int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
     AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
@@ -88,8 +91,10 @@ void BuildPlugin_Face::execute()
 
   // Build faces by edges.
   ListOfShape aFaces;
+  GeomMakeShapePtr aFaceBuilder;
   if (!anEdges.empty())
-    buildFacesByEdges(anEdges, aListOfNormals, aFaces);
+    buildFacesByEdges(anEdges, aListOfNormals, aFaces, aFaceBuilder);
+  int aNbFacesFromEdges = (int)aFaces.size();
 
   // Add faces selected by user.
   aFaces.insert(aFaces.end(), anOriginalFaces.begin(), anOriginalFaces.end());
@@ -97,22 +102,20 @@ void BuildPlugin_Face::execute()
   // Store result.
   int anIndex = 0;
   for(ListOfShape::const_iterator anIt = aFaces.cbegin(); anIt != aFaces.cend(); ++anIt) {
-    ResultBodyPtr aResultBody = document()->createBody(data(), anIndex);
-    GeomShapePtr aShape = *anIt;
-    GeomAlgoAPI_Copy aCopy(aShape);
-    aShape = aCopy.shape();
-    aResultBody->store(aShape);
-
-    // Store edges.
-    int anEdgeIndex = 1;
-    for(GeomAPI_ShapeExplorer anExp(aShape, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) {
-      GeomShapePtr anEdge = anExp.current();
-      aResultBody->generated(anEdge, "Edge_" + std::to_string((long long)anEdgeIndex), anEdgeIndex);
-      ++anEdgeIndex;
-    }
+    std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList);
+    if (anIndex < aNbFacesFromEdges)
+      aMakeShapeList->appendAlgo(aFaceBuilder);
 
-    setResult(aResultBody, anIndex);
-    ++anIndex;
+    GeomShapePtr aShape = *anIt;
+    GeomMakeShapePtr aCopy(new GeomAlgoAPI_Copy(aShape));
+    aMakeShapeList->appendAlgo(aCopy);
+
+    ListOfShape aBaseShapes;
+    if (anIndex < aNbFacesFromEdges)
+      aBaseShapes = anEdges;
+    else
+      aBaseShapes.push_back(aShape);
+    storeResult(aMakeShapeList, aBaseShapes, aContexts, aCopy->shape(), anIndex++);
   }
 
   removeResults(anIndex);
@@ -121,7 +124,8 @@ void BuildPlugin_Face::execute()
 void BuildPlugin_Face::buildFacesByEdges(
     const ListOfShape& theEdges,
     const std::list< std::shared_ptr<GeomAPI_Dir> >& theNormals,
-    ListOfShape& theFaces) const
+    ListOfShape& theFaces,
+    std::shared_ptr<GeomAlgoAPI_MakeShape>& theBuilderAlgo) const
 {
   // Get plane.
   std::shared_ptr<GeomAPI_Pln> aPln = GeomAlgoAPI_ShapeTools::findPlane(theEdges);
@@ -137,8 +141,10 @@ void BuildPlugin_Face::buildFacesByEdges(
   }
 
   // Get faces.
-  GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(),
-                                         aPln->direction(), theEdges, theFaces);
+  std::shared_ptr<GeomAlgoAPI_SketchBuilder> aSketchBuilder(
+      new GeomAlgoAPI_SketchBuilder(aPln, theEdges));
+  theFaces = aSketchBuilder->faces();
+  theBuilderAlgo = aSketchBuilder;
 
   // Get wires from faces.
   ListOfShape aWires;
index 633118eb7054da34dab7767efe72d3683bec9950..1545de1a9b936e0834c99ee303f70ded4edd14f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Face_H_
 #define BuildPlugin_Face_H_
 
 #include "BuildPlugin.h"
-
-#include <ModelAPI_Feature.h>
+#include "BuildPlugin_Shape.h"
 
 class GeomAPI_Dir;
 class GeomAPI_Shape;
+class GeomAlgoAPI_MakeShape;
 
 /// \class BuildPlugin_Face
 /// \ingroup Plugins
 /// \brief Feature for creation of face from sketch edges or existing wires.
-class BuildPlugin_Face: public ModelAPI_Feature
+class BuildPlugin_Face: public BuildPlugin_Shape
 {
 public:
   /// Use plugin manager for features creation
@@ -68,7 +67,8 @@ private:
   /// Create faces basing on the list of edges
   void buildFacesByEdges(const std::list< std::shared_ptr<GeomAPI_Shape> >& theEdges,
                          const std::list< std::shared_ptr<GeomAPI_Dir> >& theNormals,
-                         std::list< std::shared_ptr<GeomAPI_Shape> >& theFaces) const;
+                         std::list< std::shared_ptr<GeomAPI_Shape> >& theFaces,
+                         std::shared_ptr<GeomAlgoAPI_MakeShape>& theBuilderAlgo) const;
 };
 
 #endif
index 4aff9c942bdca78ac2c1f54fc59be893f3fc0845..c9ce8a257a64e0ebbda3f69c01c98b23dad63527 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Filling.h"
@@ -30,6 +29,7 @@
 #include <GeomAlgoAPI_Copy.h>
 #include <GeomAlgoAPI_Filling.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -67,8 +67,8 @@ void BuildPlugin_Filling::initAttributes()
   data()->addAttribute(TOLERANCE_3D_ID(), ModelAPI_AttributeDouble::typeId());
   data()->addAttribute(APPROXIMATION_ID(), ModelAPI_AttributeBoolean::typeId());
 
-  restoreDefaultParameters();
-  string(ADVANCED_OPTIONS_ID())->setValue("");
+  if (string(ADVANCED_OPTIONS_ID())->value().empty())
+    restoreDefaultParameters();
 }
 
 //=================================================================================================
@@ -95,8 +95,10 @@ void BuildPlugin_Filling::execute()
 
   // get base objects list
   AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
-  if (aSelectionList->size() <= 1)
+  if (aSelectionList->size() <= 1) {
+    setError("Not enough objects is selected");
     return;
+  }
 
   // collect base shapes
   for(int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
@@ -114,7 +116,9 @@ void BuildPlugin_Filling::execute()
 
   // build result
   aFilling->build(aParameters.isApprox);
-  if (isAlgorithmFailed(aFilling)) {
+  std::string anError;
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFilling, getKind(), anError)) {
+    setError(anError);
     removeResults(0);
     return;
   }
@@ -127,37 +131,11 @@ void BuildPlugin_Filling::execute()
   int anEdgeInd = 0;
   for(GeomAPI_ShapeExplorer anExp(aCreatedFace, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) {
     GeomShapePtr anEdge = anExp.current();
-    aResultBody->generated(anEdge, "Edge_" + std::to_string((long long)anEdgeInd), ++anEdgeInd);
+    aResultBody->generated(anEdge, "Edge_" + std::to_string((long long)anEdgeInd));
   }
   setResult(aResultBody, 0);
 }
 
-bool BuildPlugin_Filling::isAlgorithmFailed(
-    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm)
-{
-  if (!theAlgorithm->isDone()) {
-    static const std::string aFeatureError = "Error: filling algorithm failed.";
-    std::string anAlgoError = theAlgorithm->getError();
-    if (anAlgoError.empty())
-      anAlgoError = aFeatureError;
-    else
-      anAlgoError = aFeatureError + " " + anAlgoError;
-    setError(anAlgoError);
-    return true;
-  }
-  if (theAlgorithm->shape()->isNull()) {
-    static const std::string aShapeError = "Error: Resulting shape of filling is Null.";
-    setError(aShapeError);
-    return true;
-  }
-  if (!theAlgorithm->isValid()) {
-    std::string aFeatureError = "Error: Resulting shape of filling is not valid.";
-    setError(aFeatureError);
-    return true;
-  }
-  return false;
-}
-
 //=================================================================================================
 void BuildPlugin_Filling::attributeChanged(const std::string& theID)
 {
index cb19f063f0efe373ac3846126d5e424ebdc2ed34..43ff0f8ea07277444fb047d9e0b4a5935ed1bfe3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Filling_H_
@@ -164,9 +163,6 @@ public:
   BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
 
 private:
-  /// Check the filling algorithm is failed
-  bool isAlgorithmFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm);
-
   /// Convert shape to edge according to construction method
   std::shared_ptr<GeomAPI_Edge> toEdge(const std::shared_ptr<GeomAPI_Shape>& theShape,
                                        const std::string& theMethod);
index 4af802725d2602ab120461a2c1cd9fc511e40b56..8d6ed1584e244ce4a44c3d0bfd3340278bfc220e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Interpolation.h"
@@ -128,12 +127,12 @@ void BuildPlugin_Interpolation::execute()
   ResultBodyPtr aResultBody = document()->createBody(data());
   std::set<GeomShapePtr>::const_iterator aContextIt = aContexts.begin();
   for (; aContextIt != aContexts.end(); aContextIt++) {
-    aResultBody->storeModified(*aContextIt, anEdge, aContextIt == aContexts.begin() ? 0 : -2);
+    aResultBody->storeModified(*aContextIt, anEdge, aContextIt == aContexts.begin());
   }
   int aVertexIndex = 1;
   for (GeomAPI_ShapeExplorer anExp(anEdge, GeomAPI_Shape::VERTEX); anExp.more(); anExp.next()) {
     std::string aVertexName = "Vertex_" + std::to_string((long long)aVertexIndex);
-    aResultBody->generated(anExp.current(), aVertexName, aVertexIndex++);
+    aResultBody->generated(anExp.current(), aVertexName);
   }
 
   setResult(aResultBody);
index bdf6df0206b905e37ecb6121c847d83e21244720..a03b111abc65a82dcacbcd0d4e4f8204a6d9babf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Interpolation_H_
index 3c6a9cf48eda7ea95ad605df7de3e3269cebe2ed..5d37e3299e8602c5efddd19b4c8561d6b14de795 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Plugin.h"
index e27cd194e5bdbea650c5f57edf1680a167b1777c..e8b32b6ae6a7c64fa8996dfb38b541ed51cc553f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Plugin_H_
index 7d2369c20897f2ea51f28a8bbbf4da0b885b4c88..ad58584efbbd56c0c07536f1331dfd1493fbc7b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Polyline.h"
@@ -92,10 +91,10 @@ void BuildPlugin_Polyline::execute()
 
   // Create wire from edges
   GeomShapePtr aWire = GeomAlgoAPI_WireBuilder::wire(anEdges);
-       if (!aWire.get()) {
-               setError("Error: Result polyline is empty.");
-               return;
-       }
+  if (!aWire.get()) {
+    setError("Error: Result polyline is empty.");
+    return;
+  }
 
   // Check the wire.
   if (GeomAlgoAPI_WireBuilder::isSelfIntersected(aWire)) {
@@ -107,7 +106,7 @@ void BuildPlugin_Polyline::execute()
   ResultBodyPtr aResultBody = document()->createBody(data());
   std::set<GeomShapePtr>::const_iterator aContextIt = aContexts.begin();
   for (; aContextIt != aContexts.end(); aContextIt++) {
-    aResultBody->storeModified(*aContextIt, aWire, aContextIt == aContexts.begin() ? 0 : -2);
+    aResultBody->storeModified(*aContextIt, aWire, aContextIt == aContexts.begin());
   }
 
   aPointsIt = aPoints.cbegin();
@@ -115,7 +114,7 @@ void BuildPlugin_Polyline::execute()
   for (; anExp.more() && aPointsIt != aPoints.cend(); anExp.next(), ++aPointsIt) {
     GeomShapePtr aPoint = *aPointsIt;
     GeomShapePtr anEdge = anExp.current();
-    aResultBody->generated(aPoint, anEdge, "Edge", 1);
+    aResultBody->generated(aPoint, anEdge);
   }
 
   if (!isClosed) {
@@ -125,8 +124,8 @@ void BuildPlugin_Polyline::execute()
       aResPoints.push_back(anExp.current());
     }
 
-    aResultBody->generated(aResPoints.front(), "FirstVertex", 2);
-    aResultBody->generated(aResPoints.back(), "LastVertex", 3);
+    aResultBody->generated(aResPoints.front(), "FirstVertex");
+    aResultBody->generated(aResPoints.back(), "LastVertex");
   }
 
   setResult(aResultBody);
index b86e19554a6d3a579b8feb839a026384f23443eb..d27ad7e47273f70e4ca81cb50eef1aaa455eb268 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Polyline_H_
diff --git a/src/BuildPlugin/BuildPlugin_Shape.cpp b/src/BuildPlugin/BuildPlugin_Shape.cpp
new file mode 100644 (file)
index 0000000..60c273c
--- /dev/null
@@ -0,0 +1,78 @@
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "BuildPlugin_Shape.h"
+
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_ResultBody.h>
+
+#include <GeomAlgoAPI_MakeShape.h>
+
+#include <GeomAPI_PlanarEdges.h>
+
+
+//=================================================================================================
+void BuildPlugin_Shape::storeResult(const GeomMakeShapePtr& theAlgorithm,
+                                    const ListOfShape& theOriginalShapes,
+                                    const ListOfShape& theOriginalSolids,
+                                    const GeomShapePtr& theResultShape,
+                                    const int theResultIndex)
+{
+  ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
+  aResultBody->storeModified(theOriginalSolids, theResultShape, theAlgorithm);
+
+  for (ListOfShape::const_iterator anIt = theOriginalShapes.cbegin();
+       anIt != theOriginalShapes.cend();
+       ++anIt)
+  {
+    GeomShapePtr aShape = *anIt;
+    aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::VERTEX);
+    aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::EDGE);
+    aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::FACE);
+  }
+  setResult(aResultBody, theResultIndex);
+}
+
+//=================================================================================================
+void BuildPlugin_Shape::getOriginalShapesAndContexts(const std::string& theSelectionListID,
+                                                     ListOfShape& theShapes,
+                                                     ListOfShape& theContexts)
+{
+  std::set<GeomShapePtr, GeomAPI_Shape::Comparator> aContexts;
+
+  AttributeSelectionListPtr aSelectionList = selectionList(theSelectionListID);
+  for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
+    AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
+    GeomShapePtr aShape = aSelection->value();
+    GeomShapePtr aContext = aSelection->context()->shape();
+    if (!aShape.get())
+      aShape = aContext;
+    theShapes.push_back(aShape);
+
+    // do not collect sketch faces, because they are stored as compounds
+    // and then are treated as modified by the algorithm
+    if (!std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aContext).get())
+      aContexts.insert(aContext);
+  }
+
+  std::set<GeomShapePtr, GeomAPI_Shape::Comparator>::const_iterator anIt = aContexts.begin();
+  for (; anIt != aContexts.end(); ++anIt)
+    theContexts.push_back(*anIt);
+}
diff --git a/src/BuildPlugin/BuildPlugin_Shape.h b/src/BuildPlugin/BuildPlugin_Shape.h
new file mode 100644 (file)
index 0000000..e858ca1
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef BuildPlugin_Shape_H_
+#define BuildPlugin_Shape_H_
+
+#include "BuildPlugin.h"
+
+#include <GeomAPI_Shape.h>
+
+#include <ModelAPI_Feature.h>
+
+class GeomAlgoAPI_MakeShape;
+
+/// \class BuildPlugin_Shape
+/// \ingroup Plugins
+/// \brief Base class containing common methods for shape creating operations.
+class BuildPlugin_Shape: public ModelAPI_Feature
+{
+protected:
+  /// Obtain list of selected shapes and their contexts
+  void getOriginalShapesAndContexts(const std::string& theSelectionListID,
+                                    ListOfShape& theShapes,
+                                    ListOfShape& theContexts);
+
+  /// Store result of algorithm
+  void storeResult(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm,
+                   const ListOfShape& theOriginalShapes,
+                   const ListOfShape& theOriginalContexts,
+                   const GeomShapePtr& theResultShape,
+                   const int theResultIndex = 0);
+};
+
+#endif
index 725f8d336949c7de467ce1b871ba516d8261b69b..7f1010307502ee73fa57b18556aa824de3880354 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Shell.h"
@@ -25,6 +24,7 @@
 #include <ModelAPI_ResultConstruction.h>
 
 #include <GeomAlgoAPI_Sewing.h>
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAPI_ShapeExplorer.h>
 
 //=================================================================================================
@@ -45,71 +45,25 @@ void BuildPlugin_Shell::execute()
   AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
 
   // Collect base shapes.
-  ListOfShape aShapes;
-  for(int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
-    AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
-    GeomShapePtr aShape = aSelection->value();
-    if(!aShape.get()) {
-      aShape = aSelection->context()->shape();
-    }
-    aShapes.push_back(aShape);
-  }
+  ListOfShape aShapes, aContexts;
+  getOriginalShapesAndContexts(BASE_OBJECTS_ID(), aShapes, aContexts);
 
   // Sew faces.
-  GeomAlgoAPI_Sewing aSewingAlgo(aShapes);
-
-  // Check that algo is done.
-  if(!aSewingAlgo.isDone()) {
-    setError("Error: " + getKind() + " algorithm failed.");
-    return;
-  }
-
-  // Check if shape is not null.
-  if(!aSewingAlgo.shape().get() || aSewingAlgo.shape()->isNull()) {
-    setError("Error: Resulting shape is null.");
-    return;
-  }
+  GeomMakeShapePtr aSewingAlgo(new GeomAlgoAPI_Sewing(aShapes));
 
-  // Check that resulting shape is valid.
-  if(!aSewingAlgo.isValid()) {
-    setError("Error: Resulting shape is not valid.");
+  std::string anError;
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aSewingAlgo, getKind(), anError)) {
+    setError(anError);
     return;
   }
 
   // Store result.
-  GeomShapePtr aResult = aSewingAlgo.shape();
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = aSewingAlgo.mapOfSubShapes();
+  GeomShapePtr aResult = aSewingAlgo->shape();
 
   int anIndex = 0;
   for(GeomAPI_ShapeExplorer anExp(aResult, GeomAPI_Shape::SHELL); anExp.more(); anExp.next()) {
     GeomShapePtr aShell = anExp.current();
-    ResultBodyPtr aResultBody = document()->createBody(data(), anIndex);
-    aResultBody->store(aShell);
-    for(ListOfShape::const_iterator anIt = aShapes.cbegin(); anIt != aShapes.cend(); ++anIt) {
-      for(GeomAPI_ShapeExplorer
-          aFaceExp(*anIt, GeomAPI_Shape::FACE); aFaceExp.more(); aFaceExp.next()) {
-        GeomShapePtr aFace = aFaceExp.current();
-        ListOfShape aHistory;
-        aSewingAlgo.modified(aFace, aHistory);
-        for(ListOfShape::const_iterator aHistoryIt = aHistory.cbegin();
-            aHistoryIt != aHistory.cend();
-            ++aHistoryIt) {
-          GeomShapePtr aHistoryShape = *aHistoryIt;
-          if(aMapOfShapes->isBound(aHistoryShape)) {
-            aHistoryShape = aMapOfShapes->find(aHistoryShape);
-          }
-          if(aShell->isSubShape(aHistoryShape)) {
-            aResultBody->loadAndOrientModifiedShapes(&aSewingAlgo, aFace, GeomAPI_Shape::EDGE,
-                                                     1, "Modified_Edge", *aMapOfShapes.get());
-            aResultBody->loadAndOrientModifiedShapes(&aSewingAlgo, aFace, GeomAPI_Shape::FACE,
-                                                     2, "Modified_Face", *aMapOfShapes.get());
-            break;
-          }
-        }
-      }
-    }
-    setResult(aResultBody, anIndex);
-    ++anIndex;
+    storeResult(aSewingAlgo, aShapes, aContexts, aShell, anIndex++);
   }
 
   removeResults(anIndex);
index 4fe6d2fdbb904839c1ec5b1fa9c138192788b48b..514aa349e54b988769bf2ebecfd675d534d83067 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Shell_H_
 #define BuildPlugin_Shell_H_
 
 #include "BuildPlugin.h"
-
-#include <ModelAPI_Feature.h>
+#include "BuildPlugin_Shape.h"
 
 /// \class BuildPlugin_Shell
 /// \ingroup Plugins
 /// \brief Feature for creation of shell from faces and shells.
-class BuildPlugin_Shell: public ModelAPI_Feature
+class BuildPlugin_Shell: public BuildPlugin_Shape
 {
 public:
   /// Use plugin manager for features creation
index 0f044564e5a0355f4c340ee5af970fd53f127953..215be1683a9f934717560d3b5f1f7324a84481ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Solid.h"
@@ -23,6 +22,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_ResultBody.h>
 
+#include <GeomAPI_ShapeExplorer.h>
 #include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAlgoAPI_MakeVolume.h>
@@ -42,39 +42,15 @@ void BuildPlugin_Solid::initAttributes()
 void BuildPlugin_Solid::execute()
 {
   // all the needed checkings are in validator, so, here just make and store result
-  ListOfShape anOriginalShapes;
-  AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
-  for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
-    AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
-    GeomShapePtr aShape = aSelection->value();
-    if (!aShape.get())
-      aShape = aSelection->context()->shape();
-    anOriginalShapes.push_back(aShape);
-  }
+  ListOfShape anOriginalFaces;
+  ListOfShape anOriginalSolids;
+  getOriginalShapesAndContexts(BASE_OBJECTS_ID(), anOriginalFaces, anOriginalSolids);
+
   std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
-    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
+    new GeomAlgoAPI_MakeVolume(anOriginalFaces, false));
   // check and process result of volume maker
   GeomShapePtr aResShape = getSingleSubshape(anAlgo->shape());
-  storeResult(anOriginalShapes, aResShape, anAlgo);
-}
-
-void BuildPlugin_Solid::storeResult(const ListOfShape& theOriginalShapes,
-                                    const GeomShapePtr& theResultShape,
-                                    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm)
-{
-  ResultBodyPtr aResultBody = document()->createBody(data());
-  aResultBody->store(theResultShape);
-
-  // Store faces
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubs = theAlgorithm->mapOfSubShapes();
-  int aModifiedTag = 1;
-  for(ListOfShape::const_iterator anIt = theOriginalShapes.cbegin();
-      anIt != theOriginalShapes.cend(); ++anIt) {
-    GeomShapePtr aShape = *anIt;
-    aResultBody->loadAndOrientModifiedShapes(theAlgorithm.get(), aShape, GeomAPI_Shape::FACE,
-        aModifiedTag, "Modified_Face", *aMapOfSubs.get(), false, true, true);
-  }
-  setResult(aResultBody);
+  storeResult(anAlgo, anOriginalFaces, anOriginalSolids, aResShape);
 }
 
 GeomShapePtr BuildPlugin_Solid::getSingleSubshape(const GeomShapePtr& theCompound)
index 1fce3df589b7968ea228226b5ce75e718398183a..f364b94b0f93b7224632c39fbbd6a542ea7d8e69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Solid_H_
 #define BuildPlugin_Solid_H_
 
 #include "BuildPlugin.h"
-
-#include <GeomAPI_Shape.h>
-#include <ModelAPI_Feature.h>
-
-class GeomAlgoAPI_MakeShape;
+#include "BuildPlugin_Shape.h"
 
 /// \class BuildPlugin_Solid
 /// \ingroup Plugins
 /// \brief Feature for creation of solid from faces or shells.
-class BuildPlugin_Solid: public ModelAPI_Feature
+class BuildPlugin_Solid: public BuildPlugin_Shape
 {
 public:
   /// Use plugin manager for features creation
@@ -65,11 +60,6 @@ public:
   BUILDPLUGIN_EXPORT virtual void execute();
 
 protected:
-  /// Store result of algorithm
-  void storeResult(const ListOfShape& theOriginalShapes,
-                   const GeomShapePtr& theResultShape,
-                   const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm);
-
   /// Explode compound to get single shape
   GeomShapePtr getSingleSubshape(const GeomShapePtr& theCompound);
 };
index 35aa48914036197f31628a583661cfce70f9c210..da2faa9d9914197b293a7c2f6dd1b3cd06a280b7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_SubShapes.h"
@@ -105,9 +104,9 @@ void BuildPlugin_SubShapes::execute()
   if(!aBaseShape.get()) {
     return;
   }
-  GeomAlgoAPI_ShapeBuilder aBuilder;
-  aBuilder.removeInternal(aBaseShape);
-  GeomShapePtr aResultShape = aBuilder.shape();
+  std::shared_ptr<GeomAlgoAPI_ShapeBuilder> aBuilder(new GeomAlgoAPI_ShapeBuilder());
+  aBuilder->removeInternal(aBaseShape);
+  GeomShapePtr aResultShape = aBuilder->shape();
 
   // Get list of shapes.
   ListOfShape aShapesToAdd;
@@ -118,8 +117,8 @@ void BuildPlugin_SubShapes::execute()
 
   // Copy sub-shapes from list to new shape.
   if(!aShapesToAdd.empty()) {
-    aBuilder.addInternal(aResultShape, aShapesToAdd);
-    aResultShape = aBuilder.shape();
+    aBuilder->addInternal(aResultShape, aShapesToAdd);
+    aResultShape = aBuilder->shape();
   }
 
   // Store result.
@@ -127,15 +126,15 @@ void BuildPlugin_SubShapes::execute()
   const int aModEdgeTag = 2;
   ResultBodyPtr aResultBody = document()->createBody(data());
   aResultBody->storeModified(aBaseShape, aResultShape);
-  aResultBody->loadAndOrientModifiedShapes(&aBuilder, aBaseShape, GeomAPI_Shape::EDGE, aModEdgeTag,
-                                          "Modified_Edge", *aBuilder.mapOfSubShapes().get());
-  for(ListOfShape::const_iterator
-      anIt = aShapesToAdd.cbegin(); anIt != aShapesToAdd.cend(); ++anIt) {
+  aResultBody->loadModifiedShapes(aBuilder, aBaseShape, GeomAPI_Shape::EDGE);
+  for (ListOfShape::const_iterator anIt = aShapesToAdd.cbegin();
+       anIt != aShapesToAdd.cend();
+       ++anIt)
+  {
     GeomAPI_Shape::ShapeType aShType = (*anIt)->shapeType();
-    aResultBody->loadAndOrientModifiedShapes(&aBuilder, *anIt, aShType,
-                        aShType == GeomAPI_Shape::VERTEX ? aModVertexTag : aModEdgeTag,
-                        aShType == GeomAPI_Shape::VERTEX ? "Modified_Vertex" : "Modified_Edge",
-                        *aBuilder.mapOfSubShapes().get());
+    aResultBody->loadModifiedShapes(aBuilder,
+                                    *anIt,
+                                    aShType);
   }
   setResult(aResultBody);
 }
index d150f841bb39650edb4655385c46e457c1305610..ce90d444f4257dc123ec5f649812c9bb4a050ec7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_SubShapes_H_
index 1dc69c0a38c5566aaf2b651693ef48bd452604cb..4c7c8a4fc8afbbceb1fb1f1b6a1820c95730cc1f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Validators.h"
@@ -26,6 +25,7 @@
 #include <GeomAPI_PlanarEdges.h>
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
 #include <GeomAlgoAPI_PaveFiller.h>
@@ -34,8 +34,7 @@
 #include <GeomAlgoAPI_SketchBuilder.h>
 #include <GeomAlgoAPI_WireBuilder.h>
 #include <GeomAlgoAPI_MakeVolume.h>
-#include <GeomAPI_ShapeIterator.h>
-#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomValidators_FeatureKind.h>
 #include <GeomValidators_ShapeType.h>
@@ -247,9 +246,8 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
     }
 
     // Check that selected objects have closed contours.
-    ListOfShape aFaces;
-    GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(),
-                                           aPln->direction(), anEdges, aFaces);
+    GeomAlgoAPI_SketchBuilder aBuilder(aPln, anEdges);
+    const ListOfShape& aFaces = aBuilder.faces();
     if(aFaces.empty()) {
       theError = "Selected objects do not generate closed contour.";
       return false;
@@ -292,16 +290,9 @@ bool BuildPlugin_ValidatorBaseForSolids::isValid(
   std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgorithm(
     new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
 
-  if (!anAlgorithm->isDone()) {
-    theError = "MakeVolume algorithm failed.";
-    return false;
-  }
-  if (anAlgorithm->shape()->isNull()) {
-    theError = "Resulting shape of MakeVolume is Null.";
-    return false;
-  }
-  if (!anAlgorithm->isValid()) {
-    theError = "Resulting shape of MakeVolume is not valid.";
+  std::string anErr;
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(anAlgorithm, "MakeVolume", anErr)) {
+    theError = anErr;
     return false;
   }
 
index d69f0b8b7b3ae4f3148d759b3a1f6013c163d60d..4c54b6b7b8ef5b2c7d1ab3d65b91032f8298465f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Validators_H_
index 585682a32ff6bde03ee202ab3a898ce1bdbc975f..82f3521ed81ac72dd66859b97c9a7e5a19e83bef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Vertex.h"
@@ -24,6 +23,7 @@
 #include <ModelAPI_ResultBody.h>
 
 #include <GeomAlgoAPI_Copy.h>
+#include <GeomAlgoAPI_Tools.h>
 
 //=================================================================================================
 BuildPlugin_Vertex::BuildPlugin_Vertex()
@@ -76,29 +76,17 @@ void BuildPlugin_Vertex::execute()
     }
 
     // Copy shape.
-    GeomAlgoAPI_Copy aCopyAlgo(aShape);
+    std::shared_ptr<GeomAlgoAPI_Copy> aCopyAlgo(new GeomAlgoAPI_Copy(aShape));
 
-    // Check that algo is done.
-    if(!aCopyAlgo.isDone()) {
-      setError("Error: " + getKind() + " algorithm failed.");
-      return;
-    }
-
-    // Check if shape is not null.
-    if(!aCopyAlgo.shape().get() || aCopyAlgo.shape()->isNull()) {
-      setError("Error: Resulting shape is null.");
-      return;
-    }
-
-    // Check that resulting shape is valid.
-    if(!aCopyAlgo.isValid()) {
-      setError("Error: Resulting shape is not valid.");
+    std::string anError;
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCopyAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     // Store result.
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    aResultBody->storeModified(aShape, aCopyAlgo.shape());
+    aResultBody->storeModified(aShape, aCopyAlgo->shape());
     setResult(aResultBody, aResultIndex);
     ++aResultIndex;
   }
index 53fa1307014af278386cfaddeb47dd6169135d20..62852d5e3a087b13fb93b4739741203c6bf3f901 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Vertex_H_
index 54ae7a95bac6b5594c4508390b269ee9c90ac8c0..4fe602e84c29c5c4f0dfb3a8c3369b6cdf07c726 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "BuildPlugin_Wire.h"
@@ -88,7 +87,7 @@ void BuildPlugin_Wire::execute()
     for(ListOfShape::const_iterator anIt = anEdges.cbegin(); anIt != anEdges.cend(); ++anIt) {
       std::shared_ptr<GeomAPI_Edge> anEdgeInList(new GeomAPI_Edge(*anIt));
       if(anEdgeInList->isEqual(anEdgeInResult)) {
-        aResultBody->modified(anEdgeInList, anEdgeInResult, "Edge");
+        aResultBody->modified(anEdgeInList, anEdgeInResult);
         break;
       }
     }
index d282de050271862647d14eef864614cfb245eb51..c0b873174344e4f7db5054ec5a276bfdc26c9d9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef BuildPlugin_Wire_H_
index d99d69f68f1a0d26372648c8174d0a180d8beaee..f22f6598bbc9d5a385958abcfa4c4ca2c253a770 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -32,6 +31,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Events
 SET(PROJECT_HEADERS
     BuildPlugin.h
     BuildPlugin_Plugin.h
+    BuildPlugin_Shape.h
     BuildPlugin_Vertex.h
     BuildPlugin_Edge.h
     BuildPlugin_Wire.h
@@ -49,6 +49,7 @@ SET(PROJECT_HEADERS
 
 SET(PROJECT_SOURCES
     BuildPlugin_Plugin.cpp
+    BuildPlugin_Shape.cpp
     BuildPlugin_Vertex.cpp
     BuildPlugin_Edge.cpp
     BuildPlugin_Wire.cpp
@@ -105,21 +106,32 @@ INSTALL(FILES ${XML_RESOURCES} ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XM
 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Build)
 
 ADD_UNIT_TESTS(TestVertex.py
+               TestVertex_ErrorMsg.py
                TestEdge.py
+               TestEdge_ErrorMsg.py
                TestWire.py
+               TestWire_ErrorMsg.py
                TestPolyline.py
                TestInterpolation.py
                TestFace.py
+               TestFace_ErrorMsg.py
                TestShell.py
                TestSolid.py
+               TestSolid_ErrorMsg.py
                TestCompSolid.py
                TestCompound.py
+               TestCompound_ErrorMsg.py
+               TestCompound_History.py
                TestSubShapes.py
+               TestSubShapes_ErrorMsg.py
+               TestFilling.py
                TestFilling_ByEdges.py
                TestFilling_ByWires.py
                TestFilling_Mixed.py
+               TestFilling_ErrorMsg.py
                Test1920.py
                Test2398.py
+               Test2409.py
                Test2415.py
                Test2439.py
                Test2454.py
index 96f8eb6dcbb80fe919a7336f71c594deef7630e2..4c1728ccac26db7be4572ac5ca8cd4a9d672759e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -41,10 +40,10 @@ SketchLine_5 = Sketch_1.addLine(50, 50, 50, 0)
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_5f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_5r-SketchLine_1r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OY"), 100)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Translation_1_1/Translated_Edge_1"), model.selection("EDGE", "Translation_1_1/Translated_Edge_2"), model.selection("EDGE", "Translation_1_1/Translated_Edge_3"), model.selection("EDGE", "Translation_1_1/Translated_Edge_4"), model.selection("EDGE", "Translation_1_2/Translated_Edge_1"), model.selection("EDGE", "Translation_1_2/Translated_Edge_2"), model.selection("EDGE", "Translation_1_2/Translated_Edge_3"), model.selection("EDGE", "Translation_1_2/Translated_Edge_4")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Translation_1_1/ME:Translated&Sketch_1/SketchLine_4"), model.selection("EDGE", "Translation_1_1/ME:Translated&Sketch_1/SketchLine_1"), model.selection("EDGE", "Translation_1_1/ME:Translated&Sketch_1/SketchLine_5"), model.selection("EDGE", "Translation_1_1/ME:Translated&Sketch_1/SketchLine_3"), model.selection("EDGE", "Translation_1_2/ME:Translated&Sketch_1/SketchLine_1"), model.selection("EDGE", "Translation_1_2/ME:Translated&Sketch_1/SketchLine_2"), model.selection("EDGE", "Translation_1_2/ME:Translated&Sketch_1/SketchLine_3"), model.selection("EDGE", "Translation_1_2/ME:Translated&Sketch_1/SketchLine_5")])
 aGroupFeature = Group_1.feature()
 aSelectionList = aGroupFeature.selectionList("group_list")
 model.end()
@@ -56,4 +55,4 @@ for index in range(0, aSelectionList.size()):
     assert(shape.isEdge())
     assert(name)
 
-assert(model.checkPythonDump())
\ No newline at end of file
+assert(model.checkPythonDump())
index 2331d87226104bea233e001e34f17eb7b5f9d4a6..6054ddabfcc1123111682eb5fcb4c96c03ac002e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -34,7 +33,7 @@ SketchCircle_1 = Sketch_1.addCircle(0, 0, 30.79356776198042)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
 model.do()
 
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 100, 100)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2f_wire")], model.selection(), 100, 100)
 
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
@@ -72,7 +71,7 @@ SketchConstraintCoincidence_9 = Sketch_3.setCoincident(SketchLine_5.result(), Sk
 SketchConstraintMiddle_1 = Sketch_3.setMiddlePoint(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_5.result())
 model.do()
 
-Edge_1_objects = [model.selection("EDGE", "Sketch_3/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_3")]
+Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_2"), model.selection("EDGE", "Sketch_3/SketchLine_1"), model.selection("EDGE", "Sketch_3/SketchLine_4"), model.selection("EDGE", "Sketch_3/SketchLine_3")]
 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
 
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOZ"), model.selection("EDGE", "PartSet/OZ"), 135)
index 2056fd38645a29d3e7558a052cd91516434c496d..e8cb085548dc2abd60beb3d326eea8efdfc71b15 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Issue #2409: Filling on one edge
@@ -44,12 +43,12 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
 
-Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2")])
 model.do()
 # check error is reported
 assert(Filling_1.feature().error() != "")
 
-Filling_1.setBase([model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
+Filling_1.setBase([model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
 model.do()
 # check there is no error
 assert(Filling_1.feature().error() == "")
index 64e30318c094e092257a4965aeabf18c8d396218..7718d9a2b538e0cad2aa5f9a8ce68af6995966ca 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -52,10 +51,10 @@ SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 80)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 150)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchArc_1_2r")], model.selection(), 200, 0)
-Compound_1_objects = [model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4")]
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection(), 200, 0)
+Compound_1_objects = [model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5")]
 Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
-Compound_2_objects = [model.selection("EDGE", "Compound_1_1_2/Modified_Edge_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Compound_1_1_3/Modified_Edge_2")]
+Compound_2_objects = [model.selection("EDGE", "[Compound_1_1_2/Compound_1_1_2&Sketch_1/SketchLine_4][weak_name_4]"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "[Compound_1_1_3/Compound_1_1_3&Sketch_1/SketchLine_5][weak_name_4]")]
 Compound_2 = model.addCompound(Part_1_doc, Compound_2_objects)
 model.do()
 
index 3a66d39305aad2a220c035fd93bd5409816c48ab..14b75e91a1010ec3d6bc8cb65e0d6c376e06a6bc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -38,8 +37,8 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0)
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f_wire")], model.selection(), 100, 0)
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")])
 model.do()
 
 model.testHaveNamingSubshapes(Edge_1, model, Part_1_doc)
index f56d1d1220a0dd881e0dce3f92e26efe3296d762..19870d51f10194ac2514b0f6dcfec91120252143 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -27,11 +26,11 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(0.1822176134072968, -1.34047565209109, 35.08968954114807)
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 100, 0)
 Recover_1 = model.addRecover(Part_1_doc, Extrusion_1, [Wire_1.result()])
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Recover_1_1")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/To_Edge_1")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/To_Edge")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_2_1")])
 model.end()
 
index f27cb0a8b956d6c9eadc67b03c2a5c967df873e5..077834374342bc66d9d0fde0ca4538c6edeb0eba 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 from GeomAPI import GeomAPI_Shape
@@ -45,7 +44,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_2.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 40)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_5 = Sketch_2.addLine(20, 0, 0, 0)
 SketchLine_6 = Sketch_2.addLine(0, 0, 0, 20)
@@ -58,7 +57,7 @@ SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(),
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_9 = SketchProjection_2.createdFeature()
 SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchLine_5.startPoint(), SketchLine_9.result())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_9).startPoint(), SketchLine_5.endPoint())
@@ -75,7 +74,7 @@ SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_12.result())
 SketchConstraintEqual_3 = Sketch_2.setEqual(SketchLine_6.result(), SketchLine_12.result())
 model.do()
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r_wire")])
 AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OZ"), 270, 2)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "AngularCopy_1_1_1"), model.selection("FACE", "AngularCopy_1_1_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7f-SketchLine_10f-SketchLine_11f-SketchLine_12f")], model.selection(), 40, 0)
@@ -90,17 +89,17 @@ SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_14.endPoint()
 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
 SketchConstraintHorizontal_7 = Sketch_3.setHorizontal(SketchLine_15.result())
 SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_16.result())
-SketchProjection_3 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_5s-SketchLine_15s-SketchLine_8e-SketchLine_14e"), False)
+SketchProjection_3 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_5_StartVertex"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates())
-SketchProjection_4 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_11s-SketchLine_10e"), False)
+SketchProjection_4 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_EndVertex"), False)
 SketchPoint_3 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchAPI_Point(SketchPoint_3).coordinates())
-SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"), False)
+SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), False)
 SketchPoint_4 = SketchProjection_5.createdFeature()
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_13.startPoint(), SketchAPI_Point(SketchPoint_4).coordinates())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r")], model.selection(), 20, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r")], model.selection(), 20, 0)
 Box_1 = model.addBox(Part_1_doc, 20, 20, 20)
 model.do()
 
@@ -127,12 +126,12 @@ def createCompSolidStepByStep(theSelection, theExpectedType):
 # =============================================================================
 boundaries1 = [model.selection("FACE", "Face_1_1"),
                model.selection("SHELL", "Shell_1_1"),
-               model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+               model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_14"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_15"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_16"),
+               model.selection("FACE", "Extrusion_2_1/To_Face"),
                model.selection("FACE", "Box_1_1/Front")]
 expectType1 = [GeomAPI_Shape.SHAPE,
                GeomAPI_Shape.SHAPE,
@@ -153,14 +152,14 @@ model.testHaveNamingSubshapes(CompSolid_1, model, Part_1_doc)
 # =============================================================================
 boundaries2 = [model.selection("FACE", "Face_1_1"),
                model.selection("SHELL", "Shell_1_1"),
-               model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+               model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_15"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_16"),
+               model.selection("FACE", "Extrusion_2_1/To_Face"),
                model.selection("FACE", "Box_1_1/Front"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_14"),
                model.selection("SOLID", "Extrusion_1_1")]
 expectType2 = [GeomAPI_Shape.SHAPE,
                GeomAPI_Shape.SHAPE,
index c55dda70f52760e56c428c414db66884ff2556d9..7bcd0dfe1390b292c34af75e35f2c180e513351a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -45,9 +44,9 @@ SketchCircle_1 = Sketch_1.addCircle(51.0302184611028, -58.25492948210744, 14.676
 SketchCircle_2 = Sketch_1.addCircle(57.27434431552349, -55.3477547099222, 30.40870102508203)
 model.do()
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "PartSet/Origin")])
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_5")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_2_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_6 = Sketch_2.addLine(73.69205241424749, 19.68979803478298, 29.86213888681927, 19.68979803478298)
 SketchLine_7 = Sketch_2.addLine(29.86213888681927, 19.68979803478298, 29.86213888681927, 46.16063196348271)
@@ -62,18 +61,18 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_7.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_9.result())
 model.do()
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r")])
-AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), 120, 2)
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r_wire")])
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "Sketch_2/SketchLine_6"), 120, 2)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "AngularCopy_1_1_1"), model.selection("FACE", "AngularCopy_1_1_2")])
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), 50)
 Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_2_1/Front"), 5, True)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_2_1"), model.selection("FACE", "Plane_1")])
-Compound_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"),
-                      model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"),
-                      model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"),
-                      model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"),
+Compound_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_1"),
+                      model.selection("EDGE", "Sketch_1/SketchLine_1"),
+                      model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire"),
+                      model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"),
                       model.selection("VERTEX", "Vertex_1_1"),
                       model.selection("EDGE", "Edge_1_1"),
                       model.selection("WIRE", "Wire_1_1"),
diff --git a/src/BuildPlugin/Test/TestCompound_ErrorMsg.py b/src/BuildPlugin/Test/TestCompound_ErrorMsg.py
new file mode 100644 (file)
index 0000000..4625556
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Compound_1 = aPart.addFeature("Compound")
+Compound_1.execute()
+assert(Compound_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = Compound_1.selectionList("base_objects")
+aBaseObjectsList.append("", "EDGE")
+Compound_1.execute()
+assert(Compound_1.error() != "")
+aSession.finishOperation()
diff --git a/src/BuildPlugin/Test/TestCompound_History.py b/src/BuildPlugin/Test/TestCompound_History.py
new file mode 100644 (file)
index 0000000..a0b494b
--- /dev/null
@@ -0,0 +1,73 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that the history of compound works correctly after movement of groups after this compound feature
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchPoint_1 = Sketch_1.addPoint(-19.03078817733991, 40.92241379310347)
+SketchLine_1 = Sketch_1.addLine(-0.7463054187192111, 38.55911330049261, -18.03571428571429, 28.48399014778325)
+SketchCircle_1 = Sketch_1.addCircle(-2.238916256157633, 23.13546798029557, 5.523556488740459)
+model.do()
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Edge_1_1/Modified_Vertex&Sketch_1/SketchLine_1_EndVertex"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]")])
+Group_3 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")])
+Compound_1_objects = [model.selection("VERTEX", "Vertex_1_1"), model.selection("EDGE", "Edge_1_1"), model.selection("SOLID", "Extrusion_1_1")]
+Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
+model.do()
+# move groups after the compound
+Part_1_doc.moveFeature(Group_1.feature(), Compound_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(3):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.VERTEX)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(2):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.EDGE)
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_3.feature()))
+assert(Group_3.groupList().value(0).value().shapeType() == GeomAPI_Shape.SOLID)
+
+assert(model.checkPythonDump())
index 06c653dfb2d46865c9fbc0efbb09e659a9c8056c..83d163b5ee8294165367bcc39dace57b9495eecf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
diff --git a/src/BuildPlugin/Test/TestEdge_ErrorMsg.py b/src/BuildPlugin/Test/TestEdge_ErrorMsg.py
new file mode 100644 (file)
index 0000000..ccc550c
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+aBoxResult = aBox.firstResult()
+aBoxShape = aBoxResult.shape()
+
+aSession.startOperation()
+Edge_1 = aPart.addFeature("Edge")
+Edge_1.execute()
+assert(Edge_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = Edge_1.selectionList("base_objects")
+aBaseObjectsList.append("", "EDGE")
+Edge_1.execute()
+assert(Edge_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList.removeLast()
+aBaseObjectsList.append("Box_1_1/Top", "FACE")
+Edge_1.execute()
+assert(Edge_1.error() != "")
+aSession.finishOperation()
index a64a2f913a125e963a829e1192f189e10333f5d4..47091eeb78da7423608842dac9987239310ea93a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -107,7 +106,7 @@ aCylinderShape = aCylinderResult.shape()
 aSession.startOperation()
 aFaceFeature2 = aPart.addFeature("Face")
 aBaseObjectsList = aFaceFeature2.selectionList("base_objects")
-aBaseObjectsList.append("Cylinder_1_1/Face_1&Cylinder_1_1/Face_2", "EDGE")
+aBaseObjectsList.append("[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]", "EDGE")
 aSession.finishOperation()
 assert (len(aFaceFeature2.results()) > 0)
 
diff --git a/src/BuildPlugin/Test/TestFace_ErrorMsg.py b/src/BuildPlugin/Test/TestFace_ErrorMsg.py
new file mode 100644 (file)
index 0000000..21924a5
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(30, -30, -30, -30)
+SketchLine_2 = Sketch_1.addLine(-30, -30, -30, 30)
+SketchLine_3 = Sketch_1.addLine(-30, 30, 30, 30)
+SketchLine_4 = Sketch_1.addLine(30, 30, 30, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+assert(Face_1.feature().error() != "")
+Part_1_doc.removeFeature(Face_1.feature())
+
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "PartSet/XOY")])
+assert(Face_1.feature().error() != "")
+Part_1_doc.removeFeature(Face_1.feature())
+
+model.end()
diff --git a/src/BuildPlugin/Test/TestFilling.py b/src/BuildPlugin/Test/TestFilling.py
new file mode 100644 (file)
index 0000000..a07dc6c
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Point_3 = model.addPoint(Part_1_doc, 20, 10, 0)
+Point_4 = model.addPoint(Part_1_doc, 0, 20, 10)
+Point_5 = model.addPoint(Part_1_doc, 30, 0, 10)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+Polyline_2 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4")], False)
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Polyline_1_1/Generated_Edge&Point_1/Point_1"), model.selection("EDGE", "Polyline_2_1/Generated_Edge&Point_3/Point_3")])
+Filling_2 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Polyline_1_1/Generated_Edge&Point_1/Point_1"), model.selection("EDGE", "Polyline_2_1/Generated_Edge&Point_3/Point_3")], "curve_info", 5, 8, 0, 0.0001, 0.0001, True)
+model.do()
+
+assert(Filling_1.feature().error() == "")
+assert(Filling_2.feature().error() == "")
+
+model.end()
index 08b3aea568de66ef5e91feb80c73f9a9f867a272..6f5d6e0c1ff58233198e3deaaa08b2091e13cab0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -82,6 +81,7 @@ aSession.finishOperation()
 # Create filling
 aSession.startOperation()
 aFillingFeature = aPart.addFeature("Filling")
+aFillingFeature.string("advanced_options").setValue("")
 aBaseObjectsList = aFillingFeature.selectionList("base_objects")
 aBaseObjectsList.append(aSketch1Result, anArc.lastResult().shape())
 aSession.finishOperation()
index 1529a3c09f6fb07813b6fd00b0cf5048c0535c9f..24486a96f741aadedb1e7f2ec541fd22616effd6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -104,6 +103,7 @@ aSession.finishOperation()
 # Create filling
 aSession.startOperation()
 aFillingFeature = aPart.addFeature("Filling")
+aFillingFeature.string("advanced_options").setValue("")
 aBaseObjectsList = aFillingFeature.selectionList("base_objects")
 aBaseObjectsList.append(aWire1.lastResult(), None)
 aSession.finishOperation()
diff --git a/src/BuildPlugin/Test/TestFilling_ErrorMsg.py b/src/BuildPlugin/Test/TestFilling_ErrorMsg.py
new file mode 100644 (file)
index 0000000..5e891d9
--- /dev/null
@@ -0,0 +1,91 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Point_3 = model.addPoint(Part_1_doc, 20, 10, 0)
+Point_4 = model.addPoint(Part_1_doc, 0, 20, 10)
+Point_5 = model.addPoint(Part_1_doc, 30, 0, 10)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+Polyline_2 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_3"), model.selection("VERTEX", "Point_4")], False)
+model.do()
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Polyline_1_1/Generated_Edge&Point_1/Point_1"), model.selection("EDGE", "Polyline_2_1/Generated_Edge&Point_3/Point_3")], "curve_info", 9, 8, 0, 0.0001, 0.0001, True)
+assert(Filling_1.feature().error() != "")
+Part_1_doc.removeFeature(Filling_1.feature())
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Polyline_1_1/Generated_Edge&Point_1/Point_1")])
+assert(Filling_1.feature().error() != "")
+Part_1_doc.removeFeature(Filling_1.feature())
+
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("FACE", "Box_1_1/Top")])
+assert(Filling_1.feature().error() != "")
+Part_1_doc.removeFeature(Filling_1.feature())
+
+model.end()
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+
+aSession.startOperation()
+aFillingFeature = featureToCompositeFeature(Part_1.feature()).addFeature("Filling")
+aFillingFeature.string("advanced_options").setValue("")
+aFillingFeature.execute()
+assert(aFillingFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = aFillingFeature.selectionList("base_objects")
+aBaseObjectsList.append("Polyline_1_1/Generated_Edge&Point_1/Point_1", "EDGE")
+aBaseObjectsList.append("Box_1_1/Top", "FACE")
+aFillingFeature.execute()
+assert(aFillingFeature.error() != "")
+aSession.finishOperation()
+
+
+model.begin()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(30, -30, -30, -30)
+SketchLine_2 = Sketch_1.addLine(-30, -30, -30, 30)
+SketchLine_3 = Sketch_1.addLine(-30, 30, 30, 30)
+SketchLine_4 = Sketch_1.addLine(30, 30, 30, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", ""), model.selection("EDGE", "Sketch_1/SketchLine_1")], "auto_correct", 1, 1, 0, 0.0001, 0.0001, False)
+assert(Filling_1.feature().error() != "")
+Part_1_doc.removeFeature(Filling_1.feature())
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1")], "auto_correct", 1, 1, 0, 0.0001, 0.0001, False)
+assert(Filling_1.feature().error() != "")
+model.end()
index c020982eddcd79f83774a80fc6cb19133c9a0429..6b7d4a2417999f2ae7f066b42707a63f4839e81c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -89,6 +88,7 @@ aSession.finishOperation()
 # Create filling
 aSession.startOperation()
 aFillingFeature = aPart.addFeature("Filling")
+aFillingFeature.string("advanced_options").setValue("")
 aBaseObjectsList = aFillingFeature.selectionList("base_objects")
 aBaseObjectsList.append(aSketch1Result, anArc.lastResult().shape())
 aSession.finishOperation()
index 656351a488264cbf118aaaafa9a8965802cb7b52..9e439419e08c9a6415090f0562ad8dbd3061fd82 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -45,12 +44,12 @@ SketchLine_2 = Sketch_1.addLine(0, 0, 45, 45)
 model.do()
 
 # Get sketch points
-base_name = "Sketch_1/Vertex-SketchPoint_"
+base_name = "Sketch_1/SketchPoint_"
 p_1, p_2, p_3, p_4, p_5 = [model.selection("VERTEX", base_name + str(i + 1)) for i in range(0, 5)]
 
 # Get sketch edges
-Tangent_1 = model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")
-Tangent_2 = model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")
+Tangent_1 = model.selection("EDGE", "Sketch_1/SketchLine_1")
+Tangent_2 = model.selection("EDGE", "Sketch_1/SketchLine_2")
 
 # =============================================================================
 # Test 1. Create curve 1-2-3-4-5, closed off, reorder off, without tangents
@@ -117,14 +116,14 @@ Part_2 = model.addPart(partSet)
 Part_2_doc = Part_2.document()
 Box_1 = model.addBox(Part_2_doc, 10, 10, 10)
 
-point_names = ("Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom",
-               "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top",
-               "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top",
-               "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom",
-               "Box_1_1/Front&Box_1_1/Right&Box_1_1/Bottom",
-               "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top",
-               "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top",
-               "Box_1_1/Back&Box_1_1/Right&Box_1_1/Bottom")
+point_names = ("[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]",
+               "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]",
+               "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]",
+               "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]",
+               "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]",
+               "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]",
+               "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]",
+               "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]")
 points = [model.selection("VERTEX", name) for name in point_names]
 
 Interpolation_8 = model.addInterpolation(Part_2_doc, points, False, False)
@@ -140,8 +139,8 @@ Part_3_doc = Part_3.document()
 Box_1 = model.addBox(Part_3_doc, 20, 30, 40)
 
 points = [model.selection("VERTEX", name) for name in point_names]
-Tangent_1 = model.selection("EDGE", "Box_1_1/Back&Box_1_1/Top")
-Tangent_2 = model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")
+Tangent_1 = model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]")
+Tangent_2 = model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")
 
 Interpolation_9 = model.addInterpolation(Part_3_doc, points,
                                          Tangent_1, Tangent_2, False, False)
@@ -175,4 +174,4 @@ model.end()
 # =============================================================================
 # Test 12. Check Python dump
 # =============================================================================
-assert(model.checkPythonDump())
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
index ba399cc5470f2411cc41735bb3c51959bc7e558e..c60399f95293521087bcf19add816ee3c68296a2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -42,7 +41,7 @@ SketchPoint_5 = Sketch_1.addPoint(50, 0)
 model.do()
 
 # Get sketch points
-base_name = "Sketch_1/Vertex-SketchPoint_"
+base_name = "Sketch_1/SketchPoint_"
 p_1, p_2, p_3, p_4, p_5 = [model.selection("VERTEX", base_name + str(i + 1)) for i in range(0, 5)]
 
 # =============================================================================
@@ -100,14 +99,14 @@ Part_2 = model.addPart(partSet)
 Part_2_doc = Part_2.document()
 Box_1 = model.addBox(Part_2_doc, 10, 10, 10)
 
-point_names = ("Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom",
-               "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top",
-               "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top",
-               "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom",
-               "Box_1_1/Front&Box_1_1/Right&Box_1_1/Bottom",
-               "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top",
-               "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top",
-               "Box_1_1/Back&Box_1_1/Right&Box_1_1/Bottom")
+point_names = ("[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]",
+               "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]",
+               "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]",
+               "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]",
+               "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]",
+               "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]",
+               "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]",
+               "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]")
 points = [model.selection("VERTEX", name) for name in point_names]
 
 Polyline_7 = model.addPolyline3D(Part_2_doc, points, False)
@@ -154,4 +153,4 @@ model.end()
 # =============================================================================
 # Test 11. Check Python dump
 # =============================================================================
-assert(model.checkPythonDump())
\ No newline at end of file
+assert(model.checkPythonDump())
index 6253c1e0f9124b80188785f53bd140f45d731665..0ede7a1d262ef2d592c14d791c825c0ada493aea 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
index f0be3f0a06fafafbe339a52671da8d3f6b0d38a8..c42cf9530f3134800aa378576c8af19a9a1f4e97 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -45,7 +44,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_2.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 40)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_5 = Sketch_2.addLine(20, 0, 0, 0)
 SketchLine_6 = Sketch_2.addLine(0, 0, 0, 20)
@@ -58,7 +57,7 @@ SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(),
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_9 = SketchProjection_2.createdFeature()
 SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchLine_5.startPoint(), SketchLine_9.result())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_9).startPoint(), SketchLine_5.endPoint())
@@ -75,7 +74,7 @@ SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_12.result())
 SketchConstraintEqual_3 = Sketch_2.setEqual(SketchLine_6.result(), SketchLine_12.result())
 model.do()
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r_wire")])
 AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OZ"), 270, 2)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "AngularCopy_1_1_1"), model.selection("FACE", "AngularCopy_1_1_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7f-SketchLine_10f-SketchLine_11f-SketchLine_12f")], model.selection(), 40, 0)
@@ -90,17 +89,17 @@ SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_14.endPoint()
 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
 SketchConstraintHorizontal_7 = Sketch_3.setHorizontal(SketchLine_15.result())
 SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_16.result())
-SketchProjection_3 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_5s-SketchLine_15s-SketchLine_8e-SketchLine_14e"), False)
+SketchProjection_3 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_5_StartVertex"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates())
-SketchProjection_4 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_11s-SketchLine_10e"), False)
+SketchProjection_4 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_EndVertex"), False)
 SketchPoint_3 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchAPI_Point(SketchPoint_3).coordinates())
-SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"), False)
+SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), False)
 SketchPoint_4 = SketchProjection_5.createdFeature()
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_13.startPoint(), SketchAPI_Point(SketchPoint_4).coordinates())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r")], model.selection(), 20, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r")], model.selection(), 20, 0)
 Box_1 = model.addBox(Part_1_doc, 20, 20, 20)
 model.do()
 
@@ -125,12 +124,12 @@ def createSolidStepByStep(theSelection, theExpected):
 # =============================================================================
 boundaries1 = [model.selection("FACE", "Face_1_1"),
                model.selection("SHELL", "Shell_1_1"),
-               model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+               model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_14"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_15"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_16"),
+               model.selection("FACE", "Extrusion_2_1/To_Face"),
                model.selection("FACE", "Box_1_1/Front")]
 expectSolid1 = [False, False, False, False, False, False, False, True, False]
 Solid_1 = createSolidStepByStep(boundaries1, expectSolid1)
@@ -141,12 +140,12 @@ assert(Solid_1 is None)
 # =============================================================================
 boundaries2 = [model.selection("FACE", "Face_1_1"),
                model.selection("SHELL", "Shell_1_1"),
-               model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16r"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_1_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_3"),
-               model.selection("FACE", "Extrusion_2_1/Generated_Face_4"),
-               model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+               model.selection("FACE", "Sketch_3/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"),
+               model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_15"),
+               model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_3/SketchLine_16"),
+               model.selection("FACE", "Extrusion_2_1/To_Face"),
                model.selection("FACE", "Box_1_1/Front")]
 expectSolid2 = [False, False, False, False, False, False, False, False, True]
 Solid_2 = createSolidStepByStep(boundaries2, expectSolid2)
diff --git a/src/BuildPlugin/Test/TestSolid_ErrorMsg.py b/src/BuildPlugin/Test/TestSolid_ErrorMsg.py
new file mode 100644 (file)
index 0000000..ae1babf
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Solid_1 = aPart.addFeature("Solid")
+aSession.finishOperation()
+assert(Solid_1.error() != "")
index 7fc9813c776a113f28fdb0b04a5d3d329765b9ef..a98c2b1c939ac6584e14b84e693d875f4a1d453a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -160,9 +159,9 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(),
 SketchPoint_1 = Sketch_1.addPoint(-490.566037735849, 50.600343053173)
 SketchPoint_2 = Sketch_1.addPoint(-423.670668953688, 50.600343053173)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_2_2r")])
-SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_2_2")])
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")])
 SubShapes_1.setBaseShape(model.selection("FACE", "Face_2_1"))
 model.end()
 
diff --git a/src/BuildPlugin/Test/TestSubShapes_ErrorMsg.py b/src/BuildPlugin/Test/TestSubShapes_ErrorMsg.py
new file mode 100644 (file)
index 0000000..58c4926
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Polyline_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]")]
+Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, False)
+model.do()
+
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("WIRE", "Polyline_1_1"), [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")])
+assert(SubShapes_1.feature().error() != "")
+Part_1_doc.removeFeature(SubShapes_1.feature())
+
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("WIRE", "Polyline_1_1"), [model.selection("EDGE", "Polyline_1_1/Generated_Edge&weak_name_4")])
+assert(SubShapes_1.feature().error() == "")
+
+model.end()
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+
+aSession.startOperation()
+SubShapes_2 = featureToCompositeFeature(Part_1.feature()).addFeature("SubShapes")
+SubShapes_2.execute()
+assert(SubShapes_2.error() == "")
+aSession.finishOperation()
+
+model.begin()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(30, -30, -30, -30)
+SketchLine_2 = Sketch_1.addLine(-30, -30, -30, 30)
+SketchLine_3 = Sketch_1.addLine(-30, 30, 30, 30)
+SketchLine_4 = Sketch_1.addLine(30, 30, 30, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine4r-SketchLine3r-SketchLine2r-SketchLine1r"), [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+assert(SubShapes_1.feature().error() != "")
+Part_1_doc.removeFeature(SubShapes_1.feature())
+
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("WIRE", "Polyline_1_1"), [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+assert(SubShapes_1.feature().error() != "")
+Part_1_doc.removeFeature(SubShapes_1.feature())
+
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("WIRE", "Polyline_1_1"), [model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")])
+assert(SubShapes_1.feature().error() != "")
+Part_1_doc.removeFeature(SubShapes_1.feature())
+
+model.end()
index ad17017281391cfa222b553b608c38900e2e1c27..c9fcd95441450738029112b7f5c66ffbb70084c3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
diff --git a/src/BuildPlugin/Test/TestVertex_ErrorMsg.py b/src/BuildPlugin/Test/TestVertex_ErrorMsg.py
new file mode 100644 (file)
index 0000000..3de3412
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Vertex_1 = aPart.addFeature("Vertex")
+Vertex_1.execute()
+assert(Vertex_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = Vertex_1.selectionList("base_objects")
+aBaseObjectsList.append("", "EDGE")
+Vertex_1.execute()
+assert(Vertex_1.error() != "")
+aSession.finishOperation()
index 25dd4ecb24e203e9f26f5107eb2b5684e8bf372d..0bbbbce8fefbae0c8b8572f4b646ef490eddb5c0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -111,7 +110,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
 Wire_1.addContour()
 model.end()
 
@@ -134,12 +133,12 @@ aBoxShape = aBoxResult.shape()
 aSession.startOperation()
 aWireFeature2 = aPart.addFeature("Wire")
 aBaseObjectsList = aWireFeature2.selectionList("base_objects")
-aBaseObjectsList.append("Box_1_1/Front&Box_1_1/Bottom", "EDGE")
-aBaseObjectsList.append("Box_1_1/Front&Box_1_1/Right", "EDGE")
-aBaseObjectsList.append("Box_1_1/Right&Box_1_1/Top", "EDGE")
-aBaseObjectsList.append("Box_1_1/Back&Box_1_1/Top", "EDGE")
-aBaseObjectsList.append("Box_1_1/Back&Box_1_1/Left", "EDGE")
-aBaseObjectsList.append("Box_1_1/Left&Box_1_1/Bottom", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Front][Box_1_1/Bottom]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Front][Box_1_1/Right]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Right][Box_1_1/Top]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Back][Box_1_1/Top]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Back][Box_1_1/Left]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Left][Box_1_1/Bottom]", "EDGE")
 aSession.finishOperation()
 
 # Test results
@@ -177,4 +176,4 @@ aSession.startOperation()
 aPart.removeFeature(aWireFeature3)
 aSession.finishOperation()
 
-assert(model.checkPythonDump())
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
diff --git a/src/BuildPlugin/Test/TestWire_ErrorMsg.py b/src/BuildPlugin/Test/TestWire_ErrorMsg.py
new file mode 100644 (file)
index 0000000..2c4bd6f
--- /dev/null
@@ -0,0 +1,87 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+aBoxResult = aBox.firstResult()
+aBoxShape = aBoxResult.shape()
+
+aSession.startOperation()
+Wire_1 = aPart.addFeature("Wire")
+Wire_1.execute()
+assert(Wire_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = Wire_1.selectionList("base_objects")
+aBaseObjectsList.append("[Box_1_1/Left][Box_1_1/Top]", "EDGE")
+aBaseObjectsList.append("[Box_1_1/Right][Box_1_1/Top]", "EDGE")
+Wire_1.execute()
+assert(Wire_1.error() != "")
+aSession.finishOperation()
+
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+Wire_1 = model.addWire(Part_1_doc, [])
+Wire_1.addContour()
+Part_1_doc.removeFeature(Wire_1.feature())
+
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")])
+Wire_1.addContour()
+Part_1_doc.removeFeature(Wire_1.feature())
+
+Wire_1 = model.addWire(Part_1_doc, [model.selection("FACE", "Box_1_1/Top")])
+Wire_1.addContour()
+Part_1_doc.removeFeature(Wire_1.feature())
+
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(26.2037104714363, 14.67693246486999, 44.63854591961698, 30.23007341140914)
+SketchLine_2 = Sketch_1.addLine(44.63854591961698, 30.23007341140914, 20.93564110678636, 53.45762191102688)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+model.do()
+
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Wire_1.addContour()
+Part_1_doc.removeFeature(Wire_1.feature())
+
+model.end()
index 32efcf2d298a1218594e38ca5d214ef9ef7ced65..5984821f952b9620316cd4baba85fe06e5b857dc 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Objects:"
index bdeb1df498d763e6ea807581f29ffc2d99b9a3e1..ccad859480a22f36d7ffade180236377b90dd3c6 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Solids and CompSolids:"
index 0394678d586706a6445eefcd8467adbe60fe4c43..ef01e11f3158cfe76c9746b612663927d9d997be 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Compound_1_objects = [model.selection("FACE", "Box_1_1/Front"),
-                      model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                      model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"),
-                      model.selection("EDGE", "Box_1_1/Back&Box_1_1/Top")]
+Compound_1_objects = [model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Left")]
 Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
 model.do()
 model.end()
index 38f0254684b4283a32570a05d50320b2d30b7c42..24dccbb20da30b9e3e2f91efbd0c2adc62e36062 100644 (file)
@@ -7,9 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Edge_1_objects = [model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Front&Box_1_1/Left")]
-Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")])
 model.do()
 model.end()
index d912bd38746969f52e096ce033ac53871d38ad40..b95a1ec1d1806585fa7a36db309d49e055417d6c 100644 (file)
@@ -7,8 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Edges = [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top")]
-Filling_1 = model.addFilling(Part_1_doc, Edges)
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]")])
 model.do()
 model.end()
index be911ea9465266d957398093faa4ff6136c56058..9001d465f7e46f0ec62dc8a7b463c04e4a93a752 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Interpolation_1_objects = [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"),
-                           model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top")]
+Interpolation_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]")]
 Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, True, False)
 model.do()
 model.end()
index 9596db81130e3a6d2af6b64dead4f1a4dd820dca..4f54f0123741de4a34bcb5808736d02ec3427377 100644 (file)
@@ -9,7 +9,7 @@ Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Point_2 = model.addPoint(Part_1_doc, -10, -5, -7)
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
-Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Bottom")]
+Polyline_1_objects = [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]")]
 Polyline_1 = model.addPolyline3D(Part_1_doc, Polyline_1_objects, False)
 model.do()
 model.end()
index 4f0519ff7c0c85ca5718a20cdd3c3b978ae46fd0..cbeb0e718b4b8694c915d0f731734ac1b4fa71c6 100644 (file)
@@ -8,22 +8,17 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-56.65008576329333, 13.33962264150944, 9.528301886792452, 66.69811320754719)
-SketchLine_1.result().setColor(225, 0, 0)
 SketchLine_2 = Sketch_1.addLine(9.528301886792452, 66.69811320754719, 78.47855917667239, -27.54545454545455)
-SketchLine_2.result().setColor(225, 0, 0)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchLine_3 = Sketch_1.addLine(78.47855917667239, -27.54545454545455, 7.795883361921087, -89.2195540308748)
-SketchLine_3.result().setColor(225, 0, 0)
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchLine_4 = Sketch_1.addLine(7.795883361921087, -89.2195540308748, 12.64665523156088, -20.9622641509434)
-SketchLine_4.result().setColor(225, 0, 0)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchLine_5 = Sketch_1.addLine(12.64665523156088, -20.9622641509434, -56.65008576329333, 13.33962264150944)
-SketchLine_5.result().setColor(225, 0, 0)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.startPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r")])
-SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")])
 model.do()
 model.end()
index ea2979b7fc61956975c072e5bd72d27940177703..2b0c5ce657c2a91bec4090ab0b98febdd8d7efbd 100644 (file)
@@ -7,11 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Vertex_1_objects = [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"),
-                    model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Bottom")]
+Vertex_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")]
 Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects)
 model.do()
 model.end()
index 36497d8fff4b5a7e7fd5b5f7b053828bd543c75e..47925a3e1d1aaadc3858e48207320eaf4d3cb0d7 100644 (file)
@@ -7,10 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Wire_1_objects = [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Right&Box_1_1/Top"),
-                  model.selection("EDGE", "Box_1_1/Back&Box_1_1/Top")]
+Wire_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 model.do()
 model.end()
index ca65f6eadfd3e634e7af9c07d53d7fb35a8f3155..3aa7d16c2538581dbd7aa993406f34983609caa4 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Edges:"
index 38bce738472b8dcb2fbea87b872afaa8a44468dc..80aa05a46c96ccae4aa45090443792fa4bbf3ae9 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Segments and wires:"
index 2e08d24bae409b14c6087097d9116b85d4f0d770..da22fc0d7e730bcf9a71c57db38d1a0722260b77 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Segments and wires:"
index eb8e3e1382ffb53e36351b9ae15775b4d179d599..0922732438ef65d4a8d512541e0b3e125e29b744 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Points and vertices:"
index af32a2c622c80c6ad8c0353bb1261746aa42cd24..86725380fbc204a7e12a22be8e192477164c3c6e 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Build" document="Part">
     <group id="Generate">
index 6f45ba36283737c06b074aa616fe6cfa67e82b8d..3760b4ede9ef4553f3ef708d6986f08dd3d807e8 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Points and vertices:"
index f5ad261073a40766de1b55d6f83899bd28b590a3..27b8e3971b7d716b5053cca6e5466bc721943d4e 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Faces and shells:"
index c427af36ee8ce3a8d8980c7685832d24b56ff220..4eb1ce88f4a5baad96eb0b30a9746bc13e94caa5 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Faces and shells:"
index 93ca0cb22d69187c2ec9d9f183f110716291f1d2..7d74c0c9adb10ab2e7dc112c8b179763f106e6ca 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <shape_selector id="base_shape"
                   label="Shape:"
index 250af6d497388e7cf3e57593c0c18610316dafb4..446ed1a454937c22e96ce2c2fcad9f6fcad8ff92 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Vertices:"
index c29612880b2b92777945f9721cd95741cf3295b0..87f03df669d4cec1dff81c0e1ba1ef9fda2f40ad 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Segments and wires:"
index 62543034bc44965ca640f9bd44978aad7b136b83..a29a97b96bfacf05d5811eb4b2aed8386e214f2e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 49dc6fc42cd8fa34a4ca13d34397277d35d9fab6..9cf5e8ecad87d6c1bc4cdcdd36f16a9d9b0d150e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef COLLECTIONAPI_H
index 26d54394e2322dbb11935bb6144019b6ee05f086..c27d56cb22240e9bc29f2187c5b7deee85e2c28a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* CollectionAPI.i */
index 314fc8625e87b12e376533e8e5238ee68f6afbf3..e1337dafb20f01218c380d4b4e9b51c1b4885673 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionAPI_Field.h"
index 3753d57682f74b83975a5e274263d9fc3b65c3fa..f1a29f7353379db3933f7f7f53f0ba5f044062a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionAPI_Field_H_
index e6660beec193d03309016dfeceed7ef0d8bc018e..ee6594416638b53f776a2a959e0d37a3e40c3efc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionAPI_Group.h"
@@ -64,13 +63,19 @@ void CollectionAPI_Group::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrList = aBase->selectionList(CollectionPlugin_Group::LIST_ID());
 
-  theDumper << aBase << " = model.addGroup(" << aDocName << ", " << anAttrList << ")" << std::endl;
+  theDumper << aBase << " = model.addGroup(" << aDocName << ", " << anAttrList;
+  if (anAttrList->isGeometricalSelection())
+    theDumper <<", True";
+  theDumper << ")" << std::endl;
 }
 
 //==================================================================================================
 GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theGroupList)
+                  const std::list<ModelHighAPI_Selection>& theGroupList,
+                  const bool theShareSameTopology)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(CollectionAPI_Group::ID());
+  if (theShareSameTopology)
+    aFeature->selectionList(CollectionPlugin_Group::LIST_ID())->setGeometricalSelection(true);
   return GroupPtr(new CollectionAPI_Group(aFeature, theGroupList));
 }
index bb92ff1b81a5e64c0fc2b0359ac716a47ded3335..284737e1c087a2bcff1da8a2c80e2552e3010470 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionAPI_Group_H_
@@ -70,6 +69,7 @@ typedef std::shared_ptr<CollectionAPI_Group> GroupPtr;
 /// \brief Create Group feature.
 COLLECTIONAPI_EXPORT
 GroupPtr addGroup(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theGroupList);
+                  const std::list<ModelHighAPI_Selection>& theGroupList,
+                  const bool theShareSameTopology = false);
 
 #endif // CollectionAPI_Group_H_
index 674ea7e083acd72af5fce5378bfa0a70f9553283..1ed8befc4f43f3d7a83bd2e8bccfb80c1d671b2b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -35,7 +34,7 @@ SET(PROJECT_HEADERS
     CollectionPlugin_Field.h
     CollectionPlugin_WidgetCreator.h
     CollectionPlugin_WidgetField.h
-       CollectionPlugin_Validators.h
+    CollectionPlugin_Validators.h
 )
 
 SET(PROJECT_MOC_HEADERS
@@ -48,7 +47,7 @@ SET(PROJECT_SOURCES
     CollectionPlugin_Field.cpp
     CollectionPlugin_WidgetCreator.cpp
     CollectionPlugin_WidgetField.cpp
-       CollectionPlugin_Validators.cpp
+    CollectionPlugin_Validators.cpp
 )
 
 SET(XML_RESOURCES
@@ -105,8 +104,27 @@ INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 
 ADD_UNIT_TESTS(
                TestGroup.py
+               TestGroup2.py
                TestField.py
                TestGroup1799.py
-               TestGroupMove.py
-               TestGroupMove2.py
+               TestGroupMove01.py
+               TestGroupMove02.py
+               TestGroupMove03.py
+               TestGroupMove04.py
+               TestGroupMove05.py
+               TestGroupMove06.py
+               TestGroupMove07.py
+               TestGroupMove08.py
+               TestGroupMove09.py
+               TestGroupMove10.py
+               TestGroupMove11.py
+               TestGroupMove12.py
+               TestGroupMove13.py
+               TestGroupMove14.py
+               TestGroupMove15.py
+               TestGroupMove16.py
+               TestGroupMove17.py
+               TestGroupMove18.py
+               TestGroupMove19.py
+               TestGroupShareTopology.py
 )
index 981d3a8e369843fef1ef3f0975f9db6e6ff8c50f..79d34ac7999d7fd3f4df200d6bb487102b3423c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef COLLECTIONPLUGIN_H
index 2e91e8d541c5007637b8dac627d98ffd1ad4176c..fd3784273a751f0397a156a81ffd64ebf291d7d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionPlugin_Field.h"
index 5f90fac7140e07a9f4661c185a5d65ba884d47fc..d1c438cb12f649606eb1b42bb0a00c05ed8e1dcd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef COLLECTIONPLUGIN_FIELD_H_
index f2a5624a10c0581b4f5d5319f2a24809a9fa60b1..cd5ef4108a6b27548f44d1dde74f2c319c8e0d81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionPlugin_Group.h"
index c76887a48ff3022d2c6874c12387dd1db334a896..0d61046e3b5dfe003c37fbe7b5b8e93c36a510d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef COLLECTIONPLUGIN_GROUP_H_
index 9ef0bd736eded51dd68ea35738b17f59501db57c..1720030882a1ea8675a2aeb58a6d32adcc0eb322 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <CollectionPlugin_Plugin.h>
index edaf9f61594a2c3e62ed8c24ea3441f8cc3f9c6c..1f5defa19c2da359c92a1a4c5d2e5183e2190555 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionPlugin_Plugin_H_
index aaa9d6f84155c9cf8d16cde4a47bee88e9c2864d..0c765092eebd034c7e34b5bf713508c0f61f7b6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionPlugin_Validators.h"
index 8b0ef2f6fb9c69e9ba98c9d349730d5347e5f962..5932e2c4f7d163e8228d2a2407ab00261656bcd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionPlugin_Validators_H
index 7629876319410fe6641371f26f3748e7c6e264da..00315646c576782474871d79743f101cc273e27d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionPlugin_WidgetCreator.h"
index ef5c098e46a0c935653f59cd5501a78a6e75ce40..0c012ec6295fa9df67095960faedc321da83f1cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionPlugin_WidgetCreator_H
index 235a45d390528d0a3969b87ccaaa67410a15193d..52a54c022b656b3cf0bc8fd46d414673b00b3121 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "CollectionPlugin_WidgetField.h"
index f862fb49c51535eaaebca9038a2b6762b9aef09b..748d3551c745e1861d4bc88932242be6e5b2115a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CollectionPlugin_WidgetField_H
index 3fc6ade66f4cf2391f22de93e4df1b5cdd051ca3..a50d23150784f8801c64ac55d2048da775bfb4cc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestBoolean.py
@@ -73,16 +72,10 @@ aLineCEndPoint.setValue(-100., 0.)
 aSession.finishOperation()
 # Build sketch faces
 aSession.startOperation()
-aSketchResult = aTriangleSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm")).dir()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aSketchEdges, aSketchFaces)
+aSketchResult = modelAPI_ResultConstruction(aTriangleSketchFeature.firstResult())
 # Create extrusion on them
 anExtrusionFt = aPart.addFeature("Extrusion")
-anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(50)
@@ -98,9 +91,9 @@ aSession.startOperation()
 aField = aSession.activeDocument().addFeature("Field")
 aSelectionListAttr = aField.selectionList("selected")
 aSelectionListAttr.setSelectionType("vertex")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]")
 aComponentNames = aField.stringArray("components_names")
 aComponentNames.setSize(2) # two components
 aComponentNames.setValue(0, "temperatue")
@@ -127,7 +120,7 @@ aSession.startOperation()
 aField = aSession.activeDocument().addFeature("Field")
 aSelectionListAttr = aField.selectionList("selected")
 aSelectionListAttr.setSelectionType("face")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1")
 aComponentNames = aField.stringArray("components_names")
 aComponentNames.setSize(1) # one component
 aComponentNames.setValue(0, "description")
@@ -153,7 +146,7 @@ aSession.startOperation()
 aField = aSession.activeDocument().addFeature("Field")
 aSelectionListAttr = aField.selectionList("selected")
 aSelectionListAttr.setSelectionType("face")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1")
 aComponentNames = aField.stringArray("components_names")
 aComponentNames.setSize(1) # one component
 aComponentNames.setValue(0, "description")
@@ -177,7 +170,7 @@ aSession.startOperation()
 aField = aSession.activeDocument().addFeature("Field")
 aSelectionListAttr = aField.selectionList("selected")
 aSelectionListAttr.setSelectionType("face")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1")
 aComponentNames = aField.stringArray("components_names")
 aComponentNames.setSize(1) # one component
 aComponentNames.setValue(0, "description")
index 0ecbd0ddcc35cf5f50bed2d186012f50daaac617..a9000b46add65976b6a7a58aeb7b7d3ace4c5411 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestBoolean.py
@@ -73,21 +72,13 @@ aLineCEndPoint.setValue(-100., 0.)
 aSession.finishOperation()
 # Build sketch faces
 aSession.startOperation()
-aSketchResult = aTriangleSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm")).dir()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aSketchEdges, aSketchFaces)
+aSketchResult = modelAPI_ResultConstruction(aTriangleSketchFeature.firstResult())
 # Create extrusion on them
 anExtrusionFt = aPart.addFeature("Extrusion")
-anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(50)
-anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
 anExtrusionFt.execute()
 aSession.finishOperation()
 anExtrusionBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
@@ -98,12 +89,12 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("vertex")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]")
 aSession.finishOperation()
 #=========================================================================
 # Check results
@@ -118,15 +109,15 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("edge")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
-aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/From_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]")
+aSelectionListAttr.append("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]")
 aSession.finishOperation()
 #=========================================================================
 # Check results
@@ -175,7 +166,7 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("face")
-aSelectionListAttr.append("Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/To_Face")
 aSession.finishOperation()
 #=========================================================================
 # Check results
@@ -206,26 +197,17 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert(len(aCircleSketchFaces) > 0)
-assert(aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert(aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
-anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(50)
-anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
 anExtrusionFt.execute()
 aSession.finishOperation()
 aCylinderBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
index cacc2aeacd67405ed469f03040c55ae5273ecb8d..24a314c4379259ec6b4c791ce4a651fe4f3fed83 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # This test is based on the issue 1799: after faces are splitted and group is moved
 # down, the group-faces also must be splitted, the AttributeSelectionList should contain
@@ -114,13 +113,13 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_7.result(), 250)
 SketchConstraintEqual_4 = Sketch_1.setEqual(SketchLine_9.result(), SketchLine_11.result())
 SketchConstraintEqual_5 = Sketch_1.setEqual(SketchLine_7.result(), SketchLine_2.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_5f-SketchLine_6f-SketchLine_9r-SketchLine_10r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchCircle_1_2r-SketchLine_7f-SketchLine_9f-SketchLine_12r"), model.selection("FACE", "Sketch_1/Face-SketchLine_4f-SketchCircle_1_2r-SketchLine_8f-SketchLine_11r-SketchLine_12f"), model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_3f-SketchCircle_1_2r-SketchLine_10f-SketchLine_11f")], model.selection(), 150, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/To_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_3"), model.selection("FACE", "Extrusion_1_1/To_Face_2")])
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_15"), 150, True)
-Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_7"), 150, True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_10r-SketchCircle_1_2r-SketchLine_9r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_9f-SketchCircle_1_2r-SketchLine_12r-SketchLine_7f"), model.selection("FACE", "Sketch_1/Face-SketchLine_4f-SketchLine_12f-SketchCircle_1_2r-SketchLine_11r-SketchLine_8f"), model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_3f-SketchLine_11f-SketchCircle_1_2r-SketchLine_10f")], model.selection(), 150, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_4/To_Face"), model.selection("FACE", "Extrusion_1_1_3/To_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_6"), 150, True)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4"), 150, True)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Plane_1"), model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("FACE", "Plane_2")])
-Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Partition_1_1_7/Modified_Face_2_4"), 110, True)
-Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Partition_1_1_5/Modified_Face_3_4"), 380, True)
+Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Partition_1_1_7/Modified_Face&Sketch_1/SketchLine_3"), 110, True)
+Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Partition_1_1_5/Modified_Face&Sketch_1/SketchLine_8"), 380, True)
 Partition_2 = model.addPartition(Part_1_doc, [model.selection("FACE", "Plane_3"), model.selection("COMPSOLID", "Partition_1_1"), model.selection("FACE", "Plane_4")])
 model.do()
 
diff --git a/src/CollectionPlugin/Test/TestGroup2.py b/src/CollectionPlugin/Test/TestGroup2.py
new file mode 100644 (file)
index 0000000..3efcf9c
--- /dev/null
@@ -0,0 +1,111 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that splitted edges in the group are still correct edges in the group
+# Based on the CEA report mail 04.12.2018, page 4
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+from ModelAPI import *
+from GeomAPI import *
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+param_p = model.addParameter(Part_1_doc, "r", "15")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchArc_1 = Sketch_1.addArc(7.5, 7.5, 22.5, 7.499992770095306, 7.499999582962127, 22.5, False)
+SketchLine_1 = Sketch_1.addLine(7.499999582962127, 22.5, 7.499999582962127, 52.5)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
+SketchLine_2 = Sketch_1.addLine(22.5, 7.499992770095306, 52.5, 7.499992770095306)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
+SketchArc_2 = Sketch_1.addArc(7.5, 7.5, 52.5, 7.499992770095306, 7.499999582962127, 52.5, False)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.center(), SketchArc_2.center())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_2.startPoint())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_1.endPoint())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "r*2")
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_2.result())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "r")
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], "3*r")
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_2.center(), "r/2")
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_1.center(), "r/2")
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_2_2f-SketchLine_1r-SketchArc_1_2r")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_2_2f-SketchLine_1r-SketchArc_1_2r"))
+SketchCircle_1 = Sketch_2.addCircle(27.71638597484288, 11.4805029721516, 3)
+SketchCircle_2 = Sketch_2.addCircle(45.03912720992525, 18.6558173277981, 3)
+SketchLine_3 = Sketch_2.addLine(0, 0, 45.03912720992525, 18.6558173277981)
+SketchLine_3.setAuxiliary(True)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_3.startPoint(), SketchPoint_2.result())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchLine_3.endPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_3.result(), SketchCircle_1.center())
+SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_1.results()[1], "r/5")
+SketchConstraintRadius_4 = Sketch_2.setRadius(SketchCircle_2.results()[1], "r/5")
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_3.startPoint(), SketchCircle_1.center(), "2*r", True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_3.endPoint(), "r*1.25", True)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_4 = SketchProjection_3.createdFeature()
+SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_4.result(), SketchLine_3.result(), "r*1.5")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 10, 0)
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("EDGE", "PartSet/OZ"), "90.-r*3", 2)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Face_1_1/Modified_Edge&Sketch_1/SketchArc_1_2")])
+Group_1.setName("edge_int")
+Group_1.result().setName("edge_int")
+Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Face_1_1/Modified_Edge&Sketch_1/SketchLine_2")])
+Group_2.setName("edge_bottom")
+Group_2.result().setName("edge_bottom")
+Group_3 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Face_1_1/Modified_Edge&Sketch_1/SketchLine_1")])
+Group_3.setName("edge_left")
+Group_3.result().setName("edge_left")
+Group_4 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Face_1_1/Modified_Edge&Sketch_1/SketchArc_2_2")])
+Group_4.setName("edge_ext")
+Group_4.result().setName("edge_ext")
+model.do()
+# change parameter "p" to make one ylinder split bottom and left edges
+param_p.setValue(12)
+model.end()
+
+# check that int and ext groups are still edges, bottom and left groups are compounds of edges
+aFactory = ModelAPI_Session.get().validators()
+
+for group in [Group_1, Group_4]:
+  assert(aFactory.validate(group.feature()))
+  selectionList = group.feature().selectionList("group_list")
+  assert(selectionList.size() == 1)
+  assert(group.groupList().value(0).value().shapeType() == GeomAPI_Shape.EDGE)
+
+for group in [Group_2, Group_3]:
+  assert(aFactory.validate(group.feature()))
+  selectionList = group.feature().selectionList("group_list")
+  assert(selectionList.size() == 2)
+  assert(group.groupList().value(0).value().shapeType() == GeomAPI_Shape.EDGE)
+  assert(group.groupList().value(1).value().shapeType() == GeomAPI_Shape.EDGE)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove.py b/src/CollectionPlugin/Test/TestGroupMove.py
deleted file mode 100644 (file)
index dd1e0c1..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-# Test that box partitioned is splitted: group with edge becomes 2 edges group,
-# group with not-touched vertex keeps this vertex.
-
-from salome.shaper import model
-from ModelAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 20, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), 10, True)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")])
-Group_2 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
-model.do()
-# move groups
-Part_1_doc.moveFeature(Group_1.feature(), Partition_1.feature())
-Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
-model.end()
-
-# Check groups
-aFactory = ModelAPI_Session.get().validators()
-selectionList = Group_1.feature().selectionList("group_list")
-assert(selectionList.size() == 2)
-assert(aFactory.validate(Group_1.feature()))
-
-selectionList = Group_2.feature().selectionList("group_list")
-assert(selectionList.size() == 1)
-assert(aFactory.validate(Group_2.feature()))
diff --git a/src/CollectionPlugin/Test/TestGroupMove01.py b/src/CollectionPlugin/Test/TestGroupMove01.py
new file mode 100644 (file)
index 0000000..fb3768c
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that box partitioned is splitted: group with edge becomes 2 edges group,
+# group with not-touched vertex keeps this vertex.
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 20, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), 10, True)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+model.do()
+# move groups
+Part_1_doc.moveFeature(Group_1.feature(), Partition_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# Check groups
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_2.feature()))
diff --git a/src/CollectionPlugin/Test/TestGroupMove02.py b/src/CollectionPlugin/Test/TestGroupMove02.py
new file mode 100644 (file)
index 0000000..e764e5c
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that removed vertex, selected in the group makes empty group => invalid one
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 20)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"))
+Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1"))
+Remove_SubShapes_1.setSubShapesToKeep([model.selection("SOLID", "Partition_1_1_2")])
+model.do()
+# move group
+Part_1_doc.moveFeature(Group_1.feature(), Remove_SubShapes_1.feature())
+model.end()
+
+# Check group
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 0)
+assert(aFactory.validate(Group_1.feature()) == False)
diff --git a/src/CollectionPlugin/Test/TestGroupMove03.py b/src/CollectionPlugin/Test/TestGroupMove03.py
new file mode 100644 (file)
index 0000000..495bd4b
--- /dev/null
@@ -0,0 +1,86 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that partition divides cylinder into 4 faces, there is no edges in a group moved to the end
+# Based on the CEA report mail 04.12.2018, page 2
+
+from SketchAPI import *
+
+from ModelAPI import *
+from GeomAPI import *
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchArc_1 = Sketch_1.addArc(-1.103476974288834e-12, 24.99999999999979, 24.49489742783218, 30, 0, 50, False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result())
+SketchLine_2 = Sketch_1.addLine(0, 50, -10, 50)
+SketchLine_2.setAuxiliary(True)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_2.result())
+SketchLine_3 = Sketch_1.addLine(24.49489742783218, 30, 24.49489742783218, 5)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(24.49489742783218, 5, 34.49489742783218, 5)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(34.49489742783218, 5, 34.49489742783218, 0)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_6 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
+SketchLine_7 = Sketch_1.addLine(34.49489742783218, 0, 0, 0)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 50, 0, 0)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_8.endPoint())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_4.result(), 10)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_5.result(), 5)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 25)
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_8.result(), 50)
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_2.result(), 10)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 25)
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3")])
+Partition_1_objects = [model.selection("SOLID", "Revolution_1_1"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/YOZ")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+model.do()
+
+# move group
+Part_1_doc.moveFeature(Group_1.feature(), Partition_1.feature())
+model.end()
+
+# Check group: result must be four faces
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(4):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove04.py b/src/CollectionPlugin/Test/TestGroupMove04.py
new file mode 100644 (file)
index 0000000..4755468
--- /dev/null
@@ -0,0 +1,64 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Cylinders divided to two by cut, then each divided to
+# two by partition by plane, then resulting compsolids are collected in compound.
+# Checking that group on initial extrusion moved to the end contains the corresponding
+# results, but divided.
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-4.602216748768477, 10.94581280788177, 9.660420057801511)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 1, True)
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_2 = Sketch_2.addCircle(-5.643073116097736, 11.91382008305256, 15.03576198961618)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")], model.selection(), 2, -4)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("COMPOUND", "Cut_1_1"), model.selection("FACE", "Plane_1")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1"), model.selection("COMPSOLID", "Partition_1_2")])
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Compound_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+aFactory = ModelAPI_Session.get().validators()
+# check group 1: cylindical face is divided to 6 (because of seam edge)
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_1.feature()))
+
+# check group 2: solid is divided to 4 solids
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_2.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove05.py b/src/CollectionPlugin/Test/TestGroupMove05.py
new file mode 100644 (file)
index 0000000..400fdab
--- /dev/null
@@ -0,0 +1,103 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history.
+# Faces and edges of a box has been collected to groups. After that, the box has been copied.
+# Check that groups moved to the end contain corresponding results.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+Group_2_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), 15, 2)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), LinearCopy_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+# check group 1: all solids in compound should be selected
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_1.feature()))
+# check group 2: number of faces is multiplied twice than original
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_2.feature()))
+# check group 3: number of edges is multiplied twice than original
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 24)
+assert(aFactory.validate(Group_3.feature()))
+
+model.begin()
+LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_1_1")], model.selection("EDGE", "PartSet/OY"), 15, 2, model.selection("EDGE", "PartSet/OZ"), 15, 2)
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), LinearCopy_2.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+# check group 1: all solids in compound should be selected
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 8)
+assert(aFactory.validate(Group_1.feature()))
+# check group 2: number of faces is multiplied twice than original
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 48)
+assert(aFactory.validate(Group_2.feature()))
+# check group 3: number of edges is multiplied twice than original
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 96)
+assert(aFactory.validate(Group_3.feature()))
+
+model.begin()
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "LinearCopy_2_1_1_1"), model.selection("SOLID", "LinearCopy_2_1_1_2")], model.selection("EDGE", "PartSet/OZ"), 2)
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), AngularCopy_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+# check group 1: all solids in compound should be selected
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_1.feature()))
+# check group 2: number of faces is multiplied twice than original
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 24)
+assert(aFactory.validate(Group_2.feature()))
+# check group 3: number of edges is multiplied twice than original
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 48)
+assert(aFactory.validate(Group_3.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove06.py b/src/CollectionPlugin/Test/TestGroupMove06.py
new file mode 100644 (file)
index 0000000..93b000b
--- /dev/null
@@ -0,0 +1,128 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history.
+# Copied boxes are involved to Fill operation.
+# Check the groups of initial boxes moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"))
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "Axis_1"), 10, 2)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "LinearCopy_1_1_1")])
+Group_2_objects = [model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Back"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Top"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Right"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Left"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Bottom"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Back][LinearCopy_1_1_1/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Back][LinearCopy_1_1_1/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Back][LinearCopy_1_1_1/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Back][LinearCopy_1_1_1/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Right][LinearCopy_1_1_1/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Left][LinearCopy_1_1_1/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Left][LinearCopy_1_1_1/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Right][LinearCopy_1_1_1/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Front][LinearCopy_1_1_1/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Front][LinearCopy_1_1_1/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Front][LinearCopy_1_1_1/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_1/MF:Translated&Box_1_1/Front][LinearCopy_1_1_1/MF:Translated&Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4 = model.addGroup(Part_1_doc, [model.selection("SOLID", "LinearCopy_1_1_2")])
+Group_5_objects = [model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Back"), model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Top"), model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Right"), model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Left"), model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom"), model.selection("FACE", "LinearCopy_1_1_2/MF:Translated&Box_1_1/Front")]
+Group_5 = model.addGroup(Part_1_doc, Group_5_objects)
+Group_6_objects = [model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Back][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Right][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Left][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Left][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Right][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Bottom]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Left]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[LinearCopy_1_1_2/MF:Translated&Box_1_1/Front][LinearCopy_1_1_2/MF:Translated&Box_1_1/Top]")]
+Group_6 = model.addGroup(Part_1_doc, Group_6_objects)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Left"), model.selection("FACE", "LinearCopy_1_1_1/MF:Translated&Box_1_1/Right"))
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "LinearCopy_1_1_1")], [model.selection("SOLID", "LinearCopy_1_1_2"), model.selection("FACE", "Plane_1")])
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Fill_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+Part_1_doc.moveFeature(Group_5.feature(), Group_4.feature())
+Part_1_doc.moveFeature(Group_6.feature(), Group_5.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+# groups related to original box should be split
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 13)
+assert(aFactory.validate(Group_2.feature()))
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 19)
+assert(aFactory.validate(Group_3.feature()))
+
+# groups related to the copied box should contain only the elements connected with the original box
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_4.feature()))
+
+selectionList = Group_5.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_5.feature()))
+
+selectionList = Group_6.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_6.feature()))
+
+
+model.begin()
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Fill_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Fill_1_1_2/Modified_Face&Box_1_1/Right][(Fill_1_1_2/Modified_Face&Box_1_1/Right)(Fill_1_1_2/Modified_Face&Plane_1/Plane_1)(Fill_1_1_2/Modified_Face&Box_1_1/Front)(Fill_1_1_2/Modified_Face&Box_1_1/Top)2(Fill_1_1_2/Modified_Face&Box_1_1/Left)2]")])
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_2")], [model.selection("FACE", "Filling_1_1")])
+model.do()
+# move groups to the end once again
+Part_1_doc.moveFeature(Group_1.feature(), Fill_2.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+Part_1_doc.moveFeature(Group_5.feature(), Group_4.feature())
+Part_1_doc.moveFeature(Group_6.feature(), Group_5.feature())
+model.end()
+
+# groups related to original box should be split
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 16)
+assert(aFactory.validate(Group_2.feature()))
+
+selectionList = Group_3.feature().selectionList("group_list")
+# one of edges should disappear, due to its belonging to the face of the filling
+assert(selectionList.size() == 18)
+assert(aFactory.validate(Group_3.feature()))
+
+# groups related to the copied box should be split correspondingly
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_4.feature()))
+
+selectionList = Group_5.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_5.feature()))
+
+selectionList = Group_6.feature().selectionList("group_list")
+assert(selectionList.size() == 5)
+assert(aFactory.validate(Group_6.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove07.py b/src/CollectionPlugin/Test/TestGroupMove07.py
new file mode 100644 (file)
index 0000000..78c711f
--- /dev/null
@@ -0,0 +1,83 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history.
+# Faces and edges of a box has been collected to groups. After that, the box has been symmetried.
+# Check that groups moved to the end contain corresponding results.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+Group_2_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("FACE", "Box_1_1/Left"), False)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Symmetry_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+# check group 1: solids should be selected
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+# check group 2: number of faces is the same
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_2.feature()))
+# check group 3: number of edges is the same
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_3.feature()))
+
+model.begin()
+Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1")], model.selection("VERTEX", "[Symmetry_1_1/MF:Symmetried&Box_1_1/Front][Symmetry_1_1/MF:Symmetried&Box_1_1/Left][Symmetry_1_1/MF:Symmetried&Box_1_1/Bottom]"), True)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Symmetry_2.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+# check group 1: all solids in compound should be selected
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_1.feature()))
+# check group 2: number of faces is multiplied twice than original
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_2.feature()))
+# check group 3: number of edges is multiplied twice than original
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 24)
+assert(aFactory.validate(Group_3.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove08.py b/src/CollectionPlugin/Test/TestGroupMove08.py
new file mode 100644 (file)
index 0000000..cb32516
--- /dev/null
@@ -0,0 +1,128 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Fillet operation.
+# Check the groups of initial solids moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+Group_2_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Group_4 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")])
+Group_5_objects = [model.selection("FACE", "Cylinder_1_1/Face_1"), model.selection("FACE", "Cylinder_1_1/Face_2"), model.selection("FACE", "Cylinder_1_1/Face_3")]
+Group_5 = model.addGroup(Part_1_doc, Group_5_objects)
+Group_6_objects = [model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]"), model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_3]"), model.selection("EDGE", "([Cylinder_1_1/Face_1][Cylinder_1_1/Face_2])([Cylinder_1_1/Face_1][Cylinder_1_1/Face_3])")]
+Group_6 = model.addGroup(Part_1_doc, Group_6_objects)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")], 2)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Fillet_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+# groups related to original box should be split
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_2.feature()))
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 11)
+assert(aFactory.validate(Group_3.feature()))
+
+model.begin()
+Fillet_2 = model.addFillet(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_2")], 2)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_4.feature(), Fillet_2.feature())
+Part_1_doc.moveFeature(Group_5.feature(), Group_4.feature())
+Part_1_doc.moveFeature(Group_6.feature(), Group_5.feature())
+model.end()
+
+# groups related to original cylinder should be split
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_4.feature()))
+
+selectionList = Group_5.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_5.feature()))
+
+selectionList = Group_6.feature().selectionList("group_list")
+assert(selectionList.size() == 2) # edge selected for the fillet become removed
+assert(aFactory.validate(Group_6.feature()))
+
+model.begin()
+Fillet_3 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Fillet_1_1/MF:Fillet&Box_1_1/Front][Fillet_1_1/MF:Fillet&Box_1_1/Left]")], 1, 2)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Fillet_3.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+Part_1_doc.moveFeature(Group_5.feature(), Group_4.feature())
+Part_1_doc.moveFeature(Group_6.feature(), Group_5.feature())
+model.end()
+
+# groups related to original box should be split
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_2.feature()))
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 9)
+assert(aFactory.validate(Group_3.feature()))
+
+# groups related to original cylinder should stay untouched
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_4.feature()))
+
+selectionList = Group_5.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_5.feature()))
+
+selectionList = Group_6.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_6.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove09.py b/src/CollectionPlugin/Test/TestGroupMove09.py
new file mode 100644 (file)
index 0000000..050ee48
--- /dev/null
@@ -0,0 +1,75 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. FuseFaces operation.
+# Check the groups of initial solids moved to the end contain the corresponding
+# results, but merged faces.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1"), model.selection("SOLID", "Box_1_1")])
+Union_1_objects = [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2"), model.selection("SOLID", "Partition_1_1_3")]
+Union_1 = model.addUnion(Part_1_doc, Union_1_objects)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Union_1_1")])
+Group_2_objects = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1"), model.selection("FACE", "Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2"), model.selection("FACE", "Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2"), model.selection("FACE", "Partition_1_1_3/Modified_Face&Box_1_1/Back"), model.selection("FACE", "Partition_1_1_3/Modified_Face&Box_1_1/Bottom"), model.selection("FACE", "Partition_1_1_3/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Partition_1_1_3/Modified_Face&Box_1_1/Left"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1]"), model.selection("EDGE", "([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3])(Partition_1_1_3/Generated_Edge&Box_1_1/Back&Cylinder_1_1/Face_1)([Partition_1_1_3/Modified_Face&Box_1_1/Back][Partition_1_1_3/Modified_Face&Box_1_1/Bottom])([Partition_1_1_3/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3])_Union_1_1"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Back][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "Partition_1_1_3/Generated_Edge&Box_1_1/Back&Cylinder_1_1/Face_1"), model.selection("EDGE", "([Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2][Partition_1_1_3/Modified_Face&Box_1_1/Top])([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1])([Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Back])(Partition_1_1_3/Generated_Edge&Box_1_1/Back&Cylinder_1_1/Face_1)_Union_1_1"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Back]"), model.selection("EDGE", "([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Left])([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3])([Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom])([Partition_1_1_3/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3])_Union_1_1"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2][Partition_1_1_3/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "([Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2][Partition_1_1_3/Modified_Face&Box_1_1/Top])([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1])([Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left])([Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Left])_Union_1_1"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Right][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Box_1_1/Front]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2][Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "[Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[_weak_name_10_Union_1_1]e[_weak_name_4_Union_1_1]e"), model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Box_1_1/Right][Box_1_1/Front]"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3][Partition_1_1_3/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3]"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Top&Cylinder_1_1/Face_2][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_2][Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Back]"), model.selection("VERTEX", "[Box_1_1/Right][Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[_weak_name_3_Union_1_1]e[_weak_name_9_Union_1_1]e"), model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Back][Box_1_1/Right]"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_1][Partition_1_1_3/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Cylinder_1_1/Face_3][Partition_1_1_3/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Box_1_1/Bottom&Cylinder_1_1/Face_3]"), model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Back][Box_1_1/Right][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Union_1_1"))
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), FusionFaces_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+# number of solids should be the same
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+
+# same-plane faces should be merged
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 7)
+assert(aFactory.validate(Group_2.feature()))
+
+# shared edges of merged faces should be deleted
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 15)
+assert(aFactory.validate(Group_3.feature()))
+
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 10)
+assert(aFactory.validate(Group_4.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove10.py b/src/CollectionPlugin/Test/TestGroupMove10.py
new file mode 100644 (file)
index 0000000..ee973fd
--- /dev/null
@@ -0,0 +1,71 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-8, 20, 25)
+SketchLine_1 = Sketch_1.addLine(40, 32, -5, 32)
+SketchLine_2 = Sketch_1.addLine(-5, 32, -5, 5)
+SketchLine_3 = Sketch_1.addLine(-5, 5, 40, 5)
+SketchLine_4 = Sketch_1.addLine(40, 5, 40, 32)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+# to create groups of faces, edges and vertices
+model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc)
+model.do()
+Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Extrusion_1_1"))
+Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3")])
+model.do()
+# move groups to the end
+LastFeature = Remove_SubShapes_1.feature()
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", 0))) # move always the very first group
+  Part_1_doc.moveFeature(GroupFeature, LastFeature)
+  LastFeature = GroupFeature
+model.end()
+
+aFactory = ModelAPI_Session.get().validators()
+
+# Check groups
+a = 0
+num_in_groups = [1, 10, 15, 7]
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
+  assert(GroupFeature.selectionList("group_list").size() == num_in_groups[a])
+  a = a + 1
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove11.py b/src/CollectionPlugin/Test/TestGroupMove11.py
new file mode 100644 (file)
index 0000000..76186a6
--- /dev/null
@@ -0,0 +1,72 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Scale operation.
+# Check the groups of initial solids moved to the end contain the corresponding results.
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-15, 30, 30)
+SketchCircle_2 = Sketch_1.addCircle(15, 25, 25)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_1_1_3/From_Face"), model.selection("FACE", "Extrusion_1_1_3/To_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2][weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_2_2][weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/From_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[_weak_name_5_Extrusion_1_1_3]e[_weak_name_2_Extrusion_1_1_3]e[_weak_name_4_Extrusion_1_1_3]e"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[_weak_name_5_Extrusion_1_1_3]e[_weak_name_1_Extrusion_1_1_3]e[_weak_name_3_Extrusion_1_1_3]e"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"), model.selection("VERTEX", "[_weak_name_6_Extrusion_1_1_3]e[_weak_name_2_Extrusion_1_1_3]e[_weak_name_4_Extrusion_1_1_3]e"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/To_Face]"), model.selection("VERTEX", "[_weak_name_6_Extrusion_1_1_3]e[_weak_name_1_Extrusion_1_1_3]e[_weak_name_3_Extrusion_1_1_3]e"), model.selection("VERTEX", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_2/From_Face]"), model.selection("VERTEX", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1_1/From_Face]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 2)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Scale_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 5)
+assert(aFactory.validate(Group_2.feature()))
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 9)
+assert(aFactory.validate(Group_3.feature()))
+
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 6)
+assert(aFactory.validate(Group_4.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove12.py b/src/CollectionPlugin/Test/TestGroupMove12.py
new file mode 100644 (file)
index 0000000..28485b6
--- /dev/null
@@ -0,0 +1,81 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Translation operation.
+# Check the groups of initial boxes moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back"))
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
+Group_2_objects = [model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Front"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Right")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "Partition_1_1_1/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "Partition_1_1_3/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Top][Partition_1_1_2/Modified_Face&Box_1_1/Right]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "Partition_1_1_4/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_4/Modified_Face&Box_1_1/Front][Partition_1_1_4/Modified_Face&Box_1_1/Bottom][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("VERTEX", "Partition_1_1_1/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Plane_1/Plane_1][Partition_1_1_2/Modified_Face&Plane_2/Plane_2]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Bottom][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Right][Partition_1_1_2/Modified_Face&Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+model.do()
+model.end()
+
+num_in_groups = [2, 4, 12, 9]
+moveGroupsAndVerify(Part_1_doc, Translation_1.feature(), num_in_groups)
+
+model.begin()
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Translation_1_1")], 10, 10, 0)
+model.end()
+moveGroupsAndVerify(Part_1_doc, Translation_2.feature(), num_in_groups)
+
+model.begin()
+Translation_3 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Translation_2_1")], model.selection("VERTEX", "[Translation_2_1_1/MF:Translated&Box_1_1/Back][Translation_2_1_1/MF:Translated&Box_1_1/Bottom][Translation_2_1_1/MF:Translated&Box_1_1/Left]"), model.selection("VERTEX", "PartSet/Origin"))
+model.end()
+moveGroupsAndVerify(Part_1_doc, Translation_3.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove13.py b/src/CollectionPlugin/Test/TestGroupMove13.py
new file mode 100644 (file)
index 0000000..4df0bcf
--- /dev/null
@@ -0,0 +1,75 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Rotation operation.
+# Check the groups of initial boxes moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back"))
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
+Group_2_objects = [model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Front"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Right")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "Partition_1_1_1/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "Partition_1_1_3/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Top][Partition_1_1_2/Modified_Face&Box_1_1/Right]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "Partition_1_1_4/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_4/Modified_Face&Box_1_1/Front][Partition_1_1_4/Modified_Face&Box_1_1/Bottom][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("VERTEX", "Partition_1_1_1/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Plane_1/Plane_1][Partition_1_1_2/Modified_Face&Plane_2/Plane_2]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Bottom][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Right][Partition_1_1_2/Modified_Face&Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")], model.selection("EDGE", "PartSet/OX"), 45)
+model.end()
+
+num_in_groups = [2, 4, 12, 9]
+moveGroupsAndVerify(Part_1_doc, Rotation_1.feature(), num_in_groups)
+
+model.begin()
+Rotation_2 = model.addRotation(Part_1_doc, [model.selection("COMPSOLID", "Rotation_1_1")], model.selection("VERTEX", "[Rotation_1_1_3/MF:Rotated&Box_1_1/Top][Rotation_1_1_3/MF:Rotated&Box_1_1/Front][Rotation_1_1_3/MF:Rotated&Box_1_1/Left]"), model.selection("VERTEX", "[Rotation_1_1_4/MF:Rotated&Box_1_1/Front][Rotation_1_1_4/MF:Rotated&Box_1_1/Bottom][Rotation_1_1_4/MF:Rotated&Box_1_1/Right]"), model.selection("VERTEX", "[Rotation_1_1_2/MF:Rotated&Box_1_1/Back][Rotation_1_1_2/MF:Rotated&Box_1_1/Right][Rotation_1_1_2/MF:Rotated&Box_1_1/Bottom]"))
+model.end()
+moveGroupsAndVerify(Part_1_doc, Rotation_2.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove14.py b/src/CollectionPlugin/Test/TestGroupMove14.py
new file mode 100644 (file)
index 0000000..8bc4d00
--- /dev/null
@@ -0,0 +1,75 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Scale operation.
+# Check the groups of initial boxes moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back"))
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
+Group_2_objects = [model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Front"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Right")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "Partition_1_1_1/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "Partition_1_1_3/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Top][Partition_1_1_2/Modified_Face&Box_1_1/Right]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "Partition_1_1_4/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_4/Modified_Face&Box_1_1/Front][Partition_1_1_4/Modified_Face&Box_1_1/Bottom][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("VERTEX", "Partition_1_1_1/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Plane_1/Plane_1][Partition_1_1_2/Modified_Face&Plane_2/Plane_2]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Bottom][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Right][Partition_1_1_2/Modified_Face&Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Scale_1 = model.addScale(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 2)
+model.end()
+
+num_in_groups = [2, 4, 12, 9]
+moveGroupsAndVerify(Part_1_doc, Scale_1.feature(), num_in_groups)
+
+model.begin()
+Scale_2 = model.addScale(Part_1_doc, [model.selection("COMPSOLID", "Scale_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 1 , 2, 3)
+model.end()
+moveGroupsAndVerify(Part_1_doc, Scale_2.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove15.py b/src/CollectionPlugin/Test/TestGroupMove15.py
new file mode 100644 (file)
index 0000000..eab7390
--- /dev/null
@@ -0,0 +1,71 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Placement operation.
+# Check the groups of initial boxes moved to the end contain the corresponding
+# results, but divided.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Front"))
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
+Group_2_objects = [model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Front"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Right")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_3/Modified_Face&Box_1_1/Top][Partition_1_1_3/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "Partition_1_1_1/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "Partition_1_1_3/Generated_Edge&Plane_1/Plane_1&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Front]"), model.selection("EDGE", "[Partition_1_1_4/Modified_Face&Box_1_1/Top][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_2/Plane_2&Box_1_1/Top"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Top]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_1_1/Top][Partition_1_1_2/Modified_Face&Box_1_1/Right]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Partition_1_1_3/Modified_Face&Box_1_1/Front][Partition_1_1_3/Modified_Face&Box_1_1/Left][Partition_1_1_3/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "Partition_1_1_4/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_4/Modified_Face&Box_1_1/Front][Partition_1_1_4/Modified_Face&Box_1_1/Bottom][Partition_1_1_4/Modified_Face&Box_1_1/Right]"), model.selection("VERTEX", "Partition_1_1_1/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Bottom][Partition_1_1_2/Modified_Face&Plane_1/Plane_1][Partition_1_1_2/Modified_Face&Plane_2/Plane_2]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_2/Plane_2&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Bottom][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("VERTEX", "Partition_1_1_2/Generated_Vertex&Plane_1/Plane_1&weak_name_1"), model.selection("VERTEX", "[Partition_1_1_2/Modified_Face&Box_1_1/Back][Partition_1_1_2/Modified_Face&Box_1_1/Right][Partition_1_1_2/Modified_Face&Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")], model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Bottom"), model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"), False, True)
+model.do()
+model.end()
+
+num_in_groups = [2, 4, 12, 9]
+moveGroupsAndVerify(Part_1_doc, Placement_1.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove16.py b/src/CollectionPlugin/Test/TestGroupMove16.py
new file mode 100644 (file)
index 0000000..ced352d
--- /dev/null
@@ -0,0 +1,70 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Compsolid operation.
+# Check the initial groups moved to the end contain the corresponding results.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+Group_2_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Top"))
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchCircle_1 = Sketch_1.addCircle(3.528942405489753, -5.938455554641368, 11.4411217503133)
+model.do()
+CompSolid_1 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")])
+model.do()
+model.end()
+
+num_in_groups = [2, 10, 16, 8]
+moveGroupsAndVerify(Part_1_doc, CompSolid_1.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove17.py b/src/CollectionPlugin/Test/TestGroupMove17.py
new file mode 100644 (file)
index 0000000..673f10f
--- /dev/null
@@ -0,0 +1,71 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Solid operation.
+# Check the initial groups moved to the end contain the corresponding results.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+Group_2_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Top"))
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchCircle_1 = Sketch_1.addCircle(3.528942405489753, -5.938455554641368, 11.4411217503133)
+model.do()
+Solid_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Right")]
+Solid_1 = model.addSolid(Part_1_doc, Solid_1_objects)
+model.do()
+model.end()
+
+num_in_groups = [1, 5, 8, 4]
+moveGroupsAndVerify(Part_1_doc, Solid_1.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove18.py b/src/CollectionPlugin/Test/TestGroupMove18.py
new file mode 100644 (file)
index 0000000..889fa54
--- /dev/null
@@ -0,0 +1,70 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Shell operation.
+# Check the initial groups moved to the end contain the corresponding results.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1_objects = [model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Right"), model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Bottom"), model.selection("FACE", "Box_1_1/Front")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("FACE", "Box_1_1/Back"))
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Shell_1_objects = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Back"), model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Left"), model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Back"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Front"), model.selection("FACE", "Partition_1_1_4/Modified_Face&Box_1_1/Right")]
+Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
+model.do()
+model.end()
+
+num_in_groups = [6, 13, 6]
+moveGroupsAndVerify(Part_1_doc, Shell_1.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove19.py b/src/CollectionPlugin/Test/TestGroupMove19.py
new file mode 100644 (file)
index 0000000..7fb558f
--- /dev/null
@@ -0,0 +1,79 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test of deep nested results history. Shell operation.
+# Check the initial groups moved to the end contain the corresponding results.
+
+from salome.shaper import model
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+def moveGroupsAndVerify(thePart, theLastFeature, theRefNumInGroups):
+    # move groups to the end
+    model.begin()
+    LastFeature = theLastFeature
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", 0))) # move always the very first group
+        Part_1_doc.moveFeature(GroupFeature, LastFeature)
+        LastFeature = GroupFeature
+    model.end()
+
+    a = 0
+    for i in range(thePart.size("Groups")):
+        GroupFeature = thePart.feature(objectToResult(thePart.object("Groups", i)))
+        assert(aFactory.validate(GroupFeature))
+        assert(GroupFeature.selectionList("group_list").size() == theRefNumInGroups[a])
+        a = a + 1
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(37.25033050129738, -29.31988879634488, -32.3129114537045, -29.31988879634488)
+SketchLine_2 = Sketch_1.addLine(-32.3129114537045, -29.31988879634488, -32.3129114537045, 42.23870159689701)
+SketchLine_3 = Sketch_1.addLine(-32.3129114537045, 42.23870159689701, 37.25033050129738, 42.23870159689701)
+SketchLine_4 = Sketch_1.addLine(37.25033050129738, 42.23870159689701, 37.25033050129738, -29.31988879634488)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
+Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Group_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_2")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("VERTEX", "Edge_1_1/Modified_Vertex&Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Edge_1_2/Modified_Vertex&Sketch_1/SketchLine_4_EndVertex"), model.selection("VERTEX", "Edge_1_1/Modified_Vertex&Sketch_1/SketchLine_1_EndVertex"), model.selection("VERTEX", "Edge_1_3/Modified_Vertex&Sketch_1/SketchLine_2_StartVertex"), model.selection("VERTEX", "Edge_1_4/Modified_Vertex&Sketch_1/SketchLine_3_EndVertex"), model.selection("VERTEX", "Edge_1_2/Modified_Vertex&Sketch_1/SketchLine_4_StartVertex"), model.selection("VERTEX", "Edge_1_3/Modified_Vertex&Sketch_1/SketchLine_2_EndVertex"), model.selection("VERTEX", "Edge_1_4/Modified_Vertex&Sketch_1/SketchLine_3_StartVertex")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Face_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+model.do()
+model.end()
+
+num_in_groups = [4, 4]
+moveGroupsAndVerify(Part_1_doc, Face_1.feature(), num_in_groups)
+
+assert(model.checkPythonDump())
diff --git a/src/CollectionPlugin/Test/TestGroupMove2.py b/src/CollectionPlugin/Test/TestGroupMove2.py
deleted file mode 100644 (file)
index 0f06d1d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-# Test that removed vertex, selected in the group makes group with one invalid element (empty shape)
-
-from salome.shaper import model
-from ModelAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 20)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"))
-Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
-Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1"))
-Remove_SubShapes_1.setSubShapesToKeep([model.selection("SOLID", "Partition_1_1_2")])
-model.do()
-# move group
-Part_1_doc.moveFeature(Group_1.feature(), Remove_SubShapes_1.feature())
-model.end()
-
-# Check group
-aFactory = ModelAPI_Session.get().validators()
-selectionList = Group_1.feature().selectionList("group_list")
-assert(selectionList.size() == 1)
-assert(aFactory.validate(Group_1.feature()) == False)
diff --git a/src/CollectionPlugin/Test/TestGroupShareTopology.py b/src/CollectionPlugin/Test/TestGroupShareTopology.py
new file mode 100644 (file)
index 0000000..d37d190
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from GeomAPI import *
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 3, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchCircle_1 = Sketch_1.addCircle(4.69238908106919, 4.989364948318125, 5.746414396356567)
+ExtrusionCut_1.setNestedSketch(Sketch_1)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Box_1_1/Top&weak_name_1")])
+model.do()
+# enable geometrical selection mode => 4 faces must be selected as one compound
+Group_1.groupList().setGeometricalSelection(True)
+model.do()
+assert(Group_1.groupList().size() == 1)
+assert(Group_1.groupList().value(0).value().shapeType() == GeomAPI_Shape.COMPOUND)
+
+# disable geometrical selection mode => 4 faces must be selected as 4 group elements
+Group_1.groupList().setGeometricalSelection(False)
+model.end()
+
+assert(Group_1.groupList().size() == 4)
+assert(Group_1.groupList().value(0).value().shapeType() == GeomAPI_Shape.FACE)
+assert(Group_1.groupList().value(1).value().shapeType() == GeomAPI_Shape.FACE)
+assert(Group_1.groupList().value(2).value().shapeType() == GeomAPI_Shape.FACE)
+assert(Group_1.groupList().value(3).value().shapeType() == GeomAPI_Shape.FACE)
diff --git a/src/CollectionPlugin/doc/examoles/field.py b/src/CollectionPlugin/doc/examoles/field.py
deleted file mode 100644 (file)
index f0d917a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from salome.shaper import model
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Field_1 = model.addField(Part_1_doc, 2, "DOUBLE", 2, ["DX", "DY"], [model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Top")])
-Field_1.addStep(0, 0, [[0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
-Field_1.addStep(1, 31, [[0.1, 0.2], [1.1, 2.1], [0.75, 3.1]])
-model.do()
-model.end()
diff --git a/src/CollectionPlugin/doc/examoles/group.py b/src/CollectionPlugin/doc/examoles/group.py
deleted file mode 100644 (file)
index 5c42ca4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from salome.shaper import model
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Cone_1_1/Face_1&Cone_1_1/Face_2"), model.selection("EDGE", "Cone_1_1/Face_1")])
-Group_1.setName("edges_cone")
-Group_1.result().setName("edges_cone")
-model.do()
-model.end()
diff --git a/src/CollectionPlugin/doc/examples/field.py b/src/CollectionPlugin/doc/examples/field.py
new file mode 100644 (file)
index 0000000..6ba1b0a
--- /dev/null
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Field_1_objects = [model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Box_1_1/Front")]
+Field_1 = model.addField(Part_1_doc, 2, "DOUBLE", 2, ["Comp 1", "Comp 2"], Field_1_objects)
+Field_1.addStep(0, 0, [[0, 0], [0.1, 0.2], [2.1, 1.7], [3.7, 1.95]])
+Field_1.addStep(1, 0, [[0, 0], [0.1, 0.2], [1.1, 2.1], [0.75, 3.1]])
+model.do()
+model.end()
diff --git a/src/CollectionPlugin/doc/examples/group.py b/src/CollectionPlugin/doc/examples/group.py
new file mode 100644 (file)
index 0000000..c66c5b1
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"), model.selection("EDGE", "[Cone_1_1/Face_1][Cone_1_1/Face_3]")])
+Group_1.result().setName("edges_cone")
+model.do()
+model.end()
index 0ff1eefb3646d319e1d10eb58940ac22416b635c..5b7923c7d8bfbb2781f8133e74e0df4abde6f163 100644 (file)
@@ -2,7 +2,7 @@
 Group
 =====
 
-A groups is a set of geometrical entities created by selection.
+A group is a set of geometrical entities created by selection of sub-shapes of the same type.
 To create a Group in the active part:
 
 #. select in the Main Menu *Features - > Group* item  or
@@ -43,10 +43,9 @@ Input fields:
          :align: left         
     Solids;
  
-- The list of selected entities of the given type.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection.
-
-To delete entities from the list, select them and call pop-up menu *Delete* item.
+- The list of selected entities of the given type.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection. To delete entities from the list, select them and call pop-up menu *Delete* item.
 
+- Control **Add elements that share the same topology** allows to add automatically all elements laying on the same topology that was selected and remove these elements if they have disappeared due to the parametrical update. They will be represented as one line in the list of selection and managed in the viewer as one object if this flag is enabled. If flag becomes disabled when such elements are already in the list, they will become divided in one line per one shape.
 
 **TUI Command**: *model.addGroup(Part_1_doc, [model.selection("EDGE", "Cone_1_1/Face_1&Cone_1_1/Face_2"), model.selection("EDGE", "Cone_1_1/Face_1")])*
 
index 4302628d381beaf2b88e6b5372428b9ac9d7cf64..1ae6dea67d541640fe0c36936b3704154f7957a7 100644 (file)
Binary files a/src/CollectionPlugin/doc/images/group_property_panel.png and b/src/CollectionPlugin/doc/images/group_property_panel.png differ
index 4696d9e790ce3ce22d81dcecab882b42034414e5..3a1f83feb772573df3df2b5e9777b445eddd0ea6 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <namevalue id="name"
     label="Name"
@@ -29,7 +8,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     type_choice="Vertices Edges Faces Solids"
     use_choice="true"
     clear_in_neutral_point="false"
-    filter_points="false" >
+    filter_points="false"
+    same_topology="true">
     <validator id="GeomValidators_BodyShapes"/>
   </multi_selector>
 </source>
\ No newline at end of file
index 4adfdf2184c477afe35492945954b6494b048e15..27057f56f81d62468e1d79f1235410329fe56840 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Features" document="Part">
     <group id="Collections">
index 05bafb324a93a8baff93cdcc2706b9aa02ba3209..0f98399769c2a7e127891688b50cdb37ffc1bdff 100644 (file)
@@ -1,24 +1,24 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
+INCLUDE(UnitTest)
 INCLUDE(XMLProcessing)
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
@@ -150,3 +150,8 @@ INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 
 INSTALL(TARGETS _ConfigAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
+
+
+ADD_UNIT_TESTS(
+  TestConfig.py
+)
index 2bf42f1a044bdbab5330e527da8cfb1d5dde10c8..5efdefab5133b79a0c053de8745fe3302909a43a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* Config.i */
 #define CONFIG_EXPORT
 
 %include "typemaps.i"
+%include "std_list.i"
 %include "std_string.i"
+%include "std_vector.i"
 
 %include "Config_ModuleReader.h"
 %include "Config_PropManager.h"
 %include "Config_Prop.h"
+
+// std::list -> []
+%template(ListOfString) std::list< std::string >;
+%template(listOfProp) std::list< Config_Prop* >;
+// std::vector -> []
+%template(VectorOfInteger) std::vector<int>;
index 32051337cd23c0e703978d8cd3146387bb639565..2fa71a8fa46c3bb659d12ae220f7cc0af8f1df1f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_AttributeMessage.h"
@@ -27,6 +26,7 @@ Config_AttributeMessage::Config_AttributeMessage(const Events_ID theId, const vo
   myFeatureId = std::string(); // Feature unique id
   myIsObligatory = true;
   myIsConcealment = false;
+  myIsGeometricalSelection = false;
 }
 
 Config_AttributeMessage::~Config_AttributeMessage()
@@ -94,3 +94,13 @@ void Config_AttributeMessage::setMainArgument(bool isMainArg)
 {
   myIsMainArgument = isMainArg;
 }
+
+bool Config_AttributeMessage::isGeometricalSelection() const
+{
+  return myIsGeometricalSelection;
+}
+
+void Config_AttributeMessage::setGeometricalSelection(bool isGeometricalSelection)
+{
+  myIsGeometricalSelection = isGeometricalSelection;
+}
index cb4ef232c79b2740c8768b8a49ccf716e3a57484..8e0aae0d087fb99ed51d6cadcd96d9135f83d61a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ATTRIBUTE_MESSAGE_H
@@ -42,6 +41,7 @@ class Config_AttributeMessage : public Events_Message
   bool myIsObligatory; ///< Required to be set by user, else it's feature is invalid.
   bool myIsConcealment; ///< If true, conceals features used as input
   bool myIsMainArgument; ///< Mark attribute as a main argument of the feature
+  bool myIsGeometricalSelection; ///< If true selects geometry instead of shape;
   ///< a list of pairs, if the attribute is placed inside paged containers: (case, switch)
   std::list<std::pair<std::string, std::string> > myCases;
 
@@ -69,6 +69,8 @@ public:
   CONFIG_EXPORT bool isConcealment() const;
   /// Returns true if attribute is a main argument of the feature
   CONFIG_EXPORT bool isMainArgument() const;
+  /// Returns true if attribute selects geometry instead of shape;
+  CONFIG_EXPORT bool isGeometricalSelection() const;
   /// Returns container of ids of pair of a case and switches
   CONFIG_EXPORT const std::list<std::pair<std::string, std::string> >& getCases() const;
   /// Sets ids of pair of a case and switches
@@ -84,6 +86,8 @@ public:
   CONFIG_EXPORT void setObligatory(bool isObligatory);
   /// Set a state that the attribute is a main argument of the feature
   CONFIG_EXPORT void setMainArgument(bool isMainArg);
+  /// Set attribute's geometrical selection state
+  CONFIG_EXPORT void setGeometricalSelection(bool isGeometricalSelection);
 };
 
 #endif // ATTRIBUTE_MESSAGE_H
index c83a33079f7df2bae5bbb7ee56fa48609e9e2e28..b071546e64e99522a194ce8d1822194373c5a40d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_Common.h"
@@ -94,6 +93,7 @@ bool isWidgetNode(xmlNodePtr theNode)
   return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NULL);
 }
 
+// LCOV_EXCL_START
 // widget api?
 bool isCaseNode(xmlNodePtr theNode)
 {
@@ -103,6 +103,7 @@ bool isCaseNode(xmlNodePtr theNode)
   return isNode(theNode, WDG_OPTIONALBOX, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX,
     WDG_RADIOBOX_ITEM, NULL);
 }
+// LCOV_EXCL_STOP
 
 bool hasChild(xmlNodePtr theNode)
 {
@@ -251,6 +252,7 @@ std::string getProperty(xmlNodePtr theNode, const char* thePropName)
   return result;
 }
 
+// LCOV_EXCL_START
 std::string getContent(xmlNodePtr theNode)
 {
   std::string result = "";
@@ -261,6 +263,7 @@ std::string getContent(xmlNodePtr theNode)
   xmlFree(aContent);
   return result;
 }
+// LCOV_EXCL_STOP
 
 std::string getNormalizedProperty(xmlNodePtr theNode, const char* thePropName)
 {
@@ -279,13 +282,6 @@ bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool
   return result;
 }
 
-CONFIG_EXPORT std::string normalize(const char* theString)
-{
-  if (!theString)
-    return std::string();
-  return normalize(std::string(theString));
-}
-
 CONFIG_EXPORT std::string normalize(const std::string& theString)
 {
   std::string result = theString;
index 0d30e234a3cd8ae324aaa2e34529685b887915ad..b00ab8f0a370cf2ea2fa2f7b6c9688d181408054 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_COMMON_H_
index 0fa959f8f9ffc30bb8103af4e8a27b80dd8a7ad6..3b12cebe72336a5516e4db6ea61e93f689bf8cc8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_DataModelReader.h"
@@ -24,7 +23,8 @@
 
 #include <Events_InfoMessage.h>
 
-
+// used only for GUI xml data reading
+// LCOV_EXCL_START
 Config_DataModelReader::Config_DataModelReader()
     : Config_XMLReader(DATAMODEL_FILE), isRootReading(true), myIsResultLink(false)
 {
@@ -132,4 +132,4 @@ std::string Config_DataModelReader::
 {
   return getFolderFeatures(theFolderName, myRootFolderNames, myRootFeaturesList);
 }
-
+// LCOV_EXCL_STOP
old mode 100755 (executable)
new mode 100644 (file)
index a0a4398..4ba610e
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_DATAMODELREADER_H_
index 8c93a8f42a627e48a0d197b1c81a3b2b148bfd50..c650cf48272ac933bacaf73a741fece63dd7f44f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_FeatureMessage.h"
index 466c8e9b0d9591ccea67495a8c34cc64ac3261c0..f4936056dbfe26986da43ca9bc2b4480a35e7acc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_FEATUREMESSAGE_H
index 377cb364e10d69e818bc5899874219317fbd9e42..719dd5eb136c5affbf1b8c74fb20d4dab2ab7649 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_Keywords.h>
@@ -89,6 +88,9 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode)
         aMessage->setConcealment(isConcealment);
         bool isMainArg = isConcealment && getBooleanAttribute(theNode, ATTR_MAIN_ARG, false);
         aMessage->setMainArgument(isMainArg);
+        aMessage->setGeometricalSelection(getBooleanAttribute(theNode,
+                                                              ATTR_GEOMETRICAL_SELECTION,
+                                                              false));
 
         std::list<std::pair<std::string, std::string> > aCases;
         xmlNodePtr aCaseNode = hasParentRecursive(theNode,
index de2c96ca9237c5a08f332480fd9fff9ec5d971b4..5dfb89cf0ff0278833dd87701c5b7a7d0bc948ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_FEATUREREADER_H_
index beb599b206d87450a827f5692f1d08c75881dc10..2d30633da83096feaa3f39cf5454d761f6e57cd0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_KEYWORDS_H_
@@ -100,6 +99,8 @@ const static char* ATTR_USE_RESET = "use_reset";
 const static char* ATTR_GREED = "greed";
 const static char* ATTR_MODIFIED_IN_EDIT = "modified_in_edit";
 const static char* ATTR_MAIN_ARG = "main_argument";
+const static char* ATTR_GEOMETRICAL_SELECTION = "geometrical_selection";
+
 
 // WDG_INFO properties
 const static char* INFO_WDG_TEXT = FEATURE_TEXT;
index d38885a64e2ae9f4469772fa3738725d5391208c..8c4119975c5bc78d1e7bd5e4f8a2acbad72a88b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
@@ -240,6 +239,7 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName)
   void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY | RTLD_GLOBAL );
   #endif
   if(!aModLib && theLibName != "DFBrowser") { // don't show error for internal debugging tool
+// LCOV_EXCL_START
     std::string anErrorMsg = "Failed to load " + aFileName;
     #ifdef WIN32
     DWORD   dwLastError = ::GetLastError();
@@ -257,6 +257,7 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName)
     #endif
     std::cerr << anErrorMsg << std::endl;
     Events_InfoMessage("Config_ModuleReader", anErrorMsg).send();
+// LCOV_EXCL_STOP
   }
 }
 
index eb9bd51dd4c9673b1af9e34d93eecf62a2a0c1d5..cfff8ca358ca8307042e34284655fec771c40e64 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_MODULEREADER_H_
index eaee691a6040a7c8b2d111eaf6576defab9d6bed..9f2a97670b5dce973d395c2a9235fcf0de9e7213 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_PluginMessage.h"
index 8778c3d59888a02d1885c286bed594439c924a29..7e8a0b31d359db6c81643ad3675823edd8db1da6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_PLUGINMESSAGE_H
index 3c840787646a6e7a45aa3b291672f6e01f99efac..26fe7334f53bc214c50aa4a8565a1987d7643d93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_PointerMessage.h>
 
+// LCOV_EXCL_START
 Config_PointerMessage::Config_PointerMessage(const Events_ID theId, const void* theParent)
     : Events_Message(theId, theParent),
       myPointer(0)
@@ -41,3 +41,4 @@ void Config_PointerMessage::setPointer(void* pointer)
 {
   myPointer = pointer;
 }
+// LCOV_EXCL_STOP
index 089dda571a30230ae61c51c5b25c45032fefb512..f0ad9b24159408741131103192df2432501213b0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARTSET_MESSAGE_H_
index b3045ba73882f599a83a1ce065c6efa9d3134354..426552370fc22dd5a03d23de0295d5a38518c8b9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_Prop.h"
index 564c0a2d00cadb05a9d9b647015ac8db17d0100a..fe97e96756c9990d7c3e6ff6e529b9dd2140492f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_PROP_H
index 4f6530dd38ee216084b6a5e8f87d2b70cb6d22f8..e9da0fad1b41aa0e54e19f4891e58a73c9403bb6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_PropManager.h"
@@ -24,7 +23,10 @@ std::vector<int> stringToRGB(const std::string& theColor);
 int stringToInteger(const std::string& theInt);
 bool stringToBoolean(const std::string& theInt);
 
-Config_Properties Config_PropManager::myProps;
+Config_Properties& Config_PropManager::props() {
+  static Config_Properties* confProps = new Config_Properties();
+  return *confProps;
+}
 
 
 Config_Prop* Config_PropManager::registerProp(const std::string& theSection,
@@ -54,7 +56,7 @@ Config_Prop* Config_PropManager::registerProp(const std::string& theSection,
   else {
     aProp =
       new Config_Prop(theSection, theName, theTitle, theType, theDefaultValue, theMin, theMax);
-    myProps.push_back(aProp);
+    props().push_back(aProp);
   }
   return aProp;
 }
@@ -62,7 +64,8 @@ Config_Prop* Config_PropManager::registerProp(const std::string& theSection,
 Config_Prop* Config_PropManager::findProp(const std::string& theSection, const std::string& theName)
 {
   Config_Properties::const_iterator aIt;
-  for (aIt = myProps.cbegin(); aIt != myProps.cend(); ++aIt) {
+  Config_Properties aProps = props();
+  for (aIt = aProps.cbegin(); aIt != aProps.cend(); ++aIt) {
     Config_Prop* aProp = (*aIt);
     if ((aProp->section() == theSection) && (aProp->name() == theName))
       return aProp;
@@ -74,7 +77,8 @@ Config_Properties Config_PropManager::getProperties()
 {
   Config_Properties aRes;
   Config_Properties::const_iterator aIt;
-  for (aIt = myProps.cbegin(); aIt != myProps.cend(); aIt++) {
+  Config_Properties aProps = props();
+  for (aIt = aProps.cbegin(); aIt != aProps.cend(); aIt++) {
     Config_Prop* aProp = (*aIt);
     if (aProp->type() != Config_Prop::Disabled)
       aRes.push_back(aProp);
@@ -87,7 +91,8 @@ std::list<std::string> Config_PropManager::getSections()
   // Return only non disabled sections
   std::list<std::string> aSections;
   Config_Properties::const_iterator aIt;
-  for (aIt = myProps.cbegin(); aIt != myProps.cend(); aIt++) {
+  Config_Properties aProps = props();
+  for (aIt = aProps.cbegin(); aIt != aProps.cend(); aIt++) {
     const Config_Prop* aProp = (*aIt);
     if (aProp->type() != Config_Prop::Disabled)
       aSections.push_back(aProp->section());
@@ -100,7 +105,8 @@ Config_Properties Config_PropManager::getProperties(const std::string& theSectio
 {
   Config_Properties aRes;
   Config_Properties::iterator aIt;
-  for (aIt = myProps.begin(); aIt != myProps.end(); aIt++) {
+  Config_Properties aProps = props();
+  for (aIt = aProps.begin(); aIt != aProps.end(); aIt++) {
     Config_Prop* aProp = (*aIt);
     if ((aProp->section() == theSection) && (aProp->type() != Config_Prop::Disabled))
       aRes.push_back(aProp);
index 00dd75b738ef4162cd9c7ed09df20f9b1e9c34e1..e0b2cd7e9891aa5688d812d681e6c34c3efcc9c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Config_PropManager_H
@@ -91,7 +90,7 @@ class Config_PropManager
   CONFIG_EXPORT static double stringToDouble(const std::string& theDouble);
 
  private:
-  CONFIG_EXPORT static Config_Properties myProps; ///< List of all stored properties
+  CONFIG_EXPORT static Config_Properties& props(); ///< List of all stored properties
 };
 
 #endif
index 5edd8d3dd6e3aa432566b54738b7d961f87154d2..1c29d17657a230d4349605c96d6a37219d913e5b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Config_Translator.h"
@@ -29,6 +28,7 @@
 #pragma warning(disable : 4996) // for sprintf
 #endif
 
+// LCOV_EXCL_START
 /**
  * \class Config_TSReader
  * \ingroup Config
@@ -118,6 +118,7 @@ bool Config_Translator::load(const std::string& theFileName)
   }
   return true;
 }
+// LCOV_EXCL_STOP
 
 std::string Config_Translator::translate(const Events_InfoMessage& theInfo)
 {
@@ -174,7 +175,7 @@ std::string Config_Translator::translate(const std::string& theContext,
   return aMsg;
 }
 
-
+// LCOV_EXCL_START
 std::string Config_Translator::codec(const std::string& theContext)
 {
   return (myCodecs.count(theContext) > 0)? myCodecs[theContext] : "UTF-8";
@@ -184,6 +185,7 @@ std::string Config_Translator::codec(const Events_InfoMessage& theInfo)
 {
   return codec(theInfo.context());
 }
+// LCOV_EXCL_STOP
 
 #ifdef _DEBUG
 #ifdef MISSED_TRANSLATION
index 476ae35af2df35893e6bd8a8db9bacee22a06dae..2e70fc434474c348b55a98eba428c54f75f80991 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Config_Translator_H
index 5e91a46fbf99c17bcea4e56d4345f86dc849473a..2d681d1572ec4ec639c0ce789268eb75a1ed3808 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_ValidatorMessage.h>
index bb7cc02bd134defedfbdcc6e07bfd0e04fa725b8..f5329a733a255f749a92de2a37dfb1c568c83279 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_VALIDATORMESSAGE_H_
index ccb3090115e2d8c8bd085765b716374d467ef504..e6b802a59efce057518a2c97b903e1494ca68cc6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_ValidatorReader.h>
index d6ee2fc550d09bdced54df1eeb2bf6869c173ad8..d4cdd39407069f4719e9fc8bd500c0718f1fd639 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_VALIDATORREADER_H_
index 023ad2868ff8a647c819510b5924cef3e8f8eae5..cc1dfa98629fbcf9116bdee0297b621728861d3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_WidgetAPI.h>
index ee15c64a142122410c525e02e8f4549615878d6d..8f3a826af57d208f111fce64551b01e245b9e8db 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_WIDGETAPI_H_
index 10eb506e46e667c677c897b458906f824ed997ee..5b785a55c22ad515e677ac47eaf06a7546ff142c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_WidgetReader.h>
index d3b208cabcc9572859552564bc9a83c939b8f154..527edb9269f65d085a36bdf4dafaf1ea0bd2daa0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_WIDGETREADER_H_
index f7af50c8f21e7a9ead3ecf0652948525c84bbe84..1d7de9c6badf7991aa510e618bec1af51394e483 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_XMLReader.h>
@@ -60,6 +59,7 @@ Config_XMLReader::~Config_XMLReader()
   xmlFreeDoc(myXmlDoc);
 }
 
+// LCOV_EXCL_START
 std::string Config_XMLReader::resourcesConfigFile()
 {
   std::string aValue;
@@ -91,6 +91,7 @@ std::string Config_XMLReader::pluginConfigFile()
   }
   return aValue;
 }
+// LCOV_EXCL_STOP
 
 std::string Config_XMLReader::findConfigFile(const std::string theFileName, const int theFindIndex)
 {
@@ -115,6 +116,7 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons
       if (!anEnv)
         continue;
       if (aSolution > 2) { // there may be several paths separated by ";" symbol
+// LCOV_EXCL_START
         std::string anEnvPart = anEnv;
         size_t aPosStart = 0, aPosEnd;
         for(int aSubNum = 0; aSubNum < aSolution - 3; aSubNum++) {
@@ -130,6 +132,7 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons
         aPosEnd = anEnvPart.find(';', aPosStart);
         aFileName = anEnvPart.substr(aPosStart,
           aPosEnd == std::string::npos ? aPosEnd : aPosEnd - aPosStart) + FSEP;
+// LCOV_EXCL_STOP
       } else {
         aFileName = std::string(anEnv) + FSEP;
       }
@@ -189,10 +192,12 @@ void Config_XMLReader::cleanup(xmlNodePtr)
   // do nothing;
 }
 
+// LCOV_EXCL_START
 bool Config_XMLReader::processChildren(xmlNodePtr aNode)
 {
   return true;
 }
+// LCOV_EXCL_STOP
 
 xmlNodePtr Config_XMLReader::findRoot(const std::string theDocumentPath)
 {
@@ -234,10 +239,12 @@ void Config_XMLReader::readRecursively(xmlNodePtr theParent)
   }
 }
 
+// LCOV_EXCL_START
 xmlNodePtr Config_XMLReader::node(void* theNode)
 {
   return static_cast<xmlNodePtr>(theNode);
 }
+// LCOV_EXCL_STOP
 
 std::string Config_XMLReader::getNodeName(xmlNodePtr theNode)
 {
@@ -258,10 +265,12 @@ void Config_XMLReader::storeAttribute(xmlNodePtr theNode, const char* theAttribu
   }
 }
 
+// LCOV_EXCL_START
 std::string Config_XMLReader::restoreAttribute(xmlNodePtr theNode, const char* theAttribute)
 {
   return restoreAttribute(getNodeName(theNode).c_str(), theAttribute);
 }
+// LCOV_EXCL_STOP
 
 std::string Config_XMLReader::restoreAttribute(const char* theNodeName, const char* theAttribute)
 {
@@ -290,7 +299,9 @@ bool Config_XMLReader::cleanupAttribute(const char* theNodeName, const char* the
   return result;
 }
 
+// LCOV_EXCL_START
 const char* Config_XMLReader::encoding() const
 {
   return (const char*) myXmlDoc->encoding;
-}
\ No newline at end of file
+}
+// LCOV_EXCL_STOP
index ab067cd4bce224b276b14408f716e805dc38041d..13b3a8b20908c073434c53443e6ad29c0f4a4d46 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_XMLREADER_H_
index 635ed0fe1a60b791f3bedd3612ec54dde892e26b..61a2740f848bd74842f60a8cc848929a3d4fa8ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONFIG_H
index cda0700d8d2d2c2d3e455e4312b1de6fdc737fa1..b39d5add81c03b605d462810e0f44c8009c00ba6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONFIG_SWIG_H_
diff --git a/src/Config/Test/TestConfig.py b/src/Config/Test/TestConfig.py
new file mode 100644 (file)
index 0000000..be8b580
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+from ConfigAPI import *
+
+# register boolean property
+Config_PropManager().registerProp("TestSection", "PropBool", "PropTitle", Config_Prop.Boolean)
+# check property once again
+Config_PropManager().registerProp("TestSection", "PropBool", "PropTitle", Config_Prop.Boolean, "true")
+# check property value
+assert(Config_PropManager().boolean("TestSection", "PropBool"))
+
+# register real property
+Config_PropManager().registerProp("TestSection", "PropDouble", "PropTitle", Config_Prop.Double, "12,5")
+# check property (',' should be substituted by ".")
+assert(Config_PropManager().real("TestSection", "PropDouble") == 12.5)
+
+# register color property
+Config_PropManager().registerProp("TestSection", "PropColor", "PropTitle", Config_Prop.Color, "#B00F00")
+assert(len(Config_PropManager().color("TestSection", "PropColor")) == 3)
+
+# check sections and properties are not empty
+assert(len(Config_PropManager().getSections()) > 0)
+assert(len(Config_PropManager().getProperties()) > 0)
+
+# verify the property
+prop = Config_PropManager().findProp("TestSection", "PropDouble")
+assert(prop is not None)
+prop.setTitle("PropTitle")
+assert(prop.title() == "PropTitle")
+prop.setMin("0")
+assert(prop.min() == "0")
+prop.setMax("100")
+assert(prop.max() == "100")
+prop.setType(Config_Prop.String)
+assert(prop.type() == Config_Prop.String)
index c16bfff708b6b79890f28a3a95a780654270949e..0d79b9be008cd83114e5cc61cededb05535f6b53 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <data_model>
     <root_document group_type="Features">
         <folder name="Parameters" group_type="Parameters" icon=":pictures/params_folder.png"
index 2969b9da6eeec9f779173f80e708f4a4e65ab53c..7734d59d8eb55f740b2fc0ef20cada1863bb329b 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
 <plugins module="PartSet">
   <!-- Initialization plugin must be first here to initialize the PartSet document -->
   <plugin library="InitializationPlugin"/>
@@ -8,11 +6,12 @@
   <plugin library="ConstructionPlugin" configuration="plugin-Construction.xml"/>
   <plugin library="BuildPlugin" configuration="plugin-Build.xml"/>
   <plugin library="PrimitivesPlugin" configuration="plugin-Primitives.xml"/>
-  <plugin library="GDMLPlugin" configuration="plugin-GDML.xml"/>
+  <!--<plugin library="GDMLPlugin" configuration="plugin-GDML.xml"/>-->
   <plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
   <plugin library="CollectionPlugin" configuration="plugin-Collection.xml"/>
   <plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
   <plugin script="addons_Features" configuration="addons_Features.xml"/>
+  <plugin library="SketchPlugin" configuration="plugin-SketchDrawer.xml"/>
   <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" dependency="GEOM"/>
   <plugin library="ParametersPlugin" configuration="plugin-Parameters.xml"/>
 @DEFAULT_SOLVER@
index 188969238fbae9bc0bbc97d7d88c98a8950e7e5e..c604d3455fac59e61370f2af7cff25abf05d163c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index b63048c69838afe1ce7405c4b434d7ef7cec400d..34df97f46aa949abc15b436254dc1667588211f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONNECTORAPI_H
index 61b839a180c0304bb2ce817465ea21e8a2be6fcb..b84368ef825396e5fbe43394716a603281425cb4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ConnectorAPI.i */
index 074a14ee334ab65c5cea7edaa79206b20e4d659c..ff3089708f775b793412b29696730704db9552aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConnectorAPI_Connector.h"
index 49255e4b7d42139685ba7cb33fac59f684f31462..d4d7ef026446763bd2624e7df9d4c8b1329c780f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONNECTORAPI_CONNECTORAPI_PART_H_
index 72fd90e26cd0b9da673421450fd83b2b24a5251c..6e21f205a1bd11972368d12c410217a6d75dcd56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONNECTORAPI_CONNECTORAPI_SWIG_H_
old mode 100755 (executable)
new mode 100644 (file)
index 1506027..127d70a
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -56,4 +56,4 @@ INSTALL(FILES CTestTestfileInstall.cmake
   DESTINATION ${TEST_INSTALL_DIRECTORY}
   RENAME CTestTestfile.cmake)
 
-INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
\ No newline at end of file
+INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
index 92cde25ed1c3c9e3a3fbfb89fc2cfb6ac70f9d3a..3cc3a721fd7c05c4653baa04d8e3e7078b4f64d3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016  CEA/DEN, EDF R&D
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index c5e567add8944df4d4ab177ef1482015576a11a4..631a08c27a4793b1611bea0e8204bdb566b79496 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import salome
 from salome.shaper import model
@@ -86,8 +85,8 @@ def testSeveralExportsToGEOM():
   Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
   Box_2 = model.addBox(Part_1_doc, 20, 20, 20)
   Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), -10)
-  Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")])
-  Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face_1_2"), model.selection("FACE", "Box_2_1/Top")])
+  Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Translation_1_1"), model.selection("SOLID", "Box_2_1")])
+  Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"), model.selection("FACE", "Box_2_1/Top")])
   model.do()
   model.end()
 
index ca2b9045a3183ea3692be57ab8d3035dfa5b5562..0b552dcb1b488b9ec69c41494e77f1143fe6af08 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 # -*- coding: utf-8 -*-
 
 import os
@@ -89,13 +88,13 @@ def testGroupsAndFieldsExportToGEOM():
   Box_3 = model.addBox(Part_1_doc, 10, 10, 10)
   Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("EDGE", "PartSet/OX"), 20)
   Translation_2.result().setName("Translation_2_1")
-  Group_1_objects = [model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")]
+  Group_1_objects = [model.selection("FACE", "Translation_1_1/MF:Translated&Box_1_1/Top"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/MF:Translated&Box_3_1/Top")]
   Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
   Group_1.result().setName("faces_top")
-  Group_2_objects = [model.selection("EDGE", "Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2")]
+  Group_2_objects = [model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Left][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Left][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("EDGE", "[Translation_2_1/MF:Translated&Box_3_1/Left][Translation_2_1/MF:Translated&Box_3_1/Bottom]")]
   Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
   Group_2.result().setName("edges_x")
-  Group_3_objects = [model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_1_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2")]
+  Group_3_objects = [model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Left][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Right][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Back][Translation_2_1/MF:Translated&Box_3_1/Right][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Box_2_1/Front][Box_2_1/Right][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("VERTEX", "[(Partition_1_1_2/Modified_Face&Box_2_1/Back&Box_1_1/Front)(Partition_1_1_2/Modified_Face&Box_2_1/Left)(Box_2_1/Right)(Partition_1_1_2/Modified_Face&Box_2_1/Bottom)(Box_2_1/Top)][Box_2_1/Right][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_2_1/Back&Box_1_1/Front][Translation_1_1/MF:Translated&Box_1_1/Right][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Translation_1_1/MF:Translated&Box_1_1/Right][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Left][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]")]
   Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
   Group_3.result().setName("vertices_bottom")
   Group_4 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Translation_2_1")])
@@ -104,15 +103,15 @@ def testGroupsAndFieldsExportToGEOM():
   Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_1_objects)
   Field_1.result().setName("Field_solids")
   Field_1.addStep(0, 0, [[0], [1], [2], [3]])
-  Field_2_objects = [model.selection("FACE", "Partition_1_1_1/Modified_Face_1_2"), model.selection("FACE", "Partition_1_1_2/Modified_Face_2_1"), model.selection("FACE", "Translation_2_1/Translated_Face_2"), model.selection("FACE", "Translation_1_1/Translated_Face_1"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/Translated_Face_1")]
+  Field_2_objects = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"), model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_2_1/Bottom"), model.selection("FACE", "Translation_2_1/MF:Translated&Box_3_1/Bottom"), model.selection("FACE", "Translation_1_1/MF:Translated&Box_1_1/Top"), model.selection("FACE", "Box_2_1/Top"), model.selection("FACE", "Translation_2_1/MF:Translated&Box_3_1/Top")]
   Field_2 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_2_objects)
   Field_2.result().setName("Field_faces")
   Field_2.addStep(0, 0, [[0], [1], [1], [1], [2], [2], [2]])
-  Field_3_objects = [model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4"), model.selection("EDGE", "Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_2&Partition_1_1_2/Modified_Face_2_1"), model.selection("EDGE", "Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3"), model.selection("EDGE", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3"), model.selection("EDGE", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3"), model.selection("EDGE", "Box_2_1/Front&Box_2_1/Right"), model.selection("EDGE", "Box_2_1/Right&Box_2_1/Top"), model.selection("EDGE", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right"), model.selection("EDGE", "Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1")]
+  Field_3_objects = [model.selection("EDGE", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Left]"), model.selection("EDGE", "[Translation_2_1/MF:Translated&Box_3_1/Left][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Left][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Left][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("EDGE", "[Translation_1_1/MF:Translated&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Left]"), model.selection("EDGE", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Right]"), model.selection("EDGE", "[Translation_1_1/MF:Translated&Box_1_1/Back][Translation_1_1/MF:Translated&Box_1_1/Right]"), model.selection("EDGE", "[Box_2_1/Front][Box_2_1/Right]"), model.selection("EDGE", "[Box_2_1/Right][Box_2_1/Top]"), model.selection("EDGE", "[(Partition_1_1_2/Modified_Face&Box_2_1/Back&Box_1_1/Front)(Partition_1_1_2/Modified_Face&Box_2_1/Left)(Box_2_1/Right)(Partition_1_1_2/Modified_Face&Box_2_1/Bottom)(Box_2_1/Top)][Box_2_1/Right]"), model.selection("EDGE", "[Box_2_1/Right][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]")]
   Field_3 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_3_objects)
   Field_3.result().setName("Field_edges")
   Field_3.addStep(0, 0, [[0], [1], [1], [1], [2], [2], [2], [2], [3], [3], [3], [3]])
-  Field_4_objects = [model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Partition_1_1_1/Modified_Face_1_1&Translation_1_1/Translated_Face_3&Partition_1_1_1/Modified_Face_1_2"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Partition_1_1_2/Modified_Face_2_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_6&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_2"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Partition_1_1_1/Modified_Face_1_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Translation_1_1/Translated_Face_6&Translation_1_1/Translated_Face_3&Translation_1_1/Translated_Face_1"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Partition_1_1_2/Modified_Face_2_divided_1_1&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Partition_1_1_2/Modified_Face_2_2&Box_2_1/Top"), model.selection("VERTEX", "Box_2_1/Front&Box_2_1/Right&Box_2_1/Top"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_4&Translation_2_1/Translated_Face_1"), model.selection("VERTEX", "Translation_2_1/Translated_Face_5&Translation_2_1/Translated_Face_3&Translation_2_1/Translated_Face_1")]
+  Field_4_objects = [model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Left][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Translation_1_1/MF:Translated&Box_1_1/Right][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&Box_2_1/Back&Box_1_1/Front][Translation_1_1/MF:Translated&Box_1_1/Right][Partition_1_1_1/Modified_Face&Box_1_1/Bottom]"), model.selection("VERTEX", "[(Partition_1_1_2/Modified_Face&Box_2_1/Back&Box_1_1/Front)(Partition_1_1_2/Modified_Face&Box_2_1/Left)(Box_2_1/Right)(Partition_1_1_2/Modified_Face&Box_2_1/Bottom)(Box_2_1/Top)][Box_2_1/Right][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("VERTEX", "[Box_2_1/Front][Box_2_1/Right][Partition_1_1_2/Modified_Face&Box_2_1/Bottom]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Back][Translation_2_1/MF:Translated&Box_3_1/Right][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Right][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Left][Translation_2_1/MF:Translated&Box_3_1/Bottom]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Partition_1_1_1/Modified_Face&Box_1_1/Left][Translation_1_1/MF:Translated&Box_1_1/Top]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Box_1_1/Back][Translation_1_1/MF:Translated&Box_1_1/Right][Translation_1_1/MF:Translated&Box_1_1/Top]"), model.selection("VERTEX", "[(Partition_1_1_2/Modified_Face&Box_2_1/Back&Box_1_1/Front)(Partition_1_1_2/Modified_Face&Box_2_1/Left)(Box_2_1/Right)(Partition_1_1_2/Modified_Face&Box_2_1/Bottom)(Box_2_1/Top)][Partition_1_1_2/Modified_Face&Box_2_1/Left][Box_2_1/Top]"), model.selection("VERTEX", "[(Partition_1_1_2/Modified_Face&Box_2_1/Back&Box_1_1/Front)(Partition_1_1_2/Modified_Face&Box_2_1/Left)(Box_2_1/Right)(Partition_1_1_2/Modified_Face&Box_2_1/Bottom)(Box_2_1/Top)][Box_2_1/Right][Box_2_1/Top]"), model.selection("VERTEX", "[Box_2_1/Front][Partition_1_1_2/Modified_Face&Box_2_1/Left][Box_2_1/Top]"), model.selection("VERTEX", "[Box_2_1/Front][Box_2_1/Right][Box_2_1/Top]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Left][Translation_2_1/MF:Translated&Box_3_1/Top]"), model.selection("VERTEX", "[Translation_2_1/MF:Translated&Box_3_1/Front][Translation_2_1/MF:Translated&Box_3_1/Right][Translation_2_1/MF:Translated&Box_3_1/Top]")]
   Field_4 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_4_objects)
   Field_4.result().setName("Field_vertices")
   Field_4.addStep(0, 0, [[0], [1], [1], [1], [1], [1], [1], [1], [1], [2], [2], [2], [2], [3], [3], [3], [3]])
index 0a71a8aa1853e23b5f7cb416465d66667893c995..87a90dad7ce26ebf6c8547eaf68defa0ec67f4e2 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index c3126a360f2b038351027ec13debe7d77776c507..ed919642262e0074e6b92c6526dac4b03f07abdb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016  CEA/DEN, EDF R&D
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index bc43893d35f56fd1b6065557460a4ae40e86741b..9e247c9d8b106c9b48a0a092a547168eb5a824c3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 78c1c65eb9cfb4e59430d02bbf592fb038d23f6a..f16adee55871b3ad29316e9a96c67ca254acbae3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ## @package Plugins
 #  Python plugin for exporting entities into Salome's GEOM module
index 1fccfcef6009f6f86177797a7d96017fba0905c7..8bde3eec7a83f52e6f48062d41e7f22df045d175 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ## @package Plugins
 #  ExportFeature class definition
index 510afafc255c44f325f6736ff625c787194c2017..4ac52abae600627fd34198b5ea12ea26a679356b 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Features" document="Part">
     <group id="Exchange">
index 0f303909f0919bd08ee9fdcd4e7e4a8bafb5eb4e..751e21d34f90e2b8f782a23aaf4d62807a7c130a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 248880d6018d38bf953b43146ec4cb09ad6ca880..5ec2230122b5e585c37f02789f29bb24b5dbd243 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONSTRUCTIONAPI_H
index c8420378caa0d88b5460023d61d36bb0ee6def6f..1749836408ae95adec1bdbe8c5bca3c7260d346d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ConstructionAPI.i */
index d2c0db94b51293ffcef445454e2d6cc5288bba12..08e53d760071e1a4ebcfa68b32663b32d07a3f8a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionAPI_Axis.h"
index ca5fd86aa938c2facdf6c5121faa73edc2efbf13..38bc304675563d2b9a8cba1c40f69f6359cf85f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
index 42fc8b34c1d956f5bab074351ab51bf161cb1787..c6c956662a9c920bea1818d07a81bac444f2d797 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionAPI_Plane.h"
index 5f216cdd8a89c945539e9bd1c962040a75b171af..f1a0ee7425fb9fa6687d5476436f2e9136ad1900 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
index f0a6ef0085f7e3709a19cff3e5cfc5fbf60ec494..5fa78bf6727063e672a58ec4fd0be1e56181bebc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionAPI_Point.h"
index 8e59114049db4847de574a171b561466940f2d38..96376b481efe66626ffcda3b1ca5de5e8796f50b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
index 927687fda45f13bc48f8d22c7c76bf474f802b11..7f3cbf48503f8a531611220979b843ea6b2bf742 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_SWIG_H_
index b2764e57394cf520c6eb663e967957171b42c838..640d00816e185325a27ab192f0f658dde2175c37 100644 (file)
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
-
-import ModelAPI
-import ConstructionAPI
 from salome.shaper import model
+from GeomAPI import *
+from ModelAPI import *
 
 class AxisTestCase(unittest.TestCase):
 
     def setUp(self):
-        self.session = ModelAPI.ModelAPI_Session.get()
-        self.doc = self.session.moduleDocument()
-        self.session.startOperation()
-        self.feature = self.doc.addFeature("Axis")
-        self.feature.execute()
-        self.session.finishOperation()
+        self.doc = model.moduleDocument()
 
     def tearDown(self):
+        model.end()
         assert(model.checkPythonDump())
-        self.session.closeAll()
+        ModelAPI_Session.get().closeAll()
+
+    def checkAxis(self, axis, x1, y1, z1, x2, y2, z2):
+        edge = GeomAPI_Edge(axis.results()[0].resultSubShapePair()[0].shape())
+        self.assertTrue(edge.isLine())
+
+        p1 = edge.firstPoint()
+        self.assertAlmostEqual(p1.x(), x1, 6)
+        self.assertAlmostEqual(p1.y(), y1, 6)
+        self.assertAlmostEqual(p1.z(), z1, 6)
+
+        p2 = edge.lastPoint()
+        self.assertAlmostEqual(p2.x(), x2, 6)
+        self.assertAlmostEqual(p2.y(), y2, 6)
+        self.assertAlmostEqual(p2.z(), z2, 6)
+
+
+    def test_axis_by_dimensions(self):
+        """ Test 1. Create axis starting from Origin with the given dimensions
+        """
+        axis = model.addAxis(self.doc, 10, 50, 100)
+        self.checkAxis(axis, 0, 0, 0, 10, 50, 100)
+
+    def test_axis_by_points(self):
+        """ Test 2. Create axis between pair of points
+        """
+        model.addPoint(self.doc, 10, 0, 0)
+        axis = model.addAxis(self.doc, model.selection("VERTEX", "Origin"), model.selection("VERTEX", "Point_2"))
+        self.checkAxis(axis, 0, 0, 0, 10, 0, 0)
+
+    def test_axis_by_point_and_plane(self):
+        """ Test 3. Create axis orthogonal to a plane and passing through a point
+        """
+        model.addPoint(self.doc, 10, 0, 0)
+        axis = model.addAxis(self.doc, model.selection("FACE", "YOZ"), model.selection("VERTEX", "Point_2"))
+        self.checkAxis(axis, 10, 0, 0, 0, 0, 0)
+
+    def test_axis_by_line(self):
+        """ Test 4. Create axis by edge on a box
+        """
+        partDoc = model.addPart(self.doc).document()
+        model.addBox(partDoc, 10, 10, 10)
+        axis = model.addAxis(partDoc, model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"))
+        self.checkAxis(axis, 10, 0, 0, 10, 0, 10)
+
+    def test_axis_by_cylinder(self):
+        """ Test 5. Create axis by cylindrical face
+        """
+        partDoc = model.addPart(self.doc).document()
+        model.addCylinder(partDoc, 5, 10)
+        axis = model.addAxis(partDoc, model.selection("FACE", "Cylinder_1_1/Face_1"))
+        self.checkAxis(axis, 0, 0, -1, 0, 0, 11)
+
+    def test_axis_by_point_and_direction(self):
+        """ Test 6. Create axis starting from a point with a given direction
+        """
+        model.addPoint(self.doc, 10, 0, 0)
+        axis = model.addAxis(self.doc, model.selection("VERTEX", "Point_2"), 10, 20, 30)
+        self.checkAxis(axis, 10, 0, 0, 20, 20, 30)
+
+    def test_axis_by_planes(self):
+        """ Test 7. Create axis as intersection of two planes
+        """
+        axis = model.addAxis(self.doc, model.selection("FACE", "XOZ"), model.selection("FACE", "YOZ"))
+        self.checkAxis(axis, 0, 0, 0, 0, 0, 100)
+
+        axis = model.addAxis(self.doc, model.selection("FACE", "XOZ"), 10, False, model.selection("FACE", "YOZ"))
+        self.checkAxis(axis, 0, -10, 0, 0, -10, 100)
+
+        axis = model.addAxis(self.doc, model.selection("FACE", "XOZ"), model.selection("FACE", "YOZ"), 10, False)
+        self.checkAxis(axis, 10, 0, 0, 10, 0, 100)
 
-    def test_ConstructorWithDimensions(self):
-        axis = ConstructionAPI.ConstructionAPI_Axis(self.feature, 10, 50, 100)
-        self.assertEqual(10,axis.xDimension().value())
-        self.assertEqual(50,axis.yDimension().value())
-        self.assertEqual(100,axis.zDimension().value())
 
 if __name__ == "__main__":
     test_program = unittest.main(exit=False)
index 30d9b00bbddb680915db96bb280899236887f7fa..fb0357501474f71d80b44cc1e09c4fbefd8c4ef8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 3c5423b1f0833b4a3090ac3a94aa4371a68f8b05..b3fd7497ab883a55a07ae8ceba9d952718d2efc9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -78,6 +77,7 @@ INCLUDE_DIRECTORIES(
 
 
 ADD_UNIT_TESTS(TestAxisCreation.py
+               TestAxis_ErrorMsg.py
                UnitTestAxis.py
                TestPoint_XYZ.py
                TestPoint_IntersectLines.py
@@ -90,4 +90,9 @@ ADD_UNIT_TESTS(TestAxisCreation.py
                TestPoint_GeometricalPropertyCenterOfCircle.py
                TestPoint_VertexSelection.py
                TestPointName.py
-               TestPlane.py)
+               TestPoint_ErrorMsg.py
+               TestPoint_FiniteValidator.py
+               TestPlane.py
+               TestPlane_ErrorMsg.py
+               TestPlane_FaceValidator.py
+)
index d0072d860050cd45dd22bfe807af6152eaea6d12..3d68da3c3744537e22aeb03203a2dec0a9588937 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef CONSTRUCTIONPLUGIN_H
index 5f4b2f8d65fb45391d3dd4567dfc0fd923a970c3..2b0caa9903f8ee15818bf61a6950f48204425a02 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionPlugin_Axis.h"
@@ -33,7 +32,9 @@
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Vertex.h>
+#include <GeomAPI_XYZ.h>
 #include <GeomAlgoAPI_EdgeBuilder.h>
 #include <GeomAlgoAPI_PointBuilder.h>
 
@@ -144,17 +145,21 @@ void ConstructionPlugin_Axis::createAxisByPointAndDirection()
     std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aXAttr->value(),
                                                                aYAttr->value(),
                                                                aZAttr->value()));
-    if (aShape1->isVertex() && (!aShape1->isEqual(aVertex))) {
+    if (aShape1->isVertex() &&
+        (fabs(aXAttr->value()) > MINIMAL_LENGTH() ||
+         fabs(aYAttr->value()) > MINIMAL_LENGTH() ||
+         fabs(aZAttr->value()) > MINIMAL_LENGTH())) {
       std::shared_ptr<GeomAPI_Pnt> aStart = GeomAlgoAPI_PointBuilder::point(aShape1);
-      std::shared_ptr<GeomAPI_Pnt> anEnd = aVertex->point();
-      if (aStart->distance(anEnd) > ConstructionPlugin_Axis::MINIMAL_LENGTH()) {
-        std::shared_ptr<GeomAPI_Edge> anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd);
+      std::shared_ptr<GeomAPI_Pnt> anEnd(new GeomAPI_Pnt(aStart->x() + aXAttr->value(),
+                                                         aStart->y() + aYAttr->value(),
+                                                         aStart->z() + aZAttr->value()));
 
-        ResultConstructionPtr aConstr = document()->createConstruction(data());
-        aConstr->setInfinite(true);
-        aConstr->setShape(anEdge);
-        setResult(aConstr);
-      }
+      std::shared_ptr<GeomAPI_Edge> anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd);
+
+      ResultConstructionPtr aConstr = document()->createConstruction(data());
+      aConstr->setInfinite(true);
+      aConstr->setShape(anEdge);
+      setResult(aConstr);
     }
   }
 }
@@ -162,16 +167,26 @@ void ConstructionPlugin_Axis::createAxisByPointAndDirection()
 
 void ConstructionPlugin_Axis::createAxisByCylindricalFace()
 {
-    std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(CYLINDRICAL_FACE())->value();
-     // update arguments due to the selection value
-    if (aSelection && !aSelection->isNull() && aSelection->isFace()) {
-      std::shared_ptr<GeomAPI_Edge> anEdge = GeomAlgoAPI_EdgeBuilder::cylinderAxis(aSelection);
+  std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(CYLINDRICAL_FACE())->value();
+    // update arguments due to the selection value
 
-      ResultConstructionPtr aConstr = document()->createConstruction(data());
-      aConstr->setInfinite(true);
-      aConstr->setShape(anEdge);
-      setResult(aConstr);
-    }
+  if (!aSelection.get() || aSelection->isNull()) {
+    return;
+  }
+
+  if (aSelection->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aSelection);
+    aSelection = anIt.current();
+  }
+
+  if (aSelection->isFace()) {
+    std::shared_ptr<GeomAPI_Edge> anEdge = GeomAlgoAPI_EdgeBuilder::cylinderAxis(aSelection);
+
+    ResultConstructionPtr aConstr = document()->createConstruction(data());
+    aConstr->setInfinite(true);
+    aConstr->setShape(anEdge);
+    setResult(aConstr);
+  }
 }
 
 void ConstructionPlugin_Axis::createAxisByDimensions()
@@ -203,7 +218,36 @@ void ConstructionPlugin_Axis::createAxisByLine()
   if(!aLineShape.get()) {
     aLineShape = anEdgeSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aLineShape));
+  GeomEdgePtr anEdge;
+  if (aLineShape->isEdge()) {
+    anEdge = aLineShape->edge();
+  }
+  else if (aLineShape->isCompound()) {
+    // create an edge which covers all edges from compounds (they are on the same line)
+    GeomPointPtr aFirst, aLast;
+    GeomXYZPtr aLineVec;
+    for(GeomAPI_ShapeIterator anIt(aLineShape); anIt.more(); anIt.next()) {
+      GeomEdgePtr aSub = anIt.current()->edge();
+      if (aSub.get() && aSub->isLine()) {
+        if (!aLineVec.get()) {
+          aFirst = aSub->firstPoint();
+          aLast = aSub->lastPoint();
+        } else { // set aFirst and aLast by extreme points
+          GeomXYZPtr aFirstVec = aSub->firstPoint()->xyz()->decreased(aFirst->xyz());
+          bool aSameDirection =
+            aSub->lastPoint()->xyz()->decreased(aSub->firstPoint()->xyz())->dot(aLineVec) > 0;
+          if (aLineVec->dot(aFirstVec) < -1.e-7) { // first point is changed
+            aFirst = aSameDirection ? aSub->firstPoint() : aSub->lastPoint();
+          } else { // last point is changed
+            aLast = aSameDirection ? aSub->lastPoint() : aSub->firstPoint();
+          }
+        }
+        aLineVec = aLast->xyz()->decreased(aFirst->xyz());
+      }
+    }
+    if (aLineVec.get())
+      anEdge = GeomAlgoAPI_EdgeBuilder::line(aFirst, aLast);
+  }
 
   ResultConstructionPtr aConstr = document()->createConstruction(data());
   aConstr->setInfinite(true);
@@ -219,7 +263,16 @@ void ConstructionPlugin_Axis::createAxisByPlaneAndPoint()
   if(!aFaceShape.get()) {
     aFaceShape = aFaceSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aFaceShape));
+  GeomFacePtr aFace;
+  if (aFaceShape->isFace()) {
+    aFace = aFaceShape->face();
+  }
+  else if (aFaceShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape);
+    aFace = anIt.current()->face();
+  }
+  if (!aFace)
+    return;
   std::shared_ptr<GeomAPI_Pln> aPln = aFace->getPlane();
 
   // Get point.
@@ -253,7 +306,16 @@ void ConstructionPlugin_Axis::createAxisByTwoPlanes()
   if(!aFaceShape1.get()) {
     aFaceShape1 = aFaceSelection1->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace1(new GeomAPI_Face(aFaceShape1));
+  std::shared_ptr<GeomAPI_Face> aFace1;
+  if (aFaceShape1->isFace()) {
+    aFace1 = aFaceShape1->face();
+  }
+  else if (aFaceShape1->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape1);
+    aFace1 = anIt.current()->face();
+  }
+  if (!aFace1)
+    return;
   std::shared_ptr<GeomAPI_Pln> aPln1 = aFace1->getPlane();
 
   std::string useOffset1 = string(USE_OFFSET1())->value();
@@ -272,7 +334,16 @@ void ConstructionPlugin_Axis::createAxisByTwoPlanes()
   if(!aFaceShape2.get()) {
     aFaceShape2 = aFaceSelection2->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace2(new GeomAPI_Face(aFaceShape2));
+  std::shared_ptr<GeomAPI_Face> aFace2;
+  if (aFaceShape2->isFace()) {
+    aFace2 = aFaceShape2->face();
+  }
+  else if (aFaceShape2->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape2);
+    aFace2 = anIt.current()->face();
+  }
+  if (!aFace2)
+    return;
   std::shared_ptr<GeomAPI_Pln> aPln2 = aFace2->getPlane();
 
   std::string useOffset2 = string(USE_OFFSET2())->value();
index 03ad26dbfbf90cb291c9c180d7ca00d91f5a5734..9685eebffa3fcf68bd31fd2244304fe88788a929 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ConstructionPlugin_Axis_H
index ad046394a37ac7a5685644dcb02678c1eb7528d8..5b4338a983bf1eef77a9a72d69247038d2bad767 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionPlugin_Plane.h"
@@ -33,6 +32,7 @@
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Pnt2d.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Vertex.h>
 #include <GeomAPI_XYZ.h>
 
@@ -231,7 +231,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByLineAndPoint()
   if(!aLineShape.get()) {
     aLineShape = anEdgeSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aLineShape));
+  std::shared_ptr<GeomAPI_Edge> anEdge;
+  if (aLineShape->isEdge()) {
+    anEdge = aLineShape->edge();
+  }
+  else if (aLineShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aLineShape);
+    anEdge = anIt.current()->edge();
+  }
+  if (!anEdge)
+    return GeomShapePtr();
 
   // Get point.
   AttributeSelectionPtr aPointSelection = selection(POINT());
@@ -277,7 +286,7 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByDistanceFromOth
     bool anIsReverse = boolean(REVERSE())->value();
     if(anIsReverse) aDist = -aDist;
     GeomShapePtr aShape = aFaceAttr->value();
-    if (!aShape.get()) {
+    if (!aShape.get() && aFaceAttr->context()) {
       aShape = aFaceAttr->context()->shape();
     }
 
@@ -285,7 +294,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByDistanceFromOth
       return aPlane;
     }
 
-    std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aShape));
+    std::shared_ptr<GeomAPI_Face> aFace;
+    if (aShape->isFace()) {
+      aFace = aShape->face();
+    }
+    else if (aShape->isCompound()) {
+      GeomAPI_ShapeIterator anIt(aShape);
+      aFace = anIt.current()->face();
+    }
+    if (!aFace)
+      return GeomShapePtr();
 
     std::shared_ptr<GeomAPI_Pln> aPln = aFace->getPlane();
     std::shared_ptr<GeomAPI_Pnt> aOrig = aPln->location();
@@ -308,7 +326,14 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByCoincidentPoint
   if(!aFaceShape.get()) {
     aFaceShape = aFaceSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aFaceShape));
+  std::shared_ptr<GeomAPI_Face> aFace;
+  if (aFaceShape->isFace()) {
+    aFace = aFaceShape->face();
+  }
+  else if (aFaceShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape);
+    aFace = anIt.current()->face();
+  }
 
   // Get point.
   AttributeSelectionPtr aPointSelection = selection(COINCIDENT_POINT());
@@ -316,7 +341,9 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByCoincidentPoint
   if(!aPointShape.get()) {
     aPointShape = aPointSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aPointShape));
+  std::shared_ptr<GeomAPI_Vertex> aVertex = aPointShape->vertex();
+  if (!aVertex)
+    return GeomShapePtr();
 
   std::shared_ptr<GeomAPI_Pnt> anOrig = aVertex->point();
   std::shared_ptr<GeomAPI_Pln> aPln = aFace->getPlane();
@@ -336,7 +363,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByRotation()
   if(!aFaceShape.get()) {
     aFaceShape = aFaceSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aFaceShape));
+  std::shared_ptr<GeomAPI_Face> aFace;
+  if (aFaceShape->isFace()) {
+    aFace = aFaceShape->face();
+  }
+  else if (aFaceShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape);
+    aFace = anIt.current()->face();
+  }
+  if (!aFace)
+    return GeomShapePtr();
   aFace = makeRectangularFace(aFace, aFace->getPlane());
 
   // Get axis.
@@ -345,7 +381,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByRotation()
   if(!anAxisShape.get()) {
     anAxisShape = anAxisSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(anAxisShape));
+  std::shared_ptr<GeomAPI_Edge> anEdge;
+  if (anAxisShape->isEdge()) {
+    anEdge = anAxisShape->edge();
+  }
+  else if (anAxisShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(anAxisShape);
+    anEdge = anIt.current()->edge();
+  }
+  if (!anEdge)
+    return GeomShapePtr();
 
   std::shared_ptr<GeomAPI_Ax1> anAxis =
     std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
@@ -378,7 +423,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByTwoParallelPlan
   if(!aFaceShape1.get()) {
     aFaceShape1 = aFaceSelection1->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace1(new GeomAPI_Face(aFaceShape1));
+  std::shared_ptr<GeomAPI_Face> aFace1;
+  if (aFaceShape1->isFace()) {
+    aFace1 = aFaceShape1->face();
+  }
+  else if (aFaceShape1->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape1);
+    aFace1 = anIt.current()->face();
+  }
+  if (!aFace1)
+    return GeomShapePtr();
   std::shared_ptr<GeomAPI_Pln> aPln1 = aFace1->getPlane();
 
   // Get plane 2.
@@ -387,7 +441,16 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByTwoParallelPlan
   if(!aFaceShape2.get()) {
     aFaceShape2 = aFaceSelection2->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace2(new GeomAPI_Face(aFaceShape2));
+  std::shared_ptr<GeomAPI_Face> aFace2;
+  if (aFaceShape2->isFace()) {
+    aFace2 = aFaceShape2->face();
+  }
+  else if (aFaceShape2->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aFaceShape2);
+    aFace2 = anIt.current()->face();
+  }
+  if (!aFace2)
+    return GeomShapePtr();
   std::shared_ptr<GeomAPI_Pln> aPln2 = aFace2->getPlane();
 
   std::shared_ptr<GeomAPI_Pnt> anOrig1 = aPln1->location();
index 897f9abed6169df78134e27a78496393e6643818..b1e01060984e2a291300185fa6bf8ff3a2c1449b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ConstructionPlugin_Plane_H
index c417c11d843a029beaa42af75f8fa706388f4e33..0b0dc4bb297c7c602e1d9093af5f0e8fde747a91 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionPlugin_Plugin.h"
index 9928dcc2affcb148da3ba51a17817f44c953b30d..6fce95b0fcf05dacce38b27c15fb843bdf1e39e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ConstructionPlugin_Plugin_H_
index bb59c3d550acee82307197fd38c07ec3a372ee5b..e55894ded6b18a7866d38b8bf64e68febe491c4c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionPlugin_Point.h"
@@ -36,6 +35,7 @@
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Vertex.h>
 #include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
 
 //==================================================================================================
 ConstructionPlugin_Point::ConstructionPlugin_Point()
@@ -143,6 +143,7 @@ void ConstructionPlugin_Point::execute()
 
   removeResults(1); // for case the point type was switched from multi-results type
   std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
+  aConstr->setInfinite(true);
   aConstr->setShape(aShape);
   setResult(aConstr);
 }
@@ -270,7 +271,14 @@ std::list<std::shared_ptr<GeomAPI_Vertex> >
   if(!aLineShape.get()) {
     aLineShape = aLineSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aLineShape));
+  GeomEdgePtr anEdge;
+  if (aLineShape->isEdge()) {
+    anEdge = aLineShape->edge();
+  }
+  else if (aLineShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aLineShape);
+    anEdge = anIt.current()->edge();
+  }
 
   // Get plane.
   AttributeSelectionPtr aPlaneSelection= selection(INTERSECTION_PLANE());
@@ -278,7 +286,14 @@ std::list<std::shared_ptr<GeomAPI_Vertex> >
   if(!aPlaneShape.get()) {
     aPlaneShape = aPlaneSelection->context()->shape();
   }
-  std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
+  GeomFacePtr aFace;
+  if (aPlaneShape->isFace()) {
+    aFace = aPlaneShape->face();
+  }
+  else if (aPlaneShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(aPlaneShape);
+    aFace = anIt.current()->face();
+  }
 
   if (!string(USE_OFFSET())->value().empty()) {
     double anOffset = real(OFFSET())->value();
index bf63d8baf4ecd85f324217a0b60ee62ce6f3e1db..3ab79c2f39300dfd787dfd9123ea57cef34c85a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ConstructionPlugin_Point_H_
index 2390b83a4eec2b9e9327890a0c3d83f748dc02c5..a26f2f519bb7066b6d1cfb31d80e376bfb18389d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ConstructionPlugin_Validators.h"
@@ -27,6 +26,7 @@
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_Vertex.h>
 #include <GeomAPI_Pnt.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 
 #include <ModelAPI_AttributeSelection.h>
@@ -35,6 +35,7 @@
 #include <Events_InfoMessage.h>
 
 static std::shared_ptr<GeomAPI_Edge> getEdge(const GeomShapePtr theShape);
+static std::shared_ptr<GeomAPI_Face> getFace(const GeomShapePtr theShape);
 static std::shared_ptr<GeomAPI_Lin> getLin(const GeomShapePtr theShape);
 static std::shared_ptr<GeomAPI_Pln> getPln(const GeomShapePtr theShape);
 static std::shared_ptr<GeomAPI_Pnt> getPnt(const GeomShapePtr theShape);
@@ -114,7 +115,7 @@ bool ConstructionPlugin_ValidatorPointEdgeAndPlaneNotParallel::isValid(
   AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front());
 
   std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<GeomAPI_Pln> aPln;
+  std::shared_ptr<GeomAPI_Face> aFace;
 
   GeomShapePtr aShape1 = anAttribute1->value();
   ResultPtr aContext1 = anAttribute1->context();
@@ -137,20 +138,20 @@ bool ConstructionPlugin_ValidatorPointEdgeAndPlaneNotParallel::isValid(
 
   bool isPlaneFirst = false;
   anEdge = getEdge(aShape1);
-  aPln = getPln(aShape2);
-  if(!anEdge.get() || !aPln.get()) {
+
+  aFace = getFace(aShape2);
+  if(!anEdge.get() || !aFace.get()) {
     anEdge = getEdge(aShape2);
-    aPln = getPln(aShape1);
+    aFace = getFace(aShape1);
     isPlaneFirst = true;
   }
 
-  if(!anEdge.get() || !aPln.get()) {
+  if(!anEdge.get() || !aFace.get()) {
     theError = "Wrong shape types selected.";
     return false;
   }
 
-  std::shared_ptr<GeomAPI_Face> aPlaneFace(new GeomAPI_Face(isPlaneFirst ? aShape1 : aShape2));
-  if(GeomAlgoAPI_ShapeTools::isParallel(anEdge, aPlaneFace)) {
+  if(GeomAlgoAPI_ShapeTools::isParallel(anEdge, aFace)) {
     theError = "Plane and edge are parallel.";
     return false;
   }
@@ -474,25 +475,51 @@ bool ConstructionPlugin_ValidatorPointThreeNonParallelPlanes::isValid(
 
 std::shared_ptr<GeomAPI_Edge> getEdge(const GeomShapePtr theShape)
 {
-  if(!theShape->isEdge()) {
-    return std::shared_ptr<GeomAPI_Edge>();
-  }
+  GeomEdgePtr anEdge;
 
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(theShape));
+  if(theShape->isEdge()) {
+    anEdge = theShape->edge();
+  }
+  else if (theShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(theShape);
+    anEdge = anIt.current()->edge();
+  }
 
   return anEdge;
 }
 
+GeomFacePtr getFace(const GeomShapePtr theShape)
+{
+  GeomFacePtr aFace;
+
+  if (theShape->isFace()) {
+    aFace = theShape->face();
+  }
+  else if (theShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(theShape);
+    aFace = anIt.current()->face();
+  }
+
+  return aFace;
+}
+
 std::shared_ptr<GeomAPI_Lin> getLin(const GeomShapePtr theShape)
 {
   std::shared_ptr<GeomAPI_Lin> aLin;
 
-  if(!theShape->isEdge()) {
+  GeomEdgePtr anEdge;
+
+  if (theShape->isEdge()) {
+    anEdge = theShape->edge();
+  }
+  else if (theShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(theShape);
+    anEdge = anIt.current()->edge();
+  }
+  else {
     return aLin;
   }
 
-  std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(theShape));
-
   if(!anEdge->isLine()) {
     return aLin;
   }
@@ -506,13 +533,20 @@ std::shared_ptr<GeomAPI_Pln> getPln(const GeomShapePtr theShape)
 {
   std::shared_ptr<GeomAPI_Pln> aPln;
 
-  if(!theShape->isFace()) {
+  GeomFacePtr aFace;
+
+  if(theShape->isFace()) {
+    aFace = theShape->face();
+  }
+  else if (theShape->isCompound()) {
+    GeomAPI_ShapeIterator anIt(theShape);
+    aFace = anIt.current()->face();
+  }
+  else {
     return aPln;
   }
 
-  std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(theShape));
-
-  if(!aFace->isPlanar()) {
+  if(!aFace || !aFace->isPlanar()) {
     return aPln;
   }
 
index e5dbdd2891c53a6cfc299ffff0e2bf0f57b75da6..aa013c5dbc2b39eef91e5d4a763d5b20489cc682 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ConstructionPlugin_Validators_H_
index 642d83bde2f2c73dccb4e13df86a46334d4eb885..000a9dadf163ad8e7c801a6c92c5f3057dd7bc54 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -107,22 +106,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
-anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(100)
 anExtrusionFt.real("from_size").setValue(0)
@@ -145,7 +137,7 @@ anAxisFeature = aPart.addFeature("Axis")
 anAxisFeatureData = anAxisFeature.data()
 assert(anAxisFeatureData is not None)
 anAxisFeatureData.string("CreationMethod").setValue("AxisByCylindricalFaceCase")
-anAxisFeatureData.selection("CylindricalFace").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
+anAxisFeatureData.selection("CylindricalFace").selectSubShape("face", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2")
 anAxisFeature.execute()
 aSession.finishOperation()
 
diff --git a/src/ConstructionPlugin/Test/TestAxis_ErrorMsg.py b/src/ConstructionPlugin/Test/TestAxis_ErrorMsg.py
new file mode 100644 (file)
index 0000000..21e4a0f
--- /dev/null
@@ -0,0 +1,119 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("Box_1_1/Front", "FACE")
+aCompoundList.append("[Box_1_1/Left][Box_1_1/Top]", "EDGE")
+aSession.finishOperation()
+
+# Create auxiliary box 2
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound 2
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("[Box_2_1/Left][Box_2_1/Top]", "EDGE")
+aCompoundList.append("Box_2_1/Front", "FACE")
+aSession.finishOperation()
+
+
+# Axis by cylindrical face
+aSession.startOperation()
+Axis_1 = aPart.addFeature("Axis")
+Axis_1.string("CreationMethod").setValue("AxisByCylindricalFaceCase")
+Axis_1.selection("CylindricalFace").selectSubShape("COMPOUND", "Compound_2_1")
+Axis_1.execute()
+aSession.finishOperation()
+assert(Axis_1.error() != "")
+
+# Axis by dimensions
+aSession.startOperation()
+Axis_1.string("CreationMethod").setValue("AxisByDimensionsCase")
+Axis_1.real("DX").setValue(0)
+Axis_1.real("DY").setValue(0)
+Axis_1.real("DZ").setValue(0)
+Axis_1.execute()
+assert(Axis_1.error() != "")
+aSession.finishOperation()
+
+# Axis by line
+aSession.startOperation()
+Axis_1.string("CreationMethod").setValue("by_line")
+Axis_1.selection("line").selectSubShape("COMPOUND", "Compound_1_1")
+Axis_1.execute()
+assert(Axis_1.error() != "")
+aSession.finishOperation()
+
+# Axis by plane and point
+aSession.startOperation()
+Axis_1.string("CreationMethod").setValue("by_plane_and_point")
+Axis_1.selection("point").selectSubShape("COMPOUND", "Compound_1_1")
+Axis_1.selection("plane").selectSubShape("COMPOUND", "Compound_2_1")
+Axis_1.execute()
+assert(Axis_1.error() != "")
+aSession.finishOperation()
+
+# Axis by two planes
+aSession.startOperation()
+Axis_1.string("CreationMethod").setValue("by_two_planes")
+Axis_1.selection("plane1").selectSubShape("COMPOUND", "Compound_2_1")
+Axis_1.selection("plane2").selectSubShape("COMPOUND", "Compound_2_1")
+Axis_1.execute()
+assert(Axis_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+Axis_1.selection("plane1").selectSubShape("COMPOUND", "Compound_1_1")
+Axis_1.string("use_offset1").setValue("true")
+Axis_1.real("offset1").setValue(10)
+Axis_1.boolean("reverse_offset1").setValue(True)
+Axis_1.execute()
+assert(Axis_1.error() != "")
+aSession.finishOperation()
index ccae5922a6198e74fa6b1b0e67c3f88dc1e67aaa..82bc063d0e58a34a9cafb3c8ff828945aaad7646 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Plane feature. Written on High API.
diff --git a/src/ConstructionPlugin/Test/TestPlane_ErrorMsg.py b/src/ConstructionPlugin/Test/TestPlane_ErrorMsg.py
new file mode 100644 (file)
index 0000000..34585b9
--- /dev/null
@@ -0,0 +1,132 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("Box_1_1/Front", "FACE")
+aCompoundList.append("[Box_1_1/Left][Box_1_1/Top]", "EDGE")
+aSession.finishOperation()
+
+# Create auxiliary box 2
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound 2
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("[Box_2_1/Left][Box_2_1/Top]", "EDGE")
+aCompoundList.append("Box_2_1/Front", "FACE")
+aSession.finishOperation()
+
+
+# Plane by line and point
+aSession.startOperation()
+Plane_1 = aPart.addFeature("Plane")
+Plane_1.string("creation_method").setValue("by_line_and_point")
+Plane_1.selection("line").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.selection("point").selectSubShape("VERTEX", "PartSet/Origin")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+# Unsupported type
+aSession.startOperation()
+Plane_1.string("creation_method").setValue("by_rotation")
+Plane_1.selection("plane").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.selection("axis").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+# By two parallel planes
+aSession.startOperation()
+Plane_1.string("creation_method").setValue("by_two_parallel_planes")
+Plane_1.selection("plane1").selectSubShape("COMPOUND", "Compound_2_1")
+Plane_1.selection("plane2").selectSubShape("COMPOUND", "Compound_2_1")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+Plane_1.selection("plane1").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+# By distance from other plane
+aSession.startOperation()
+Plane_1.string("creation_method").setValue("by_other_plane")
+Plane_1.string("by_other_plane_option").setValue("by_distance_from_other")
+Plane_1.selection("plane").selectSubShape("COMPOUND", "Compound_2_1")
+Plane_1.real("distance").setValue(10)
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+# By coincident point
+aSession.startOperation()
+Plane_1.string("by_other_plane_option").setValue("by_coincident_to_point")
+Plane_1.selection("coincident_point").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+# By rotation
+aSession.startOperation()
+Plane_1.string("by_other_plane_option").setValue("by_rotation")
+Plane_1.selection("axis").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.real("angle").setValue(90)
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+Plane_1.selection("plane").selectSubShape("COMPOUND", "Compound_1_1")
+Plane_1.execute()
+assert(Plane_1.error() != "")
+aSession.finishOperation()
diff --git a/src/ConstructionPlugin/Test/TestPlane_FaceValidator.py b/src/ConstructionPlugin/Test/TestPlane_FaceValidator.py
new file mode 100644 (file)
index 0000000..950f4ad
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10)
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Sphere_1_1/Face_1")])
+
+Plane_1 = model.addPlane(Part_1_doc, model.selection("COMPOUND", (0, 0, 0)), 10, False)
+assert(Plane_1.feature().error() != "")
+Part_1_doc.removeFeature(Plane_1.feature())
+
+Plane_1 = model.addPlane(Part_1_doc, model.selection("EDGE", "[Compound_1_1_1/Compound_1_1_1&Sphere_1_1/Face_1][weak_name_3]"), 10, False)
+assert(Plane_1.feature().error() != "")
+Part_1_doc.removeFeature(Plane_1.feature())
+
+model.end()
index 3b4fee98513248617c1c61b2029d936afa627968..8f98c0fd6a6877cde9fbd2ca83ad7bfd5bb1e012 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from ModelAPI import *
 from GeomDataAPI import *
index 4f6c5ef88d3778e524a88c5f0ab5030bcb39c7d2..eec8341f36589962d0aa3bb9a0006ac58eb360ba 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by coordinates.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -35,15 +33,17 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchPoint_1.result())
 model.do()
-Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 50, False, False)
-Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 0.4, True, False)
-Point_4 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 0.4, True, True)
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchLine_1"), 50, False, False)
+Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchLine_1"), 0.4, True, False)
+Point_4 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchLine_1"), 0.4, True, True)
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 50, 10)
-Point_5 = model.addPoint(Part_1_doc, model.selection("EDGE", "Cylinder_1_1/Face_1&Cylinder_1_1/Face_2"), 0.25, True, False)
-Point_6 = model.addPoint(Part_1_doc, model.selection("EDGE", "Cylinder_1_1/Face_1&Cylinder_1_1/Face_2"), 0.25, True, True)
+Point_5 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]"), 0.25, True, False)
+Point_6 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]"), 0.25, True, True)
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(35.3553390593, 35.3553390593, 0)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
diff --git a/src/ConstructionPlugin/Test/TestPoint_ErrorMsg.py b/src/ConstructionPlugin/Test/TestPoint_ErrorMsg.py
new file mode 100644 (file)
index 0000000..b91bc2c
--- /dev/null
@@ -0,0 +1,76 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("Box_1_1/Front", "FACE")
+aCompoundList.append("[Box_1_1/Left][Box_1_1/Top]", "EDGE")
+aSession.finishOperation()
+
+# Create auxiliary box 2
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound 2
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompoundList = aCompound.selectionList("base_objects")
+aCompoundList.append("[Box_2_1/Left][Box_2_1/Top]", "EDGE")
+aCompoundList.append("Box_2_1/Front", "FACE")
+aSession.finishOperation()
+
+
+# Point by line and plane
+aSession.startOperation()
+Point_1 = aPart.addFeature("Point")
+Point_1.string("creation_method").setValue("by_intersection")
+Point_1.string("intersection_type").setValue("intersection_type_by_line_and_plane")
+Point_1.selection("intersection_line").selectSubShape("COMPOUND", "Compound_1_1")
+Point_1.selection("intersection_plane").selectSubShape("COMPOUND", "Compound_2_1")
+Point_1.execute()
+assert(Point_1.error() != "")
+aSession.finishOperation()
diff --git a/src/ConstructionPlugin/Test/TestPoint_FiniteValidator.py b/src/ConstructionPlugin/Test/TestPoint_FiniteValidator.py
new file mode 100644 (file)
index 0000000..cbbcf54
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "PartSet/OZ"), 10, False, False)
+assert(Point_2.feature().error() != "")
+
+model.end()
index e08fa1158e6a2dad2b82438bb83ae1594ea28b40..d39e4de501cf12d5aec07738dcc2d7bcc22f4c62 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by center of gravity.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -34,12 +32,14 @@ SketchCircle_1 = Sketch_1.addCircle(-50, 25, 25)
 SketchArc_1 = Sketch_1.addArc(50, 25, 25, 25, 75, 25, True)
 model.do()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 100)
-Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"), True)
-Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), True)
-Point_4 = model.addPoint(Part_1_doc, model.selection("EDGE", "Cylinder_1_1/Face_1&Cylinder_1_1/Face_2"), True)
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchCircle_1_2"), True)
+Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchArc_1_2"), True)
+Point_4 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]"), True)
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(-50, 25, 0)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index 933252369cc1a72db0c86021354c8bbb6707539f..858cfddb4b0bf4421f57e7ddc4c8333fb0755543 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by center of gravity.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -37,10 +35,12 @@ Box_1 = model.addBox(Part_1_doc, 50, 50, 50)
 Point_2 = model.addPoint(Part_1_doc, model.selection("COMPOUND", "Sketch_1"))
 Point_3 = model.addPoint(Part_1_doc, model.selection("SOLID", "Box_1_1"))
 Point_4 = model.addPoint(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
-Point_5 = model.addPoint(Part_1_doc, model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top"))
+Point_5 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"))
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(0, 0, 25)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index 635ab81022712e7006f9cb2fb7e094be06f9ef2d..1741dc85d6f6a46ccee025697caf18551b94fbfa 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature as intersection of line and plane.
@@ -38,14 +37,14 @@ SketchArc_1 = Sketch_2.addArc(0, 0, -65.89631323066888, 61.2998850129882, -90, 0
 model.do()
 
 # point by sketch face and a line
-Point_1 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"))
+Point_1 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/SketchLine_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"))
 model.do()
 # check the point position
 rightPosition = GeomAPI_Vertex(-15, 0, 0)
 assert(rightPosition.isEqual(Point_1.results()[0].resultSubShapePair()[0].shape()))
 
 # point by sketch face and an arc, intersection outside of the face, offset is defined
-Point_2 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/Edge-SketchArc_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), 10, True)
+Point_2 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/SketchArc_1_2"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), 10, True)
 # check the point position
 rightPosition = GeomAPI_Vertex(-89.442719099991606, 0, -10)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index f3b08471afcb13373e704090d330aa15934c9a02..e23c41bfff7cce7d98cefde923f3ce6fdeffe3fb 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by lines intersection.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -35,11 +33,13 @@ SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchLine_1 = Sketch_1.addLine(-50, 50, 50, 50)
 model.do()
 Box_1 = model.addBox(Part_1_doc, 25, 100, 100)
-Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Box_1_1/Back&Box_1_1/Bottom"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
-Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"))
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Bottom]"), model.selection("EDGE", "Sketch_1/SketchLine_1"))
+Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"))
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(0, 50, 0)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index 16d89773bbf940f1084f31d8c0787482295cd89b..680dfe76dea8a34d94a85115f94474f0789b4b25 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by planes intersection.
index af44576ac973d54707d09c2608334c299f3f80c3..88dd11210b652d7b3356f266b56ba7f72a23d0a3 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by coordinates.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -34,11 +32,13 @@ SketchCircle_1 = Sketch_1.addCircle(0, 0, 100)
 SketchPoint_1 = Sketch_1.addPoint(100, 100)
 model.do()
 Box_1 = model.addBox(Part_1_doc, 50, 50, 50)
-Point_2 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"))
-Point_3 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"))
+Point_2 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("EDGE", "Sketch_1/SketchCircle_1_2"))
+Point_3 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"))
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(70.7106781187, 70.7106781187, 0)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index 1b5218ea7caf9aaea793ef10e250bfde2d7095c3..ac3eaa2552da8d92e9962063e47f45bb59c2c493 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by projection point on face.
 """
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -33,11 +31,13 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchPoint_1 = Sketch_1.addPoint(50, 50)
 model.do()
 Box_1 = model.addBox(Part_1_doc, 10, 100, 100)
-Point_2 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("FACE", "Box_1_1/Front"))
-Point_3 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("FACE", "PartSet/XOY"))
+Point_2 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("FACE", "Box_1_1/Front"))
+Point_3 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("FACE", "PartSet/XOY"))
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(10, 0, 50)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index 8180742aa599c5960b67a217896c39f00f9da20f..7240c4398cb41f5c206f50099311c84a90d34710 100644 (file)
@@ -1,35 +1,37 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
-from GeomAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Point_2 = model.addPoint(Part_1_doc, model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top"))
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 10)
 model.do()
 model.end()
 
+from GeomAPI import GeomAPI_Vertex
+
 assert (len(Point_2.results()) > 0)
 rightPosition = GeomAPI_Vertex(10, 0, 10)
 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
index df73e5fd1577dcee3691a2db7e159c3d1e9e9be7..e4f5c6255f51146df537bd3279cea1339d5e2ad4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Construction Point feature by coordinates.
index eb32d6aec891375e07103b4ce13e19b5db9af927..2e193f97e91896ee689397209b51fca241b3a368 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     UnitTestAxis.py
index 928d0302256c95e84fcba78a2cbd44de8cdde5a5..97fd01a22ab98ee2a8bfe144a2d351f10ebf4220 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="AxisByDimensionsCase" title="By three dimensions" icon="icons/Construction/axis_dxyz_32x32.png">
@@ -50,7 +29,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Line"
                       tooltip="Select line."
                       icon="icons/Construction/edge.png"
-                      shape_types="edge">
+                      shape_types="edge"
+                      geometrical_selection="true">
         <validator id="GeomValidators_ShapeType" parameters="line"/>
       </shape_selector>
     </box>
@@ -59,7 +39,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
         label="Main object"
         icon="icons/Construction/circle.png"
         tooltip="Select a cylindrical object"
-        shape_types="face">
+        shape_types="face"
+        geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="cylinder"/>
       </shape_selector>
     </box>
@@ -68,7 +49,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
       </shape_selector>
       <shape_selector id="point"
@@ -83,7 +65,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="1st plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
         <validator id="ConstructionPlugin_ValidatorAxisTwoNotParallelPlanes" parameters="plane2"/>
       </shape_selector>
@@ -95,7 +78,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="2nd plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
         <validator id="ConstructionPlugin_ValidatorAxisTwoNotParallelPlanes" parameters="plane1"/>
       </shape_selector>
index 576189911de01acfb8d59d591fa5fc731dc3bb7f..416292fdd8ff7965346894d50f76b63560b6e2af 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"))
 model.do()
 model.end()
index fe351d87e18d2be2d8f5b3b5c1a2fe4b382f24f7..6e5475625551dc1e051fa5f0946ccc20708aa06f 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"), False)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"), model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]"), False)
 model.do()
 model.end()
index 41fa8768c0616944bd4c68f308b9b4a3cd580594..f73127ca597a7aeb1a92f8e009908e90d0fdc305 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Box_1_1/Front&Box_1_1/Left"), 0.4, True, False)
+Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 0.4, True, False)
 model.do()
 model.end()
index 0d28192273391ee112cb2727e414212ac990f34f..88e2cc32ac827040ade839ae57257b0821487168 100644 (file)
@@ -7,8 +7,8 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"))
-Axis_5 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"))
+Axis_5 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"))
 Point_2 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("EDGE", "Axis_2"))
 model.do()
 model.end()
index f23a4f40604f8053683bf81bf5461866a8ddd343..b9e777555003b0ea4e5115d31c43f50a028aeff6 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="creation_method">
     <box id="by_three_points"
@@ -55,7 +34,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Line"
                       tooltip="Select line."
                       icon="icons/Construction/edge.png"
-                      shape_types="edge">
+                      shape_types="edge"
+                      geometrical_selection="true">
         <validator id="GeomValidators_ShapeType" parameters="line"/>
         <validator id="ConstructionPlugin_ValidatorPlaneLinePoint" parameters="point,perpendicular"/>
       </shape_selector>
@@ -79,7 +59,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
       </shape_selector>
       <toolbox id="by_other_plane_option">
@@ -118,7 +99,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Axis"
                           tooltip="Select line for axis."
                           icon="icons/Construction/axis.png"
-                          shape_types="edge">
+                          shape_types="edge"
+                          geometrical_selection="true">
             <validator id="GeomValidators_ShapeType" parameters="line"/>
           </shape_selector>
           <doublevalue id="angle"
@@ -140,7 +122,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="1st plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
         <validator id="ConstructionPlugin_ValidatorPlaneTwoParallelPlanes" parameters="plane2"/>
       </shape_selector>
@@ -148,7 +131,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="2nd plane"
                       tooltip="Select a planar face."
                       icon="icons/Construction/face.png"
-                      shape_types="face">
+                      shape_types="face"
+                      geometrical_selection="true">
         <validator id="GeomValidators_Face" parameters="plane"/>
         <validator id="ConstructionPlugin_ValidatorPlaneTwoParallelPlanes" parameters="plane1"/>
       </shape_selector>
index f0d46b5fc60af141a77a6dc293978b7ad0543d61..dcffc622e5cb1e71df9d7bda0b91552fcc9b00b1 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Construction">
     <group id="Basic">
index bd7439f8acc791f8f7d68c814c8b3e17ac248792..450dadd33f32adad79d5486b8294f719509deae9 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="creation_method">
     <box id="by_xyz"
@@ -141,7 +120,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Line"
                           tooltip="Line for intersection."
                           icon="icons/Construction/edge.png"
-                          shape_types="edge">
+                          shape_types="edge"
+                          geometrical_selection="true">
             <validator id="ConstructionPlugin_ValidatorPointEdgeAndPlaneNotParallel"
                        parameters="intersection_plane"/>
           </shape_selector>
@@ -149,7 +129,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane"
                           tooltip="Plane for intersection."
                           icon="icons/Construction/face.png"
-                          shape_types="face">
+                          shape_types="face"
+                          geometrical_selection="true">
             <validator id="GeomValidators_Face" parameters="plane"/>
             <validator id="ConstructionPlugin_ValidatorPointEdgeAndPlaneNotParallel"
                        parameters="intersection_line"/>
index 1dc931fd1ba7e0ded16518c68a4aa25b22cc43ba..61fd28a0648f554365d276cb6c5c348858ed0e7a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 FIND_PACKAGE(SWIG REQUIRED)
index 523b2a9c9f8a361cd5521eed67b0f6137702a5ab..61a8ad85c1777955ea5f11a4de90567b3d927173 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EVENTS_H
index 61ad50d538aa73e230c6b00f0a22d8427f7a5772..aa09fbbee2c4db7980b22df440d9a19642c4346a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* Events.i */
index b8f4ef67d0745c3feebfaed363d0633d1ef71624..f85bed86846604220216215418037208024dbb98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Events_InfoMessage.h"
index 16398492d55afb2095c223902eea3c8d9127175e..a64b5e8bf64e4ceb40947ac5e891f8670f47abd6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Events_InfoMessage_H_
index b59f4fba7005cde7c59aab129d1e8a7ad6485ede..8e00955c55ec93104b58115a7d0812d86fb285a8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Events_Listener.h>
index 30c20d9aadd9e58b45f7b7f856374dac96621453..07fd93f97996dfe14b1b57b60f33c19937574698 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Events_Listener_H_
index f4c6e2dc4b26b07310ee3909e08361b775fbfb14..22cc69035a47c76fe4b7e6cb99d3b5a8df49dd6f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Events_LongOp.h>
index 2840dde3cbb85d2ccc7b636220ec6a839f317a3c..1b5eb36b8f1ae22fc00305b9430b1b541e84a001 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EVENTS_LONGOP_H_
index fda4aadca27f471169fd4bcdc7d1453074826fbc..2723057a964a43bd7ba065c24fada25add300ecc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Events_Loop.h>
index f53307c5bfd57a6675dd30e91cc74f7184e13ff7..ded3f67185759fe7026ca93800d6bb7246891dfb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Events_Loop_H_
index 421463c5652a6bb3546211f63972ea011525987a..ddd69fef1b0b648f1ebe65df4973da46f48967b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Events_Message.h>
index ba1e922376f65572e417412b4f7fcf2e43cadb2e..e7a631fc6023291aac898f84fa56a6b82b893de1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Events_Message_H_
index 0cd8df40b8bb1e0703f1fa16ff1a9747e64cce25..bc1af3b1aa84a76b15b05e976fd14c9425030515 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Events_MessageGroup.h>
index a2988241f6ffd0648665ffecfbd53cada5aedfec..5a2fe7a8c14e788a120397465d28340698f9358d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Events_MessageGroup_H_
index f8fafc7dfca9e3003510a68d97180f8f8401e4bc..8cc29b806682dc8500180c5bb7cd68c28e8eb147 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index e5e9eb77d2d5ffffd5ec5dfcc7c6806513dbfb87..2370a80f18e1e1726c97c637f17be58535cae923 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEAPI_H
index 9bd456ae38e8b8d84040047734e7e2c0dc401c08..025f3d800c09d4066a28644740f509ac6c5e9cb6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ExchangeAPI.i */
index 6165c8fa62e8cfa958cb6ba5f2090320e72a0276..10ea384268c4e8ca0c1cefe2219c89290934a99c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ExchangeAPI_Export.h"
index a4b314836c0775554452e820a61094bf348f6b7f..927a07127615458d400eadf1f4582ac94fa4bcd2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_EXPORT_H_
index ab60deed59bec458a66484951138ff8e0dfa215f..d360c95a76ca54f2bc23866b2f33c8db82a49d2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ExchangeAPI_Import.h"
index f94a3d68fefd909a79c694a7d5547666653ceba3..1713c9271bfc4eba6b5ae063e06e4cd45829c825 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_IMPORT_H_
index 6685534c4f5f8489df16aad56e226c94b826e047..b741d333f6c86feb7015d7fe0605741409b70273 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_EXCHANGEAPI_EXCHANGEAPI_SWIG_H_
index 06e294a5c2bafd69d2ef84e7106596b6094d4767..1cc0a6109e922da94245477fa402141d141d9bd7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 91dcb66901c699a0ce4c68d95a2a14e5b06efd64..222f2e6eaea1ac3bea1cbbb0aa44e8d0b8465cd8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -83,4 +82,7 @@ ADD_UNIT_TESTS(TestImport.py
                TestExport.py
                Test2290.py
                Test2459.py
-               TestExportToXAOWithGroupNotUpdated.py)
+               TestExportToXAOWithFields.py
+               TestExportToXAOWithGroupNotUpdated.py
+               TestExport_FiniteValidator.py
+)
index b08d2593e5d4cbfd79d8a8ecd4b002d182b7854f..567649d21806b6a30670ee4fdc996869bf74e68e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_H
index dbec8bef6c28bc8dc91876fdf2bda9c0af0fe3d4..30f4169614983a4ef26c11f1eaa67fed7f5b0b15 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_Dump.h>
index 06047cde0524f46ff13cad0d642bb9745700029b..b297583f964c4c344c35c031bffbed0c7096f25d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_DUMP_H_
index 407887dbce81cf2c0a194d64600a48fc6501dcb0..7ae2e133f301731019628a418f4e73e97c6ed85f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_ExportFeature.h>
@@ -411,9 +410,11 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
     return;
   }
 
+// LCOV_EXCL_START
   } catch (XAO::XAO_Exception& e) {
     std::string anError = e.what();
     setError("An error occurred while exporting " + theFileName + ": " + anError);
     return;
   }
+// LCOV_EXCL_STOP
 }
index f0866181c1e63d5c22a2b05ae1f5965a91a4419f..3644a37b4c4ad6457738e86d37422dba84ff221a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_EXPORTFEATURE_H_
index ef70f9a6619a9ec1ca3428dd3cabc422b4862b42..e6f2e8f3e28cdebdf29df214eb86a4a729e590b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_ImportFeature.h>
@@ -204,7 +203,7 @@ void ExchangePlugin_ImportFeature::importXAO(const std::string& theFileName)
       // complex conversion of element index to reference id
       int anElementID = aXaoGroup->get(anElementIndex);
       std::string aReferenceString =
-          aXaoGeometry->getElementReference(aXaoGroup->getDimension(), anElementID);
+        aXaoGeometry->getElementReference(aXaoGroup->getDimension(), anElementID);
       int aReferenceID = XAO::XaoUtils::stringToInt(aReferenceString);
 
       aSelectionList->value(anElementIndex)->setId(aReferenceID);
@@ -332,11 +331,13 @@ void ExchangePlugin_ImportFeature::importXAO(const std::string& theFileName)
   ModelAPI_EventCreator::get()->sendReordered(
     std::dynamic_pointer_cast<ModelAPI_Feature>(aRefListOfGroups->owner()));
 
+// LCOV_EXCL_START
   } catch (XAO::XAO_Exception& e) {
     std::string anError = e.what();
     setError("An error occurred while importing " + theFileName + ": " + anError);
     return;
   }
+// LCOV_EXCL_STOP
 }
 
 //============================================================================
@@ -351,6 +352,7 @@ std::shared_ptr<ModelAPI_Feature> ExchangePlugin_ImportFeature::addFeature(
   return aNew;
 }
 
+// LCOV_EXCL_START
 void ExchangePlugin_ImportFeature::removeFeature(
     std::shared_ptr<ModelAPI_Feature> theFeature)
 {
@@ -359,6 +361,7 @@ void ExchangePlugin_ImportFeature::removeFeature(
   AttributeRefListPtr aList = reflist(FEATURES_ID());
   aList->remove(theFeature);
 }
+// LCOV_EXCL_STOP
 
 int ExchangePlugin_ImportFeature::numberOfSubs(bool forTree) const
 {
@@ -373,6 +376,7 @@ std::shared_ptr<ModelAPI_Feature> ExchangePlugin_ImportFeature::subFeature(
   return aRes;
 }
 
+// LCOV_EXCL_START
 int ExchangePlugin_ImportFeature::subFeatureId(const int theIndex) const
 {
   std::shared_ptr<ModelAPI_AttributeRefList> aRefList = std::dynamic_pointer_cast<
@@ -390,6 +394,7 @@ int ExchangePlugin_ImportFeature::subFeatureId(const int theIndex) const
   }
   return aResultIndex;
 }
+// LCOV_EXCL_STOP
 
 bool ExchangePlugin_ImportFeature::isSub(ObjectPtr theObject) const
 {
@@ -410,5 +415,5 @@ void ExchangePlugin_ImportFeature::loadNamingDS(
 
   int aTag(1);
   std::string aNameMS = "Shape";
-  theResultBody->loadFirstLevel(theGeomShape, aNameMS, aTag);
+  theResultBody->loadFirstLevel(theGeomShape, aNameMS);
 }
index 2843e92e8ba8c387441f1cec933f880d929d7e81..674ed09a195a59f303b7e31a6025dc2d62cfa9f2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
index 53f17692eeeb868c405ef8a4a9d6ba1e9931654b..34c3c1b61a3f923ba84384e37867f86c1e235717 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_Plugin.h>
index 5d13973b06c8c52b9ca44e3048fa6f3b4362d9f9..03e711f9f8c89493a7183280aa8c779584ac8f93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_PLUGIN_H_
index 7ef4bdcf9f14134ee973647844ae7e3c74fa8696..d369df2fcd8ff1cf50fa13de08fbcaa119d46fd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_Tools.h>
index b0154c6bfa6657b84dbc38dc01577107d323f2aa..35c177611671ba7c0c6547227c81818c505996d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_TOOLS_H_
index 7e768cb460a785c6308b5a0649f3bd063a617213..3f52e2cf1023ccd86dc3161e219e459e8555a57e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ExchangePlugin_Validators.h>
@@ -58,17 +57,21 @@ bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
                                              Events_InfoMessage& theError) const
 {
   if (!theAttribute->isInitialized()) {
+// LCOV_EXCL_START
     theError = "%1 is not initialized.";
     theError.arg(theAttribute->id());
     return false;
+// LCOV_EXCL_STOP
   }
 
   const AttributeStringPtr aStrAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
   if (!aStrAttr) {
+// LCOV_EXCL_START
     theError = "%1 is not a string attribute.";
     theError.arg(theAttribute->id());
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::string aFileName = aStrAttr->value();
index ffaa7664dab47eb3c07bb61758bea0509d473dd9..b8569a5db3c544a90b962a40c89be439284cd08a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef EXCHANGEPLUGIN_VALIDATORS_H
index 04a0ca50ae5fec253972c6ffef9e84b621c9e1a1..6a5dbac4b010012944843a0e7f699bb644a8492a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -27,8 +26,12 @@ Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 5, 10, 10)
 Box_2 = model.addBox(Part_1_doc, 10, 50, 8)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_2_1"), model.selection("SOLID", "Box_1_1")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_3/Modified_Face_2_3"), model.selection("FACE", "Partition_1_1_1/Modified_Face_2_3")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Left&Box_2_1/Left"), model.selection("FACE", "Partition_1_1_3/Modified_Face&Box_1_1/Front")])
 model.do()
+
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Group_1.feature()))
 # test export to XAO
 anExportFeature = Part_1_doc.addFeature("Export")
 anExportFeature.string("xao_file_path").setValue("Data/export2290.xao")
index 9cd57811e0372a40026adfbfb8fae57ccc382420..8f0de14d056541490592cc1b5ba1cee215a775bf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -109,7 +108,7 @@ SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchArc_15.endPoint(),
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchAPI_Arc(SketchArc_12).startPoint())
 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchAPI_Arc(SketchArc_6).endPoint())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2f-SketchArc_4_2r-SketchArc_5_2r-SketchCircle_1_2r-SketchArc_6_2r-SketchArc_7_2r-SketchLine_6f-SketchLine_7f-SketchArc_8_2f-SketchArc_9_2f-SketchLine_8f-SketchLine_9f-SketchArc_10_2f-SketchArc_11_2f-SketchLine_10f-SketchLine_11f-SketchArc_12_2r-SketchArc_13_2r-SketchCircle_2_2r-SketchCircle_3_2r-SketchArc_14_2f-SketchArc_15_2f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_1_2f-SketchLine_3f-SketchArc_2_2f-SketchLine_4f-SketchArc_5_2r-SketchArc_3_2f-SketchArc_6_2r-SketchLine_6f-SketchArc_8_2f-SketchLine_8f-SketchArc_10_2f-SketchLine_10f-SketchArc_12_2r-SketchArc_15_2f-SketchArc_7_2r-SketchLine_7f-SketchArc_9_2f-SketchLine_9f-SketchArc_11_2f-SketchLine_11f-SketchArc_13_2r-SketchArc_14_2f-SketchArc_4_2r-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 10, 0)
 model.do()
 model.end()
 
index 8a6f1e320eceb40448228fe50d0d0c27ec3085b4..353e7ea2cceb2066a797cdf54cf47acd57e45b84 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestExport.py
@@ -50,7 +49,7 @@ def removeFile(theFileName):
 #=========================================================================
 # Common test function
 #=========================================================================
-def testExport(theType, theFormat, theFile, theVolume, theDelta):
+def testExport(theType, theFormat, theFile, theVolume, theDelta, theErrorExpected = False):
     # Import a reference part
     aSession.startOperation("Add part")
     aPartFeature = aSession.moduleDocument().addFeature("Part")
@@ -76,12 +75,22 @@ def testExport(theType, theFormat, theFile, theVolume, theDelta):
     aSelectionListAttr.append(anImportFeature.firstResult(), anImportFeature.firstResult().shape())
     aSession.finishOperation()
 
-    assert os.path.exists(theFile)
+    if theErrorExpected:
+        assert anExportFeature.error() != ""
+        aPart.removeFeature(anExportFeature)
+    else:
+        assert os.path.exists(theFile)
 
-    # Test exported file by importing
-    testImport(theType, theFile, theVolume, theDelta)
+        # Test exported file by importing
+        testImport(theType, theFile, theVolume, theDelta)
+
+def testExportXAO(theFile, theEmptyFormat = False):
+    type = "XAO"
+    format = "XAO"
+    if theEmptyFormat:
+        type = "Regular"
+        format = ""
 
-def testExportXAO(theFile):
     # Import a reference part
     aSession.startOperation("Add part")
     aPartFeature = aSession.moduleDocument().addFeature("Part")
@@ -108,16 +117,16 @@ def testExportXAO(theFile):
     aGroupFeature.data().setName("")
     aSelectionListAttr = aGroupFeature.selectionList("group_list")
     aSelectionListAttr.setSelectionType("face")
-    aSelectionListAttr.append("box1_1/Shape1")
-    aSelectionListAttr.append("box1_1/Shape2")
+    aSelectionListAttr.append("box1_1/Shape_1")
+    aSelectionListAttr.append("box1_1/Shape_2")
     aSession.finishOperation()
 
     aSession.startOperation("Create a field")
     aField = aSession.activeDocument().addFeature("Field")
     aSelectionListAttr = aField.selectionList("selected")
     aSelectionListAttr.setSelectionType("face")
-    aSelectionListAttr.append("box1_1/Shape1")
-    aSelectionListAttr.append("box1_1/Shape2")
+    aSelectionListAttr.append("box1_1/Shape_1")
+    aSelectionListAttr.append("box1_1/Shape_2")
     aComponentNames = aField.stringArray("components_names")
     aComponentNames.setSize(2) # two components
     aComponentNames.setValue(0, "temperatue")
@@ -140,8 +149,8 @@ def testExportXAO(theFile):
     aSession.startOperation("Export to XAO")
     anExportFeature = aPart.addFeature("Export")
     anExportFeature.string("xao_file_path").setValue(theFile)
-    anExportFeature.string("file_format").setValue("XAO")
-    anExportFeature.string("ExportType").setValue("XAO")
+    anExportFeature.string("file_format").setValue(type)
+    anExportFeature.string("ExportType").setValue(type)
     anExportFeature.string("xao_author").setValue("me")
     anExportFeature.string("xao_geometry_name").setValue("mygeom")
     aSession.finishOperation()
@@ -159,22 +168,30 @@ if __name__ == '__main__':
         aRealVolume = 3.78827401738e-06
         testExport("BREP", "BREP", os.path.join(tmp_dir, "screw_export.brep"), aRealVolume, 10 ** -17)
         testExport("BRP", "BREP", os.path.join(tmp_dir, "screw_export.brp"), aRealVolume, 10 ** -17)
+        testExport("Regular", "", os.path.join(tmp_dir, "screw_export.brep"), aRealVolume, 10 ** -17)
         #=========================================================================
         # Export a shape into STEP
         #=========================================================================
         testExport("STEP", "STEP", os.path.join(tmp_dir, "screw_export.step"), 3.78825807533e-06, 10 ** -17)
         testExport("STP", "STEP", os.path.join(tmp_dir, "screw_export.stp"), 3.78825807533e-06, 10 ** -17)
+        testExport("Regular", "", os.path.join(tmp_dir, "screw_export.step"), 3.78825807533e-06, 10 ** -17)
         #=========================================================================
         # Export a shape into IGES
         #=========================================================================
         testExport("IGES-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17)
         testExport("IGS-5.1", "IGES-5.1", os.path.join(tmp_dir, "screw_export-5.1.igs"), 3.78829613776e-06, 10 ** -17)
+        testExport("Regular", "", os.path.join(tmp_dir, "screw_export-5.1.iges"), 3.78829613776e-06, 10 ** -17)
         testExport("IGES-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.iges"), 3.78827401651e-06, 10 ** -17)
         testExport("IGS-5.3", "IGES-5.3", os.path.join(tmp_dir, "screw_export-5.3.igs"), 3.78827401651e-06, 10 ** -17)
         #=========================================================================
         # Export a shape into XAO
         #=========================================================================
         testExportXAO(os.path.join(tmp_dir, "export.xao"))
+        testExportXAO(os.path.join(tmp_dir, "export.xao"), True)
+        #=========================================================================
+        # Check error when export to unsupported format
+        #=========================================================================
+        testExport("Regular", "", os.path.join(tmp_dir, "screw_export.dwg"), 3.78825807533e-06, 10 ** -17, True)
         #=========================================================================
         # End of test
         #=========================================================================
diff --git a/src/ExchangePlugin/Test/TestExportToXAOWithFields.py b/src/ExchangePlugin/Test/TestExportToXAOWithFields.py
new file mode 100644 (file)
index 0000000..61c7016
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+import tempfile
+import os
+
+def getTmpFileName(ext):
+  tempdir = tempfile.gettempdir()
+  tmp_file = tempfile.NamedTemporaryFile(suffix=".%s"%ext, prefix='shaper_', dir=tempdir, delete=False)
+  tmp_filename = tmp_file.name
+  return tmp_filename
+
+tmp_file1 = getTmpFileName("xao")
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Field_1 = model.addField(Part_1_doc, 1, "BOOLEAN", 1, ["Comp 1"], [model.selection("FACE", "Box_1_1/Front")])
+Field_1.addStep(0, 0, [[False], [False]])
+Field_2_objects = [model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")]
+Field_2 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_2_objects)
+Field_2.addStep(0, 0, [[0], [1], [0], [0], [0]])
+Field_3 = model.addField(Part_1_doc, 1, "STRING", 1, ["Comp 1"], [model.selection("SOLID", "Box_1_1")])
+Field_3.addStep(0, 0, [[""], ["box"]])
+
+Export_1 = model.exportToXAO(Part_1_doc, tmp_file1)
+assert(Export_1.feature().error() == "")
+
+model.end()
index 40e9e80889cddcea3366352041edbf69e586eec4..3a64ec297bbc6c725855dca6ee1185e7513f99e0 100644 (file)
@@ -1,4 +1,22 @@
 # -*- coding: utf-8 -*-
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # This test checks that exportToXAO works even if a group or a field is not valid
 
@@ -39,14 +57,14 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL
 SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
 # Create a group with the faces of the box
-Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")]
+Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 Group_1.setName("Group_faces")
 Group_1.result().setName("Group_faces")
 # Create a field on the box
-Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")]
+Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")]
 Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_1_objects)
 Field_1.addStep(0, 0, [[0], [1], [2], [3], [4], [5], [6]])
 # Create a plane to split the box in two parts
diff --git a/src/ExchangePlugin/Test/TestExport_FiniteValidator.py b/src/ExchangePlugin/Test/TestExport_FiniteValidator.py
new file mode 100644 (file)
index 0000000..81ad7bd
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+
+aSession = ModelAPI_Session.get()
+
+# Import a reference part
+aSession.startOperation("Add part")
+aPartFeature = aSession.moduleDocument().addFeature("Part")
+aSession.finishOperation()
+aPart = aSession.activeDocument()
+
+# Export a part
+aSession.startOperation("Export part")
+anExportFeature = aPart.addFeature("Export")
+anExportFeature.string("file_format").setValue("BREP")
+anExportFeature.string("file_path").setValue("file.brep")
+anExportFeature.string("ExportType").setValue("Regular")
+aSelectionListAttr = anExportFeature.selectionList("selection_list")
+aSelectionListAttr.setSelectionType("solids")
+aSelectionListAttr.append("PartSet/OX", "EDGE")
+aSession.finishOperation()
+assert(anExportFeature.error() != "")
index 0d42f92072977e94f3994665b252aa4c08efe7fa..587fa615a8faf37151267aa0060ddea69b4e869b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestImport.py
@@ -44,7 +43,7 @@ def getShapePath(path):
     shapes_dir = os.path.join(os.getenv("DATA_DIR"), "Shapes")
     return os.path.join(shapes_dir, path)
 
-def testImport(theType, theFile, theVolume, theDelta):
+def testImport(theType, theFile, theVolume, theDelta, theErrorExpected = False):
     # Create a part for import
     aSession.startOperation("Create part for import")
     aPartFeature = aSession.moduleDocument().addFeature("Part")
@@ -61,18 +60,21 @@ def testImport(theType, theFile, theVolume, theDelta):
     file.setValue(theFile)
     aSession.finishOperation()
 
-    # Check results
-    assert anImportFeature.error() == '', "{0}: The error after execution: {1}".format(theType, anImportFeature.error())
-    assert len(anImportFeature.results()) == 1, "{0}: Wrong number of results: expected = 1, real = {1}".format(theType, len(anImportFeature.results()))
-    aResultBody = modelAPI_ResultBody(anImportFeature.firstResult())
-    assert aResultBody, "{0}: The result is not a body".format(theType)
-    aShape = aResultBody.shape()
-    assert aShape, "{0}: The body does not have a shape".format(theType)
-
-    # Check shape volume
-    aRefVolume = theVolume
-    aResVolume = GeomAlgoAPI_ShapeTools.volume(aShape)
-    assert (math.fabs(aResVolume - aRefVolume) < theDelta), "{0}: The volume is wrong: expected = {1}, real = {2}".format(theType, aRefVolume, aResVolume)
+    if theErrorExpected:
+        assert anImportFeature.error() != ''
+    else:
+        # Check results
+        assert anImportFeature.error() == '', "{0}: The error after execution: {1}".format(theType, anImportFeature.error())
+        assert len(anImportFeature.results()) == 1, "{0}: Wrong number of results: expected = 1, real = {1}".format(theType, len(anImportFeature.results()))
+        aResultBody = modelAPI_ResultBody(anImportFeature.firstResult())
+        assert aResultBody, "{0}: The result is not a body".format(theType)
+        aShape = aResultBody.shape()
+        assert aShape, "{0}: The body does not have a shape".format(theType)
+
+        # Check shape volume
+        aRefVolume = theVolume
+        aResVolume = GeomAlgoAPI_ShapeTools.volume(aShape)
+        assert (math.fabs(aResVolume - aRefVolume) < theDelta), "{0}: The volume is wrong: expected = {1}, real = {2}".format(theType, aRefVolume, aResVolume)
 
 def testImportXAO():
     # Create a part for import
@@ -112,9 +114,8 @@ def testImportXAO():
     aSelectionList = aFeature2.selectionList("group_list")
     assert aSelectionList.selectionType() == "face"
     assert aSelectionList.size() == 2
-    assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape1"
-    print(aSelectionList.value(1).namingName(""))
-    assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape2"
+    assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape_1"
+    assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape_2"
 
     aFeature3 = aCompositeFeature.subFeature(2, False)
     assert aFeature3.getKind() == "Field"
@@ -155,6 +156,15 @@ if __name__ == '__main__':
         #=========================================================================
         testImportXAO()
 
+        #=========================================================================
+        # Check import errors
+        #=========================================================================
+        testImport("BREP", "", 0, 10 ** -25, True)
+        shape_path = getShapePath("Brep/solid.dwg")
+        testImport("BREP", shape_path, 0, 10 ** -25, True)
+        shape_path = getShapePath("Xao/wrong_file.xao")
+        testImport("XAO", shape_path, 0, 10 ** -25, True)
+
         #=========================================================================
         # End of test
         #=========================================================================
index 330187a1c7d74295c005d8d93ec869bb954ae709..6c60d9f569c4c4f84ffa3ff3b11584e7e1064528 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <switch id="ExportType">
     <case id="Regular" title="BREP, STEP, IGES">
old mode 100755 (executable)
new mode 100644 (file)
index 8377f64..8dc02f2
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Part">
     <group id="Exchange">
index 166375166037771c42b9356649cdd6e648f34f28..10702894a2fc161afd7dd93c76a20310d5ad321c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 8ce48f82a74ca25726f38ce52c473fc951d29ab4..c2279c452ea90903ff5854957485e03ef24d9132 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESAPI_H
index e9668c42c29f38eeafd9125a7a93442166aa8ed8..d9082cc2598baeea6c4e15a6bd2a379a0c3df47e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* FeaturesAPI.i */
index b1af676882115e71249dd47b099eba95ccff94b2..b036ab38e90e865d4dec2d05d982b1d974537400 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_BooleanCommon.h"
index e6e20576d0db5dc256570dac3021515b3bc4f6a8..9005aed2b8ebb8a3aca65e4083d5407136e4ca5c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_BooleanCommon_H_
index 496b1fdbc799a0b6aacc29d53b1924e19c1677f0..5b81a2be3ed55df17b9b723e152c1f0f9654f12f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_BooleanCut.h"
index c39dd49d398ed9ddc6cfcf9b812b9ff032a70add..82eb5ad992e73d5549a13f8371ce9ca1c7c6adb7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_BooleanCut_H_
index f9924204a341c8ac9d3b4f5d04dcc2a05f2ebeca..1d4b4d7e07c3a0c55a45026f3524419d83301942 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_BooleanFill.h"
index 32413f17515fdab81ff6f474bd4b8f254c32ca14..14055dc258bfade13801a680050738aa9c48ffaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_BooleanFill_H_
index 6d837663c87152033b91e77626d9f3ee00aa82c0..c6cab27359d8ea39e5430f0ef364b05f3144c494 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_BooleanFuse.h"
index 7c5f8a2398fac84463fdc762da39611c111a97e5..db80f967743843855c763f94371436b2dbb44be0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_BooleanFuse_H_
index 7c7583bbfa43c6e16fe96683daafcc7faf7e502e..9c22e3bd34a632af326690dc06babf9138d26a9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_BooleanSmash.h"
index bfe0d5e8712c9042837cad68cd9b90ca8b4d4360..f9cadd6edfdbed06549ea6f95339dbbdf1d33eb9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_BooleanSmash_H_
index 5e2975ac3bfe595874fe4fc8da741e161cc7012c..ea7fe5331019f6d6e5581baeb9dd0fd795e73e7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Extrusion.h"
@@ -175,11 +174,7 @@ void FeaturesAPI_Extrusion::setSizes(const ModelHighAPI_Double& theToSize,
 //==================================================================================================
 void FeaturesAPI_Extrusion::setSize(const ModelHighAPI_Double& theSize)
 {
-  fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-  fillAttribute(theSize, mytoSize);
-  fillAttribute(ModelHighAPI_Double(), myfromSize);
-
-  execIfBaseNotEmpty();
+  setSizes(theSize, ModelHighAPI_Double());
 }
 
 //==================================================================================================
index ec83ff9fb558beacd08663d7e35cf17030bae6d7..194d4d7f3a7ffd34341dd3af41edcc6759ba4364 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Extrusion_H_
index 1b16e2aff44b0d798faae5ca0a5b54c0bd01d19b..934a9ae02e0c35113e8d653070896dbb6fd9f227 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_ExtrusionBoolean.h"
@@ -89,11 +88,7 @@ void FeaturesAPI_ExtrusionBoolean::setSizes(const ModelHighAPI_Double& theToSize
 //==================================================================================================
 void FeaturesAPI_ExtrusionBoolean::setSize(const ModelHighAPI_Double& theSize)
 {
-  fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-  fillAttribute(theSize, mytoSize);
-  fillAttribute(ModelHighAPI_Double(), myfromSize);
-
-  execIfBaseNotEmpty();
+  setSizes(theSize, ModelHighAPI_Double());
 }
 
 //==================================================================================================
@@ -198,9 +193,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theSize, mytoSize);
-    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setSize(theSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -217,9 +210,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theSize, mytoSize);
-    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setSize(theSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -235,9 +226,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theToSize, mytoSize);
-    fillAttribute(theFromSize, myfromSize);
+    setSizes(theToSize, theFromSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -255,9 +244,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theToSize, mytoSize);
-    fillAttribute(theFromSize, myfromSize);
+    setSizes(theToSize, theFromSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -275,11 +262,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
-    fillAttribute(theToObject, mytoObject);
-    fillAttribute(theToOffset, mytoOffset);
-    fillAttribute(theFromObject, myfromObject);
-    fillAttribute(theFromOffset, myfromOffset);
+    setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -299,11 +282,7 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
-    fillAttribute(theToObject, mytoObject);
-    fillAttribute(theToOffset, mytoOffset);
-    fillAttribute(theFromObject, myfromObject);
-    fillAttribute(theFromOffset, myfromOffset);
+    setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -425,9 +404,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theSize, mytoSize);
-    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setSize(theSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -444,9 +421,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theSize, mytoSize);
-    fillAttribute(ModelHighAPI_Double(), myfromSize);
+    setSize(theSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -462,9 +437,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theToSize, mytoSize);
-    fillAttribute(theFromSize, myfromSize);
+    setSizes(theToSize, theFromSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -482,9 +455,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES(), mycreationMethod);
-    fillAttribute(theToSize, mytoSize);
-    fillAttribute(theFromSize, myfromSize);
+    setSizes(theToSize, theFromSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -502,11 +473,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
 {
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
-    fillAttribute(theToObject, mytoObject);
-    fillAttribute(theToOffset, mytoOffset);
-    fillAttribute(theFromObject, myfromObject);
-    fillAttribute(theFromOffset, myfromOffset);
+    setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
     setBooleanObjects(theBooleanObjects);
   }
 }
@@ -526,11 +493,7 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theDirection, mydirection);
-    fillAttribute(FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES(), mycreationMethod);
-    fillAttribute(theToObject, mytoObject);
-    fillAttribute(theToOffset, mytoOffset);
-    fillAttribute(theFromObject, myfromObject);
-    fillAttribute(theFromOffset, myfromOffset);
+    setPlanesAndOffsets(theToObject, theToOffset, theFromObject, theFromOffset);
     setBooleanObjects(theBooleanObjects);
   }
 }
index c8400df8827a457026cfbfff794338f5070bb7a7..42a4791195bcdabcdc8e9b4776fe5b2598e1ab68 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_ExtrusionBoolean_H_
index d69ed3d06fc9ee72f34b533513992ec4241f2d6f..914db27e7a2f2b49f4009988d570841cb413247c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Fillet.h"
index e62240823efc352243b55caf1d7467ad5bb20c9a..7670f2dcb8923843bf35b30aa79c1c73b2c3b609 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Fillet_H_
index 0a2efc8b2585377a371c7407f1e0414926f977ed..d8a2793e6d6e634e2d3076973de4b7c617f4ba13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_FusionFaces.h"
index 054f7ac2fac8d7644efba8f0d9bfa6a5bdf9cb74..8fb54fd41f0a456c439649e1209014adaf0c5dea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_FusionFaces_H_
index 72d82355f4159158477bafa50226afdeb3e2efe4..5e85db2d38e5cdd0269c9c070f21049f0161545d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Intersection.h"
index 3720b25e475e8615bda29c611ea4542316b456f2..4135816c8ca2dcce44447381da615d4f734b7f6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Intersection_H_
index 40029631414224f683574d5a3395a79f68c11d92..8acd60f46513a0a8fb88d6da1d2121cd17fdaacb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Measurement.h"
index 774f7f98e99b6c12107adef56595aac28202a892..bbbc67445715785e365c12aeba3ff2aa15fe73b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Measurement_H_
index 9d23177d290142d90997e820fa78e7bb5a9561da..8e59da5f22c912ffd96c0f85c3c4e8cf402cf0fa 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        FeaturesAPI_MultiRotation.cpp
 // Created:     04 Apr 2017
@@ -141,4 +158,4 @@ MultiRotationPtr addMultiRotation(const std::shared_ptr<ModelAPI_Document>& theP
     thePart->addFeature(FeaturesAPI_MultiRotation::ID());
   return MultiRotationPtr(new FeaturesAPI_MultiRotation(aFeature, theMainObjects,
                                                         theAxis, theStep, theNumber));
-}
\ No newline at end of file
+}
index d1ae1c75c1957178ce5211731ef9f11896350061..6c33affb060c6061837f4e7f7495ae94ab28271b 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        FeaturesAPI_MultiRotation.h
 // Created:     04 Apr 2017
index 64bfef004ed2adb8ecade7b275e34fde1fc9aaca..c5afd844478eb078400a8331a9c188296cde8370 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesAPI_MultiTranslation.h>
index 70b76ff60e67c9e5a3148283ab52c8ea4bbced96..d62314116fc99abe9dff40cfbfedbff8aad42991 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESAPI_MULTITRANSLATION_H_
index da32aac178c22a3cdeb4b15d3aae532d02c7a80a..1af34d8300d797959aa43eafa47bf00c791261e2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Partition.h"
index 3e7cfdf84f4f0c479e063719e9f9dba9661367b5..15c7253fbd5ed2e58570863980518b094b9a21fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Partition_H_
index 0c3cf0dc242c1d7846a47e46b682b5f5bc649eaf..a2f3402bac070e0626a67c2f9718ae187bf360c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Pipe.h"
index e3f7ee3967de2c7658539a47b74aaf847e836c62..3991a031aa0ac52858c1dd000d182a514cd7f071 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Pipe_H_
index 988536e6a19855458ae7ac62a5a177e46519e5f3..54cb9fd13dc94275955d50fa65e14627bc0e158e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Placement.h"
index a4245186e7180edbcbd6c73fa5777a67bfd8fd71..e749c148927ef03d521ed1f343b8dcd441b7156c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Placement_H_
index a7d35b63ce0bd069f34f9826daf4746af5fbc9e2..3699e131e14a2a8f176ff2daf0d1ce81b330265d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Recover.h"
index 29cae46d3dc55317c05b7e16f0c3c9b62f993a17..95335fb29c9dce4719bc5cfc2f47aba47144b348 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Recover_H_
index 784869fdb57abff897fb4408c3c47bed6864e044..97a86b2dab574afd07cfcf3b14922ceaa9a16010 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_RemoveSubShapes.h"
index 15a1d04955edbe434da7db64f179da41b877de64..53a66afba0d03b96a3a44be4c2d0235f6fe4d3ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_RemoveSubShapes_H_
index 47a1ffc226e9decc5986c39795a4df84fb4624c1..a685523e0ed125f56a7424ed9f601dca55f46cf0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Revolution.h"
@@ -139,11 +138,7 @@ void FeaturesAPI_Revolution::setAngles(const ModelHighAPI_Double& theToAngle,
 //==================================================================================================
 void FeaturesAPI_Revolution::setAngle(const ModelHighAPI_Double& theAngle)
 {
-  fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
-  fillAttribute(theAngle, mytoAngle);
-  fillAttribute(ModelHighAPI_Double(), myfromAngle);
-
-  execIfBaseNotEmpty();
+  setAngles(theAngle, ModelHighAPI_Double());
 }
 
 //==================================================================================================
index 75db833fd0fd637bc8bcefd341d88ef4a8aa4d4d..fcdf73bd45f5e1a98022d76e0bdc510ab7f50466 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Revolution_H_
index 030de04c9ca02bb04db50c84f253c42ed88dca9c..385244275779ff6a8c4b0d2adf9dcc13dac69b18 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_RevolutionBoolean.h"
@@ -89,11 +88,7 @@ void FeaturesAPI_RevolutionBoolean::setAngles(const ModelHighAPI_Double& theToAn
 //==================================================================================================
 void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle)
 {
-  fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
-  fillAttribute(theAngle, mytoAngle);
-  fillAttribute(ModelHighAPI_Double(), myfromAngle);
-
-  execIfBaseNotEmpty();
+  setAngles(theAngle, ModelHighAPI_Double());
 }
 
 //==================================================================================================
@@ -202,9 +197,7 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
   if(initialize()) {
     fillAttribute(theBaseObjects, mybaseObjects);
     fillAttribute(theAxis, myaxis);
-    fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod);
-    fillAttribute(theSize, mytoAngle);
-    fillAttribute(ModelHighAPI_Double(), myfromAngle);
+    setAngle(theSize);
     setBooleanObjects(theBooleanObjects);
   }
 }
index 7e30f27efd758b50668503b9059684fc6b3b135d..cd7809176800c9941d44decdb3551cd953d0a469 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_RevolutionBoolean_H_
index 4291a78f7c14b3c9a49f44d0c99808782eea82ed..01c9caebac9fbe3f6d35900de119600b36f39608 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Rotation.h"
index 47f0185a89fa6adb0ab5b03739d13fd6f7c092ad..f11c8e35faca727885e1820edbb7abd19b5231ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Rotation_H_
index baa8aaaf5af320b06ad5e6ddab2f3c9f404d516d..fcb4d331a8dd6eeca8bfd4ed17a68bf028532789 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Scale.h"
index 39463ce54778c0bf0e0a3cd1acd46b6b9964f570..0ea718acc43b98a993000cb02b2e0f9446ad0ae9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESAPI_SCALE_H_
index d51c90bd1c0a4f3713fb8997edbed87907e7528b..4a33af20d86f550b9d804ef624714d1e343085a6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Symmetry.h"
index 9ce53f69851af1ab3818a0453568010fccac0daa..c760c0914c6a49f059400b8e12403f72eff933e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESAPI_SYMMETRY_H_
index 2a23db4f6242990edf0771f9ae8637b609f3c413..35090f2020720073a7a1786af6d0be1fcf037635 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Translation.h"
index e24a9de9e0447035b9e2c8ef5186fb3b2549cbc5..10e20a36806f5782aafed941d0779f673687c4ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Translation_H_
index 86a3d8ab33dae3df430b3c17259a51ee977cb20d..e32efa1ae05d0244a33c333601fd5024c06d1923 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesAPI_Union.h"
index 5b00b48d226075b48016e5cd273871f859f0cbe0..cc977c62e9c0ce7fb066d4324718fbc1bc9c53eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_Union_H_
index e6e4435a16705b3f43743e94e624f942591d9d39..6eeaf064b9a0ead0be1b325a4d644f4153b43bcb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesAPI_swig_H_
index e2ede78a66a7869b535f16be0383e710da0d84ee..907daf15375632cca10e7b0389796f4b6ccf8133 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -73,6 +72,7 @@ SET(PROJECT_SOURCES
     FeaturesPlugin_BooleanFuse.cpp
     FeaturesPlugin_BooleanCommon.cpp
     FeaturesPlugin_BooleanSmash.cpp
+    FeaturesPlugin_BooleanFill.cpp
     FeaturesPlugin_Intersection.cpp
     FeaturesPlugin_Partition.cpp
     FeaturesPlugin_Pipe.cpp
@@ -168,26 +168,66 @@ INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Featu
 INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 
 ADD_UNIT_TESTS(TestExtrusion.py
+               TestExtrusionOfCompound.py
                TestExtrusionCut.py
+               TestExtrusionCut_BySize.py
+               TestExtrusionCut_ByPlanesAndOffsets.py
                TestExtrusionFuse.py
+               TestExtrusionFuse_BySize.py
+               TestExtrusionFuse_ByPlanesAndOffsets.py
+               TestExtrusion_ErrorMsg.py
+               TestExtrusion_ZeroOffsetError.py
                TestRevolution.py
+               TestRevolution_ByAngle.py
+               TestRevolutionOfPoint.py
+               TestRevolutionOfEdge.py
+               TestRevolutionOfCompound.py
                TestRevolutionCut.py
+               TestRevolutionCut_ByAngle.py
+               TestRevolutionCut_ByPlanesAndOffsets.py
                TestRevolutionFuse.py
+               TestRevolutionFuse_ByAngle.py
+               TestRevolutionFuse_ByPlanesAndOffsets.py
                TestCompositeFeaturesOnCompSolids.py
                TestPartition.py
-               TestPlacement.py
+               TestPartition_ErrorMsg.py
+               TestPlacement_Vertex_Vertex.py
+               TestPlacement_Edge_Vertex.py
+               TestPlacement_Edge_Edge.py
+               TestPlacement_Face_Vertex.py
+               TestPlacement_Face_Edge.py
+               TestPlacement_Face_Face.py
+               TestPlacement_Part_Part.py
+               TestPlacement_Complex.py
+               TestPlacement_ErrorMsg.py
+               TestPlacement_BodyShapesValidator.py
                TestTranslation.py
+               TestTranslation_Part.py
                TestRotation.py
-               TestBoolean.py
+               TestRotation_ByAxis.py
+               TestRotation_ByPoints.py
+               TestRotation_ErrorMsg.py
+               TestMultiRotation_Part.py
+               TestMultiRotation_ErrorMsg.py
+               TestMultiTranslation_Part.py
+               TestMultiTranslation_ErrorMsg.py
+               TestSymmetry_Part.py
+               TestBoolean1.py
+               TestBoolean2.py
+               TestBoolean3.py
                TestBooleanCompSolids.py
                TestBooleanSmash.py
                TestBooleanFill.py
                TestBooleanFillWithPlane.py
+               TestBooleanFill_ErrorMsg.py
                TestMultiBoolean.py
                TestSerialBoolean.py
+               TestBoolean_ErrorMsg.py
                TestIntersection.py
+               TestIntersection_ErrorMsg.py
                TestUnion.py
                TestUnionFaces.py
+               TestUnion_ErrorMsg.py
                TestRemoveSubShapes.py
                TestRemoveSubShapes2.py
                TestRemoveSubShapes3.py
@@ -195,6 +235,10 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestRemoveSubShapes5.py
                TestRemoveSubShapes6.py
                TestPipe.py
+               TestPipe_Edge.py
+               TestPipe_Wire.py
+               TestPipe_Compound.py
+               TestPipe_ErrorMsg.py
                TestRecover.py
                TestRecover1798.py
                TestFillEdgeVertex.py
@@ -233,13 +277,14 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestFillSolidCompFace.py
                TestFillSolidShell.py
                TestFillSolidCompShell.py
+               TestFillCompsolidPlane.py
                TestPartition2Faces.py
                TestPartition2Solids.py
                TestPartition2Wires.py
                TestPartitionBox4Planes.py
                TestPartitionEdgeSolid.py
                TestPartitionFace2Solid.py
-#               TestPartitionFaceSolid.py
+               TestPartitionFaceSolid.py
                TestPartitionFaceWire.py
                TestPartitionInclinedFaceSolid.py
                TestPartitionWireFaceSolid.py
@@ -251,7 +296,10 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestMeasurementDistance.py
                TestMeasurementRadius.py
                TestMeasurementAngle.py
+               TestMeasurementAngle3Points.py
+               TestMeasurementPresentation.py
                TestFusionFaces.py
+               TestFusionFaces2697.py
                Test1379.py
                Test1922.py
                Test1942.py
@@ -307,9 +355,17 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanCut_Wire_Face.py
                TestBooleanCut_Wire_Wire.py
                TestBooleanCut_WireCompound_WireCompound.py
+               TestBooleanCut_Compound_Solid.py
+               TestBooleanCut_ErrorMsg.py
+               TestBooleanCut_SolidsHistory.py
                TestBooleanSmash_Face_Face.py
+               TestBooleanSmash_SubSolid_Solid.py
+               TestBooleanSmash_CompSolid_Solid.py
+               TestBooleanSmash_ErrorMsg.py
+               TestBooleanSmash_SolidsHistory.py
                TestBooleanFuse_SimpleMode.py
                TestBooleanFuse_RemoveEdges.py
+               TestBooleanFuse_ErrorMsg.py
                TestBooleanCommon_Vertex_Vertex.py
                TestBooleanCommon_VertexCompound_VertexCompound.py
                TestBooleanCommon_Edge_Edge.py
@@ -317,6 +373,7 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanCommon_Wire_Wire.py
                TestBooleanCommon_WireCompound_WireCompound.py
                TestBooleanCommon_Face_Face.py
+               TestBooleanCommon_Face_Plane.py
                TestBooleanCommon_FaceCompound_FaceCompound.py
                TestBooleanCommon_Shell_Shell.py
                TestBooleanCommon_ShellCompound_ShellCompound.py
@@ -326,19 +383,23 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanCommon_SolidCompound_Face.py
                TestBooleanCommon_SolidCompound_Shell.py
                TestBooleanCommon_SolidCompound_SolidCompound.py
+               TestBooleanCommon_SubCompound_Solid.py
+               TestBooleanCommon_SubSolid_Solid.py
                TestBooleanCommon_CompSolid_Face.py
                TestBooleanCommon_CompSolid_Shell.py
                TestBooleanCommon_CompSolid_CompSolid.py
                TestBooleanCommon_CompSolidCompound_Face.py
                TestBooleanCommon_CompSolidCompound_Shell.py
                TestBooleanCommon_CompSolidCompound_CompSolidCompound.py
+               TestBooleanCommon_ErrorMsg.py
+               TestBooleanCommon_SolidsHistory.py
                Test2596.py
                Test2592.py
                Test2588.py
                Test1467.py
-               TestPartitionSubCompsolidWithCompsolid1.py
-               TestPartitionSubCompsolidWithCompsolid2.py
-               TestPartitionSubCompsolidWithCompsolid3.py
+               TestPartitionSubCompsolidWithCompSolid1.py
+               TestPartitionSubCompsolidWithCompSolid2.py
+               TestPartitionSubCompsolidWithCompSolid3.py
                TestPartitionSubCompsolidWithSolid1.py
                TestPartitionSubCompsolidWithSolid2.py
                TestPartitionSubCompsolidWithSolid3.py
@@ -354,6 +415,8 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestPartitionSubCompsolidWithPlane3.py
                TestPartitionSubCompsolidWithPlane4.py
                TestPartitionSubCompsolidWithPlane5.py
+               TestPartitionArgsUpdate.py
+               TestPartition_SolidsHistory.py
                TestBooleanFuse_Vertex_Vertex.py
                TestBooleanFuse_VertexCompound_VertexCompound.py
                TestBooleanFuse_Edge_Edge.py
@@ -366,9 +429,34 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestBooleanFuse_ShellCompound_ShellCompound.py
                TestBooleanFuse_Solid_Solid.py
                TestBooleanFuse_SolidCompound_SolidCompound.py
+               TestBooleanFuse_CompSolid_Face.py
                TestBooleanFuse_CompSolid_CompSolid.py
                TestBooleanFuse_CompSolidCompound_CompSolidCompound.py
+               TestBooleanFuse_SolidsHistory.py
+               TestFillet.py
+               TestFillet1.py
+               TestFillet_ErrorMsg.py
+               TestFillet_History.py
+               TestScale1.py
+               TestScale2.py
                Test1816.py
+               Test1876.py
                Test2631.py
+               Test2636.py
                Test2650.py
+               Test2681.py
+               Test2686.py
+               Test2689.py
+               Test2693.py
+               Test2698.py
+               Test2701.py
+               Test2724.py
+               Test2692.py
+               Test2617.py
+               Test2729.py
+               Test2738.py
+               Test2751.py
+               Test2826.py
+               Test2854.py
+               Test2878.py
 )
index 5dea4d4bc13926b840b9d6898e98a483c4c1f031..25e028b6fcf5f956ff6cff580bcc67355bb0adf3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESPLUGIN_H
index 99afc6e8dbf6d78c1c37838d639f26fad7caf9f4..b768b90af0aadaf7e6dde8a80af97b2601189f5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Boolean.h"
@@ -63,683 +62,41 @@ void FeaturesPlugin_Boolean::initAttributes()
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID());
 }
 
-//=================================================================================================
-std::shared_ptr<GeomAPI_Shape> FeaturesPlugin_Boolean::getShape(const std::string& theAttrName)
-{
-  std::shared_ptr<ModelAPI_AttributeReference> aObjRef = std::dynamic_pointer_cast<
-      ModelAPI_AttributeReference>(data()->attribute(theAttrName));
-  if (aObjRef) {
-    std::shared_ptr<ModelAPI_ResultBody> aConstr = std::dynamic_pointer_cast<
-        ModelAPI_ResultBody>(aObjRef->value());
-    if (aConstr)
-      return aConstr->shape();
-  }
-  return std::shared_ptr<GeomAPI_Shape>();
-}
-
 //=================================================================================================
 FeaturesPlugin_Boolean::OperationType FeaturesPlugin_Boolean::operationType()
 {
   return myOperationType;
 }
 
-//=================================================================================================
-void FeaturesPlugin_Boolean::execute()
-{
-  ListOfShape anObjects, aTools, anEdgesAndFaces, aPlanes;
-  std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
-
-  // Getting objects.
-  AttributeSelectionListPtr anObjectsSelList =
-    selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
-  for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
-    AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
-    std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
-    if(!anObject.get()) {
-      return;
-    }
-    ResultPtr aContext = anObjectAttr->context();
-    ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-    if(aResCompSolidPtr.get()
-        && aResCompSolidPtr->shape()->shapeType() == GeomAPI_Shape::COMPSOLID) {
-      std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
-      std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
-        anIt = aCompSolidsObjects.begin();
-      for(; anIt != aCompSolidsObjects.end(); anIt++) {
-        if(anIt->first->isEqual(aContextShape)) {
-          aCompSolidsObjects[anIt->first].push_back(anObject);
-          break;
-        }
-      }
-      if(anIt == aCompSolidsObjects.end()) {
-        aCompSolidsObjects[aContextShape].push_back(anObject);
-      }
-    } else {
-      if(myOperationType != BOOL_FILL
-        && (anObject->shapeType() == GeomAPI_Shape::EDGE
-          || anObject->shapeType() == GeomAPI_Shape::FACE))
-      {
-        anEdgesAndFaces.push_back(anObject);
-      }
-      else
-      {
-        anObjects.push_back(anObject);
-      }
-    }
-  }
-
-  // Getting tools.
-  AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID());
-  for(int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) {
-    AttributeSelectionPtr aToolAttr = aToolsSelList->value(aToolsIndex);
-    GeomShapePtr aTool = aToolAttr->value();
-    if(!aTool.get()) {
-      // It could be a construction plane.
-      ResultPtr aContext = aToolAttr->context();
-      aPlanes.push_back(aToolAttr->context()->shape());
-    }
-    else if (myOperationType != BOOL_FILL
-      && (aTool->shapeType() == GeomAPI_Shape::EDGE
-        || aTool->shapeType() == GeomAPI_Shape::FACE))
-    {
-      anEdgesAndFaces.push_back(aTool);
-    } else {
-      aTools.push_back(aTool);
-    }
-  }
-
-  int aResultIndex = 0;
-
-  switch(myOperationType) {
-    case BOOL_CUT:
-    case BOOL_COMMON:
-    case BOOL_FILL: {
-      if((anObjects.empty() && aCompSolidsObjects.empty())
-          || (aTools.empty() && aPlanes.empty())) {
-        std::string aFeatureError = "Error: Not enough objects for boolean operation.";
-        setError(aFeatureError);
-        return;
-      }
-
-      // For solids cut each object with all tools.
-      for(ListOfShape::iterator
-          anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
-        std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
-        ListOfShape aListWithObject;
-        aListWithObject.push_back(anObject);
-        GeomAlgoAPI_MakeShapeList aMakeShapeList;
-        std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
-        GeomShapePtr aResShape;
-
-        switch(myOperationType) {
-          case BOOL_CUT: {
-            aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
-                                                    aTools,
-                                                    GeomAlgoAPI_Boolean::BOOL_CUT));
-            aResShape = aBoolAlgo->shape();
-            break;
-          }
-          case BOOL_COMMON: {
-            aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
-                                                    aTools,
-                                                    GeomAlgoAPI_Boolean::BOOL_COMMON));
-            aResShape = aBoolAlgo->shape();
-            break;
-          }
-          case BOOL_FILL: {
-              std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
-                GeomAlgoAPI_ShapeTools::getBoundingBox(aListWithObject, 1.0);
-
-            // Resize planes.
-            ListOfShape aToolsWithPlanes = aTools;
-            for(ListOfShape::const_iterator anIt = aPlanes.cbegin();
-                                            anIt != aPlanes.cend();
-                                            ++anIt)
-            {
-              GeomShapePtr aPlane = *anIt;
-              GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
-              std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
-                new GeomAlgoAPI_MakeShapeCustom);
-              aMkShCustom->addModified(aPlane, aTool);
-              aMakeShapeList.appendAlgo(aMkShCustom);
-              aToolsWithPlanes.push_back(aTool);
-            }
-
-            aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes));
-            aResShape = aBoolAlgo->shape();
-            if (aResShape.get() && aResShape->shapeType() == GeomAPI_Shape::COMPOUND) {
-              int aSubResultsNb = 0;
-              GeomAPI_ShapeIterator anIt(aResShape);
-              for(; anIt.more(); anIt.next()) {
-                ++aSubResultsNb;
-              }
-              if(aSubResultsNb == 1) {
-                anIt.init(aResShape);
-                if(anIt.more()) {
-                  aResShape = anIt.current();
-                }
-              }
-            }
-            break;
-          }
-        }
-
-        // Checking that the algorithm worked properly.
-        if(!aBoolAlgo->isDone()) {
-          static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-          setError(aFeatureError);
-          return;
-        }
-        if(aResShape->isNull()) {
-          static const std::string aShapeError = "Error: Resulting shape is Null.";
-          setError(aShapeError);
-          return;
-        }
-        if(!aBoolAlgo->isValid()) {
-          std::string aFeatureError = "Error: Resulting shape is not valid.";
-          setError(aFeatureError);
-          return;
-        }
-
-        aMakeShapeList.appendAlgo(aBoolAlgo);
-
-        if(GeomAlgoAPI_ShapeTools::volume(aResShape) > 1.e-27
-           || (myOperationType != BOOL_CUT && myOperationType != BOOL_COMMON))
-        {
-          std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-            document()->createBody(data(), aResultIndex);
-
-          ListOfShape aUsedTools = aTools;
-          if (myOperationType == BOOL_FILL) {
-            aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
-          }
-
-          loadNamingDS(aResultBody, anObject, aUsedTools, aResShape,
-                       aMakeShapeList, *(aBoolAlgo->mapOfSubShapes()),
-                       myOperationType == BOOL_FILL);
-          setResult(aResultBody, aResultIndex);
-          aResultIndex++;
-        }
-      }
-
-      // Compsolids handling
-      for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
-          anIt = aCompSolidsObjects.begin();
-          anIt != aCompSolidsObjects.end(); anIt++) {
-        std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
-        ListOfShape& aUsedInOperationSolids = anIt->second;
-
-        // Collecting solids from compsolids which will not be modified in boolean operation.
-        ListOfShape aNotUsedSolids;
-        for(GeomAPI_ShapeExplorer
-            anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-          std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
-          ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
-          for(; anIt != aUsedInOperationSolids.end(); anIt++) {
-            if(aSolidInCompSolid->isEqual(*anIt)) {
-              break;
-            }
-          }
-          if(anIt == aUsedInOperationSolids.end()) {
-            aNotUsedSolids.push_back(aSolidInCompSolid);
-          }
-        }
-
-        GeomAlgoAPI_MakeShapeList aMakeShapeList;
-        std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
-
-        switch(myOperationType) {
-          case BOOL_CUT: {
-            aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aUsedInOperationSolids,
-                                                    aTools,
-                                                    GeomAlgoAPI_Boolean::BOOL_CUT));
-            break;
-          }
-          case BOOL_COMMON: {
-            aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aUsedInOperationSolids,
-                                                    aTools,
-                                                    GeomAlgoAPI_Boolean::BOOL_COMMON));
-            break;
-          }
-          case BOOL_FILL: {
-            std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
-              GeomAlgoAPI_ShapeTools::getBoundingBox(aUsedInOperationSolids, 1.0);
-
-            // Resize planes.
-            ListOfShape aToolsWithPlanes = aTools;
-            for(ListOfShape::const_iterator anIt = aPlanes.cbegin();
-                                            anIt != aPlanes.cend();
-                                            ++anIt)
-            {
-              GeomShapePtr aPlane = *anIt;
-              GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
-              std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
-                new GeomAlgoAPI_MakeShapeCustom);
-              aMkShCustom->addModified(aPlane, aTool);
-              aMakeShapeList.appendAlgo(aMkShCustom);
-              aToolsWithPlanes.push_back(aTool);
-            }
-
-            aBoolAlgo.reset(new GeomAlgoAPI_Partition(aUsedInOperationSolids, aToolsWithPlanes));
-            break;
-          }
-        }
-
-        // Checking that the algorithm worked properly.
-        if(!aBoolAlgo->isDone()) {
-          static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-          setError(aFeatureError);
-          return;
-        }
-        if(aBoolAlgo->shape()->isNull()) {
-          static const std::string aShapeError = "Error: Resulting shape is Null.";
-          setError(aShapeError);
-          return;
-        }
-        if(!aBoolAlgo->isValid()) {
-          std::string aFeatureError = "Error: Resulting shape is not valid.";
-          setError(aFeatureError);
-          return;
-        }
-
-        aMakeShapeList.appendAlgo(aBoolAlgo);
-        GeomAPI_DataMapOfShapeShape aMapOfShapes;
-        aMapOfShapes.merge(aBoolAlgo->mapOfSubShapes());
-        GeomShapePtr aResultShape = aBoolAlgo->shape();
-
-        // Add result to not used solids from compsolid.
-        if(!aNotUsedSolids.empty()) {
-          ListOfShape aShapesToAdd = aNotUsedSolids;
-          aShapesToAdd.push_back(aBoolAlgo->shape());
-          std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
-            new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-          if(!aFillerAlgo->isDone()) {
-            std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-            setError(aFeatureError);
-            return;
-          }
-
-          aMakeShapeList.appendAlgo(aFillerAlgo);
-          aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
-          aResultShape = aFillerAlgo->shape();
-        }
-
-        if(GeomAlgoAPI_ShapeTools::volume(aResultShape) > 1.e-27
-           || (myOperationType != BOOL_CUT && myOperationType != BOOL_COMMON))
-        {
-          std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-            document()->createBody(data(), aResultIndex);
-
-          ListOfShape aUsedTools = aTools;
-          if (myOperationType == BOOL_FILL) {
-            aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
-          }
-
-          loadNamingDS(aResultBody,
-                       aCompSolid,
-                       aUsedTools,
-                       aResultShape,
-                       aMakeShapeList,
-                       aMapOfShapes,
-                       myOperationType == BOOL_FILL);
-          setResult(aResultBody, aResultIndex);
-          aResultIndex++;
-        }
-      }
-      break;
-    }
-    case BOOL_FUSE: {
-      if((anObjects.size() + aTools.size() +
-          aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) {
-        std::string aFeatureError = "Error: Not enough objects for boolean operation.";
-        setError(aFeatureError);
-        return;
-      }
-
-      // Collecting all solids which will be fused.
-      ListOfShape aSolidsToFuse;
-      aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end());
-      aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end());
-
-      // Collecting solids from compsolids which will not be modified
-      // in boolean operation and will be added to result.
-      ListOfShape aShapesToAdd;
-      for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
-          anIt = aCompSolidsObjects.begin();
-          anIt != aCompSolidsObjects.end(); anIt++) {
-        std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
-        ListOfShape& aUsedInOperationSolids = anIt->second;
-        aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(),
-                             aUsedInOperationSolids.end());
-
-        // Collect solids from compsolid which will not be modified in boolean operation.
-        for(GeomAPI_ShapeExplorer
-            anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-          std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
-          ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
-          for(; anIt != aUsedInOperationSolids.end(); anIt++) {
-            if(aSolidInCompSolid->isEqual(*anIt)) {
-              break;
-            }
-          }
-          if(anIt == aUsedInOperationSolids.end()) {
-            aShapesToAdd.push_back(aSolidInCompSolid);
-          }
-        }
-      }
-
-      ListOfShape anOriginalShapes = aSolidsToFuse;
-      anOriginalShapes.insert(anOriginalShapes.end(), aShapesToAdd.begin(), aShapesToAdd.end());
-
-      // Cut edges and faces(if we have any) with solids.
-      GeomAlgoAPI_MakeShapeList aMakeShapeList;
-      GeomAPI_DataMapOfShapeShape aMapOfShapes;
-      std::shared_ptr<GeomAPI_Shape> aCuttedEdgesAndFaces;
-      if(!anEdgesAndFaces.empty()) {
-        std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces,
-                                            anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT));
-        if(aCutAlgo->isDone()) {
-          aCuttedEdgesAndFaces = aCutAlgo->shape();
-          aMakeShapeList.appendAlgo(aCutAlgo);
-          aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
-        }
-      }
-      anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(),
-                              anEdgesAndFaces.end());
-
-      // If we have compsolids then cut with not used solids all others.
-      if(!aShapesToAdd.empty()) {
-        aSolidsToFuse.clear();
-        for(ListOfShape::iterator
-            anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) {
-          ListOfShape aOneObjectList;
-          aOneObjectList.push_back(*anIt);
-          std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(
-            new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Boolean::BOOL_CUT));
-
-          if(GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) {
-            aSolidsToFuse.push_back(aCutAlgo->shape());
-            aMakeShapeList.appendAlgo(aCutAlgo);
-            aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
-          }
-        }
-      }
-
-      if(!aSolidsToFuse.empty()) {
-        anObjects.clear();
-        anObjects.push_back(aSolidsToFuse.back());
-        aSolidsToFuse.pop_back();
-        aTools = aSolidsToFuse;
-      }
-
-      // Fuse all objects and all tools.
-      std::shared_ptr<GeomAPI_Shape> aShape;
-      if(anObjects.size() == 1 && aTools.empty()) {
-        aShape = anObjects.front();
-      } else if(anObjects.empty() && aTools.size() == 1) {
-        aShape = aTools.front();
-      } else if((anObjects.size() + aTools.size()) > 1){
-        std::shared_ptr<GeomAlgoAPI_Boolean> aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects,
-                                                                aTools,
-                                                                GeomAlgoAPI_Boolean::BOOL_FUSE));
-
-        // Checking that the algorithm worked properly.
-        if(!aFuseAlgo->isDone()) {
-          static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-          setError(aFeatureError);
-          return;
-        }
-        if(aFuseAlgo->shape()->isNull()) {
-          static const std::string aShapeError = "Error: Resulting shape is Null.";
-          setError(aShapeError);
-          return;
-        }
-        if(!aFuseAlgo->isValid()) {
-          std::string aFeatureError = "Error: Resulting shape is not valid.";
-          setError(aFeatureError);
-          return;
-        }
-
-        aShape = aFuseAlgo->shape();
-        aMakeShapeList.appendAlgo(aFuseAlgo);
-        aMapOfShapes.merge(aFuseAlgo->mapOfSubShapes());
-      }
-
-      // Combine result with not used solids from compsolid and edges and faces (if we have any).
-      if(aCuttedEdgesAndFaces.get() && !aCuttedEdgesAndFaces->isNull()) {
-        aShapesToAdd.push_back(aCuttedEdgesAndFaces);
-      } else {
-        aShapesToAdd.insert(aShapesToAdd.end(), anEdgesAndFaces.begin(), anEdgesAndFaces.end());
-      }
-      if(!aShapesToAdd.empty()) {
-        if(aShape.get()) {
-          aShapesToAdd.push_back(aShape);
-        }
-        std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
-          new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-        if(!aFillerAlgo->isDone()) {
-          std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-          setError(aFeatureError);
-          return;
-        }
-        if(aFillerAlgo->shape()->isNull()) {
-          static const std::string aShapeError = "Error: Resulting shape is Null.";
-          setError(aShapeError);
-          return;
-        }
-        if(!aFillerAlgo->isValid()) {
-          std::string aFeatureError = "Error: Resulting shape is not valid.";
-          setError(aFeatureError);
-          return;
-        }
-
-        aShape = aFillerAlgo->shape();
-        aMakeShapeList.appendAlgo(aFillerAlgo);
-        aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
-      }
-
-      std::shared_ptr<GeomAPI_Shape> aBackShape = anOriginalShapes.back();
-      anOriginalShapes.pop_back();
-      std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-        document()->createBody(data(), aResultIndex);
-      loadNamingDS(aResultBody, aBackShape, anOriginalShapes,
-                   aShape, aMakeShapeList, aMapOfShapes);
-      setResult(aResultBody, aResultIndex);
-      aResultIndex++;
-      break;
-    }
-    case BOOL_SMASH: {
-      if((anObjects.empty() && aCompSolidsObjects.empty()) || aTools.empty()) {
-        std::string aFeatureError = "Error: Not enough objects for boolean operation.";
-        setError(aFeatureError);
-        return;
-      }
-
-      // List of original solids for naming.
-      ListOfShape anOriginalShapes;
-      anOriginalShapes.insert(anOriginalShapes.end(), anObjects.begin(), anObjects.end());
-      anOriginalShapes.insert(anOriginalShapes.end(), aTools.begin(), aTools.end());
-
-      // Collecting all solids which will be smashed.
-      ListOfShape aShapesToSmash;
-      aShapesToSmash.insert(aShapesToSmash.end(), anObjects.begin(), anObjects.end());
-
-      // Collecting solids from compsolids which will not be modified in
-      // boolean operation and will be added to result.
-      ListOfShape aShapesToAdd;
-      for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
-        anIt = aCompSolidsObjects.begin();
-        anIt != aCompSolidsObjects.end(); anIt++) {
-        std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
-        ListOfShape& aUsedInOperationSolids = anIt->second;
-        anOriginalShapes.push_back(aCompSolid);
-        aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(),
-                              aUsedInOperationSolids.end());
-
-        // Collect solids from compsolid which will not be modified in boolean operation.
-        for(GeomAPI_ShapeExplorer
-            anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-          std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
-          ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
-          for(; anIt != aUsedInOperationSolids.end(); anIt++) {
-            if(aSolidInCompSolid->isEqual(*anIt)) {
-              break;
-            }
-          }
-          if(anIt == aUsedInOperationSolids.end()) {
-            aShapesToAdd.push_back(aSolidInCompSolid);
-          }
-        }
-      }
-
-      GeomAlgoAPI_MakeShapeList aMakeShapeList;
-      GeomAPI_DataMapOfShapeShape aMapOfShapes;
-      if(!aShapesToAdd.empty()) {
-        // Cut objects with not used solids.
-        std::shared_ptr<GeomAlgoAPI_Boolean> anObjectsCutAlgo(new GeomAlgoAPI_Boolean(
-                                                              aShapesToSmash,
-                                                              aShapesToAdd,
-                                                              GeomAlgoAPI_Boolean::BOOL_CUT));
-
-        if(GeomAlgoAPI_ShapeTools::volume(anObjectsCutAlgo->shape()) > 1.e-27) {
-          aShapesToSmash.clear();
-          aShapesToSmash.push_back(anObjectsCutAlgo->shape());
-          aMakeShapeList.appendAlgo(anObjectsCutAlgo);
-          aMapOfShapes.merge(anObjectsCutAlgo->mapOfSubShapes());
-        }
-
-        // Cut tools with not used solids.
-        std::shared_ptr<GeomAlgoAPI_Boolean> aToolsCutAlgo(new GeomAlgoAPI_Boolean(aTools,
-                                                              aShapesToAdd,
-                                                              GeomAlgoAPI_Boolean::BOOL_CUT));
-
-        if(GeomAlgoAPI_ShapeTools::volume(aToolsCutAlgo->shape()) > 1.e-27) {
-          aTools.clear();
-          aTools.push_back(aToolsCutAlgo->shape());
-          aMakeShapeList.appendAlgo(aToolsCutAlgo);
-          aMapOfShapes.merge(aToolsCutAlgo->mapOfSubShapes());
-        }
-      }
-
-      // Cut objects with tools.
-      std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(new GeomAlgoAPI_Boolean(aShapesToSmash,
-                                                                aTools,
-                                                                GeomAlgoAPI_Boolean::BOOL_CUT));
-
-      // Checking that the algorithm worked properly.
-      if(!aBoolAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if(aBoolAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if(!aBoolAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
-        return;
-      }
-      aMakeShapeList.appendAlgo(aBoolAlgo);
-      aMapOfShapes.merge(aBoolAlgo->mapOfSubShapes());
-
-      // Put all (cut result, tools and not used solids) to PaveFiller.
-      aShapesToAdd.push_back(aBoolAlgo->shape());
-      aShapesToAdd.insert(aShapesToAdd.end(), aTools.begin(), aTools.end());
-
-      std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd,
-                                                                                     true));
-      if(!aFillerAlgo->isDone()) {
-        std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if(aFillerAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if(!aFillerAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
-        return;
-      }
-
-      std::shared_ptr<GeomAPI_Shape> aShape = aFillerAlgo->shape();
-      aMakeShapeList.appendAlgo(aFillerAlgo);
-      aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
-
-      std::shared_ptr<GeomAPI_Shape> aFrontShape = anOriginalShapes.front();
-      anOriginalShapes.pop_front();
-      std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-        document()->createBody(data(), aResultIndex);
-      loadNamingDS(aResultBody, aFrontShape, anOriginalShapes,
-        aShape, aMakeShapeList, aMapOfShapes);
-      setResult(aResultBody, aResultIndex);
-      aResultIndex++;
-
-      break;
-    }
-    default: {
-      std::string anOperationError = "Error: Wrong type of operation";
-      setError(anOperationError);
-      return;
-    }
-  }
-  // remove the rest results if there were produced in the previous pass
-  removeResults(aResultIndex);
-}
-
 //=================================================================================================
 void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                                           const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                                           const ListOfShape& theTools,
                                           const std::shared_ptr<GeomAPI_Shape> theResultShape,
-                                          GeomAlgoAPI_MakeShape& theMakeShape,
-                                          GeomAPI_DataMapOfShapeShape& theMapOfShapes,
-                                          const bool theIsStoreAsGenerated)
+                                          const GeomMakeShapePtr& theMakeShape)
 {
   //load result
   if(theBaseShape->isEqual(theResultShape)) {
     theResultBody->store(theResultShape, false);
-  } else {
-    const int aModifyTag = 1;
-    const int aModifyEdgeTag = 2;
-    const int aModifyFaceTag = 3;
-    const int aDeletedTag = 4;
-    /// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
-    const int aSubsolidsTag = 5;
+    return;
+  }
+
+  theResultBody->storeModified(theBaseShape, theResultShape);
 
-    theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
+  theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE);
+  theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
 
-    const std::string aModName = "Modified";
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
+  theResultBody->loadDeletedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE);
 
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
-      aModifyEdgeTag, aModEName, theMapOfShapes, false, theIsStoreAsGenerated, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-      aModifyFaceTag, aModFName, theMapOfShapes, false, theIsStoreAsGenerated, true);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::FACE, aDeletedTag);
+  for (ListOfShape::const_iterator anIter = theTools.begin();
+       anIter != theTools.end();
+       ++anIter)
+  {
+    GeomAPI_Shape::ShapeType aShapeType =
+      (*anIter)->shapeType() <= GeomAPI_Shape::FACE ? GeomAPI_Shape::FACE
+                                                    : GeomAPI_Shape::EDGE;
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, aShapeType);
 
-    int aTag;
-    std::string aName;
-    for(ListOfShape::const_iterator
-        anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
-      if((*anIter)->shapeType() <= GeomAPI_Shape::FACE) {
-        aTag = aModifyFaceTag;
-        aName = aModFName;
-      } else {
-        aTag = aModifyEdgeTag;
-        aName = aModEName;
-      }
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter,
-        aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE,
-        aTag, aName, theMapOfShapes, false, theIsStoreAsGenerated, true);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
-    }
+    theResultBody->loadDeletedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE);
   }
 }
index ce70e57bc619a23adb39ed2f23015eab795ec68b..38c8a57ee2cf570b07bd79d4aeff2a4e38dc9b52 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Boolean_H_
@@ -59,9 +58,6 @@ public:
   /// \return boolean operation type.
   FEATURESPLUGIN_EXPORT OperationType operationType();
 
-  /// Creates a new part document if needed.
-  FEATURESPLUGIN_EXPORT virtual void execute();
-
   /// Request for initialization of data model of the feature: adding all attributes.
   FEATURESPLUGIN_EXPORT virtual void initAttributes();
 
@@ -70,17 +66,12 @@ protected:
   /// Use plugin manager for features creation.
   FeaturesPlugin_Boolean(const OperationType theOperationType);
 
-private:
-  std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
-
   /// Load Naming data structure of the feature to the document
   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                     const ListOfShape& theTools,
                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
-                    GeomAlgoAPI_MakeShape& theMakeShape,
-                    GeomAPI_DataMapOfShapeShape& theMapOfShapes,
-                    const bool theIsStoreAsGenerated = false);
+                    const GeomMakeShapePtr& theMakeShape);
 
 private:
   OperationType myOperationType;
index c8cee631839272fbef71d96a584e6e4fad907cae..eb23d0bab2fe563e12263c35936482224cba2bec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_BooleanCommon.h"
 
+#include "FeaturesPlugin_Tools.h"
+
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
@@ -34,6 +35,7 @@
 #include <GeomAPI_ShapeExplorer.h>
 #include <GeomAlgoAPI_PaveFiller.h>
 #include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_Tools.h>
 
 
 //==================================================================================================
@@ -76,7 +78,8 @@ void FeaturesPlugin_BooleanCommon::execute()
     }
     ResultPtr aContext = anObjectAttr->context();
     ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-    if (aResCompSolidPtr.get())
+    if (!isSimpleMode
+        && aResCompSolidPtr.get())
     {
       std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
       GeomAPI_Shape::ShapeType aShapeType = aResCompSolidPtr->shape()->shapeType();
@@ -117,7 +120,7 @@ void FeaturesPlugin_BooleanCommon::execute()
     }
   }
 
-  if ((anObjects.empty() && aCompSolidsObjects.empty())
+  if ((anObjects.empty() && aCompSolidsObjects.empty() && aCompoundObjects.empty())
       || (!isSimpleMode && aTools.empty() && aPlanes.empty())) {
     std::string aFeatureError = "Error: Not enough objects for boolean operation.";
     setError(aFeatureError);
@@ -125,8 +128,10 @@ void FeaturesPlugin_BooleanCommon::execute()
   }
 
   int aResultIndex = 0;
-  GeomAlgoAPI_MakeShapeList aMakeShapeList;
-  GeomAPI_DataMapOfShapeShape aMapOfShapes;
+  std::string anError;
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
+  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  ListOfShape aResultShapesList;
 
   if (isSimpleMode)
   {
@@ -138,25 +143,13 @@ void FeaturesPlugin_BooleanCommon::execute()
                                 *anObjectsIt,
                                 GeomAlgoAPI_Boolean::BOOL_COMMON));
 
-      if (!aCommonAlgo->isDone()) {
-        std::string aFeatureError = "Error: An algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if (aCommonAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if (!aCommonAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCommonAlgo, getKind(), anError)) {
+        setError(anError);
         return;
       }
 
       aShape = aCommonAlgo->shape();
-      aMakeShapeList.appendAlgo(aCommonAlgo);
-      aMapOfShapes.merge(aCommonAlgo->mapOfSubShapes());
+      aMakeShapeList->appendAlgo(aCommonAlgo);
     }
 
     GeomAPI_ShapeIterator aShapeIt(aShape);
@@ -164,9 +157,24 @@ void FeaturesPlugin_BooleanCommon::execute()
       std::shared_ptr<ModelAPI_ResultBody> aResultBody =
         document()->createBody(data(), aResultIndex);
 
-      loadNamingDS(aResultBody, anObjects.front(), anObjects, aShape, aMakeShapeList, aMapOfShapes);
+      ListOfShape anEmptyTools;
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               anObjects,
+                                               anEmptyTools,
+                                               aMakeShapeList,
+                                               aShape);
+      GeomShapePtr aBaseShape = anObjects.front();
+      anObjects.pop_front();
       setResult(aResultBody, aResultIndex);
       aResultIndex++;
+
+      aTools = anObjects;
+      FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+      aRBA.resultBody = aResultBody;
+      aRBA.baseShape = aBaseShape;
+      aRBA.makeShape = aMakeShapeList;
+      aResultBaseAlgoList.push_back(aRBA);
+      aResultShapesList.push_back(aShape);
     }
   } else {
     for (ListOfShape::iterator anObjectsIt = anObjects.begin();
@@ -176,7 +184,7 @@ void FeaturesPlugin_BooleanCommon::execute()
       std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
       ListOfShape aListWithObject;
       aListWithObject.push_back(anObject);
-      GeomAlgoAPI_MakeShapeList aMakeShapeList;
+      std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
       std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
       GeomShapePtr aResShape;
 
@@ -193,7 +201,7 @@ void FeaturesPlugin_BooleanCommon::execute()
         std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
           new GeomAlgoAPI_MakeShapeCustom);
         aMkShCustom->addModified(aPlane, aTool);
-        aMakeShapeList.appendAlgo(aMkShCustom);
+        aMakeShapeList->appendAlgo(aMkShCustom);
         aToolsWithPlanes.push_back(aTool);
       }
 
@@ -203,33 +211,33 @@ void FeaturesPlugin_BooleanCommon::execute()
       aResShape = aBoolAlgo->shape();
 
       // Checking that the algorithm worked properly.
-      if (!aBoolAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if (aResShape->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if (!aBoolAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
+        setError(anError);
         return;
       }
 
-      aMakeShapeList.appendAlgo(aBoolAlgo);
+      aMakeShapeList->appendAlgo(aBoolAlgo);
 
       GeomAPI_ShapeIterator aShapeIt(aResShape);
       if (aShapeIt.more() || aResShape->shapeType() == GeomAPI_Shape::VERTEX) {
         std::shared_ptr<ModelAPI_ResultBody> aResultBody =
           document()->createBody(data(), aResultIndex);
-
-        loadNamingDS(aResultBody, anObject, aTools, aResShape,
-                     aMakeShapeList, *(aBoolAlgo->mapOfSubShapes()));
+        ListOfShape anObjectList;
+        anObjectList.push_back(anObject);
+        FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                                 anObjectList,
+                                                 aTools,
+                                                 aMakeShapeList,
+                                                 aResShape);
         setResult(aResultBody, aResultIndex);
         aResultIndex++;
+
+        FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+        aRBA.resultBody = aResultBody;
+        aRBA.baseShape = anObject;
+        aRBA.makeShape = aMakeShapeList;
+        aResultBaseAlgoList.push_back(aRBA);
+        aResultShapesList.push_back(aResShape);
       }
     }
 
@@ -267,25 +275,12 @@ void FeaturesPlugin_BooleanCommon::execute()
           GeomAlgoAPI_Boolean::BOOL_COMMON));
 
       // Checking that the algorithm worked properly.
-      if (!aCommonAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if (aCommonAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if (!aCommonAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCommonAlgo, getKind(), anError)) {
+        setError(anError);
         return;
       }
 
       aMakeShapeList->appendAlgo(aCommonAlgo);
-      GeomAPI_DataMapOfShapeShape aMapOfShapes;
-      aMapOfShapes.merge(aCommonAlgo->mapOfSubShapes());
       GeomShapePtr aResultShape = aCommonAlgo->shape();
 
       // Add result to not used solids from compsolid.
@@ -301,7 +296,6 @@ void FeaturesPlugin_BooleanCommon::execute()
         }
 
         aMakeShapeList->appendAlgo(aFillerAlgo);
-        aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
         aResultShape = aFillerAlgo->shape();
       }
 
@@ -311,14 +305,22 @@ void FeaturesPlugin_BooleanCommon::execute()
         std::shared_ptr<ModelAPI_ResultBody> aResultBody =
           document()->createBody(data(), aResultIndex);
 
-        loadNamingDS(aResultBody,
-          aCompSolid,
-          aTools,
-          aResultShape,
-          *aMakeShapeList,
-          aMapOfShapes);
+        ListOfShape aCompSolidList;
+        aCompSolidList.push_back(aCompSolid);
+        FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                                 aCompSolidList,
+                                                 aTools,
+                                                 aMakeShapeList,
+                                                 aResultShape);
         setResult(aResultBody, aResultIndex);
         aResultIndex++;
+
+        FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+        aRBA.resultBody = aResultBody;
+        aRBA.baseShape = aCompSolid;
+        aRBA.makeShape = aMakeShapeList;
+        aResultBaseAlgoList.push_back(aRBA);
+        aResultShapesList.push_back(aResultShape);
       }
     }
 
@@ -356,25 +358,12 @@ void FeaturesPlugin_BooleanCommon::execute()
           GeomAlgoAPI_Boolean::BOOL_COMMON));
 
       // Checking that the algorithm worked properly.
-      if (!aCommonAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-        setError(aFeatureError);
-        return;
-      }
-      if (aCommonAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        return;
-      }
-      if (!aCommonAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCommonAlgo, getKind(), anError)) {
+        setError(anError);
         return;
       }
 
       aMakeShapeList->appendAlgo(aCommonAlgo);
-      GeomAPI_DataMapOfShapeShape aMapOfShapes;
-      aMapOfShapes.merge(aCommonAlgo->mapOfSubShapes());
       GeomShapePtr aResultShape = aCommonAlgo->shape();
 
       // Add result to not used shape from compound.
@@ -402,82 +391,32 @@ void FeaturesPlugin_BooleanCommon::execute()
         std::shared_ptr<ModelAPI_ResultBody> aResultBody =
           document()->createBody(data(), aResultIndex);
 
-        loadNamingDS(aResultBody,
-          aCompound,
-          aTools,
-          aResultShape,
-          *aMakeShapeList,
-          aMapOfShapes);
+        ListOfShape aCompoundList;
+        aCompoundList.push_back(aCompound);
+        FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                                 aCompoundList,
+                                                 aTools,
+                                                 aMakeShapeList,
+                                                 aResultShape);
         setResult(aResultBody, aResultIndex);
         aResultIndex++;
+
+        FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+        aRBA.resultBody = aResultBody;
+        aRBA.baseShape = aCompound;
+        aRBA.makeShape = aMakeShapeList;
+        aResultBaseAlgoList.push_back(aRBA);
+        aResultShapesList.push_back(aResultShape);
       }
     }
 
   }
 
+  // Store deleted shapes after all results has been proceeded. This is to avoid issue when in one
+  // result shape has been deleted, but in another it was modified or stayed.
+  GeomShapePtr aResultShapesCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools, aResultShapesCompound);
+
   // remove the rest results if there were produced in the previous pass
   removeResults(aResultIndex);
 }
-
-//==================================================================================================
-void FeaturesPlugin_BooleanCommon::loadNamingDS(ResultBodyPtr theResultBody,
-                                                const GeomShapePtr theBaseShape,
-                                                const ListOfShape& theTools,
-                                                const GeomShapePtr theResultShape,
-                                                GeomAlgoAPI_MakeShape& theMakeShape,
-                                                GeomAPI_DataMapOfShapeShape& theMapOfShapes)
-{
-  //load result
-  if (theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-  } else {
-    const int aModifyVTag = 1;
-    const int aModifyETag = 2;
-    const int aModifyFTag = 3;
-    const int aDeletedTag = 4;
-    /// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
-    const int aSubsolidsTag = 5;
-
-    theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-
-    const std::string aModVName = "Modified_Vertex";
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
-
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aModifyVTag, aModVName, theMapOfShapes, false,
-                                               false, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
-                                               aModifyETag, aModEName, theMapOfShapes, false,
-                                               false, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-                                               aModifyFTag, aModFName, theMapOfShapes, false,
-                                               false, true);
-
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::VERTEX, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::EDGE, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::FACE, aDeletedTag);
-
-    for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
-    {
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
-                                                 aModifyVTag, aModVName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
-                                                 aModifyETag, aModEName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE,
-                                                 aModifyFTag, aModFName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
-    }
-  }
-}
index caf67d38e76c1c90999d0bca2eeda1ccd583a49c..31bb1335d37a8671b9e7c52abdb2a2a420008795 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanCommon_H_
@@ -91,17 +90,6 @@ public:
 
   /// Use plugin manager for features creation.
   FeaturesPlugin_BooleanCommon();
-
-private:
-
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(ResultBodyPtr theResultBody,
-                    const GeomShapePtr theBaseShape,
-                    const ListOfShape& theTools,
-                    const GeomShapePtr theResultShape,
-                    GeomAlgoAPI_MakeShape& theMakeShape,
-                    GeomAPI_DataMapOfShapeShape& theMapOfShapes);
-
 };
 
 #endif
index 79b959e9b0531737345e9344fe49d12dc539ae44..04b9020ba0858e837393e6d29b78b4487b60a4ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_BooleanCut.h"
 
+#include "FeaturesPlugin_Tools.h"
+
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_PaveFiller.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
+
 #include <GeomAPI_ShapeExplorer.h>
 #include <GeomAPI_ShapeIterator.h>
 
-//==================================================================================================
-const int ModifyVTag = 1;
-const int ModifyETag = 2;
-const int ModifyFTag = 3;
-const int DeletedTag = 4;
-/// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
-const int SubsolidsTag = 5;
-
-
 //==================================================================================================
 FeaturesPlugin_BooleanCut::FeaturesPlugin_BooleanCut()
 : FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_CUT)
@@ -108,8 +102,9 @@ void FeaturesPlugin_BooleanCut::execute()
     return;
   }
 
-  std::vector<ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
   ListOfShape aResultShapesList;
+  std::string anError;
 
   // For solids cut each object with all tools.
   for(ListOfShape::iterator anObjectsIt = anObjects.begin();
@@ -124,19 +119,8 @@ void FeaturesPlugin_BooleanCut::execute()
     GeomShapePtr aResShape = aCutAlgo->shape();
 
     // Checking that the algorithm worked properly.
-    if (!aCutAlgo->isDone()) {
-      static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if(aResShape->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aCutAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
@@ -148,13 +132,17 @@ void FeaturesPlugin_BooleanCut::execute()
       std::shared_ptr<ModelAPI_ResultBody> aResultBody =
         document()->createBody(data(), aResultIndex);
 
-      loadNamingDS(aResultBody, anObject, aTools, aResShape,
-                   *aMakeShapeList, *(aCutAlgo->mapOfSubShapes()),
-                   false);
+      ListOfShape anObjectList;
+      anObjectList.push_back(anObject);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               anObjectList,
+                                               aTools,
+                                               aMakeShapeList,
+                                               aResShape);
       setResult(aResultBody, aResultIndex);
       aResultIndex++;
 
-      ResultBaseAlgo aRBA;
+      FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
       aRBA.resultBody = aResultBody;
       aRBA.baseShape = anObject;
       aRBA.makeShape = aMakeShapeList;
@@ -197,25 +185,12 @@ void FeaturesPlugin_BooleanCut::execute()
                               GeomAlgoAPI_Boolean::BOOL_CUT));
 
     // Checking that the algorithm worked properly.
-    if (!aCutAlgo->isDone()) {
-      static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aCutAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aCutAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aMakeShapeList->appendAlgo(aCutAlgo);
-    GeomAPI_DataMapOfShapeShape aMapOfShapes;
-    aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
     GeomShapePtr aResultShape = aCutAlgo->shape();
 
     // Add result to not used solids from compsolid.
@@ -231,7 +206,6 @@ void FeaturesPlugin_BooleanCut::execute()
       }
 
       aMakeShapeList->appendAlgo(aFillerAlgo);
-      aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
       aResultShape = aFillerAlgo->shape();
     }
 
@@ -241,17 +215,17 @@ void FeaturesPlugin_BooleanCut::execute()
       std::shared_ptr<ModelAPI_ResultBody> aResultBody =
         document()->createBody(data(), aResultIndex);
 
-      loadNamingDS(aResultBody,
-                   aCompSolid,
-                   aTools,
-                   aResultShape,
-                   *aMakeShapeList,
-                   aMapOfShapes,
-                   false);
+      ListOfShape anObjectList;
+      anObjectList.push_back(aCompSolid);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               anObjectList,
+                                               aTools,
+                                               aMakeShapeList,
+                                               aResultShape);
       setResult(aResultBody, aResultIndex);
       aResultIndex++;
 
-      ResultBaseAlgo aRBA;
+      FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
       aRBA.resultBody = aResultBody;
       aRBA.baseShape = aCompSolid;
       aRBA.makeShape = aMakeShapeList;
@@ -294,25 +268,12 @@ void FeaturesPlugin_BooleanCut::execute()
                               GeomAlgoAPI_Boolean::BOOL_CUT));
 
     // Checking that the algorithm worked properly.
-    if (!aCutAlgo->isDone()) {
-      static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aCutAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aCutAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aMakeShapeList->appendAlgo(aCutAlgo);
-    GeomAPI_DataMapOfShapeShape aMapOfShapes;
-    aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
     GeomShapePtr aResultShape = aCutAlgo->shape();
 
     // Add result to not used shape from compound.
@@ -338,17 +299,17 @@ void FeaturesPlugin_BooleanCut::execute()
       std::shared_ptr<ModelAPI_ResultBody> aResultBody =
         document()->createBody(data(), aResultIndex);
 
-      loadNamingDS(aResultBody,
-                   aCompound,
-                   aTools,
-                   aResultShape,
-                   *aMakeShapeList,
-                   aMapOfShapes,
-                   false);
+      ListOfShape anObjectList;
+      anObjectList.push_back(aCompound);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               anObjectList,
+                                               aTools,
+                                               aMakeShapeList,
+                                               aResultShape);
       setResult(aResultBody, aResultIndex);
       aResultIndex++;
 
-      ResultBaseAlgo aRBA;
+      FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
       aRBA.resultBody = aResultBody;
       aRBA.baseShape = aCompound;
       aRBA.makeShape = aMakeShapeList;
@@ -360,102 +321,8 @@ void FeaturesPlugin_BooleanCut::execute()
   // Store deleted shapes after all results has been proceeded. This is to avoid issue when in one
   // result shape has been deleted, but in another it was modified or stayed.
   GeomShapePtr aResultShapesCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
-  storeDeletedShapes(aResultBaseAlgoList, aTools, aResultShapesCompound);
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools, aResultShapesCompound);
 
   // remove the rest results if there were produced in the previous pass
   removeResults(aResultIndex);
 }
-
-//==================================================================================================
-void FeaturesPlugin_BooleanCut::loadNamingDS(ResultBodyPtr theResultBody,
-                                             const GeomShapePtr theBaseShape,
-                                             const ListOfShape& theTools,
-                                             const GeomShapePtr theResultShape,
-                                             GeomAlgoAPI_MakeShape& theMakeShape,
-                                             GeomAPI_DataMapOfShapeShape& theMapOfShapes,
-                                             const bool theIsStoreAsGenerated)
-{
-  //load result
-  if(theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-  } else {
-    theResultBody->storeModified(theBaseShape, theResultShape, SubsolidsTag);
-
-    const std::string aModVName = "Modified_Vertex";
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
-
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX,
-                                               ModifyVTag, aModVName, theMapOfShapes, false,
-                                               theIsStoreAsGenerated, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
-                                               ModifyETag, aModEName, theMapOfShapes, false,
-                                               theIsStoreAsGenerated, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-                                               ModifyFTag, aModFName, theMapOfShapes, false,
-                                               theIsStoreAsGenerated, true);
-
-    for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
-    {
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
-                                                 ModifyVTag, aModVName, theMapOfShapes, false,
-                                                 theIsStoreAsGenerated, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
-                                                 ModifyETag, aModEName, theMapOfShapes, false,
-                                                 theIsStoreAsGenerated, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE,
-                                                 ModifyFTag, aModFName, theMapOfShapes, false,
-                                                 theIsStoreAsGenerated, true);
-    }
-  }
-}
-
-//==================================================================================================
-void FeaturesPlugin_BooleanCut::storeDeletedShapes(
-  std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
-  const ListOfShape& theTools,
-  const GeomShapePtr theResultShapesCompound)
-{
-  for (std::vector<ResultBaseAlgo>::iterator anIt = theResultBaseAlgoList.begin();
-       anIt != theResultBaseAlgoList.end();
-       ++anIt)
-  {
-    ResultBaseAlgo& aRCA = *anIt;
-    aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                       aRCA.baseShape,
-                                       GeomAPI_Shape::VERTEX,
-                                       DeletedTag,
-                                       theResultShapesCompound);
-    aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                       aRCA.baseShape,
-                                       GeomAPI_Shape::EDGE,
-                                       DeletedTag,
-                                       theResultShapesCompound);
-    aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                       aRCA.baseShape,
-                                       GeomAPI_Shape::FACE,
-                                       DeletedTag,
-                                       theResultShapesCompound);
-
-    for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
-    {
-      aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                         *anIter,
-                                         GeomAPI_Shape::VERTEX,
-                                         DeletedTag,
-                                         theResultShapesCompound);
-      aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                         *anIter,
-                                         GeomAPI_Shape::EDGE,
-                                         DeletedTag,
-                                         theResultShapesCompound);
-      aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
-                                         *anIter,
-                                         GeomAPI_Shape::FACE,
-                                         DeletedTag,
-                                         theResultShapesCompound);
-    }
-  }
-}
index 11c154ced95cca7479ef5b131460c7da9e071ece..ffd5c3486a7e3fe8b4ac12b25a69d52be6bec5af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanCut_H_
@@ -55,30 +54,6 @@ public:
   /// Use plugin manager for features creation.
   FeaturesPlugin_BooleanCut();
 
-private:
-
-  struct ResultBaseAlgo {
-    ResultBodyPtr resultBody;
-    GeomShapePtr baseShape;
-    std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape;
-  };
-
-private:
-
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(ResultBodyPtr theResultBody,
-                    const GeomShapePtr theBaseShape,
-                    const ListOfShape& theTools,
-                    const GeomShapePtr theResultShape,
-                    GeomAlgoAPI_MakeShape& theMakeShape,
-                    GeomAPI_DataMapOfShapeShape& theMapOfShapes,
-                    const bool theIsStoreAsGenerated = false);
-
-  /// Stores deleted shapes.
-  void storeDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
-                          const ListOfShape& theTools,
-                          const GeomShapePtr theResultShapesCompound);
-
 };
 
 #endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp
new file mode 100644 (file)
index 0000000..92d513e
--- /dev/null
@@ -0,0 +1,289 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 "FeaturesPlugin_BooleanFill.h"
+#include "FeaturesPlugin_Tools.h"
+
+#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_Tools.h>
+
+#include <GeomAlgoAPI_Boolean.h>
+#include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_MakeShapeCustom.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
+#include <GeomAlgoAPI_Partition.h>
+#include <GeomAlgoAPI_PaveFiller.h>
+#include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
+
+#include <GeomAPI_Face.h>
+#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
+
+#include <algorithm>
+#include <map>
+
+//=================================================================================================
+FeaturesPlugin_BooleanFill::FeaturesPlugin_BooleanFill()
+  : FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_FILL)
+{
+}
+
+//=================================================================================================
+void FeaturesPlugin_BooleanFill::execute()
+{
+  std::string anError;
+  ListOfShape anObjects, aTools, anEdgesAndFaces, aPlanes;
+  std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
+
+  // Getting objects.
+  AttributeSelectionListPtr anObjectsSelList =
+    selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
+  for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
+    AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+    std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
+    if(!anObject.get()) {
+      return;
+    }
+    ResultPtr aContext = anObjectAttr->context();
+    ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+    if(aResCompSolidPtr.get()
+        && aResCompSolidPtr->shape()->shapeType() == GeomAPI_Shape::COMPSOLID) {
+      std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
+      std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+        anIt = aCompSolidsObjects.begin();
+      for(; anIt != aCompSolidsObjects.end(); anIt++) {
+        if(anIt->first->isEqual(aContextShape)) {
+          aCompSolidsObjects[anIt->first].push_back(anObject);
+          break;
+        }
+      }
+      if(anIt == aCompSolidsObjects.end()) {
+        aCompSolidsObjects[aContextShape].push_back(anObject);
+      }
+    } else {
+      anObjects.push_back(anObject);
+    }
+  }
+
+  // Getting tools.
+  AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID());
+  for(int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) {
+    AttributeSelectionPtr aToolAttr = aToolsSelList->value(aToolsIndex);
+    GeomShapePtr aTool = aToolAttr->value();
+    if(!aTool.get()) {
+      // It could be a construction plane.
+      ResultPtr aContext = aToolAttr->context();
+      aPlanes.push_back(aToolAttr->context()->shape());
+    }
+    else {
+      aTools.push_back(aTool);
+    }
+  }
+
+  int aResultIndex = 0;
+
+  if ((anObjects.empty() && aCompSolidsObjects.empty())
+      || (aTools.empty() && aPlanes.empty())) {
+    std::string aFeatureError = "Error: Not enough objects for boolean operation.";
+    setError(aFeatureError);
+    return;
+  }
+
+  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  ListOfShape aResultShapesList;
+
+  // For solids cut each object with all tools.
+  for(ListOfShape::iterator
+      anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
+    std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
+    ListOfShape aListWithObject;
+    aListWithObject.push_back(anObject);
+    std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
+    std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
+    GeomShapePtr aResShape;
+
+    std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
+        GeomAlgoAPI_ShapeTools::getBoundingBox(aListWithObject, 1.0);
+
+    // Resize planes.
+    ListOfShape aToolsWithPlanes = aTools;
+    for(ListOfShape::const_iterator anIt = aPlanes.cbegin();
+                                    anIt != aPlanes.cend();
+                                    ++anIt)
+    {
+      GeomShapePtr aPlane = *anIt;
+      GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
+      std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
+        new GeomAlgoAPI_MakeShapeCustom);
+      aMkShCustom->addModified(aPlane, aTool);
+      aMakeShapeList->appendAlgo(aMkShCustom);
+      aToolsWithPlanes.push_back(aTool);
+    }
+
+    aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes));
+    aResShape = aBoolAlgo->shape();
+    if (aResShape.get() && aResShape->shapeType() == GeomAPI_Shape::COMPOUND) {
+      int aSubResultsNb = 0;
+      GeomAPI_ShapeIterator anIt(aResShape);
+      for(; anIt.more(); anIt.next()) {
+        ++aSubResultsNb;
+      }
+      if(aSubResultsNb == 1) {
+        anIt.init(aResShape);
+        if(anIt.more()) {
+          aResShape = anIt.current();
+        }
+      }
+    }
+
+    // Checking that the algorithm worked properly.
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
+      setError(anError);
+      return;
+    }
+
+    aMakeShapeList->appendAlgo(aBoolAlgo);
+
+    std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+        document()->createBody(data(), aResultIndex);
+
+    // tools should be added to the list to fulfill the correct history of modification
+    aListWithObject.insert(aListWithObject.end(), aTools.begin(), aTools.end());
+
+    ListOfShape aUsedTools = aTools;
+    aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
+
+    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aListWithObject, aUsedTools,
+                                             aMakeShapeList, aResShape);
+    setResult(aResultBody, aResultIndex);
+    aResultIndex++;
+
+    FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+    aRBA.resultBody = aResultBody;
+    aRBA.baseShape = anObject;
+    aRBA.makeShape = aMakeShapeList;
+    aResultBaseAlgoList.push_back(aRBA);
+    aResultShapesList.push_back(aResShape);
+  }
+
+  // Compsolids handling
+  for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+      anIt = aCompSolidsObjects.begin();
+      anIt != aCompSolidsObjects.end(); anIt++) {
+    std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
+    ListOfShape& aUsedInOperationSolids = anIt->second;
+
+    // Collecting solids from compsolids which will not be modified in boolean operation.
+    ListOfShape aNotUsedSolids;
+    for(GeomAPI_ShapeExplorer
+        anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+      std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
+      ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
+      for(; anIt != aUsedInOperationSolids.end(); anIt++) {
+        if(aSolidInCompSolid->isEqual(*anIt)) {
+          break;
+        }
+      }
+      if(anIt == aUsedInOperationSolids.end()) {
+        aNotUsedSolids.push_back(aSolidInCompSolid);
+      }
+    }
+
+    std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
+    std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
+
+    std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints =
+      GeomAlgoAPI_ShapeTools::getBoundingBox(aUsedInOperationSolids, 1.0);
+
+    // Resize planes.
+    ListOfShape aToolsWithPlanes = aTools;
+    for(ListOfShape::const_iterator anIt = aPlanes.cbegin();
+                                    anIt != aPlanes.cend();
+                                    ++anIt)
+    {
+      GeomShapePtr aPlane = *anIt;
+      GeomShapePtr aTool = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPlane, aBoundingPoints);
+      std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(
+        new GeomAlgoAPI_MakeShapeCustom);
+      aMkShCustom->addModified(aPlane, aTool);
+      aMakeShapeList->appendAlgo(aMkShCustom);
+      aToolsWithPlanes.push_back(aTool);
+    }
+
+    aBoolAlgo.reset(new GeomAlgoAPI_Partition(aUsedInOperationSolids, aToolsWithPlanes));
+
+    // Checking that the algorithm worked properly.
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
+      setError(anError);
+      return;
+    }
+
+    aMakeShapeList->appendAlgo(aBoolAlgo);
+    GeomShapePtr aResultShape = aBoolAlgo->shape();
+
+    // Add result to not used solids from compsolid.
+    if(!aNotUsedSolids.empty()) {
+      ListOfShape aShapesToAdd = aNotUsedSolids;
+      aShapesToAdd.push_back(aBoolAlgo->shape());
+      std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+        new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+      if(!aFillerAlgo->isDone()) {
+        std::string aFeatureError = "Error: PaveFiller algorithm failed.";
+        setError(aFeatureError);
+        return;
+      }
+
+      aMakeShapeList->appendAlgo(aFillerAlgo);
+      aResultShape = aFillerAlgo->shape();
+    }
+
+    std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+      document()->createBody(data(), aResultIndex);
+
+    ListOfShape aUsedTools = aTools;
+    aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
+
+    ListOfShape aBaseShapes;
+    aBaseShapes.push_back(aCompSolid);
+    // tools should be added to the list to fulfill the correct history of modification
+    aBaseShapes.insert(aBaseShapes.end(), aTools.begin(), aTools.end());
+
+    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, aUsedTools,
+                                             aMakeShapeList, aResultShape);
+    setResult(aResultBody, aResultIndex);
+    aResultIndex++;
+
+    FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+    aRBA.resultBody = aResultBody;
+    aRBA.baseShape = aCompSolid;
+    aRBA.makeShape = aMakeShapeList;
+    aResultBaseAlgoList.push_back(aRBA);
+    aResultShapesList.push_back(aResultShape);
+  }
+
+  // Store deleted shapes after all results has been proceeded. This is to avoid issue when in one
+  // result shape has been deleted, but in another it was modified or stayed.
+  GeomShapePtr aResultShapesCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools, aResultShapesCompound);
+
+  // remove the rest results if there were produced in the previous pass
+  removeResults(aResultIndex);
+}
index b4cb73b94a27ab992a577cc44adaf896a164829e..2eb1c02d3eb5b60f484ab206ad1df309e40ef6ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanFill_H_
@@ -44,10 +43,13 @@ public:
     return MY_KIND;
   }
 
+  /// Creates a new part document if needed.
+  FEATURESPLUGIN_EXPORT virtual void execute();
+
 public:
 
     /// Use plugin manager for features creation.
-  FeaturesPlugin_BooleanFill(): FeaturesPlugin_Boolean(BOOL_FILL) {};
+  FeaturesPlugin_BooleanFill();
 
 };
 
index 0f1ac4f724384ff62e4321a7e50b8bbd1071be19..176e8b6fe9eecbfb5e28d458ed58bc7f1c3aec0a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_BooleanFuse.h"
 
+#include "FeaturesPlugin_Tools.h"
+
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeSelectionList.h>
@@ -32,6 +33,7 @@
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_PaveFiller.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAlgoAPI_UnifySameDomain.h>
 #include <GeomAPI_ShapeExplorer.h>
 
@@ -58,14 +60,16 @@ void FeaturesPlugin_BooleanFuse::initAttributes()
 //==================================================================================================
 void FeaturesPlugin_BooleanFuse::execute()
 {
+  std::string anError;
   ListOfShape anObjects, aTools, anEdgesAndFaces;
-  std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
+  std::map<GeomShapePtr, ListOfShape> aCompSolidsObjects;
 
   bool isSimpleCreation = false;
 
   AttributeStringPtr aCreationMethodAttr = string(CREATION_METHOD());
   if (aCreationMethodAttr.get()
-      && aCreationMethodAttr->value() == CREATION_METHOD_SIMPLE()) {
+      && aCreationMethodAttr->value() == CREATION_METHOD_SIMPLE())
+  {
     isSimpleCreation = true;
   }
 
@@ -74,7 +78,7 @@ void FeaturesPlugin_BooleanFuse::execute()
     selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
   for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
     AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
-    std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
+    GeomShapePtr anObject = anObjectAttr->value();
     if (!anObject.get()) {
       return;
     }
@@ -82,9 +86,10 @@ void FeaturesPlugin_BooleanFuse::execute()
     ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
     if (!isSimpleCreation
         && aResCompSolidPtr.get()
-        && aResCompSolidPtr->shape()->shapeType() == GeomAPI_Shape::COMPSOLID) {
-      std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
-      std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+        && aResCompSolidPtr->shape()->shapeType() == GeomAPI_Shape::COMPSOLID)
+    {
+      GeomShapePtr aContextShape = aResCompSolidPtr->shape();
+      std::map<GeomShapePtr, ListOfShape>::iterator
         anIt = aCompSolidsObjects.begin();
       for (; anIt != aCompSolidsObjects.end(); anIt++) {
         if (anIt->first->isEqual(aContextShape)) {
@@ -136,10 +141,11 @@ void FeaturesPlugin_BooleanFuse::execute()
   // Collecting solids from compsolids which will not be modified
   // in boolean operation and will be added to result.
   ListOfShape aShapesToAdd;
-  for (std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
-       anIt = aCompSolidsObjects.begin();
-       anIt != aCompSolidsObjects.end(); anIt++) {
-    std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
+  for (std::map<GeomShapePtr, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
+       anIt != aCompSolidsObjects.end();
+       ++anIt)
+  {
+    GeomShapePtr aCompSolid = anIt->first;
     ListOfShape& aUsedInOperationSolids = anIt->second;
     aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(),
                          aUsedInOperationSolids.end());
@@ -147,7 +153,7 @@ void FeaturesPlugin_BooleanFuse::execute()
     // Collect solids from compsolid which will not be modified in boolean operation.
     for (GeomAPI_ShapeExplorer
          anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-      std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
+      GeomShapePtr aSolidInCompSolid = anExp.current();
       ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
       for (; anIt != aUsedInOperationSolids.end(); anIt++) {
         if (aSolidInCompSolid->isEqual(*anIt)) {
@@ -164,16 +170,14 @@ void FeaturesPlugin_BooleanFuse::execute()
   anOriginalShapes.insert(anOriginalShapes.end(), aShapesToAdd.begin(), aShapesToAdd.end());
 
   // Cut edges and faces(if we have any) with solids.
-  GeomAlgoAPI_MakeShapeList aMakeShapeList;
-  GeomAPI_DataMapOfShapeShape aMapOfShapes;
-  std::shared_ptr<GeomAPI_Shape> aCuttedEdgesAndFaces;
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
+  GeomShapePtr aCuttedEdgesAndFaces;
   if (!anEdgesAndFaces.empty()) {
     std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces,
       anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT));
     if (aCutAlgo->isDone()) {
       aCuttedEdgesAndFaces = aCutAlgo->shape();
-      aMakeShapeList.appendAlgo(aCutAlgo);
-      aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
+      aMakeShapeList->appendAlgo(aCutAlgo);
     }
   }
   anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(),
@@ -191,8 +195,7 @@ void FeaturesPlugin_BooleanFuse::execute()
 
       if (GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) {
         aSolidsToFuse.push_back(aCutAlgo->shape());
-        aMakeShapeList.appendAlgo(aCutAlgo);
-        aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
+        aMakeShapeList->appendAlgo(aCutAlgo);
       }
     }
   }
@@ -205,7 +208,7 @@ void FeaturesPlugin_BooleanFuse::execute()
   }
 
   // Fuse all objects and all tools.
-  std::shared_ptr<GeomAPI_Shape> aShape;
+  GeomShapePtr aShape;
   if (anObjects.size() == 1 && aTools.empty()) {
     aShape = anObjects.front();
   } else if (anObjects.empty() && aTools.size() == 1) {
@@ -216,25 +219,13 @@ void FeaturesPlugin_BooleanFuse::execute()
       GeomAlgoAPI_Boolean::BOOL_FUSE));
 
     // Checking that the algorithm worked properly.
-    if (!aFuseAlgo->isDone()) {
-      static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aFuseAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aFuseAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFuseAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aShape = aFuseAlgo->shape();
-    aMakeShapeList.appendAlgo(aFuseAlgo);
-    aMapOfShapes.merge(aFuseAlgo->mapOfSubShapes());
+    aMakeShapeList->appendAlgo(aFuseAlgo);
   }
 
   // Combine result with not used solids from compsolid and edges and faces (if we have any).
@@ -249,25 +240,13 @@ void FeaturesPlugin_BooleanFuse::execute()
     }
     std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
       new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-    if (!aFillerAlgo->isDone()) {
-      std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aFillerAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aFillerAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFillerAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aShape = aFillerAlgo->shape();
-    aMakeShapeList.appendAlgo(aFillerAlgo);
-    aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
+    aMakeShapeList->appendAlgo(aFillerAlgo);
   }
 
   bool isRemoveEdges = false;
@@ -280,101 +259,34 @@ void FeaturesPlugin_BooleanFuse::execute()
     std::shared_ptr<GeomAlgoAPI_UnifySameDomain> aUnifyAlgo(
       new GeomAlgoAPI_UnifySameDomain(aShape));
 
-    if (!aUnifyAlgo->isDone()) {
-      std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aUnifyAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aUnifyAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aUnifyAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aShape = aUnifyAlgo->shape();
-    aMakeShapeList.appendAlgo(aUnifyAlgo);
-    aMapOfShapes.merge(aUnifyAlgo->mapOfSubShapes());
+    aMakeShapeList->appendAlgo(aUnifyAlgo);
   }
 
   int aResultIndex = 0;
 
-  std::shared_ptr<GeomAPI_Shape> aBackShape = anOriginalShapes.back();
-  anOriginalShapes.pop_back();
-  std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-    document()->createBody(data(), aResultIndex);
-  loadNamingDS(aResultBody, aBackShape, anOriginalShapes,
-               aShape, aMakeShapeList, aMapOfShapes);
+  ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
+
+  ListOfShape anEmptyTools;
+  FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                           anOriginalShapes,
+                                           anEmptyTools,
+                                           aMakeShapeList,
+                                           aShape);
   setResult(aResultBody, aResultIndex);
   aResultIndex++;
 
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBody,
+                                          GeomShapePtr(),
+                                          anOriginalShapes,
+                                          aMakeShapeList,
+                                          aShape);
+
   // remove the rest results if there were produced in the previous pass
   removeResults(aResultIndex);
 }
-
-//==================================================================================================
-void FeaturesPlugin_BooleanFuse::loadNamingDS(ResultBodyPtr theResultBody,
-                                              const GeomShapePtr theBaseShape,
-                                              const ListOfShape& theTools,
-                                              const GeomShapePtr theResultShape,
-                                              GeomAlgoAPI_MakeShape& theMakeShape,
-                                              GeomAPI_DataMapOfShapeShape& theMapOfShapes)
-{
-  //load result
-  if (theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-  } else {
-    const int aModifyVTag = 1;
-    const int aModifyETag = 2;
-    const int aModifyFTag = 3;
-    const int aDeletedTag = 4;
-    /// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
-    const int aSubsolidsTag = 5;
-
-    theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-
-    const std::string aModVName = "Modified_Vertex";
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
-
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aModifyVTag, aModVName, theMapOfShapes, false,
-                                               false, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
-                                               aModifyETag, aModEName, theMapOfShapes, false,
-                                               false, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-                                               aModifyFTag, aModFName, theMapOfShapes, false,
-                                               false, true);
-
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::VERTEX, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::EDGE, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::FACE, aDeletedTag);
-
-    for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
-    {
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
-                                                 aModifyVTag, aModVName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
-                                                 aModifyETag, aModEName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE,
-                                                 aModifyFTag, aModFName, theMapOfShapes, false,
-                                                 false, true);
-
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
-    }
-  }
-}
index 950b8223f769e8230eb09b666e435c2b8a0e4c29..a16c8781ae07eff63d923f11bfb36a3af5422998 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanFuse_H_
@@ -96,15 +95,6 @@ public:
 
   /// Use plugin manager for features creation.
   FeaturesPlugin_BooleanFuse();
-
-private:
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                    const ListOfShape& theTools,
-                    const std::shared_ptr<GeomAPI_Shape> theResultShape,
-                    GeomAlgoAPI_MakeShape& theMakeShape,
-                    GeomAPI_DataMapOfShapeShape& theMapOfShapes);
 };
 
 #endif
index 0dbe5a3485dcbc1238587580dd2648057209549a..9c8bb1e578bffda2db38ab2ccc6990304361f277 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_BooleanSmash.h"
 
+#include "FeaturesPlugin_Tools.h"
+
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -29,6 +30,8 @@
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_PaveFiller.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
+
 #include <GeomAPI_ShapeExplorer.h>
 #include <GeomAPI_ShapeIterator.h>
 
@@ -48,6 +51,7 @@ void FeaturesPlugin_BooleanSmash::initAttributes()
 //==================================================================================================
 void FeaturesPlugin_BooleanSmash::execute()
 {
+  std::string anError;
   ListOfShape anObjects, aTools;
   std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
 
@@ -144,8 +148,7 @@ void FeaturesPlugin_BooleanSmash::execute()
     }
   }
 
-  GeomAlgoAPI_MakeShapeList aMakeShapeList;
-  GeomAPI_DataMapOfShapeShape aMapOfShapes;
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
   if (!aShapesToAdd.empty()) {
     // Cut objects with not used solids.
     std::shared_ptr<GeomAlgoAPI_Boolean> anObjectsCutAlgo(
@@ -156,8 +159,7 @@ void FeaturesPlugin_BooleanSmash::execute()
     if (GeomAlgoAPI_ShapeTools::volume(anObjectsCutAlgo->shape()) > 1.e-27) {
       aShapesToSmash.clear();
       aShapesToSmash.push_back(anObjectsCutAlgo->shape());
-      aMakeShapeList.appendAlgo(anObjectsCutAlgo);
-      aMapOfShapes.merge(anObjectsCutAlgo->mapOfSubShapes());
+      aMakeShapeList->appendAlgo(anObjectsCutAlgo);
     }
 
     // Cut tools with not used solids.
@@ -169,8 +171,7 @@ void FeaturesPlugin_BooleanSmash::execute()
     if (GeomAlgoAPI_ShapeTools::volume(aToolsCutAlgo->shape()) > 1.e-27) {
       aTools.clear();
       aTools.push_back(aToolsCutAlgo->shape());
-      aMakeShapeList.appendAlgo(aToolsCutAlgo);
-      aMapOfShapes.merge(aToolsCutAlgo->mapOfSubShapes());
+      aMakeShapeList->appendAlgo(aToolsCutAlgo);
     }
   }
 
@@ -181,23 +182,12 @@ void FeaturesPlugin_BooleanSmash::execute()
                             GeomAlgoAPI_Boolean::BOOL_CUT));
 
   // Checking that the algorithm worked properly.
-  if (!aBoolAlgo->isDone()) {
-    static const std::string aFeatureError = "Error: Boolean algorithm failed.";
-    setError(aFeatureError);
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) {
+    setError(anError);
     return;
   }
-  if (aBoolAlgo->shape()->isNull()) {
-    static const std::string aShapeError = "Error: Resulting shape is Null.";
-    setError(aShapeError);
-    return;
-  }
-  if (!aBoolAlgo->isValid()) {
-    std::string aFeatureError = "Error: Resulting shape is not valid.";
-    setError(aFeatureError);
-    return;
-  }
-  aMakeShapeList.appendAlgo(aBoolAlgo);
-  aMapOfShapes.merge(aBoolAlgo->mapOfSubShapes());
+
+  aMakeShapeList->appendAlgo(aBoolAlgo);
 
   // Put all (cut result, tools and not used solids) to PaveFiller.
   GeomShapePtr aShape = aBoolAlgo->shape();
@@ -213,105 +203,32 @@ void FeaturesPlugin_BooleanSmash::execute()
   else {
     std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
       new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-    if (!aFillerAlgo->isDone()) {
-      std::string aFeatureError = "Error: PaveFiller algorithm failed.";
-      setError(aFeatureError);
-      return;
-    }
-    if (aFillerAlgo->shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      return;
-    }
-    if (!aFillerAlgo->isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFillerAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aShape = aFillerAlgo->shape();
-    aMakeShapeList.appendAlgo(aFillerAlgo);
-    aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
+    aMakeShapeList->appendAlgo(aFillerAlgo);
   }
 
-  std::shared_ptr<GeomAPI_Shape> aFrontShape = anOriginalShapes.front();
-  anOriginalShapes.pop_front();
   std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
-  loadNamingDS(aResultBody,
-               aFrontShape,
-               anOriginalShapes,
-               aShape,
-               aMakeShapeList,
-               aMapOfShapes);
+
+  FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                           anOriginalShapes,
+                                           anOriginalShapes,
+                                           aMakeShapeList,
+                                           aShape);
 
   setResult(aResultBody, aResultIndex);
   aResultIndex++;
 
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBody,
+                                          GeomShapePtr(),
+                                          anOriginalShapes,
+                                          aMakeShapeList,
+                                          aShape);
+
   // remove the rest results if there were produced in the previous pass
   removeResults(aResultIndex);
 }
-
-//==================================================================================================
-void FeaturesPlugin_BooleanSmash::loadNamingDS(ResultBodyPtr theResultBody,
-                                             const GeomShapePtr theBaseShape,
-                                             const ListOfShape& theTools,
-                                             const GeomShapePtr theResultShape,
-                                             GeomAlgoAPI_MakeShape& theMakeShape,
-                                             GeomAPI_DataMapOfShapeShape& theMapOfShapes)
-{
-  //load result
-  if (theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-  } else if (theResultShape->isEqual(theTools.front())) {
-    theResultBody->store(theResultShape, false);
-  } else {
-    const int aModifyVTag = 1;
-    const int aModifyETag = 2;
-    const int aModifyFTag = 3;
-    const int aDeletedTag = 4;
-    /// sub solids will be placed at labels 5, 6, etc. if result is compound of solids
-    const int aSubsolidsTag = 5;
-
-    theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-
-    const std::string aModVName = "Modified_Vertex";
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
-
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aModifyVTag, aModVName, theMapOfShapes, false,
-                                               true, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::EDGE,
-                                               aModifyETag, aModEName, theMapOfShapes, false,
-                                               true, true);
-    theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
-                                               aModifyFTag, aModFName, theMapOfShapes, false,
-                                               true, true);
-
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::VERTEX, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::EDGE, aDeletedTag);
-    theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
-                                     GeomAPI_Shape::FACE, aDeletedTag);
-
-    for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
-    {
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
-                                                 aModifyVTag, aModVName, theMapOfShapes, false,
-                                                 true, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
-                                                 aModifyETag, aModEName, theMapOfShapes, false,
-                                                 true, true);
-
-      theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE,
-                                                 aModifyFTag, aModFName, theMapOfShapes, false,
-                                                 true, true);
-
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE, aDeletedTag);
-      theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
-    }
-  }
-}
index 0238d271292a3f754c2af746dfa77d488e1e0191..ed611c0aeccc8a202041893e3f7655a8c4971beb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanSmash_H_
@@ -70,17 +69,6 @@ public:
 
   /// Use plugin manager for features creation.
   FeaturesPlugin_BooleanSmash();
-
-private:
-
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(ResultBodyPtr theResultBody,
-                    const GeomShapePtr theBaseShape,
-                    const ListOfShape& theTools,
-                    const GeomShapePtr theResultShape,
-                    GeomAlgoAPI_MakeShape& theMakeShape,
-                    GeomAPI_DataMapOfShapeShape& theMapOfShapes);
-
 };
 
 #endif
index 6f0d65f4d923f4824950dd9986ed2e64ab49b191..4692110f43eb3efdee8889ae4a6a38af6a09b111 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_CompositeBoolean.h"
@@ -29,7 +28,7 @@
 #include <GeomAlgoAPI_PaveFiller.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 
-#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <map>
 
@@ -77,8 +76,6 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean()
   for(; aBoolObjIt != aBooleanObjects.cend() && aBoolMSIt != aBooleanMakeShapes.cend();
       ++aBoolObjIt, ++aBoolMSIt) {
 
-    int aTag = 1;
-
     ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex);
 
     if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) {
@@ -86,26 +83,25 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean()
     }
     else
     {
-      aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
-
-      aTag += 5000;
+      aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape());
 
       // Store generation history.
       ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
       ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
       for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
           ++aGenBaseIt, ++aGenMSIt) {
-        storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+        std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMSList(new GeomAlgoAPI_MakeShapeList());
+        aMSList->appendAlgo(*aGenMSIt);
+        aMSList->appendAlgo(*aBoolMSIt);
+        storeGenerationHistory(aResultBody, *aGenBaseIt, aMSList);
       }
 
-      int aModTag = aTag;
-      storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+      storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt);
 
       ResultBaseAlgo aRBA;
       aRBA.resultBody = aResultBody;
       aRBA.baseShape = *aBoolObjIt;
       aRBA.makeShape = *aBoolMSIt;
-      aRBA.delTag = aModTag;
       aResultBaseAlgoList.push_back(aRBA);
       aResultShapesList.push_back((*aBoolMSIt)->shape());
     }
@@ -199,9 +195,11 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools,
 
         // Collecting solids from compsolids which will not be modified in boolean operation.
         ListOfShape aShapesToAdd;
-        for(GeomAPI_ShapeExplorer
-            anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-          GeomShapePtr aSolidInCompSolid = anExp.current();
+        for (GeomAPI_ShapeIterator aCompSolidIt(aCompSolid);
+             aCompSolidIt.more();
+             aCompSolidIt.next())
+        {
+          GeomShapePtr aSolidInCompSolid = aCompSolidIt.current();
           ListOfShape::const_iterator aUsedShapesIt = aUsedShapes.cbegin();
           for(; aUsedShapesIt != aUsedShapes.cend(); ++aUsedShapesIt) {
             if(aSolidInCompSolid->isEqual(*aUsedShapesIt)) {
@@ -282,9 +280,11 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools,
         aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedShapes.begin(), aUsedShapes.end());
 
         // Collect solids from compsolid which will not be modified in boolean operation.
-        for(GeomAPI_ShapeExplorer
-            anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
-          GeomShapePtr aSolidInCompSolid = anExp.current();
+        for (GeomAPI_ShapeIterator aCompSolidIt(aCompSolid);
+             aCompSolidIt.more();
+             aCompSolidIt.next())
+        {
+          GeomShapePtr aSolidInCompSolid = aCompSolidIt.current();
           ListOfShape::iterator anIt = aUsedShapes.begin();
           for(; anIt != aUsedShapes.end(); anIt++) {
             if(aSolidInCompSolid->isEqual(*anIt)) {
@@ -380,38 +380,16 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools,
 void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr theResultBody,
                                 const GeomShapePtr theObject,
                                 const ListOfShape& theTools,
-                                const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                int& theTag)
+                                const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  int aModTag = theTag;
-  int anEdgesAndFacesTag = ++aModTag;
-  int aDelTag = ++anEdgesAndFacesTag;
-  theTag = aDelTag;
-
-  const std::string aModName = "Modfied";
-
   ListOfShape aTools = theTools;
   aTools.push_back(theObject);
 
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMap = theMakeShape->mapOfSubShapes();
-
-  int aTag;
-  std::string aName;
   for(ListOfShape::const_iterator anIt = aTools.begin(); anIt != aTools.end(); anIt++) {
-    if((*anIt)->shapeType() == GeomAPI_Shape::EDGE) {
-      aTag = anEdgesAndFacesTag;
-      aName = aModName + "_Edge";
-    }
-    else if((*anIt)->shapeType() == GeomAPI_Shape::FACE) {
-      aTag = anEdgesAndFacesTag;
-      aName = aModName + "_Face";
-    } else {
-      aTag = aModTag;
-      aName = aModName;
-    }
-    theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt,
-      (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
-      GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get(), false, false, true);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIt,
+                                      (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
+                                                              GeomAPI_Shape::EDGE :
+                                                              GeomAPI_Shape::FACE);
   }
 }
 
@@ -426,18 +404,16 @@ void FeaturesPlugin_CompositeBoolean::storeDeletedShapes(
     ++anIt)
   {
     ResultBaseAlgo& aRCA = *anIt;
-    aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
+    aRCA.resultBody->loadDeletedShapes(aRCA.makeShape,
       aRCA.baseShape,
       GeomAPI_Shape::FACE,
-      aRCA.delTag,
       theResultShapesCompound);
 
     for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
     {
-      aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
+      aRCA.resultBody->loadDeletedShapes(aRCA.makeShape,
         *anIter,
         GeomAPI_Shape::FACE,
-        aRCA.delTag,
         theResultShapesCompound);
     }
   }
index 3f07d107b14ffc804f1e11285deed8b5ac447e3c..3c5681de0b6b4bb1a4383eac5d0ba8e1d5803d13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_CompositeBoolean_H_
@@ -55,7 +54,6 @@ protected:
     ResultBodyPtr resultBody;
     GeomShapePtr baseShape;
     std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape;
-    int delTag;
   };
 
 protected:
@@ -80,15 +78,13 @@ protected:
   /// Stores generation history.
   virtual void storeGenerationHistory(ResultBodyPtr theResultBody,
                                       const GeomShapePtr theBaseShape,
-                                      const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                      int& theTag) = 0;
+                                      const GeomMakeShapePtr theMakeShape) = 0;
 
   /// Stores modification history.
   void storeModificationHistory(ResultBodyPtr theResultBody,
                                 const GeomShapePtr theObject,
                                 const ListOfShape& theTools,
-                                const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                int& theTag);
+                                const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 
   /// Stores deleted shapes.
   void storeDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
index 77766fcb58be2cd4dacf071a65bca81d18ae6104..1a2d4589f5e3a0cf0a1a009065e8c767dd218b9f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_CompositeSketch.h>
@@ -28,7 +27,6 @@
 #include <ModelAPI_Validator.h>
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
-#include <GeomAlgoAPI_Prism.h>
 #include <GeomAlgoAPI_Revolution.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 #include <GeomAlgoAPI_SketchBuilder.h>
 #include <map>
 #include <sstream>
 
-static void storeSubShape(ResultBodyPtr theResultBody,
+static void storeSubShape(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+                          ResultBodyPtr theResultBody,
                           const GeomShapePtr theShape,
                           const GeomAPI_Shape::ShapeType theType,
-                          const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
-                          const std::string theName,
-                          int& theShapeIndex,
-                          int& theTag);
+                          const std::string& theName);
 
 //=================================================================================================
 void FeaturesPlugin_CompositeSketch::initCompositeSketchAttribtues(const int theInitFlags)
@@ -86,11 +82,12 @@ int FeaturesPlugin_CompositeSketch::numberOfSubs(bool forTree) const
 std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex,
                                                                              bool forTree)
 {
+  FeaturePtr aSubFeature;
   if(theIndex == 0) {
-    return std::dynamic_pointer_cast<ModelAPI_Feature>(data()->reference(SKETCH_ID())->value());
+    aSubFeature =
+        std::dynamic_pointer_cast<ModelAPI_Feature>(data()->reference(SKETCH_ID())->value());
   }
-
-  return std::shared_ptr<ModelAPI_Feature>();
+  return aSubFeature;
 }
 
 //=================================================================================================
@@ -110,14 +107,14 @@ int FeaturesPlugin_CompositeSketch::subFeatureId(const int theIndex) const
 //=================================================================================================
 bool FeaturesPlugin_CompositeSketch::isSub(ObjectPtr theObject) const
 {
+  bool isSubFeature = false;
   // Check is this feature of result
   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
-  if(!aFeature.get()) {
-    return false;
+  if (aFeature.get()) {
+    ObjectPtr aSub = data()->reference(SKETCH_ID())->value();
+    isSubFeature = aSub == theObject;
   }
-
-  ObjectPtr aSub = data()->reference(SKETCH_ID())->value();
-  return aSub == theObject;
+  return isSubFeature;
 }
 
 //=================================================================================================
@@ -224,44 +221,14 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis
 
   // Searching faces with common edges.
   if(theIsMakeShells && aBaseFacesList.size() > 1) {
-    ListOfShape aShells;
-    ListOfShape aFreeFaces;
     GeomShapePtr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
-    GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
-                                          aShells, aFreeFaces);
-    theBaseShapesList.insert(theBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end());
-    theBaseShapesList.insert(theBaseShapesList.end(), aShells.begin(), aShells.end());
+    GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, theBaseShapesList);
   } else {
     theBaseShapesList.insert(theBaseShapesList.end(), aBaseFacesList.begin(),
                              aBaseFacesList.end());
   }
 }
 
-//=================================================================================================
-bool FeaturesPlugin_CompositeSketch::isMakeShapeValid(
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  // Check that algo is done.
-  if(!theMakeShape->isDone()) {
-    setError("Error: " + getKind() + " algorithm failed.");
-    return false;
-  }
-
-  // Check if shape is not null.
-  if(!theMakeShape->shape().get() || theMakeShape->shape()->isNull()) {
-    setError("Error: Resulting shape is null.");
-    return false;
-  }
-
-  // Check that resulting shape is valid.
-  if(!theMakeShape->isValid()) {
-    setError("Error: Resulting shape is not valid.");
-    return false;
-  }
-
-  return true;
-}
-
 //=================================================================================================
 void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape,
                                         const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
@@ -274,8 +241,7 @@ void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape
   aResultBody->storeGenerated(theBaseShape, theMakeShape->shape());
 
   // Store generated edges/faces.
-  int aGenTag = 1;
-  storeGenerationHistory(aResultBody, theBaseShape, theMakeShape, aGenTag);
+  storeGenerationHistory(aResultBody, theBaseShape, theMakeShape);
 
   setResult(aResultBody, theIndex);
 }
@@ -283,31 +249,17 @@ void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape
 //=================================================================================================
 void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theResultBody,
                                         const GeomShapePtr theBaseShape,
-                                        const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                        int& theTag)
+                                        const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
   GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
   GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
-  std::string aGenName = "Generated_";
 
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
   switch(aBaseShapeType) {
     case GeomAPI_Shape::EDGE: {
             aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
       break;
     }
     case GeomAPI_Shape::WIRE: {
-      //std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
-      //GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
-      //ListOfShape aV1History, aV2History;
-      //theMakeShape->generated(aV1, aV1History);
-      //theMakeShape->generated(aV2, aV2History);
-      //if(!aV1History.empty()) {
-      //  theResultBody->generated(aV1, aV1History.front(), aGenName + "Edge_1", theTag++);
-      //}
-      //if(!aV2History.empty()) {
-      //  theResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", theTag++);
-      //}
       aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
       break;
     }
@@ -321,158 +273,54 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes
     }
   }
 
+  int aLateralIndex = 1;
+  int aBaseEdgeIndex = 1;
+  int aVertexIndex = 1;
+  int aBaseVertexIndex = 1;
+
   if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
       aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
-    theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
-                                                GeomAPI_Shape::VERTEX,
-                                                theTag++, aGenName + "Edge",
-                                                *aMapOfSubShapes.get());
+    theResultBody->loadGeneratedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::VERTEX);
   }
   if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
       aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
-    theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(),
-                                                theBaseShape, GeomAPI_Shape::EDGE,
-                                                theTag++, aGenName + "Face",
-                                                *aMapOfSubShapes.get());
-  }
-  // issue #2197: make naming of edges generated from vertices
-  if (aShapeTypeToExplode == GeomAPI_Shape::EDGE) {
-    GeomAPI_DataMapOfShapeShape aFacesFromFromEdges;
-    GeomAPI_ShapeExplorer anEdgeExp(theBaseShape, GeomAPI_Shape::EDGE);
-    for(; anEdgeExp.more(); anEdgeExp.next()) {
-      ListOfShape aGenerated;
-      theMakeShape->generated(anEdgeExp.current(), aGenerated);
-      ListOfShape::iterator aGenIter = aGenerated.begin();
-      for(; aGenIter != aGenerated.end(); aGenIter++) {
-        GeomShapePtr aGen = *aGenIter;
-        if (aGen.get() && !aGen->isNull()) {
-          if ((*aGenIter)->shapeType() == GeomAPI_Shape::FACE) { // normal case
-            aFacesFromFromEdges.bind(aGen, anEdgeExp.current());
-          }
-        }
-      }
-    }
-
-    // closed revolution of 1-3 faces can not distinguish lateral and base edges
-    if (aFacesFromFromEdges.size() <= 3) {
-      bool isClosed = false; // lateral edges are closed (in full revolution)
-      GeomAPI_DataMapOfShapeShape anEdgesFromVertices;
-      GeomAPI_ShapeExplorer aVertExp(theBaseShape, GeomAPI_Shape::VERTEX);
-      for(; aVertExp.more(); aVertExp.next()) {
-        ListOfShape aGenerated;
-        theMakeShape->generated(aVertExp.current(), aGenerated);
-        ListOfShape::iterator aGenIter = aGenerated.begin();
-        for(; aGenIter != aGenerated.end(); aGenIter++) {
-          std::shared_ptr<GeomAPI_Shape> aGenerated = *aGenIter;
-          if (anEdgesFromVertices.isBound(aGenerated)) // already here
-            continue;
-          std::ostringstream aStream;
-          aStream<<"Lateral_"<<theTag++;
-          theResultBody->generated(aGenerated, aStream.str(), theTag++);
-
-          anEdgesFromVertices.bind(aGenerated, aVertExp.current());
-          std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aGenerated));
-          isClosed = isClosed || anEdge->isClosed();
-        }
-      }
-      if (isClosed) {
-        GeomAPI_ShapeExplorer anEdgesExp(theMakeShape->shape(), GeomAPI_Shape::EDGE);
-        for(; anEdgesExp.more(); anEdgesExp.next()) {
-          if (!anEdgesFromVertices.isBound(anEdgesExp.current())) {
-            // found a base edge
-            std::ostringstream aStream;
-            aStream<<"Base_Edge_"<<theTag++;
-            theResultBody->generated(anEdgesExp.current(), aStream.str(), theTag++);
-            // only one orientation is needed
-            anEdgesFromVertices.bind(anEdgesExp.current(), anEdgesExp.current());
-          }
-        }
-      } else if (aFacesFromFromEdges.size() == 1) { // 2233: sphere created by the revolution:
-        // vertices at degenerated edges will have the same name
-        GeomAPI_DataMapOfShapeShape aVertices;
-        GeomAPI_ShapeExplorer aVertExp(theMakeShape->shape(), GeomAPI_Shape::VERTEX);
-        for(int anIndex = 1; aVertExp.more(); aVertExp.next()) {
-          if (!aVertices.isBound(aVertExp.current())) {
-            // found a base edge
-            std::ostringstream aStream;
-            aStream<<"Vertex_"<<theTag++;
-            theResultBody->generated(aVertExp.current(), aStream.str(), theTag++);
-            // only one orientation is needed
-            aVertices.bind(aVertExp.current(), aVertExp.current());
-          }
-        }
-      }
-    } else { // issue #2197, test case 4 : edges that produce fully-revolved face,
-      // but contain only 2 edges (on apex of revolution)
-      GeomAPI_ShapeExplorer anEdgeExp(theBaseShape, GeomAPI_Shape::EDGE);
-      for(; anEdgeExp.more(); anEdgeExp.next()) {
-        ListOfShape aGenerated;
-        theMakeShape->generated(anEdgeExp.current(), aGenerated);
-        ListOfShape::iterator aGenIter = aGenerated.begin();
-        for(; aGenIter != aGenerated.end(); aGenIter++) {
-          GeomShapePtr aGen = (*aGenIter);
-          if (aGen.get() && !aGen->isNull()) {
-            GeomAPI_ShapeExplorer aFaceEdgeExp(aGen, GeomAPI_Shape::EDGE);
-            int aNumEdges = 0;
-            int aNumClosed = 0;
-            GeomShapePtr aNotClosedEdge;
-            GeomEdgePtr aDegenerateEdge;
-            GeomAPI_DataMapOfShapeShape alreadyIterated;
-            for(; aFaceEdgeExp.more(); aFaceEdgeExp.next()) {
-              std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aFaceEdgeExp.current()));
-              if (anEdge->isDegenerated()) {
-                aDegenerateEdge = anEdge;
-                continue;
-              }
-              if (alreadyIterated.isBound(anEdge))
-                continue;
-              alreadyIterated.bind(anEdge, anEdge);
-              aNumEdges++;
-              if (anEdge->isClosed()) {
-                aNumClosed++;
-              } else {
-                aNotClosedEdge = anEdge;
-              }
-            }
-            if (aNumEdges == 2 && aNumClosed == 1) {
-              std::ostringstream aStream;
-              aStream<<"Base_Edge_"<<theTag++;
-              theResultBody->generated(aNotClosedEdge, aStream.str(), theTag++);
-              if (aDegenerateEdge.get()) { // export vertex of the degenerated edge (apex) #2520
-                GeomAPI_ShapeExplorer anEdgeExp(aDegenerateEdge, GeomAPI_Shape::VERTEX);
-                if (anEdgeExp.more()) {
-                  std::ostringstream aStream;
-                  aStream << "Base_Vertex_" << theTag++;
-                  theResultBody->generated(anEdgeExp.current(), aStream.str(), theTag++);
-                }
-              }
-            }
-          }
-        }
-      }
-    }
+    theResultBody->loadGeneratedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE);
   }
-
+  std::list<std::shared_ptr<GeomAlgoAPI_MakeSweep> > aSweeps; // all sweeps collected
   std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep =
     std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
   if(aMakeSweep.get()) {
+    aSweeps.push_back(aMakeSweep);
+  } else {
+    std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeList =
+      std::dynamic_pointer_cast<GeomAlgoAPI_MakeShapeList>(theMakeShape);
+    if (aMakeList.get()) {
+      ListOfMakeShape::const_iterator anIter = aMakeList->list().cbegin();
+      for(; anIter != aMakeList->list().cend(); anIter++) {
+        std::shared_ptr<GeomAlgoAPI_MakeSweep> aSweep =
+          std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(*anIter);
+        if (aSweep.get())
+          aSweeps.push_back(aSweep);
+      }
+    }
+  }
+  std::list<std::shared_ptr<GeomAlgoAPI_MakeSweep> >::iterator aSweep = aSweeps.begin();
+  for(; aSweep != aSweeps.end(); aSweep++) {
     // Store from shapes.
-    storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
-                aMakeSweep->fromShapes(), "From_", theTag);
+    storeShapes(theMakeShape, theResultBody, aBaseShapeType, (*aSweep)->fromShapes(), "From_");
 
     // Store to shapes.
-    storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
-                aMakeSweep->toShapes(), "To_", theTag);
+    storeShapes(theMakeShape, theResultBody, aBaseShapeType, (*aSweep)->toShapes(), "To_");
   }
 }
 
 //=================================================================================================
-void FeaturesPlugin_CompositeSketch::storeShapes(ResultBodyPtr theResultBody,
-                              const GeomAPI_Shape::ShapeType theBaseShapeType,
-                              const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
-                              const ListOfShape& theShapes,
-                              const std::string theName,
-                              int& theTag)
+void FeaturesPlugin_CompositeSketch::storeShapes(
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+  ResultBodyPtr theResultBody,
+  const GeomAPI_Shape::ShapeType theBaseShapeType,
+  const ListOfShape& theShapes,
+  const std::string theName)
 {
   GeomAPI_Shape::ShapeType aShapeTypeToExplore = GeomAPI_Shape::FACE;
   std::string aShapeTypeStr = "Face";
@@ -501,48 +349,36 @@ void FeaturesPlugin_CompositeSketch::storeShapes(ResultBodyPtr theResultBody,
   }
 
   // Store shapes.
-  int aShapeIndex = 1;
-  int aFaceIndex = 1;
   for(ListOfShape::const_iterator anIt = theShapes.cbegin(); anIt != theShapes.cend(); ++anIt) {
     GeomShapePtr aShape = *anIt;
 
     if(aShapeTypeToExplore == GeomAPI_Shape::COMPOUND) {
       std::string aName = theName + (aShape->shapeType() == GeomAPI_Shape::EDGE ? "Edge" : "Face");
-      storeSubShape(theResultBody,
-                    aShape,
-                    aShape->shapeType(),
-                    theMapOfSubShapes,
-                    aName,
-                    aShape->shapeType() == GeomAPI_Shape::EDGE ? aShapeIndex : aFaceIndex,
-                    theTag);
+      storeSubShape(theMakeShape, theResultBody, aShape, aShape->shapeType(), aName);
     } else {
       std::string aName = theName + aShapeTypeStr;
-      storeSubShape(theResultBody, aShape, aShapeTypeToExplore,
-                    theMapOfSubShapes, aName, aShapeIndex, theTag);
+      storeSubShape(theMakeShape, theResultBody, aShape, aShapeTypeToExplore, aName);
       if (theBaseShapeType == GeomAPI_Shape::WIRE) { // issue 2289: special names also for vertices
         aName = theName + "Vertex";
-        storeSubShape(theResultBody, aShape, GeomAPI_Shape::VERTEX,
-                      theMapOfSubShapes, aName, aShapeIndex, theTag);
+        storeSubShape(theMakeShape, theResultBody, aShape, GeomAPI_Shape::VERTEX, aName);
       }
     }
   }
 }
 
-void storeSubShape(ResultBodyPtr theResultBody,
-                   const GeomShapePtr theShape,
-                   const GeomAPI_Shape::ShapeType theType,
-                   const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
-                   const std::string theName,
-                   int& theShapeIndex,
-                   int& theTag)
+void storeSubShape(
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+  ResultBodyPtr theResultBody,
+  const GeomShapePtr theShape,
+  const GeomAPI_Shape::ShapeType theType,
+  const std::string& theName)
 {
   for(GeomAPI_ShapeExplorer anExp(theShape, theType); anExp.more(); anExp.next()) {
     GeomShapePtr aSubShape = anExp.current();
-    if(theMapOfSubShapes->isBound(aSubShape)) {
-      aSubShape = theMapOfSubShapes->find(aSubShape);
+    if (!theResultBody->generated(aSubShape, theName)) {
+      // store from/to shapes as primitives and then store modification of them by the boolean
+      theResultBody->generated(aSubShape, theName, false);
+      theResultBody->loadModifiedShapes(theMakeShape, aSubShape, theType);
     }
-    std::ostringstream aStr;
-    aStr << theName << "_" << theShapeIndex++;
-    theResultBody->generated(aSubShape, aStr.str(), theTag++);
   }
 }
index 62d5c30f69770e6ea69ff8899aa83742694ecef7..67fde35a59fc0a08b508aad5419b2d7c653138c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_CompositeSketch_H_
@@ -83,9 +82,6 @@ protected:
   /// \param[in] theIsMakeShells if true make shells from faces with shared edges.
   void getBaseShapes(ListOfShape& theBaseShapesList, const bool theIsMakeShells = true);
 
-  /// Checks make shape algo.
-  bool isMakeShapeValid(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
-
   /// Stores result of generation.
   void storeResult(const GeomShapePtr theBaseShape,
                    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
@@ -94,16 +90,14 @@ protected:
   /// Stores generation history.
   void storeGenerationHistory(ResultBodyPtr theResultBody,
                               const GeomShapePtr theBaseShape,
-                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                              int& theTag);
+                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 
-  /// Used to store from and to shapes.
-  void storeShapes(ResultBodyPtr theResultBody,
+  /// Used to store from and to shapes: generated, or in common modified tag
+  void storeShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+                   ResultBodyPtr theResultBody,
                    const GeomAPI_Shape::ShapeType theBaseShapeType,
-                   const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
                    const ListOfShape& theShapes,
-                   const std::string theName,
-                   int& theTag);
+                   const std::string theName);
 
 };
 
index baf8f639769f49b80e20980a6b7761b807be346d..3ff47274e205bde1c282998eb26c699a0910af94 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Extrusion.h"
 #include <ModelAPI_Validator.h>
 
 #include <GeomAlgoAPI_Prism.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 
 //=================================================================================================
 FeaturesPlugin_Extrusion::FeaturesPlugin_Extrusion()
@@ -95,16 +96,29 @@ bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes,
   getBaseShapes(theBaseShapes);
 
   //Getting direction.
-  std::shared_ptr<GeomAPI_Dir> aDir;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
+  static const std::string aSelectionError = "Error: The direction shape selection is bad.";
   AttributeSelectionPtr aSelection = selection(DIRECTION_OBJECT_ID());
-  if(aSelection.get() && aSelection->value().get() && aSelection->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->value()));
-  } else if(aSelection->context().get() &&
-            aSelection->context()->shape().get() &&
-            aSelection->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->context()->shape()));
+  GeomShapePtr aShape = aSelection->value();
+  if (!aShape.get()) {
+    if (aSelection->context().get()) {
+      aShape = aSelection->context()->shape();
+    }
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape.get()) {
+    if (aShape->isEdge())
+    {
+      anEdge = aShape->edge();
+    }
+    else if (aShape->isCompound())
+    {
+      GeomAPI_ShapeIterator anIt(aShape);
+      anEdge = anIt.current()->edge();
+    }
   }
+
+  std::shared_ptr<GeomAPI_Dir> aDir;
   if(anEdge.get()) {
     if(anEdge->isLine()) {
       aDir = anEdge->line()->direction();
@@ -134,6 +148,10 @@ bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes,
       if(!aToShape.get() && aSelection->context().get()) {
         aToShape = aSelection->context()->shape();
       }
+      if (aToShape.get() && aToShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aToShape);
+        aToShape = anIt.current();
+      }
     }
     aSelection = selection(FROM_OBJECT_ID());
     if(aSelection.get()) {
@@ -141,10 +159,15 @@ bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes,
       if(!aFromShape.get() && aSelection->context().get()) {
         aFromShape = aSelection->context()->shape();
       }
+      if (aFromShape.get() && aFromShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aFromShape);
+        aFromShape = anIt.current();
+      }
     }
   }
 
   // Generating result for each base shape.
+  std::string anError;
   for(ListOfShape::const_iterator
       anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *anIter;
@@ -152,7 +175,8 @@ bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes,
     std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo(new GeomAlgoAPI_Prism(aBaseShape, aDir,
                                                                         aToShape, aToSize,
                                                                         aFromShape, aFromSize));
-    if(!isMakeShapeValid(aPrismAlgo)) {
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPrismAlgo, getKind(), anError)) {
+      setError(anError);
       return false;
     }
 
index 2f373e568e4cfcfcb893c1d6b74a38f36e9f3415..216d1704c232a2e2ce65c88a5269702cd4ab392d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Extrusion_H_
old mode 100755 (executable)
new mode 100644 (file)
index 88af05a..774328d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_ExtrusionBoolean.h"
@@ -38,9 +37,7 @@ bool FeaturesPlugin_ExtrusionBoolean::makeGeneration(ListOfShape& theBaseShapes,
 //=================================================================================================
 void FeaturesPlugin_ExtrusionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody,
                                         const GeomShapePtr theBaseShape,
-                                        const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                        int& theTag)
+                                        const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape,
-                                                   theMakeShape, theTag);
+  FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape);
 }
index ed9f8f3c4d954f964345277dd585ee128b2a571c..ee575471bf4ff6f92d3260e208671fa9e9938a82 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_ExtrusionBoolean_H_
@@ -44,8 +43,7 @@ protected:
   /// Stores generation history.
   void storeGenerationHistory(ResultBodyPtr theResultBody,
                               const GeomShapePtr theBaseShape,
-                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                              int& theTag);
+                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 };
 
 #endif
index 0683328b1728f8cbedc1dc9fea6982bb1acacc5b..d4320c3408d148921ee63afb0032ddabf936cc4f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_ExtrusionCut.h"
old mode 100755 (executable)
new mode 100644 (file)
index e4ae728..9870799
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_ExtrusionCut_H_
index cd77372c05048c7a6902b2ea7e8af84a2a39abda..52461e30388f73559141f7991b4d2e94fd942d26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_ExtrusionFuse.h"
index 591bdb2e581f68f5e3efd18a557ee43d50087d12..55f5a671ee1a1f2fe3705f285a127cb991d6d308 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_ExtrusionFuse_H_
index 8b0fdab8130349a2b35a6160557a2a2124f6565f..8dcd2fae4e5383a3ebe1aa74ecf7d24b1c2a7114 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Fillet.h"
+#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_Validator.h>
 
+#include <GeomAlgoAPI_CompoundBuilder.h>
 #include <GeomAlgoAPI_Fillet.h>
 #include <GeomAlgoAPI_MakeShapeList.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_DataMapOfShapeMapOfShapes.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -61,7 +63,7 @@ static ListOfShape selectEdges(const ListOfShape& theShapes)
   return anEdges;
 }
 
-// If theShape is a compound of single shape, return it
+// If theShape is a compound of a single sub-shape, return this sub-shape
 static GeomShapePtr unwrapCompound(const GeomShapePtr& theShape)
 {
   GeomShapePtr aShape = theShape;
@@ -101,9 +103,9 @@ void FeaturesPlugin_Fillet::execute()
   if (!aCreationMethod)
     return;
 
-  GeomAPI_DataMapOfShapeMapOfShapes aSolidsAndSubs;
+  std::list<std::pair<GeomShapePtr, ListOfShape> > aSolidsAndSubs;
 
-  // getting objects and sort them accroding to parent solids
+  // getting objects and sort them according to parent solids
   AttributeSelectionListPtr anObjectsSelList = selectionList(OBJECT_LIST_ID());
   for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); ++anObjectsIndex) {
     AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
@@ -125,12 +127,26 @@ void FeaturesPlugin_Fillet::execute()
     if (!aParent)
       return;
 
+    // searching this parent is already in the list aSolidsAndSubs
+    std::list<std::pair<GeomShapePtr, ListOfShape> >::iterator aSearch = aSolidsAndSubs.begin();
+    ListOfShape* aFound;
+    for(; aSearch != aSolidsAndSubs.end(); aSearch++) {
+      if (aSearch->first->isSame(aParent)) {
+        aFound = &(aSearch->second);
+        break;
+      }
+    }
+    if (aSearch == aSolidsAndSubs.end()) { // not found, so, add a new one
+      aSolidsAndSubs.push_back(std::pair<GeomShapePtr, ListOfShape>(aParent, ListOfShape()));
+      aFound = &(aSolidsAndSubs.back().second);
+    }
+
     ListOfShape anEdgesAndVertices;
     collectSubs(anObject, anEdgesAndVertices, GeomAPI_Shape::EDGE);
     collectSubs(anObject, anEdgesAndVertices, GeomAPI_Shape::VERTEX);
     for (ListOfShape::iterator aEIt = anEdgesAndVertices.begin();
          aEIt != anEdgesAndVertices.end(); ++aEIt)
-      aSolidsAndSubs.add(aParent, *aEIt);
+      aFound->push_back(*aEIt);
   }
 
   bool isFixedRadius = true;
@@ -147,91 +163,62 @@ void FeaturesPlugin_Fillet::execute()
   GeomAlgoAPI_MakeShapeList aMakeShapeList;
   std::shared_ptr<GeomAlgoAPI_Fillet> aFilletBuilder;
   int aResultIndex = 0;
+  std::string anError;
 
-  GeomAPI_DataMapOfShapeMapOfShapes::iterator anIt = aSolidsAndSubs.begin();
+  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  ListOfShape anOriginalShapesList, aResultShapesList;
+
+  std::list<std::pair<GeomShapePtr, ListOfShape> >::iterator anIt = aSolidsAndSubs.begin();
   for (; anIt != aSolidsAndSubs.end(); ++anIt) {
-    GeomShapePtr aSolid = anIt.first();
-    ListOfShape aFilletEdgesAndVertices = anIt.second();
+    GeomShapePtr aSolid = anIt->first;
+    ListOfShape aFilletEdgesAndVertices = anIt->second;
 
     ListOfShape aFilletEdges = selectEdges(aFilletEdgesAndVertices);
     if (isFixedRadius)
       aFilletBuilder.reset(new GeomAlgoAPI_Fillet(aSolid, aFilletEdges, aRadius1));
     else
       aFilletBuilder.reset(new GeomAlgoAPI_Fillet(aSolid, aFilletEdges, aRadius1, aRadius2));
-    if (isFailed(aFilletBuilder))
+
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFilletBuilder, getKind(), anError)) {
+      setError(anError);
       return;
+    }
 
     GeomShapePtr aResult = unwrapCompound(aFilletBuilder->shape());
     std::shared_ptr<ModelAPI_ResultBody> aResultBody =
         document()->createBody(data(), aResultIndex);
 
-    loadNamingDS(aResultBody, aSolid, aFilletEdgesAndVertices, aResult, aFilletBuilder);
+    ListOfShape aBaseShapes;
+    aBaseShapes.push_back(aSolid);
+    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+                                             aFilletBuilder, aResult, "Fillet");
+
     setResult(aResultBody, aResultIndex);
     aResultIndex++;
-  }
-  removeResults(aResultIndex);
-}
-
-bool FeaturesPlugin_Fillet::isFailed(
-    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm)
-{
-  if (!theAlgorithm->isDone()) {
-    static const std::string aFeatureError = "Error: fillet algorithm failed.";
-    setError(aFeatureError);
-    return true;
-  }
-  if (theAlgorithm->shape()->isNull()) {
-    static const std::string aShapeError = "Error: Resulting shape of fillet is Null.";
-    setError(aShapeError);
-    return true;
-  }
-  if (!theAlgorithm->isValid()) {
-    std::string aFeatureError = "Error: Resulting shape of fillet is not valid.";
-    setError(aFeatureError);
-    return true;
-  }
-  return false;
-}
 
-void FeaturesPlugin_Fillet::loadNamingDS(
-    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-    const ListOfShape& theFilletShapes,
-    const std::shared_ptr<GeomAPI_Shape> theResultShape,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape)
-{
-  //load result
-  if(theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-    return;
+    FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+    aRBA.resultBody = aResultBody;
+    aRBA.baseShape = aSolid;
+    aRBA.makeShape = aFilletBuilder;
+    aResultBaseAlgoList.push_back(aRBA);
+    aResultShapesList.push_back(aResult);
+    anOriginalShapesList.push_back(aSolid);
+
+    const std::string aFilletFaceName = "Fillet";
+    ListOfShape::iterator aSelectedBase = aFilletEdges.begin();
+    for(; aSelectedBase != aFilletEdges.end(); aSelectedBase++) {
+      GeomShapePtr aBase = *aSelectedBase;
+      // Store new faces generated from edges and vertices
+      aResultBody->loadGeneratedShapes(
+        aFilletBuilder, aBase, GeomAPI_Shape::EDGE, aFilletFaceName, true);
+    }
   }
 
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = theMakeShape->mapOfSubShapes();
+  // Store deleted shapes after all results has been proceeded. This is to avoid issue when in one
+  // result shape has been deleted, but in another it was modified or stayed.
+  GeomShapePtr aResultShapesCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList);
+  FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList,
+      anOriginalShapesList, aResultShapesCompound);
 
-  const int aDeletedTag = 1;
-  const int aModifyTag = 2;
-  const int aGeneratedTag = 3;
-  /// sub solids will be placed at labels 4, 5, etc. if result is compound of solids
-  const int aSubsolidsTag = 4;
-
-  theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
-
-  const std::string aModFaceName = "Modified_Face";
-  const std::string aFilletFaceName = "Fillet_Face";
-
-  // Store modified faces
-  theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), theBaseShape,
-      GeomAPI_Shape::FACE, aModifyTag, aModFaceName, *aMapOfShapes);
-
-  // Store new faces generated from edges and vertices
-  theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
-      GeomAPI_Shape::EDGE, aGeneratedTag, aFilletFaceName, *aMapOfShapes);
-  theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
-      GeomAPI_Shape::VERTEX, aGeneratedTag, aFilletFaceName, *aMapOfShapes);
-
-  // Deleted shapes
-  theResultBody->loadDeletedShapes(theMakeShape.get(), theBaseShape,
-                                   GeomAPI_Shape::EDGE, aDeletedTag);
-  theResultBody->loadDeletedShapes(theMakeShape.get(), theBaseShape,
-                                   GeomAPI_Shape::FACE, aDeletedTag);
+  removeResults(aResultIndex);
 }
index d0aa71255a567699072cbc06dbedda56f310d71e..1b0cb782f82de9d56872adf8946fc0533a57f458 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Fillet_H_
@@ -106,13 +105,9 @@ public:
   FeaturesPlugin_Fillet();
 
 private:
-  /// Check algorithm is finished correctly and store error otherwise
-  bool isFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm);
-
   /// Load Naming data structure of the feature to the document
   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                    const ListOfShape& theFilletShapes,
                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
                     const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape);
 };
index b3cc312c52097f8113056fb743f35972132a157e..7a1e75453a33877c9aa406ae976cf3b5d017f293 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_FusionFaces.h"
+#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
@@ -30,6 +30,7 @@
 #include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_ShapeExplorer.h>
 
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAlgoAPI_UnifySameDomain.h>
 
 
@@ -60,36 +61,19 @@ void FeaturesPlugin_FusionFaces::execute()
   std::shared_ptr<GeomAlgoAPI_UnifySameDomain> anAlgo(new GeomAlgoAPI_UnifySameDomain(aBaseShape));
 
   // Check algo status
-  if (!anAlgo->isDone()) {
-    setError("Error: Fusion algorithm failed.");
-    return;
-  }
-  if (anAlgo->shape()->isNull()) {
-    setError("Error: Resulting shape is Null.");
-    return;
-  }
-  if (!anAlgo->isValid()) {
-    setError("Error: Resulting shape is not valid.");
+  std::string anError;
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(anAlgo, getKind(), anError)) {
+    setError(anError);
     return;
   }
 
   // Store result
   GeomShapePtr aResultShape = anAlgo->shape();
   ResultBodyPtr aResultBody = document()->createBody(data());
-  if (aResultShape->isEqual(aBaseShape)) {
-    aResultBody->store(aResultShape);
-  } else {
-    aResultBody->storeModified(aBaseShape, aResultShape);
 
-    const int aModifyEdgeTag = 1;
-    const int aModifyFaceTag = 2;
-    const std::string aModEName = "Modified_Edge";
-    const std::string aModFName = "Modified_Face";
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = anAlgo->mapOfSubShapes();
-    aResultBody->loadAndOrientModifiedShapes(anAlgo.get(), aBaseShape, GeomAPI_Shape::EDGE,
-      aModifyEdgeTag, aModEName, *aMapOfShapes.get(), true);
-    aResultBody->loadAndOrientModifiedShapes(anAlgo.get(), aBaseShape, GeomAPI_Shape::FACE,
-      aModifyFaceTag, aModFName, *aMapOfShapes.get(), true);
-  }
+  ListOfShape aBaseShapesList;
+  aBaseShapesList.push_back(aBaseShape);
+  FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapesList, ListOfShape(),
+                                           anAlgo, aResultShape);
   setResult(aResultBody);
 }
index 3b919257c7424e2e183fbca550d694ae805b9406..be3e033cdc06f640dbf15841d59aae430b08226a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_FusionFaces_H_
index 7a33f2d463cf4e09dd340ae3ee9a247beac11f3e..1fa9079247f632a9cf86732de0a28b271bfada7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Intersection.h"
@@ -27,6 +26,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 
 #include <GeomAlgoAPI_Intersection.h>
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAPI_ShapeExplorer.h>
 
 #include <sstream>
@@ -68,22 +68,12 @@ void FeaturesPlugin_Intersection::execute()
   int aResultIndex = 0;
 
   // Create result.
-  GeomAlgoAPI_Intersection anIntersectionAlgo(anObjects);
+  GeomMakeShapePtr anIntersectionAlgo(new GeomAlgoAPI_Intersection(anObjects));
 
   // Checking that the algorithm worked properly.
-  if (!anIntersectionAlgo.isDone()) {
-    static const std::string aFeatureError = "Error: Intersection algorithm failed.";
-    setError(aFeatureError);
-    return;
-  }
-  if (anIntersectionAlgo.shape()->isNull()) {
-    static const std::string aShapeError = "Error: Resulting shape is Null.";
-    setError(aShapeError);
-    return;
-  }
-  if (!anIntersectionAlgo.isValid()) {
-    std::string aFeatureError = "Error: Resulting shape is not valid.";
-    setError(aFeatureError);
+  std::string anError;
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(anIntersectionAlgo, getKind(), anError)) {
+    setError(anError);
     return;
   }
 
@@ -92,72 +82,33 @@ void FeaturesPlugin_Intersection::execute()
   setResult(aResultBody, aResultIndex);
   aResultIndex++;
 
-
   // remove the rest results if there were produced in the previous pass
   removeResults(aResultIndex);
 }
 
 //=================================================================================================
-void FeaturesPlugin_Intersection::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+void FeaturesPlugin_Intersection::loadNamingDS(ResultBodyPtr theResultBody,
                                                const ListOfShape& theObjects,
-                                               GeomAlgoAPI_MakeShape& theMakeShape)
+                                               const GeomMakeShapePtr& theMakeShape)
 {
-  std::shared_ptr<GeomAPI_Shape> aResultShape = theMakeShape.shape();
-  theResultBody->storeModified(theObjects.front(), aResultShape);
+  std::shared_ptr<GeomAPI_Shape> aResultShape = theMakeShape->shape();
+
+  if(theObjects.front()->isEqual(aResultShape)) {
+    theResultBody->store(aResultShape, false);
+    return;
+  }
+
+  theResultBody->storeModified(theObjects, aResultShape, theMakeShape);
 
-  GeomAPI_DataMapOfShapeShape aShapesMap; // Map to store {result_shape, original_shape}
-  const int aShapeTypesNb = 2;
-  const GeomAPI_Shape::ShapeType aShapeTypes[aShapeTypesNb] =
-    {GeomAPI_Shape::VERTEX, GeomAPI_Shape::EDGE};
+  const int aShapeTypesNb = 3;
+  const GeomAPI_Shape::ShapeType aShapeTypes[aShapeTypesNb] = {GeomAPI_Shape::VERTEX,
+                                                               GeomAPI_Shape::EDGE,
+                                                               GeomAPI_Shape::FACE };
   for (ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) {
     const GeomShapePtr aShape = *anIt;
     for(int anIndex = 0; anIndex < aShapeTypesNb; ++anIndex) {
-      for(GeomAPI_ShapeExplorer anOrigShapeExp(aShape, aShapeTypes[anIndex]);
-          anOrigShapeExp.more();
-          anOrigShapeExp.next()) {
-        ListOfShape aHistory;
-        const GeomShapePtr aSubShape = anOrigShapeExp.current();
-        theMakeShape.modified(aSubShape, aHistory);
-        for(ListOfShape::const_iterator aHistoryIt = aHistory.cbegin();
-            aHistoryIt != aHistory.cend();
-            ++aHistoryIt) {
-          aShapesMap.bind(*aHistoryIt, aSubShape);
-        }
-      }
-    }
-  }
-
-  int aModifiedVertexIndex(1),
-      aGeneratedVertexIndex(1),
-      aModifiedEdgeIndex(1),
-      aGeneratedEdgeIndex(1);
-  int aTag = 4;
-  GeomAPI_DataMapOfShapeShape aStoredShapes;
-  for(int anIndex = 0; anIndex < aShapeTypesNb; ++anIndex) {
-    for(GeomAPI_ShapeExplorer aShapeExp(aResultShape, aShapeTypes[anIndex]);
-        aShapeExp.more();
-        aShapeExp.next()) {
-      const GeomShapePtr aSubShape = aShapeExp.current();
-      if(aStoredShapes.isBound(aSubShape)) {
-        continue;
-      }
-      if(aShapesMap.isBound(aSubShape)) {
-        theResultBody->modified(aShapesMap.find(aSubShape),
-          aSubShape,
-          std::string("Modified_")
-            + (anIndex == 0 ? "Vertex_" : "Edge_")
-            + std::to_string((long long)(anIndex == 0 ? aModifiedVertexIndex++
-                                                      : aModifiedEdgeIndex++)),
-          aTag++);
-      } else {
-        theResultBody->generated(aSubShape,
-          std::string("Generated_")
-            + (anIndex == 0 ? "Vertex_" : "Edge_")
-            + std::to_string((long long)(anIndex == 0 ? aGeneratedVertexIndex++
-                                                      : aGeneratedEdgeIndex++)),
-          aTag++);
-      }
-      aStoredShapes.bind(aSubShape, aSubShape);
+      theResultBody->loadModifiedShapes(theMakeShape, aShape, aShapeTypes[anIndex]);
+      theResultBody->loadGeneratedShapes(theMakeShape, aShape, aShapeTypes[anIndex]);
     }
   }
 }
index c4a210fc857ae269dacd0f3a2f6eef998333709d..6d4d99cdfeba75b18a5c8c983b7533e894488d4d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Intersection_H_
@@ -73,7 +72,7 @@ private:
   /// Load Naming data structure of the feature to the document.
   void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     const ListOfShape& theObjects,
-                    GeomAlgoAPI_MakeShape& theMakeShape);
+                    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape);
 };
 
 #endif
index 5deb05c69390980a5990b37627aa39ab2950866e..8318f3d08779db0209e154872c4e5923f8be6592 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Measurement.h"
@@ -323,6 +322,13 @@ AISObjectPtr FeaturesPlugin_Measurement::getAISObject(AISObjectPtr thePrevious)
   if ((aValues->size() == 0) || (aValues->value(0) <= Precision::Confusion()))
     return AISObjectPtr();
 
+  if (!myScreenPlane) {
+    // initialize a default plane for dimension
+    GeomPointPtr anOrigin(new GeomAPI_Pnt(0., 0., 0.));
+    GeomDirPtr aNormal(new GeomAPI_Dir(0., 0., 1.));
+    myScreenPlane = GeomPlanePtr(new GeomAPI_Pln(anOrigin, aNormal));
+  }
+
   AISObjectPtr anAIS;
   std::string aKind = string(MEASURE_KIND())->value();
   if (aKind == MEASURE_LENGTH())
@@ -342,8 +348,6 @@ AISObjectPtr FeaturesPlugin_Measurement::getAISObject(AISObjectPtr thePrevious)
 AISObjectPtr FeaturesPlugin_Measurement::lengthDimension(AISObjectPtr thePrevious)
 {
   AISObjectPtr aAISObj;
-  if (!myScreenPlane.get())
-    return aAISObj;
 
   AttributeSelectionPtr aSelectedFeature = selection(EDGE_FOR_LENGTH_ID());
 
@@ -404,8 +408,6 @@ AISObjectPtr FeaturesPlugin_Measurement::lengthDimension(AISObjectPtr thePreviou
 AISObjectPtr FeaturesPlugin_Measurement::distanceDimension(AISObjectPtr thePrevious)
 {
   AISObjectPtr aAISObj;
-  if (!myScreenPlane.get())
-    return aAISObj;
 
   AttributeSelectionPtr aFirstFeature = selection(DISTANCE_FROM_OBJECT_ID());
   AttributeSelectionPtr aSecondFeature = selection(DISTANCE_TO_OBJECT_ID());
@@ -612,7 +614,7 @@ void FeaturesPlugin_Measurement::setupDimension(AISObjectPtr theDim)
     anAspect->SetExtensionSize((aTextSize / mySceenScale + aSize) / 2.0);
     aDim->SetDimensionAspect(anAspect);
 
-    aDim->SetZLayer(1);
+    aDim->SetZLayer(Graphic3d_ZLayerId_Top);
     std::vector<int> aColor = Config_PropManager::color("Visualization", "sketch_dimension_color");
     theDim->setColor(aColor[0], aColor[1], aColor[2]);
   }
index 562d998a7537e3f75074510b93ae62465c40a4b9..4f8b516b61be5c6f1690fbbd72e6cee57aa56d40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Measurement_H_
index 5f8870f5952bb4799b2cf337555b26e35b7a766c..64286a9d7e6d8b70f52cbdfca3d2debc18a95d97 100644 (file)
@@ -1,13 +1,33 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        FeaturesPlugin_MultiRotation.cpp
 // Created:     30 Jan 2017
 // Author:      Clarisse Genrault (CEA)
 
 #include <FeaturesPlugin_MultiRotation.h>
+#include <FeaturesPlugin_Tools.h>
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAlgoAPI_Translation.h>
 
 #include <GeomAPI_ShapeExplorer.h>
@@ -15,6 +35,7 @@
 #include <GeomAPI_Ax1.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Trsf.h>
 
 #include <ModelAPI_AttributeDouble.h>
@@ -49,24 +70,29 @@ void FeaturesPlugin_MultiRotation::initAttributes()
   data()->addAttribute(FeaturesPlugin_MultiRotation::NB_COPIES_ANGULAR_ID(),
                        ModelAPI_AttributeInteger::typeId());
 
-  /*data()->addAttribute(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID(),
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+  data()->addAttribute(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID(),
                        ModelAPI_AttributeString::typeId());
   data()->addAttribute(FeaturesPlugin_MultiRotation::STEP_RADIAL_ID(),
                        ModelAPI_AttributeDouble::typeId());
   data()->addAttribute(FeaturesPlugin_MultiRotation::NB_COPIES_RADIAL_ID(),
-                       ModelAPI_AttributeInteger::typeId());*/
+                       ModelAPI_AttributeInteger::typeId());
+#endif
 }
 
 //=================================================================================================
 void FeaturesPlugin_MultiRotation::execute()
 {
-  /*std::string useRadialDir = string(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID())->value();
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+  std::string useRadialDir = string(FeaturesPlugin_MultiRotation::USE_RADIAL_DIR_ID())->value();
   if (useRadialDir.empty()) {
     performRotation1D();
   } else {
     performRotation2D();
-  }*/
+  }
+#else
   performRotation1D();
+#endif
 }
 
 //=================================================================================================
@@ -78,6 +104,7 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
   AttributeSelectionListPtr anObjectsSelList =
     selectionList(FeaturesPlugin_MultiRotation::OBJECTS_LIST_ID());
   if (anObjectsSelList->size() == 0) {
+    setError("Error: empty selection list");
     return;
   }
   for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
@@ -85,7 +112,6 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -93,21 +119,39 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
   }
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_MultiRotation::AXIS_ANGULAR_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_ANGULAR_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> anAxis(new GeomAPI_Ax1(anEdge->line()->location(),
+                                                      anEdge->line()->direction()));
+
   // Getting number of copies.
   int nbCopies =
     integer(FeaturesPlugin_MultiRotation::NB_COPIES_ANGULAR_ID())->value();
@@ -149,8 +193,10 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
         aResultIndex++;
       }
     } else {
+      std::string anError;
       ListOfShape aListOfShape;
-      std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > aListOfRotationAlgo;
+      std::shared_ptr<GeomAlgoAPI_MakeShapeList>
+          aListOfRotationAlgo(new GeomAlgoAPI_MakeShapeList);
 
       for (int i=0; i<nbCopies; i++) {
         std::shared_ptr<GeomAlgoAPI_Rotation> aRotationnAlgo(
@@ -164,29 +210,21 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
         aRotationnAlgo->build();
 
         // Checking that the algorithm worked properly.
-        if (!aRotationnAlgo->isDone()) {
-          static const std::string aFeatureError = "Error : Multitranslation algorithm failed.";
-          setError(aFeatureError);
-          break;
-        }
-        if (aRotationnAlgo->shape()->isNull()) {
-          static const std::string aShapeError = "Error : Resulting shape is null.";
-          setError(aShapeError);
-          break;
-        }
-        if (!aRotationnAlgo->isValid()) {
-          static const std::string aFeatureError = "Error : Resulting shape in not valid.";
-          setError(aFeatureError);
+        if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aRotationnAlgo, getKind(), anError)) {
+          setError(anError);
           break;
         }
         aListOfShape.push_back(aRotationnAlgo->shape());
-        aListOfRotationAlgo.push_back(aRotationnAlgo);
+        aListOfRotationAlgo->appendAlgo(aRotationnAlgo);
       }
       std::shared_ptr<GeomAPI_Shape> aCompound =
         GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      aResultBody->storeModified(aBaseShape, aCompound);
-      loadNamingDS(aListOfRotationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aBaseShapes;
+      aBaseShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+                                               aListOfRotationAlgo, aCompound, "Rotated");
 
       setResult(aResultBody, aResultIndex);
     }
@@ -198,6 +236,7 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
 }
 
 //=================================================================================================
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
 void FeaturesPlugin_MultiRotation::performRotation2D()
 {
   // Getting objects.
@@ -213,7 +252,6 @@ void FeaturesPlugin_MultiRotation::performRotation2D()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -388,34 +426,16 @@ void FeaturesPlugin_MultiRotation::loadNamingDS2(
     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
     std::shared_ptr<GeomAPI_Shape> theBaseShape)
 {
-  int aTag = 1;
-  int anIndex = 1;
-  std::string aRotatedName;
-
   for (std::list<std::shared_ptr<GeomAlgoAPI_Translation> >::const_iterator anIt =
     theListOfTranslationAlgo.begin(); anIt != theListOfTranslationAlgo.cend(); ++anIt) {
-    std::cout << "LOAD" << std::endl;
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = (*anIt)->mapOfSubShapes();
-
     // naming of faces
-    aRotatedName = "Rotated_Face_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::FACE,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
+    theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::FACE, "Rotated_Face");
 
     // naming of edges
-    aRotatedName = "Rotated_Edge_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::EDGE,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
+    theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::EDGE, "Rotated_Edge");
 
     // naming of vertex
-    aRotatedName = "Rotated_Vertex_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
-
-    ++anIndex;
+    theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::VERTEX, "Rotated_Vertex");
   }
 }
 
@@ -425,7 +445,6 @@ void FeaturesPlugin_MultiRotation::loadNamingDS3(
     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
     std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb)
 {
-  int aTag = 6*nb+1;
   int anIndex = nb+1;
   std::string aRotatedName;
 
@@ -438,44 +457,10 @@ void FeaturesPlugin_MultiRotation::loadNamingDS3(
     for(; anExp.more(); anExp.next()) {
        aRotatedName = "Rotated_Face_" + std::to_string((long long) anIndex);
        aRotatedName = aRotatedName + "_" + std::to_string((long long) numFace);
-       theResultBody->generated(anExp.current(), aRotatedName, aTag++);
+       theResultBody->generated(anExp.current(), aRotatedName);
        ++numFace;
     }
     ++anIndex;
   }
 }
-
-//=================================================================================================
-void FeaturesPlugin_MultiRotation::loadNamingDS(
-    std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
-    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-    std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  int aTag = 1;
-  int anIndex = 1;
-  std::string aRotatedName;
-
-  for (std::list<std::shared_ptr<GeomAlgoAPI_Rotation> >::const_iterator anIt =
-    theListOfRotationAlgo.begin(); anIt != theListOfRotationAlgo.cend(); ++anIt) {
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = (*anIt)->mapOfSubShapes();
-
-    // naming of faces
-    aRotatedName = "Rotated_Face_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::FACE,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
-
-    // naming of edges
-    aRotatedName = "Rotated_Edge_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::EDGE,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
-
-    // naming of vertex
-    aRotatedName = "Rotated_Vertex_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aTag++, aRotatedName, *aSubShapes.get(),
-                                               false, true);
-    ++anIndex;
-  }
-}
+#endif
index 45af5b97c9b84cf36168ab0d9110ec27ec5321a2..f7dc3dc8d304ce105ca0011301e3959ab38b90e8 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        FeaturesPlugin_MultiRotation.h
 // Created:     30 Jan 2017
@@ -106,7 +123,8 @@ private:
   /// Perform the multi rotation in one direction.
   void performRotation1D();
 
-  /// Perform the multi totation in two directions.
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+  /// Perform the multi rotation in two directions.
   void performRotation2D();
 
   void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
@@ -116,10 +134,7 @@ private:
   void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
-
-  void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
+#endif
 };
 
-#endif // FEATURESPLUGIN_MULTIROTATION_H_
\ No newline at end of file
+#endif // FEATURESPLUGIN_MULTIROTATION_H_
index d23742c6df621107ffa698b33a2287421fa3024d..b9af9671352fd044aa1e628b1af8dad648aa5916 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_MultiTranslation.h>
+#include <FeaturesPlugin_Tools.h>
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Ax1.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Trsf.h>
 
 #include <ModelAPI_AttributeDouble.h>
@@ -86,6 +89,7 @@ void FeaturesPlugin_MultiTranslation::performOneDirection()
   AttributeSelectionListPtr anObjectsSelList =
     selectionList(FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID());
   if (anObjectsSelList->size() == 0) {
+    setError("Error: empty selection list");
     return;
   }
   for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
@@ -93,7 +97,6 @@ void FeaturesPlugin_MultiTranslation::performOneDirection()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -101,21 +104,39 @@ void FeaturesPlugin_MultiTranslation::performOneDirection()
   }
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_FIRST_DIR_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> anAxis (new GeomAPI_Ax1(anEdge->line()->location(),
+                                                       anEdge->line()->direction()));
+
   // Getting step.
   double aStep = real(FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID())->value();
 
@@ -150,8 +171,10 @@ void FeaturesPlugin_MultiTranslation::performOneDirection()
         aResultIndex++;
       }
     } else {
+      std::string anError;
       ListOfShape aListOfShape;
-      std::list<std::shared_ptr<GeomAlgoAPI_Translation> > aListOfTranslationAlgo;
+      std::shared_ptr<GeomAlgoAPI_MakeShapeList>
+          aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList);
 
       for (int i=0; i<nbCopies; i++) {
         std::shared_ptr<GeomAlgoAPI_Translation> aTranslationAlgo(
@@ -165,29 +188,22 @@ void FeaturesPlugin_MultiTranslation::performOneDirection()
         aTranslationAlgo->build();
 
         // Checking that the algorithm worked properly.
-        if (!aTranslationAlgo->isDone()) {
-          static const std::string aFeatureError = "Error : Multitranslation algorithm failed.";
-          setError(aFeatureError);
-          break;
-        }
-        if (aTranslationAlgo->shape()->isNull()) {
-          static const std::string aShapeError = "Error : Resulting shape is null.";
-          setError(aShapeError);
-          break;
-        }
-        if (!aTranslationAlgo->isValid()) {
-          static const std::string aFeatureError = "Error : Resulting shape in not valid.";
-          setError(aFeatureError);
+        if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(
+            aTranslationAlgo, getKind(), anError)) {
+          setError(anError);
           break;
         }
         aListOfShape.push_back(aTranslationAlgo->shape());
-        aListOfTranslationAlgo.push_back(aTranslationAlgo);
+        aListOfTranslationAlgo->appendAlgo(aTranslationAlgo);
       }
       std::shared_ptr<GeomAPI_Shape> aCompound =
         GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      aResultBody->storeModified(aBaseShape, aCompound);
-      loadNamingDS(aListOfTranslationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aBaseShapes;
+      aBaseShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+                                               aListOfTranslationAlgo, aCompound, "Translated");
 
       setResult(aResultBody, aResultIndex);
     }
@@ -207,6 +223,7 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
   AttributeSelectionListPtr anObjectsSelList =
     selectionList(FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID());
   if (anObjectsSelList->size() == 0) {
+    setError("Error: empty selection list");
     return;
   }
   for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
@@ -214,7 +231,6 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -222,33 +238,71 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
   }
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> aFirstAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_FIRST_DIR_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
+  }
+
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> aFirstAxis(new GeomAPI_Ax1(anEdge->line()->location(),
+                                                          anEdge->line()->direction()));
+
+  //Getting axis.
+  anObjRef = selection(AXIS_SECOND_DIR_ID());
+  aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
   }
-  if(anEdge) {
-    aFirstAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                              anEdge->line()->direction()));
+
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
   }
-  std::shared_ptr<GeomAPI_Ax1> aSecondAxis;
-  anObjRef = selection(FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
-  if(anEdge) {
-    aSecondAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                               anEdge->line()->direction()));
+
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  std::shared_ptr<GeomAPI_Ax1> aSecondAxis(new GeomAPI_Ax1(anEdge->line()->location(),
+                                                           anEdge->line()->direction()));
+
   // Getting step.
   double aFirstStep = real(FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID())->value();
   double aSecondStep = real(FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID())->value();
@@ -310,8 +364,10 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
         }
       }
     } else {
+      std::string anError;
       ListOfShape aListOfShape;
-      std::list<std::shared_ptr<GeomAlgoAPI_Translation> > aListOfTranslationAlgo;
+      std::shared_ptr<GeomAlgoAPI_MakeShapeList>
+          aListOfTranslationAlgo(new GeomAlgoAPI_MakeShapeList);
 
       for (int j=0; j<aSecondNbCopies; j++) {
         for (int i=0; i<aFirstNbCopies; i++) {
@@ -329,30 +385,24 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
           aTranslationAlgo->build();
 
           // Checking that the algorithm worked properly.
-          if (!aTranslationAlgo->isDone()) {
-            static const std::string aFeatureError = "Error : Multitranslation algorithm failed.";
-            setError(aFeatureError);
-            break;
-          }
-          if (aTranslationAlgo->shape()->isNull()) {
-            static const std::string aShapeError = "Error : Resulting shape is null.";
-            setError(aShapeError);
+          if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(
+              aTranslationAlgo, getKind(), anError)) {
+            setError(anError);
             break;
           }
-          if (!aTranslationAlgo->isValid()) {
-            static const std::string aFeatureError = "Error : Resulting shape in not valid.";
-            setError(aFeatureError);
-           break;
-          }
           aListOfShape.push_back(aTranslationAlgo->shape());
-          aListOfTranslationAlgo.push_back(aTranslationAlgo);
+          aListOfTranslationAlgo->appendAlgo(aTranslationAlgo);
         }
       }
       std::shared_ptr<GeomAPI_Shape> aCompound =
         GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      aResultBody->storeModified(aBaseShape, aCompound);
-      loadNamingDS(aListOfTranslationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aBaseShapes;
+      aBaseShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+                                               aListOfTranslationAlgo, aCompound, "Translated");
+
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -361,39 +411,3 @@ void FeaturesPlugin_MultiTranslation::performTwoDirection()
   // Remove the rest results if there were produced in the previous pass.
   removeResults(aResultIndex);
 }
-
-//=================================================================================================
-void FeaturesPlugin_MultiTranslation::loadNamingDS(
-    std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
-    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-    std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  int aTag = 1;
-  int anIndex = 1;
-  std::string aTranslatedName;
-
-  for (std::list<std::shared_ptr<GeomAlgoAPI_Translation> >::const_iterator anIt =
-    theListOfTranslationAlgo.begin(); anIt != theListOfTranslationAlgo.cend(); ++anIt) {
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = (*anIt)->mapOfSubShapes();
-
-    // naming of faces
-    aTranslatedName = "Translated_Face_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::FACE,
-                                               aTag++, aTranslatedName, *aSubShapes.get(),
-                                               false, true);
-
-    // naming of edges
-    aTranslatedName = "Translated_Edge_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::EDGE,
-                                               aTag++, aTranslatedName, *aSubShapes.get(),
-                                               false, true);
-
-    // naming of vertex
-    aTranslatedName = "Translated_Vertex_" + std::to_string((long long) anIndex);
-    theResultBody->loadAndOrientModifiedShapes((*anIt).get(), theBaseShape, GeomAPI_Shape::VERTEX,
-                                               aTag++, aTranslatedName, *aSubShapes.get(),
-                                               false, true);
-
-    ++anIndex;
-  }
-}
index 4edeb695f7432a0703e4e84d78c4432ebaae7ec3..9571ed3d218c91228b58167d2eadd62c5f625b32 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESPLUGIN_MULTITRANSLATION_H_
@@ -120,10 +119,6 @@ private:
 
   /// Perform the multi translation in two directions.
   void performTwoDirection();
-
-  void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
 };
 
 #endif // FEATURESPLUGIN_MULTITRANSLATION_H_
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index cd4f34c..f572664
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Partition.h"
@@ -38,6 +37,7 @@
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_Partition.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Face.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -66,9 +66,6 @@ static bool cutUnusedSubs(CompsolidSubs& theObjects, CompsolidSubs& theNotUsed,
                           std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
                           std::string& theError);
 
-static bool isAlgoFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                         std::string& theError);
-
 
 //=================================================================================================
 FeaturesPlugin_Partition::FeaturesPlugin_Partition()
@@ -125,7 +122,7 @@ void FeaturesPlugin_Partition::execute()
     new GeomAlgoAPI_Partition(aTargetObjects, aPlanes));
 
   // Checking that the algorithm worked properly.
-  if (isAlgoFailed(aPartitionAlgo, aError)) {
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPartitionAlgo, getKind(), aError)) {
     setError(aError);
     return;
   }
@@ -143,7 +140,7 @@ void FeaturesPlugin_Partition::execute()
     aPartitionAlgo.reset(new GeomAlgoAPI_Partition(aTargetObjects, ListOfShape()));
 
     // Checking that the algorithm worked properly.
-    if (isAlgoFailed(aPartitionAlgo, aError)) {
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPartitionAlgo, getKind(), aError)) {
       setError(aError);
       return;
     }
@@ -174,56 +171,31 @@ void FeaturesPlugin_Partition::storeResult(
   const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
   const int theIndex)
 {
-  // Find base. The most complicated is the real modified object (#1799 if box is partitioned by
-  // two planes the box is the base, not planes, independently on the order in the list).
-  GeomShapePtr aBaseShape;
-  for(ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) {
-    GeomShapePtr anObjectShape = *anIt;
-    GeomShapePtr aCandidate =
-      findBase(anObjectShape, theResultShape, GeomAPI_Shape::VERTEX, theMakeShape);
-    if(!aCandidate.get()) {
-      aCandidate = findBase(anObjectShape, theResultShape, GeomAPI_Shape::EDGE, theMakeShape);
-    }
-    if (!aCandidate.get())
-      aCandidate = findBase(anObjectShape, theResultShape, GeomAPI_Shape::FACE, theMakeShape);
-
-    if(aCandidate.get()) {
-      if (!aBaseShape.get() || aBaseShape->shapeType() > aCandidate->shapeType()) {
-        aBaseShape = aCandidate;
-      }
-    }
-  }
-
   // Create result body.
   ResultBodyPtr aResultBody = document()->createBody(data(), theIndex);
 
-  // Store modified shape.
-  if(!aBaseShape.get() || aBaseShape->isEqual(theResultShape)) {
-    aResultBody->store(theResultShape, false);
-    setResult(aResultBody, theIndex);
-    return;
+  // if result is same as one of the base object, no modification was performed
+  for(ListOfShape::const_iterator anObj = theObjects.cbegin(); anObj != theObjects.cend(); ++anObj)
+  {
+    if (anObj->get() && (*anObj)->isSame(theResultShape)) {
+      aResultBody->store(theResultShape, false);
+      setResult(aResultBody, theIndex);
+      return;
+    }
   }
 
-  const int aDelTag = 1;
-  /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
-  const int aSubTag = 2;
-  int aModTag = aSubTag + 10000;
-  const std::string aModName = "Modified";
-
-  aResultBody->storeModified(aBaseShape, theResultShape, aSubTag);
+  aResultBody->storeModified(theObjects, theResultShape, theMakeShape);
 
   std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
   theObjects.insert(theObjects.end(), thePlanes.begin(), thePlanes.end());
-  int anIndex = 1;
-  for(ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) {
+  for (ListOfShape::const_iterator anIt = theObjects.cbegin();
+       anIt != theObjects.cend();
+       ++anIt)
+  {
     GeomShapePtr aShape = *anIt;
-    std::string aModEdgeName = aModName + "_Edge_" + std::to_string((long long)anIndex);
-    aResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::EDGE,
-      aModTag, aModEdgeName, *aMapOfSubShapes.get(), false, true, true);
-    std::string aModFaceName = aModName + "_Face_" + std::to_string((long long)anIndex++);
-    aResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::FACE,
-      aModTag + 1, aModFaceName, *aMapOfSubShapes.get(), false, true, true);
-    aResultBody->loadDeletedShapes(theMakeShape.get(), aShape, GeomAPI_Shape::FACE, aDelTag);
+    aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::EDGE);
+    aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::FACE);
+    aResultBody->loadDeletedShapes(theMakeShape, aShape, GeomAPI_Shape::FACE);
   }
 
   setResult(aResultBody, theIndex);
@@ -232,38 +204,6 @@ void FeaturesPlugin_Partition::storeResult(
 
 //=================     Auxiliary functions     ===================================================
 
-GeomShapePtr findBase(const GeomShapePtr theObjectShape,
-                      const GeomShapePtr theResultShape,
-                      const GeomAPI_Shape::ShapeType theShapeType,
-                      const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  GeomShapePtr aBaseShape;
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
-  for(GeomAPI_ShapeExplorer anObjectSubShapesExp(theObjectShape, theShapeType);
-      anObjectSubShapesExp.more();
-      anObjectSubShapesExp.next()) {
-    GeomShapePtr anObjectSubShape = anObjectSubShapesExp.current();
-    ListOfShape aModifiedShapes;
-    theMakeShape->modified(anObjectSubShape, aModifiedShapes);
-    for(ListOfShape::const_iterator
-        aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) {
-      GeomShapePtr aModShape = *aModIt;
-      if(aMapOfSubShapes->isBound(aModShape)) {
-        aModShape = aMapOfSubShapes->find(aModShape);
-      }
-      if(theResultShape->isSubShape(aModShape)) {
-        aBaseShape = theObjectShape;
-        break;
-      }
-    }
-    if(aBaseShape.get()) {
-      break;
-    }
-  }
-
-  return aBaseShape;
-}
-
 static CompsolidSubs::iterator findOrAdd(CompsolidSubs& theList, const GeomShapePtr& theCompsolid)
 {
   CompsolidSubs::iterator aFound = theList.begin();
@@ -384,7 +324,7 @@ static bool cutSubs(const GeomShapePtr& theFirstArgument,
     // cut from current list of solids
     aCutAlgo.reset(
         new GeomAlgoAPI_Boolean(aUIt->second, theTools, GeomAlgoAPI_Boolean::BOOL_CUT));
-    if (isAlgoFailed(aCutAlgo, theError))
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, "", theError))
       return false;
     theMakeShapeList->appendAlgo(aCutAlgo);
 
@@ -419,22 +359,3 @@ bool cutUnusedSubs(CompsolidSubs& theObjects, CompsolidSubs& theNotUsed,
   return cutSubs(aFirstArgument, theObjects, aToolsForUsed, theMakeShapeList, theError)
       && cutSubs(aFirstArgument, theNotUsed, aToolsForUnused, theMakeShapeList, theError);
 }
-
-bool isAlgoFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo, std::string& theError)
-{
-  if (!theAlgo->isDone()) {
-    theError = "Error: Partition algorithm failed.";
-    return true;
-  }
-  if (theAlgo->shape()->isNull()) {
-    theError = "Error: Resulting shape is Null.";
-    return true;
-  }
-  if (!theAlgo->isValid()) {
-    theError = "Error: Resulting shape is not valid.";
-    return true;
-  }
-
-  theError.clear();
-  return false;
-}
old mode 100755 (executable)
new mode 100644 (file)
index 5db7fc5..0826920
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Partition_H_
index ca72a5aeb951bc15b49bf129cd14b79e5e0e3508..cd6c8781fd3af762360ae3b84edea67165994f70 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Pipe.h"
@@ -30,6 +29,8 @@
 #include <GeomAlgoAPI_CompoundBuilder.h>
 #include <GeomAlgoAPI_Pipe.h>
 #include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
+
 #include <GeomAPI_PlanarEdges.h>
 #include <GeomAPI_ShapeExplorer.h>
 
 static void storeSubShape(ResultBodyPtr theResultBody,
                           const GeomShapePtr theShape,
                           const GeomAPI_Shape::ShapeType theType,
-                          const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
                           const std::string theName,
-                          int& theShapeIndex,
-                          int& theTag);
+                          int& theShapeIndex);
 
 //==================================================================================================
 FeaturesPlugin_Pipe::FeaturesPlugin_Pipe()
@@ -147,14 +146,9 @@ void FeaturesPlugin_Pipe::execute()
 
   // Searching faces with common edges.
   if(aCreationMethod == CREATION_METHOD_SIMPLE()) {
-    ListOfShape aShells;
-    ListOfShape aFreeFaces;
     std::shared_ptr<GeomAPI_Shape> aFacesCompound =
       GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
-    GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
-                                          aShells, aFreeFaces);
-    aBaseShapesList.insert(aBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end());
-    aBaseShapesList.insert(aBaseShapesList.end(), aShells.begin(), aShells.end());
+    GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aBaseShapesList);
   } else {
     aBaseShapesList.insert(aBaseShapesList.end(), aBaseFacesList.begin(), aBaseFacesList.end());
   }
@@ -167,8 +161,8 @@ void FeaturesPlugin_Pipe::execute()
   }
   std::shared_ptr<GeomAPI_Shape> aPathShape =
     std::dynamic_pointer_cast<GeomAPI_Shape>(aPathSelection->value());
-  if(!aPathShape.get()) {
-    // Probaply it is a construction.
+  if(!aPathShape.get() && aPathSelection->context().get()) {
+    // Probably it is a construction.
     aPathShape = aPathSelection->context()->shape();
   }
   if(!aPathShape.get() || aPathShape->isNull()) {
@@ -185,7 +179,7 @@ void FeaturesPlugin_Pipe::execute()
       return;
     }
     aBiNormal = std::dynamic_pointer_cast<GeomAPI_Shape>(aBiNormalSelection->value());
-    if(!aBiNormal.get()) {
+    if(!aBiNormal.get() && aBiNormalSelection->context().get()) {
       // Probably it is a construction.
       aBiNormal = aBiNormalSelection->context()->shape();
     }
@@ -210,7 +204,7 @@ void FeaturesPlugin_Pipe::execute()
         return;
       }
       std::shared_ptr<GeomAPI_Shape> aLocationShape = aLocationSelection->value();
-      if(!aLocationShape.get()) {
+      if(!aLocationShape.get() && aLocationSelection->context().get()) {
         // Probably it is a construction.
         aLocationShape = aLocationSelection->context()->shape();
       }
@@ -224,30 +218,22 @@ void FeaturesPlugin_Pipe::execute()
 
   // Generating result for each object.
   int aResultIndex = 0;
+  std::string anError;
   if(aCreationMethod == CREATION_METHOD_SIMPLE() ||
       aCreationMethod == CREATION_METHOD_BINORMAL()) {
     for(ListOfShape::const_iterator
         anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) {
       std::shared_ptr<GeomAPI_Shape> aBaseShape = *anIter;
 
-      GeomAlgoAPI_Pipe aPipeAlgo = aCreationMethod ==
-        CREATION_METHOD_SIMPLE() ? GeomAlgoAPI_Pipe(aBaseShape, aPathShape) :
-                                   GeomAlgoAPI_Pipe(aBaseShape, aPathShape, aBiNormal);
+      std::shared_ptr<GeomAlgoAPI_Pipe> aPipeAlgo(
+        aCreationMethod == CREATION_METHOD_SIMPLE() ? new GeomAlgoAPI_Pipe(aBaseShape,
+                                                                           aPathShape)
+                                                    : new GeomAlgoAPI_Pipe(aBaseShape,
+                                                                           aPathShape,
+                                                                           aBiNormal));
 
-      if(!aPipeAlgo.isDone()) {
-        setError("Error: Pipe algorithm failed.");
-        aResultIndex = 0;
-        break;
-      }
-
-      // Check if shape is valid
-      if(!aPipeAlgo.shape().get() || aPipeAlgo.shape()->isNull()) {
-        setError("Error: Resulting shape is Null.");
-        aResultIndex = 0;
-        break;
-      }
-      if(!aPipeAlgo.isValid()) {
-        setError("Error: Resulting shape is not valid.");
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPipeAlgo, getKind(), anError)) {
+        setError(anError);
         aResultIndex = 0;
         break;
       }
@@ -255,22 +241,12 @@ void FeaturesPlugin_Pipe::execute()
       storeResult(aBaseShape, aPipeAlgo, aResultIndex++);
     }
   } else if(aCreationMethod == CREATION_METHOD_LOCATIONS()) {
-    GeomAlgoAPI_Pipe aPipeAlgo = GeomAlgoAPI_Pipe(aBaseShapesList, aLocations, aPathShape);
+    std::shared_ptr<GeomAlgoAPI_Pipe> aPipeAlgo(new GeomAlgoAPI_Pipe(aBaseShapesList,
+                                                                     aLocations,
+                                                                     aPathShape));
 
-    if(!aPipeAlgo.isDone()) {
-      setError("Error: Pipe algorithm failed.");
-      removeResults(0);
-      return;
-    }
-
-    // Check if shape is valid
-    if(!aPipeAlgo.shape().get() || aPipeAlgo.shape()->isNull()) {
-      setError("Error: Resulting shape is Null.");
-      removeResults(0);
-      return;
-    }
-    if(!aPipeAlgo.isValid()) {
-      setError("Error: Resulting shape is not valid.");
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPipeAlgo, getKind(), anError)) {
+      setError(anError);
       removeResults(0);
       return;
     }
@@ -286,22 +262,19 @@ void FeaturesPlugin_Pipe::execute()
 
 //==================================================================================================
 void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                                      GeomAlgoAPI_Pipe& thePipeAlgo,
+                                      const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
                                       const int theResultIndex)
 {
   // Create result body.
   ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
 
   // Store generated shape.
-  aResultBody->storeGenerated(theBaseShape, thePipeAlgo.shape());
+  aResultBody->storeGenerated(theBaseShape, thePipeAlgo->shape());
 
   // Store generated edges/faces.
   GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
   GeomAPI_Shape::ShapeType aShapeTypeToExplode;
-  int aGenTag = 1;
-  std::string aGenName = "Generated_";
 
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = thePipeAlgo.mapOfSubShapes();
   switch(aBaseShapeType) {
     case GeomAPI_Shape::VERTEX: {
       aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
@@ -312,13 +285,13 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr<GeomAPI_Shape> theBa
       std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
       GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
       ListOfShape aV1History, aV2History;
-      thePipeAlgo.generated(aV1, aV1History);
-      thePipeAlgo.generated(aV2, aV2History);
+      thePipeAlgo->generated(aV1, aV1History);
+      thePipeAlgo->generated(aV2, aV2History);
       if(!aV1History.empty()) {
-        aResultBody->generated(aV1, aV1History.front(), aGenName + "Edge_1", aGenTag++);
+        aResultBody->generated(aV1, aV1History.front());
       }
       if(!aV2History.empty()) {
-        aResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", aGenTag++);
+        aResultBody->generated(aV2, aV2History.front());
       }
     }
     case GeomAPI_Shape::FACE:
@@ -333,52 +306,44 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr<GeomAPI_Shape> theBa
 
   if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
       aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
-    aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::VERTEX,
-                                           aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get());
+    aResultBody->loadGeneratedShapes(thePipeAlgo, theBaseShape, GeomAPI_Shape::VERTEX);
   }
   if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
       aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
-    aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE,
-                                           aGenTag++, aGenName + "Face", *aMapOfSubShapes.get());
+    aResultBody->loadGeneratedShapes(thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE);
   }
 
   // Store from shapes.
-  int aFromTag = aGenTag;
-  storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes,
-              thePipeAlgo.fromShapes(), "From_", aFromTag);
+  storeShapes(aResultBody, aBaseShapeType, thePipeAlgo->fromShapes(), "From_");
 
   // Store to shapes.
-  int aToTag = aFromTag;
-  storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, thePipeAlgo.toShapes(), "To_", aToTag);
+  storeShapes(aResultBody, aBaseShapeType, thePipeAlgo->toShapes(), "To_");
 
   setResult(aResultBody, theResultIndex);
 }
 
 //==================================================================================================
 void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes,
-                                      GeomAlgoAPI_Pipe& thePipeAlgo,
+                                      const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
                                       const int theResultIndex)
 {
   // Create result body.
   ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
 
   // Store generated shape.
-  aResultBody->storeGenerated(theBaseShapes.front(), thePipeAlgo.shape());
+  aResultBody->storeGenerated(theBaseShapes.front(), thePipeAlgo->shape());
 
   // Store generated edges/faces.
-  int aGenTag = 1;
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = thePipeAlgo.mapOfSubShapes();
-
-  for(ListOfShape::const_iterator
-      anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
+  for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin();
+      anIter != theBaseShapes.cend();
+      ++anIter)
+  {
     GeomShapePtr aBaseShape = *anIter;
     GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType();
     GeomAPI_Shape::ShapeType aShapeTypeToExplode;
-    std::string aGenName = "Generated_";
     switch(aBaseShapeType) {
       case GeomAPI_Shape::VERTEX: {
         aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
-        aGenName += "Edge";
         break;
       }
       case GeomAPI_Shape::EDGE:
@@ -386,31 +351,25 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes,
         std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
         GeomAlgoAPI_ShapeTools::findBounds(aBaseShape, aV1, aV2);
         ListOfShape aV1History, aV2History;
-        thePipeAlgo.generated(aV1, aV1History);
-        thePipeAlgo.generated(aV2, aV2History);
-        aResultBody->generated(aV1, aV1History.front(), aGenName + "Edge_1", aGenTag++);
-        aResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", aGenTag++);
+        thePipeAlgo->generated(aV1, aV1History);
+        thePipeAlgo->generated(aV2, aV2History);
+        aResultBody->generated(aV1, aV1History.front());
+        aResultBody->generated(aV2, aV2History.front());
       }
       case GeomAPI_Shape::FACE:
       case GeomAPI_Shape::SHELL: {
         aShapeTypeToExplode = GeomAPI_Shape::EDGE;
-        aGenName += "Face";
         break;
       }
     }
-    aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, aBaseShape, aShapeTypeToExplode,
-                                              aGenTag++, aGenName, *aMapOfSubShapes.get());
+    aResultBody->loadGeneratedShapes(thePipeAlgo, aBaseShape, aShapeTypeToExplode);
   }
 
   // Store from shapes.
-  int aFromTag = aGenTag;
-  storeShapes(aResultBody, theBaseShapes.front()->shapeType(), aMapOfSubShapes,
-              thePipeAlgo.fromShapes(), "From", aFromTag);
+  storeShapes(aResultBody, theBaseShapes.front()->shapeType(), thePipeAlgo->fromShapes(), "From_");
 
   // Store to shapes.
-  int aToTag = aFromTag;
-  storeShapes(aResultBody, theBaseShapes.back()->shapeType(),
-              aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag);
+  storeShapes(aResultBody, theBaseShapes.back()->shapeType(), thePipeAlgo->toShapes(), "To_");
 
 
   setResult(aResultBody, theResultIndex);
@@ -418,11 +377,9 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes,
 
 //==================================================================================================
 void FeaturesPlugin_Pipe::storeShapes(ResultBodyPtr theResultBody,
-                              const GeomAPI_Shape::ShapeType theBaseShapeType,
-                              const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
-                              const ListOfShape& theShapes,
-                              const std::string theName,
-                              int& theTag)
+                                      const GeomAPI_Shape::ShapeType theBaseShapeType,
+                                      const ListOfShape& theShapes,
+                                      const std::string theName)
 {
   GeomAPI_Shape::ShapeType aShapeTypeToExplore = GeomAPI_Shape::FACE;
   std::string aShapeTypeStr = "Face";
@@ -458,17 +415,13 @@ void FeaturesPlugin_Pipe::storeShapes(ResultBodyPtr theResultBody,
 
     if(aShapeTypeToExplore == GeomAPI_Shape::COMPOUND) {
       std::string aName = theName + (aShape->shapeType() == GeomAPI_Shape::EDGE ? "Edge" : "Face");
-      storeSubShape(theResultBody,
-                    aShape,
+      storeSubShape(theResultBody, aShape,
                     aShape->shapeType(),
-                    theMapOfSubShapes,
                     aName,
-                    aShape->shapeType() == GeomAPI_Shape::EDGE ? aShapeIndex : aFaceIndex,
-                    theTag);
+                    aShape->shapeType() == GeomAPI_Shape::EDGE ? aShapeIndex : aFaceIndex);
     } else {
       std::string aName = theName + aShapeTypeStr;
-      storeSubShape(theResultBody, aShape, aShapeTypeToExplore,
-                    theMapOfSubShapes, aName, aShapeIndex, theTag);
+      storeSubShape(theResultBody, aShape, aShapeTypeToExplore, aName, aShapeIndex);
     }
   }
 }
@@ -477,18 +430,13 @@ void FeaturesPlugin_Pipe::storeShapes(ResultBodyPtr theResultBody,
 void storeSubShape(ResultBodyPtr theResultBody,
                    const GeomShapePtr theShape,
                    const GeomAPI_Shape::ShapeType theType,
-                   const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
                    const std::string theName,
-                   int& theShapeIndex,
-                   int& theTag)
+                   int& theShapeIndex)
 {
   for(GeomAPI_ShapeExplorer anExp(theShape, theType); anExp.more(); anExp.next()) {
     GeomShapePtr aSubShape = anExp.current();
-    if(theMapOfSubShapes->isBound(aSubShape)) {
-      aSubShape = theMapOfSubShapes->find(aSubShape);
-    }
     std::ostringstream aStr;
     aStr << theName << "_" << theShapeIndex++;
-    theResultBody->generated(aSubShape, aStr.str(), theTag++);
+    theResultBody->generated(aSubShape, aStr.str());
   }
 }
index 074c8b088ec90222c437c5899f284be467d9d2a6..08ccb1e8e35de664975f8f86274ed88d210a69c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Pipe_H_
@@ -121,19 +120,17 @@ public:
 
 private:
   void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                   GeomAlgoAPI_Pipe& thePipeAlgo,
+                   const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
                    const int theResultIndex = 0);
 
   void storeResult(const ListOfShape& theBaseShapes,
-                   GeomAlgoAPI_Pipe& thePipeAlgo,
+                   const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
                    const int theResultIndex = 0);
 
   void storeShapes(ResultBodyPtr theResultBody,
                    const GeomAPI_Shape::ShapeType theBaseShapeType,
-                   const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
                    const ListOfShape& theShapes,
-                   const std::string theName,
-                   int& theTag);
+                   const std::string theName);
 };
 
 #endif
index ab932f01d6c21ac5993a434a9846b0253f926bda..0acf3a84e07c22da2d7d80bc2c0757fde884230a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Placement.h"
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Face.h>
 #include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAlgoAPI_Placement.h>
 #include <GeomAlgoAPI_Transform.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <FeaturesPlugin_Tools.h>
 
@@ -67,7 +68,6 @@ void FeaturesPlugin_Placement::execute()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -121,21 +121,8 @@ void FeaturesPlugin_Placement::execute()
   // Verify planarity of faces and linearity of edges
   std::shared_ptr<GeomAPI_Shape> aShapes[2] = {aStartShape, anEndShape};
   for (int i = 0; i < 2; i++) {
-    if (aShapes[i]->isFace()) {
-      std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aShapes[i]));
-      if (!aFace->isPlanar()) {
-        static const std::string aPlanarityError = "Error: One of selected faces is not planar.";
-        setError(aPlanarityError);
-        return;
-      }
-    }
-    else if (aShapes[i]->isEdge()) {
-      std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShapes[i]));
-      if (!anEdge->isLine()) {
-        static const std::string aLinearityError = "Error: One of selected endges is not linear.";
-        setError(aLinearityError);
-        return;
-      }
+    if (!isShapeValid(aShapes[i])) {
+      return;
     }
   }
 
@@ -155,6 +142,7 @@ void FeaturesPlugin_Placement::execute()
 
   // Applying transformation to each object.
   int aResultIndex = 0;
+  std::string anError;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
       anObjectsIt++, aContext++) {
@@ -167,29 +155,22 @@ void FeaturesPlugin_Placement::execute()
       setResult(aResultPart, aResultIndex);
     } else {
       std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
-      GeomAlgoAPI_Transform aTransformAlgo(aBaseShape, aTrsf);
+      std::shared_ptr<GeomAlgoAPI_Transform> aTransformAlgo(new GeomAlgoAPI_Transform(aBaseShape,
+                                                                                      aTrsf));
 
       // Checking that the algorithm worked properly.
-      if(!aTransformAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Transform algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aTransformAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aTransformAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTransformAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       //LoadNamingDS
-      std::shared_ptr<ModelAPI_ResultBody> aResultBody =
-        document()->createBody(data(), aResultIndex);
-      loadNamingDS(aTransformAlgo, aResultBody, aBaseShape);
+      ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aShapes, ListOfShape(),
+                                               aTransformAlgo, aTransformAlgo->shape(), "Placed");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -199,18 +180,44 @@ void FeaturesPlugin_Placement::execute()
   removeResults(aResultIndex);
 }
 
-//============================================================================
-void FeaturesPlugin_Placement::loadNamingDS(GeomAlgoAPI_Transform& theTransformAlgo,
-                                            std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                            std::shared_ptr<GeomAPI_Shape> theBaseShape)
+//==================================================================================================
+bool FeaturesPlugin_Placement::isShapeValid(GeomShapePtr theShape)
 {
-  //load result
-  theResultBody->storeModified(theBaseShape, theTransformAlgo.shape());
+  if (theShape->isCompound()) {
+    GeomAPI_Shape::ShapeType aShapeType = GeomAPI_Shape::SHAPE;
+    for (GeomAPI_ShapeIterator anIt(theShape); anIt.more(); anIt.next()) {
+      GeomShapePtr aCurrentShape = anIt.current();
+      if (aShapeType == GeomAPI_Shape::SHAPE) {
+        aShapeType = aCurrentShape->shapeType();
+      }
+      else if (aShapeType != aCurrentShape->shapeType()) {
+        static const std::string aLinearityError =
+          "Error: Selected compound contains shapes with different types.";
+        setError(aLinearityError);
+        return false;
+      }
 
-  std::string aPlacedName = "Placed";
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTransformAlgo.mapOfSubShapes();
+      if (!isShapeValid(aCurrentShape)) {
+        return false;
+      }
+    }
+  }
+  else if (theShape->isFace()) {
+    std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(theShape));
+    if (!aFace->isPlanar()) {
+      static const std::string aPlanarityError = "Error: One of selected faces is not planar.";
+      setError(aPlanarityError);
+      return false;
+    }
+  }
+  else if (theShape->isEdge()) {
+    std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(theShape));
+    if (!anEdge->isLine()) {
+      static const std::string aLinearityError = "Error: One of selected edges is not linear.";
+      setError(aLinearityError);
+      return false;
+    }
+  }
 
-  FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody,
-                                            theBaseShape, 1, 2, 3, aPlacedName,
-                                            *aSubShapes.get());
+  return true;
 }
index 1b8a7b6bd0e1bcf5d27adc62b6d050ee0e62af0b..9e1e4db74cdbc2075591d56a00f957a0bd60f92c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Placement_H_
@@ -96,10 +95,8 @@ class FeaturesPlugin_Placement : public ModelAPI_Feature
   /// Use plugin manager for features creation
   FeaturesPlugin_Placement();
 private:
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(GeomAlgoAPI_Transform& theTransformAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
+  /// Checks validity of passed shape.
+  bool isShapeValid(GeomShapePtr theShape);
 };
 
 #endif
index 68b1001e9241f2e45f78897796a7e004a48571cd..4f5d35f36dc2ec2f95526741b5ad2acab4c56a7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_Plugin.h>
index 51693c52fabf8137b9d50b1b94f48fcb9ffa05b6..bf470612365dfe8d2d4fa38a362af750fba4120d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Plugin_H_
index cf16130b979520cbe8f40c9d3cd43f0aad4b6716..4cebf871bb4201c544d3d1964a212d918e23b981 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Recover.h"
@@ -31,6 +30,7 @@
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_Tools.h>
 #include <GeomAlgoAPI_Copy.h>
+#include <GeomAlgoAPI_Tools.h>
 
 FeaturesPlugin_Recover::FeaturesPlugin_Recover()
 {
@@ -45,6 +45,7 @@ void FeaturesPlugin_Recover::initAttributes()
 
 void FeaturesPlugin_Recover::execute()
 {
+  std::string anError;
   int aResultIndex = 0;
   AttributeRefListPtr aRecovered = reflist(RECOVERED_ENTITIES());
   for(int anIndex = aRecovered->size() - 1; anIndex >= 0; anIndex--) {
@@ -59,31 +60,20 @@ void FeaturesPlugin_Recover::execute()
       continue;
 
     // Copy shape.
-    GeomAlgoAPI_Copy aCopyAlgo(aShape);
+    std::shared_ptr<GeomAlgoAPI_Copy> aCopyAlgo(new GeomAlgoAPI_Copy(aShape));
     // Check that algo is done.
-    if(!aCopyAlgo.isDone()) {
-      setError("Error: recover algorithm failed.");
-      return;
-    }
-    // Check if shape is not null.
-    if(!aCopyAlgo.shape().get() || aCopyAlgo.shape()->isNull()) {
-      setError("Error: resulting shape is null.");
-      return;
-    }
-    // Check that resulting shape is valid.
-    if(!aCopyAlgo.isValid()) {
-      setError("Error: resulting shape is not valid.");
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCopyAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     // Store result.
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    aResultBody->store(aCopyAlgo.shape());//, aCopyAlgo.shape());
-    std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = aCopyAlgo.mapOfSubShapes();
-    // like in import: forget any history
-    int aTag(1);
-    std::string aNameMS = "Shape";
-    aResultBody->loadFirstLevel(aCopyAlgo.shape(), aNameMS, aTag);
+    aResultBody->store(aCopyAlgo->shape());//, aCopyAlgo.shape());
+
+    aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::VERTEX);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::EDGE);
+    aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::FACE);
 
     setResult(aResultBody, aResultIndex);
     ++aResultIndex;
index 6b2706d9bc7af03d14df0d308d0dbb0d006895c6..de1937a157aca646dfbffb3e1f2a32323728542e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESPLUGIN_RECOVER_H_
index e4d61f163b0066fa38a4ecd7ef87fe8dd4cc6b78..24a0de7e7b1cbddbb950deafdfbdd43c4fe8ffd3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_RemoveSubShapes.h"
@@ -232,7 +231,7 @@ void FeaturesPlugin_RemoveSubShapes::execute()
     aResultShape = anAttrSelectionInList->value();
   }
   // deleted and copied must be jointed to one list which keeps all the history
-  GeomAlgoAPI_MakeShapeList aMakeShapeList;
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
 
   // find all removed shapes
   std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aDeletedSubs(new GeomAlgoAPI_MakeShapeCustom);
@@ -263,11 +262,11 @@ void FeaturesPlugin_RemoveSubShapes::execute()
       }
     }
   }
-  aMakeShapeList.appendAlgo(aDeletedSubs);
+  aMakeShapeList->appendAlgo(aDeletedSubs);
 
   std::shared_ptr<GeomAlgoAPI_Copy> aCopy(new GeomAlgoAPI_Copy(aResultShape));
   aResultShape = aCopy->shape();
-  aMakeShapeList.appendAlgo(aCopy);
+  aMakeShapeList->appendAlgo(aCopy);
 
   if (aResultShape->shapeType() == GeomAPI_Shape::COMPOUND) {
     aResultShape = GeomAlgoAPI_ShapeTools::groupSharedTopology(aResultShape);
@@ -283,15 +282,22 @@ void FeaturesPlugin_RemoveSubShapes::execute()
 
   // Store result.
   ResultBodyPtr aResultBody = document()->createBody(data());
-  aResultBody->storeModified(aBaseShape, aResultShape, 1);
-  std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
-  for(; aTypeIter != aTypes.end(); aTypeIter++)
-    aResultBody->loadDeletedShapes(&aMakeShapeList, aBaseShape, *aTypeIter, 1);
-  aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::FACE,
-      2, "Modified_Face", *aMakeShapeList.mapOfSubShapes().get(), true, false, true);
-  aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::EDGE,
-      3, "Modified_Edge", *aMakeShapeList.mapOfSubShapes().get(), false, false, true);
-  aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::VERTEX,
-      4, "Modified_Vertex", *aMakeShapeList.mapOfSubShapes().get());
+  aResultBody->storeModified(aBaseShape, aResultShape);
+  for (std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
+       aTypeIter != aTypes.end();
+       ++aTypeIter)
+  {
+    aResultBody->loadDeletedShapes(aMakeShapeList, aBaseShape, *aTypeIter);
+  }
+
+  aResultBody->loadModifiedShapes(aMakeShapeList,
+                                  aBaseShape,
+                                  GeomAPI_Shape::FACE);
+  aResultBody->loadModifiedShapes(aMakeShapeList,
+                                  aBaseShape,
+                                  GeomAPI_Shape::EDGE);
+  aResultBody->loadModifiedShapes(aMakeShapeList,
+                                  aBaseShape,
+                                  GeomAPI_Shape::VERTEX);
   setResult(aResultBody);
 }
index 4bbe6a01c2abf0b3017c5a4be2a92f7038137f6b..15e51f32bcdd5d52c51c1a1ba0042d8226e76559 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_RemoveSubShapes_H_
index 4a643318083edd19d5ba970d0452f74c18c0c355..9994cd900268067bdf4f7ed728600b7306da9945 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Revolution.h"
 #include <ModelAPI_Validator.h>
 
 #include <GeomAlgoAPI_Revolution.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 
 //=================================================================================================
 FeaturesPlugin_Revolution::FeaturesPlugin_Revolution()
@@ -92,17 +93,37 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
   // Getting base shapes.
   getBaseShapes(theBaseShapes);
 
-  //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
+  // Getting axis.
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
   AttributeSelectionPtr aSelection = selection(AXIS_OBJECT_ID());
-  if(aSelection.get() && aSelection->value().get() && aSelection->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->value()));
-  } else if(aSelection->context().get() &&
-            aSelection->context()->shape().get() &&
-            aSelection->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->context()->shape()));
+  GeomShapePtr aShape = aSelection->value();
+  if (!aShape.get()) {
+    if (aSelection->context().get()) {
+      aShape = aSelection->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return false;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
+  else
+  {
+    setError(aSelectionError);
+    return false;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> anAxis;
   if(anEdge.get()) {
     if(anEdge->isLine()) {
       anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
@@ -137,6 +158,10 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
       if(!aToShape.get() && aSelection->context().get()) {
         aToShape = aSelection->context()->shape();
       }
+      if (aToShape.get() && aToShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aToShape);
+        aToShape = anIt.current();
+      }
     }
     aSelection = selection(FROM_OBJECT_ID());
     if(aSelection.get()) {
@@ -144,10 +169,15 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
       if(!aFromShape.get() && aSelection->context().get()) {
         aFromShape = aSelection->context()->shape();
       }
+      if (aFromShape.get() && aFromShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aFromShape);
+        aFromShape = anIt.current();
+      }
     }
   }
 
   // Generating result for each base shape.
+  std::string anError;
   for(ListOfShape::const_iterator
       anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
     GeomShapePtr aBaseShape = *anIter;
@@ -156,7 +186,8 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes,
                                                        aBaseShape, anAxis,
                                                        aToShape, aToAngle,
                                                        aFromShape, aFromAngle));
-    if(!isMakeShapeValid(aRevolAlgo)) {
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aRevolAlgo, getKind(), anError)) {
+      setError(anError);
       return false;
     }
 
index 7fa98bf74e68b567e246e8e08734a2fd1c7bd05d..cd0b929fc777eefe1984a6e9a68b6703c5ec6367 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Revolution_H_
index 50c03fa4ef1a58ddc9aed69e1f3637bad3273ac7..261c7b0bb27d9aa1624a165b9a966cb25562a898 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_RevolutionBoolean.h"
@@ -38,9 +37,7 @@ bool FeaturesPlugin_RevolutionBoolean::makeGeneration(ListOfShape& theBaseShapes
 //=================================================================================================
 void FeaturesPlugin_RevolutionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody,
                                       const GeomShapePtr theBaseShape,
-                                      const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                                      int& theTag)
+                                      const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape,
-                                                    theMakeShape, theTag);
+  FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape);
 }
index 8aceb322b95fcb46a3cfc74391b469d5e26c6ccb..72463a955974ae85f25fc50b06e2b48c195ec105 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_RevolutionBoolean_H_
@@ -44,8 +43,7 @@ protected:
   /// Stores generation history.
   void storeGenerationHistory(ResultBodyPtr theResultBody,
                               const GeomShapePtr theBaseShape,
-                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
-                              int& theTag);
+                              const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 };
 
 #endif
index 90fbe1ac4d3d45bad515080cdcfb17d0d88ac35e..983ae59d4cf64d679c38b30f7ead3e3164d66eab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_RevolutionCut.h"
index 932d180b0e3ca32dc0c9e3230346e1dfc390d70e..5a255735a24cb962cb8f5ca92b4c33d90c117c16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_RevolutionCut_H_
index 97523b44bf52c1b5c2435df23f388affa9636f7d..87b484ddb924764a04cf9c794c79d5cdbee39084 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_RevolutionFuse.h"
index 8f422db281a07973753168d94f2ef4e2ef92c892..81042b2b26fe559d71a14fc26f6f3369f78785dc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_RevolutionFuse_H_
old mode 100755 (executable)
new mode 100644 (file)
index 07d2d57..7ef1d86
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_Rotation.h>
 #include <ModelAPI_ResultPart.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Trsf.h>
 
 #include <FeaturesPlugin_Tools.h>
@@ -99,25 +100,44 @@ void FeaturesPlugin_Rotation::performTranslationByAxisAndAngle()
   }
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_OBJECT_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
   }
 
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
+  }
+
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> anAxis (new GeomAPI_Ax1(anEdge->line()->location(),
+                                                       anEdge->line()->direction()));
+
   // Getting angle.
   double anAngle = real(FeaturesPlugin_Rotation::ANGLE_ID())->value();
 
   // Rotating each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -134,34 +154,33 @@ void FeaturesPlugin_Rotation::performTranslationByAxisAndAngle()
       aResultPart->setTrsf(*aContext, aTrsf);
       setResult(aResultPart, aResultIndex);
     } else {
-      GeomAlgoAPI_Rotation aRotationAlgo(aBaseShape, anAxis, anAngle);
+      std::shared_ptr<GeomAlgoAPI_Rotation> aRotationAlgo(new GeomAlgoAPI_Rotation(aBaseShape,
+                                                                                   anAxis,
+                                                                                   anAngle));
 
-      if (!aRotationAlgo.check()) {
-        setError(aRotationAlgo.getError());
+      if (!aRotationAlgo->check()) {
+        setError(aRotationAlgo->getError());
         return;
       }
 
-      aRotationAlgo.build();
+      aRotationAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aRotationAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Rotation algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aRotationAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aRotationAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aRotationAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      loadNamingDS(aRotationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               aShapes,
+                                               ListOfShape(),
+                                               aRotationAlgo,
+                                               aRotationAlgo->shape(),
+                                               "Rotated");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -203,16 +222,17 @@ void FeaturesPlugin_Rotation::performTranslationByThreePoints()
     selection(FeaturesPlugin_Rotation::START_POINT_ID());
   std::shared_ptr<ModelAPI_AttributeSelection> anEndPointRef =
     selection(FeaturesPlugin_Rotation::END_POINT_ID());
-  if ((aCenterRef.get() != NULL) && (aStartPointRef.get() != NULL)
-      && (anEndPointRef.get() != NULL)) {
+  if ((aCenterRef.get() != NULL) &&
+      (aStartPointRef.get() != NULL) &&
+      (anEndPointRef.get() != NULL)) {
     GeomShapePtr aCenterShape = aCenterRef->value();
-    if (!aCenterShape.get())
+    if (!aCenterShape.get() && aCenterRef->context().get())
       aCenterShape = aCenterRef->context()->shape();
     GeomShapePtr aStartShape = aStartPointRef->value();
-    if (!aStartShape.get())
+    if (!aStartShape.get() && aStartPointRef->context().get())
       aStartShape = aStartPointRef->context()->shape();
-      GeomShapePtr anEndShape = anEndPointRef->value();
-    if (!anEndShape.get())
+    GeomShapePtr anEndShape = anEndPointRef->value();
+    if (!anEndShape.get() && anEndPointRef->context().get())
       anEndShape = anEndPointRef->context()->shape();
     if (aStartShape && anEndShape && aCenterShape) {
       aCenterPoint = GeomAlgoAPI_PointBuilder::point(aCenterShape);
@@ -222,6 +242,7 @@ void FeaturesPlugin_Rotation::performTranslationByThreePoints()
   }
 
   // Rotating each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -238,52 +259,36 @@ void FeaturesPlugin_Rotation::performTranslationByThreePoints()
        aResultPart->setTrsf(*aContext, aTrsf);
        setResult(aResultPart, aResultIndex);
     } else {
-      GeomAlgoAPI_Rotation aRotationAlgo(aBaseShape, aCenterPoint, aStartPoint, anEndPoint);
+      std::shared_ptr<GeomAlgoAPI_Rotation> aRotationAlgo(new GeomAlgoAPI_Rotation(aBaseShape,
+                                                                                   aCenterPoint,
+                                                                                   aStartPoint,
+                                                                                   anEndPoint));
 
-      if (!aRotationAlgo.check()) {
-        setError(aRotationAlgo.getError());
+      if (!aRotationAlgo->check()) {
+        setError(aRotationAlgo->getError());
         return;
       }
 
-      aRotationAlgo.build();
+      aRotationAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aRotationAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Rotation algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aRotationAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error : Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aRotationAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aRotationAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      loadNamingDS(aRotationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               aShapes,
+                                               ListOfShape(),
+                                               aRotationAlgo,
+                                               aRotationAlgo->shape(),
+                                               "Rotated");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
   }
 }
-
-//=================================================================================================
-void FeaturesPlugin_Rotation::loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
-                                           std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                           std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  // Store result.
-  theResultBody->storeModified(theBaseShape, theRotaionAlgo.shape());
-
-  std::string aRotatedName = "Rotated";
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
-
-  FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
-                                            theBaseShape, 1, 2, 3, aRotatedName,
-                                            *aSubShapes.get());
-}
old mode 100755 (executable)
new mode 100644 (file)
index ce064ca..c6b80c3
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Rotation_H_
@@ -125,10 +124,6 @@ private:
 
   ///Perform the rotation using a center and two points.
   void performTranslationByThreePoints();
-
-  void loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
 };
 
 #endif
index 4e854c22a5f491e742f68ad57121d9b4c916382b..bdb4cdd52fde517cc999053ac555b78368b7d3f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_Scale.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelectionList.h>
@@ -90,7 +90,6 @@ void FeaturesPlugin_Scale::performScaleByFactor()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -115,39 +114,38 @@ void FeaturesPlugin_Scale::performScaleByFactor()
   double aScaleFactor = real(FeaturesPlugin_Scale::SCALE_FACTOR_ID())->value();
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
         anObjectsIt++, aContext++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
-    GeomAlgoAPI_Scale aScaleAlgo(aBaseShape, aCenterPoint, aScaleFactor);
+    std::shared_ptr<GeomAlgoAPI_Scale> aScaleAlgo(
+      new GeomAlgoAPI_Scale(aBaseShape, aCenterPoint, aScaleFactor));
 
-    if (!aScaleAlgo.check()) {
-      setError(aScaleAlgo.getError());
+    if (!aScaleAlgo->check()) {
+      setError(aScaleAlgo->getError());
       return;
     }
 
-    aScaleAlgo.build();
+    aScaleAlgo->build();
 
     // Checking that the algorithm worked properly.
-    if(!aScaleAlgo.isDone()) {
-      static const std::string aFeatureError = "Error: Symmetry algorithm failed.";
-      setError(aFeatureError);
-      break;
-    }
-    if(aScaleAlgo.shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      break;
-    }
-    if(!aScaleAlgo.isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aScaleAlgo, getKind(), anError)) {
+      setError(anError);
       break;
     }
 
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    loadNamingDS(aScaleAlgo, aResultBody, aBaseShape);
+
+    ListOfShape aShapes;
+    aShapes.push_back(aBaseShape);
+    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                             aShapes,
+                                             ListOfShape(),
+                                             aScaleAlgo,
+                                             aScaleAlgo->shape(),
+                                             "Scaled");
     setResult(aResultBody, aResultIndex);
     aResultIndex++;
   }
@@ -172,7 +170,6 @@ void FeaturesPlugin_Scale::performScaleByDimensions()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -199,40 +196,41 @@ void FeaturesPlugin_Scale::performScaleByDimensions()
   double aScaleFactorZ = real(FeaturesPlugin_Scale::SCALE_FACTOR_Z_ID())->value();
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
         anObjectsIt++, aContext++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
-    GeomAlgoAPI_Scale aScaleAlgo(aBaseShape, aCenterPoint,
-                                 aScaleFactorX, aScaleFactorY, aScaleFactorZ);
-
-    if (!aScaleAlgo.check()) {
-      setError(aScaleAlgo.getError());
+    std::shared_ptr<GeomAlgoAPI_Scale> aScaleAlgo(new GeomAlgoAPI_Scale(aBaseShape,
+                                                                        aCenterPoint,
+                                                                        aScaleFactorX,
+                                                                        aScaleFactorY,
+                                                                        aScaleFactorZ));
+
+    if (!aScaleAlgo->check()) {
+      setError(aScaleAlgo->getError());
       return;
     }
 
-    aScaleAlgo.build();
+    aScaleAlgo->build();
 
     // Checking that the algorithm worked properly.
-    if(!aScaleAlgo.isDone()) {
-      static const std::string aFeatureError = "Error: Symmetry algorithm failed.";
-      setError(aFeatureError);
-      break;
-    }
-    if(aScaleAlgo.shape()->isNull()) {
-      static const std::string aShapeError = "Error: Resulting shape is Null.";
-      setError(aShapeError);
-      break;
-    }
-    if(!aScaleAlgo.isValid()) {
-      std::string aFeatureError = "Error: Resulting shape is not valid.";
-      setError(aFeatureError);
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aScaleAlgo, getKind(), anError)) {
+      setError(anError);
       break;
     }
 
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    loadNamingDS(aScaleAlgo, aResultBody, aBaseShape);
+
+    ListOfShape aShapes;
+    aShapes.push_back(aBaseShape);
+    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                             aShapes,
+                                             ListOfShape(),
+                                             aScaleAlgo,
+                                             aScaleAlgo->shape(),
+                                             "Scaled");
     setResult(aResultBody, aResultIndex);
     aResultIndex++;
   }
@@ -240,19 +238,3 @@ void FeaturesPlugin_Scale::performScaleByDimensions()
   // Remove the rest results if there were produced in the previous pass.
   removeResults(aResultIndex);
 }
-
-//=================================================================================================
-void FeaturesPlugin_Scale::loadNamingDS(GeomAlgoAPI_Scale& theScaleAlgo,
-                                        std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                        std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  // Store and name the result.
-  theResultBody->storeModified(theBaseShape, theScaleAlgo.shape());
-
-  // Name the faces
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theScaleAlgo.mapOfSubShapes();
-  std::string aScaledName = "Scaled";
-  FeaturesPlugin_Tools::storeModifiedShapes(theScaleAlgo, theResultBody,
-                                            theBaseShape, 1, 2, 3, aScaledName,
-                                            *aSubShapes.get());
-}
index 519dec4e4b529cbca3ce9ee92e65324b012e2c10..873ae607537add0f02158ead1afdb500d259390d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESPLUGIN_SCALE_H_
@@ -126,11 +125,6 @@ private:
 
   /// Perform symmetry using a central point and three dimensions
   void performScaleByDimensions();
-
-  /// Perform the naming
-  void loadNamingDS(GeomAlgoAPI_Scale& theScaleAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
 };
 
 #endif // FEATURESPLUGIN_SCALE_H_
\ No newline at end of file
index d50b74aa2088b65f7e4930cac773dc6ab1a69163..38b50f39391e0d19cd01cf266d4ef525c52f57e2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_Symmetry.h>
 #include <GeomAlgoAPI_FaceBuilder.h>
 #include <GeomAlgoAPI_Copy.h>
 #include <GeomAlgoAPI_MakeShapeList.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Face.h>
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Trsf.h>
 
 #include <ModelAPI_AttributeBoolean.h>
@@ -101,7 +102,6 @@ bool FeaturesPlugin_Symmetry::collectSourceObjects(ListOfShape& theSourceShapes,
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if (!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return false;
     }
     theSourceShapes.push_back(anObject);
@@ -134,6 +134,7 @@ void FeaturesPlugin_Symmetry::performSymmetryByPoint()
   }
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -160,19 +161,8 @@ void FeaturesPlugin_Symmetry::performSymmetryByPoint()
       aSymmetryAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aSymmetryAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Symmetry algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aSymmetryAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aSymmetryAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aSymmetryAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
@@ -195,22 +185,42 @@ void FeaturesPlugin_Symmetry::performSymmetryByAxis()
     return;
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_Symmetry::AXIS_OBJECT_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_OBJECT_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax1> anAxis (new GeomAPI_Ax1(anEdge->line()->location(),
+                                                       anEdge->line()->direction()));
+
+
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -237,19 +247,8 @@ void FeaturesPlugin_Symmetry::performSymmetryByAxis()
       aSymmetryAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aSymmetryAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Symmetry algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aSymmetryAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aSymmetryAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aSymmetryAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
@@ -271,25 +270,43 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane()
   if (!collectSourceObjects(anObjects, aContextes))
     return;
 
-  //Getting axis.
-  std::shared_ptr<GeomAPI_Ax2> aPlane;
-  std::shared_ptr<GeomAPI_Pln> aPln;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_Symmetry::PLANE_OBJECT_ID());
-  if (anObjRef && anObjRef->value() && anObjRef->value()->isFace()) {
-    aPln = std::shared_ptr<GeomAPI_Face>(new GeomAPI_Face(anObjRef->value()))->getPlane();
+  //Getting plane.
+  static const std::string aSelectionError = "Error: The plane shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(PLANE_OBJECT_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomFacePtr aFace;
+  if (aShape->isFace())
+  {
+    aFace = aShape->face();
   }
-  else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isFace()) {
-    aPln =
-      std::shared_ptr<GeomAPI_Face>(new GeomAPI_Face(anObjRef->context()->shape()))->getPlane();
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    aFace = anIt.current()->face();
   }
-  if (aPln) {
-    aPlane = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aPln->location(),
-                                                          aPln->direction()));
+
+  if (!aFace.get())
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  std::shared_ptr<GeomAPI_Ax2> aPlane(new GeomAPI_Ax2(aFace->getPlane()->location(),
+                                                      aFace->getPlane()->direction()));
+
+
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -315,19 +332,8 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane()
       aSymmetryAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aSymmetryAlgo->isDone()) {
-        static const std::string aFeatureError = "Error: Symmetry algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aSymmetryAlgo->shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aSymmetryAlgo->isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aSymmetryAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
@@ -345,8 +351,8 @@ void FeaturesPlugin_Symmetry::buildResult(
   std::shared_ptr<GeomAlgoAPI_Symmetry>& theSymmetryAlgo,
   std::shared_ptr<GeomAPI_Shape> theBaseShape, int theResultIndex)
 {
-  GeomAlgoAPI_MakeShapeList anAlgoList;
-  anAlgoList.appendAlgo(theSymmetryAlgo);
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> anAlgoList(new GeomAlgoAPI_MakeShapeList());
+  anAlgoList->appendAlgo(theSymmetryAlgo);
   // Compose source shape and the result of symmetry.
   GeomShapePtr aCompound;
   if (boolean(KEEP_ORIGINAL_RESULT())->value()) {
@@ -354,7 +360,7 @@ void FeaturesPlugin_Symmetry::buildResult(
     // add a copy of a base shape otherwise selection of this base shape is bad (2592)
     std::shared_ptr<GeomAlgoAPI_Copy> aCopyAlgo(new GeomAlgoAPI_Copy(theBaseShape));
     aShapes.push_back(aCopyAlgo->shape());
-    anAlgoList.appendAlgo(aCopyAlgo);
+    anAlgoList->appendAlgo(aCopyAlgo);
 
     aShapes.push_back(theSymmetryAlgo->shape());
     aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
@@ -363,8 +369,12 @@ void FeaturesPlugin_Symmetry::buildResult(
 
   // Store and name the result.
   ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
-  aResultBody->storeModified(theBaseShape, aCompound);
-  loadNamingDS(anAlgoList, aResultBody, theBaseShape);
+
+  ListOfShape aBaseShapes;
+  aBaseShapes.push_back(theBaseShape);
+  FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+                                           anAlgoList, aCompound, "Symmetried");
+
   setResult(aResultBody, theResultIndex);
 }
 
@@ -385,16 +395,3 @@ void FeaturesPlugin_Symmetry::buildResult(ResultPartPtr theOriginal,
   aResultPart->setTrsf(theOriginal, theTrsf);
   setResult(aResultPart, theResultIndex);
 }
-
-//=================================================================================================
-void FeaturesPlugin_Symmetry::loadNamingDS(GeomAlgoAPI_MakeShapeList& theAlgo,
-                                           std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                           std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  // Name the faces
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theAlgo.mapOfSubShapes();
-  std::string aReflectedName = "Symmetried";
-  FeaturesPlugin_Tools::storeModifiedShapes(theAlgo, theResultBody,
-                                            theBaseShape, 1, 2, 3, aReflectedName,
-                                            *aSubShapes.get());
-}
index a19d143cfa73448e098563a67d761957e3560310..fb4b47da8a49e6fb11dabf1decabbad37500fdea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FEATURESPLUGIN_SYMMETRY_H_
@@ -137,11 +136,6 @@ private:
   /// Perform symmetry with respect to a plane.
   void performSymmetryByPlane();
 
-  /// Perform the naming
-  void loadNamingDS(GeomAlgoAPI_MakeShapeList& theSymmetryAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
-
   /// Create new result on given shapes and the index of result
   void buildResult(std::shared_ptr<GeomAlgoAPI_Symmetry>& theSymmetryAlgo,
                    std::shared_ptr<GeomAPI_Shape> theBaseShape,
index 07709d1ed7fa2a2056346f9e0f0c28ebed31b07e..dc1b1a7e16efd8149b6eefb799c1afccbbb98635 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Tools.h"
 
 #include <GeomAPI_ShapeIterator.h>
 
-void FeaturesPlugin_Tools::storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
-                                               std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                               std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                                               const int theFaceTag,
-                                               const int theEdgeTag,
-                                               const int theVertexTag,
-                                               const std::string theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes)
+//==================================================================================================
+void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody,
+                                              const ListOfShape& theBaseShapes,
+                                              const ListOfShape& theTools,
+                                              const GeomMakeShapePtr& theMakeShape,
+                                              const GeomShapePtr theResultShape,
+                                              const std::string& theNamePrefix)
+{
+  theResultBody->storeModified(theBaseShapes, theResultShape, theMakeShape);
+
+  ListOfShape aShapes = theBaseShapes;
+  ListOfShape::const_iterator aToolIter = theTools.cbegin();
+  for(; aToolIter != theTools.cend(); aToolIter++)
+    aShapes.push_back(*aToolIter);
+
+  for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); ++anIter)
+  {
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::VERTEX, theNamePrefix);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::EDGE, theNamePrefix);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE, theNamePrefix);
+  }
+}
+
+//==================================================================================================
+void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody,
+                                              const GeomShapePtr& theBaseShape,
+                                              const GeomMakeShapePtr& theMakeShape,
+                                              const std::string theName)
 {
   switch(theBaseShape->shapeType()) {
     case GeomAPI_Shape::COMPOUND: {
       for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
       {
-        storeModifiedShapes(theAlgo,
-                            theResultBody,
-                            anIt.current(),
-                            theFaceTag,
-                            theEdgeTag,
-                            theVertexTag,
-                            theName,
-                            theSubShapes);
+        loadModifiedShapes(theResultBody,
+                           anIt.current(),
+                           theMakeShape,
+                           theName);
       }
       break;
     }
     case GeomAPI_Shape::COMPSOLID:
     case GeomAPI_Shape::SOLID:
     case GeomAPI_Shape::SHELL: {
-      theResultBody->loadAndOrientModifiedShapes(&theAlgo,
-                                theBaseShape, GeomAPI_Shape::FACE,
-                                theFaceTag, theName + "_Face", theSubShapes, false, true);
+      theResultBody->loadModifiedShapes(theMakeShape,
+                                        theBaseShape,
+                                        GeomAPI_Shape::FACE,
+                                        theName);
     }
     case GeomAPI_Shape::FACE:
     case GeomAPI_Shape::WIRE: {
-      theResultBody->loadAndOrientModifiedShapes(&theAlgo,
-                                theBaseShape, GeomAPI_Shape::EDGE,
-                                theEdgeTag, theName + "_Edge", theSubShapes, false, true);
+      theResultBody->loadModifiedShapes(theMakeShape,
+                                        theBaseShape,
+                                        GeomAPI_Shape::EDGE,
+                                        theName);
     }
     case GeomAPI_Shape::EDGE: {
-      theResultBody->loadAndOrientModifiedShapes(&theAlgo,
-                              theBaseShape, GeomAPI_Shape::VERTEX,
-                              theVertexTag, theName + "_Vertex", theSubShapes, false, true);
+      theResultBody->loadModifiedShapes(theMakeShape,
+                                        theBaseShape,
+                                        GeomAPI_Shape::VERTEX,
+                                        theName);
     }
   }
 }
+
+//==================================================================================================
+void FeaturesPlugin_Tools::loadDeletedShapes(ResultBodyPtr theResultBody,
+  const GeomShapePtr theBaseShape,
+  const ListOfShape& theTools,
+  const GeomMakeShapePtr& theMakeShape,
+  const GeomShapePtr theResultShapesCompound)
+{
+  ListOfShape aShapes = theTools;
+  if (theBaseShape.get())
+    aShapes.push_front(theBaseShape);
+
+  for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); anIter++)
+  {
+    theResultBody->loadDeletedShapes(theMakeShape,
+                                     *anIter,
+                                     GeomAPI_Shape::VERTEX,
+                                     theResultShapesCompound);
+    theResultBody->loadDeletedShapes(theMakeShape,
+                                     *anIter,
+                                     GeomAPI_Shape::EDGE,
+                                     theResultShapesCompound);
+    theResultBody->loadDeletedShapes(theMakeShape,
+                                     *anIter,
+                                     GeomAPI_Shape::FACE,
+                                     theResultShapesCompound);
+  }
+}
+
+//==================================================================================================
+void FeaturesPlugin_Tools::loadDeletedShapes(
+  std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
+  const ListOfShape& theTools,
+  const GeomShapePtr theResultShapesCompound)
+{
+  for (std::vector<ResultBaseAlgo>::iterator anIt = theResultBaseAlgoList.begin();
+       anIt != theResultBaseAlgoList.end();
+       ++anIt)
+  {
+    ResultBaseAlgo& aRCA = *anIt;
+    loadDeletedShapes(aRCA.resultBody,
+                      aRCA.baseShape,
+                      theTools,
+                      aRCA.makeShape,
+                      theResultShapesCompound);
+  }
+}
index 02a0b5e454b95a2b09a778e0ec165c77398b7805..dd04de569f511a3517ccc12b7604ac69afe31ea3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Tools_H_
 #define FeaturesPlugin_Tools_H_
 
-#include <GeomAlgoAPI_Translation.h>
+#include <GeomAlgoAPI_MakeShape.h>
+#include <ModelAPI_ResultBody.h>
 
-class ModelAPI_ResultBody;
+#include <vector>
 
 class FeaturesPlugin_Tools {
 public:
-  static void storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
-                                  std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                  std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                                  const int theFaceTag,
-                                  const int theEdgeTag,
-                                  const int theVertexTag,
-                                  const std::string theName,
-                                  GeomAPI_DataMapOfShapeShape& theSubShapes);
+  struct ResultBaseAlgo {
+    ResultBodyPtr resultBody;
+    GeomShapePtr baseShape;
+    GeomMakeShapePtr makeShape;
+  };
+
+public:
+  static void loadModifiedShapes(ResultBodyPtr theResultBody,
+                                 const ListOfShape& theBaseShapes,
+                                 const ListOfShape& theTools,
+                                 const GeomMakeShapePtr& theMakeShape,
+                                 const GeomShapePtr theResultShape,
+                                 const std::string& theNamePrefix = "");
+
+  static void loadModifiedShapes(ResultBodyPtr theResultBody,
+                                 const GeomShapePtr& theBaseShape,
+                                 const GeomMakeShapePtr& theMakeShape,
+                                 const std::string theName);
+    /// Stores deleted shapes.
+  static void loadDeletedShapes(ResultBodyPtr theResultBody,
+                                const GeomShapePtr theBaseShape,
+                                const ListOfShape& theTools,
+                                const GeomMakeShapePtr& theMakeShape,
+                                const GeomShapePtr theResultShapesCompound);
+
+  /// Stores deleted shapes.
+  static void loadDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
+                                const ListOfShape& theTools,
+                                const GeomShapePtr theResultShapesCompound);
 };
 
 #endif /* FeaturesPlugin_Tools_H_ */
index 0da4b6acc7fcfa4f99de679fa38c1efd7db4e183..eff54dc689f759480f280cca2cc47ef3a11f5a39 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <FeaturesPlugin_Translation.h>
 
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Trsf.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAlgoAPI_Tools.h>
 
 #include <FeaturesPlugin_Tools.h>
 
@@ -104,7 +105,6 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -112,25 +112,45 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance()
   }
 
   //Getting axis.
-  std::shared_ptr<GeomAPI_Ax1> anAxis;
-  std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
-    selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID());
-  if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
-  } else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
-             anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  AttributeSelectionPtr anObjRef = selection(AXIS_OBJECT_ID());
+  GeomShapePtr aShape = anObjRef->value();
+  if (!aShape.get()) {
+    if (anObjRef->context().get()) {
+      aShape = anObjRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
+
+  GeomEdgePtr anEdge;
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
-                                                          anEdge->line()->direction()));
+
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  std::shared_ptr<GeomAPI_Ax1> anAxis(new GeomAPI_Ax1(anEdge->line()->location(),
+                                                      anEdge->line()->direction()));
+
+
   // Getting distance.
   double aDistance = real(FeaturesPlugin_Translation::DISTANCE_ID())->value();
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -147,34 +167,32 @@ void FeaturesPlugin_Translation::performTranslationByAxisAndDistance()
       aResultPart->setTrsf(*aContext, aTrsf);
       setResult(aResultPart, aResultIndex);
     } else {
-      GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, anAxis, aDistance);
+      std::shared_ptr<GeomAlgoAPI_Translation> aTranslationAlgo(
+        new GeomAlgoAPI_Translation(aBaseShape, anAxis, aDistance));
 
-      if (!aTranslationAlgo.check()) {
-        setError(aTranslationAlgo.getError());
+      if (!aTranslationAlgo->check()) {
+        setError(aTranslationAlgo->getError());
         return;
       }
 
-      aTranslationAlgo.build();
+      aTranslationAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aTranslationAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Translation algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aTranslationAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aTranslationAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      loadNamingDS(aTranslationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               aShapes,
+                                               ListOfShape(),
+                                               aTranslationAlgo,
+                                               aTranslationAlgo->shape(),
+                                               "Translated");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -200,7 +218,6 @@ void FeaturesPlugin_Translation::performTranslationByDimensions()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -213,6 +230,7 @@ void FeaturesPlugin_Translation::performTranslationByDimensions()
   double aDZ = real(FeaturesPlugin_Translation::DZ_ID())->value();
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -229,34 +247,32 @@ void FeaturesPlugin_Translation::performTranslationByDimensions()
       aResultPart->setTrsf(*aContext, aTrsf);
       setResult(aResultPart, aResultIndex);
     } else {
-      GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, aDX, aDY, aDZ);
+      std::shared_ptr<GeomAlgoAPI_Translation> aTranslationAlgo(
+        new GeomAlgoAPI_Translation(aBaseShape, aDX, aDY, aDZ));
 
-      if (!aTranslationAlgo.check()) {
-        setError(aTranslationAlgo.getError());
+      if (!aTranslationAlgo->check()) {
+        setError(aTranslationAlgo->getError());
         return;
       }
 
-      aTranslationAlgo.build();
+      aTranslationAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aTranslationAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Translation algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aTranslationAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aTranslationAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      loadNamingDS(aTranslationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               aShapes,
+                                               ListOfShape(),
+                                               aTranslationAlgo,
+                                               aTranslationAlgo->shape(),
+                                               "Translated");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -282,7 +298,6 @@ void FeaturesPlugin_Translation::performTranslationByTwoPoints()
       anObjectsSelList->value(anObjectsIndex);
     std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
     if(!anObject.get()) { // may be for not-activated parts
-      eraseResults();
       return;
     }
     anObjects.push_back(anObject);
@@ -308,6 +323,7 @@ void FeaturesPlugin_Translation::performTranslationByTwoPoints()
   }
 
   // Moving each object.
+  std::string anError;
   int aResultIndex = 0;
   std::list<ResultPtr>::iterator aContext = aContextes.begin();
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
@@ -324,34 +340,32 @@ void FeaturesPlugin_Translation::performTranslationByTwoPoints()
       aResultPart->setTrsf(*aContext, aTrsf);
       setResult(aResultPart, aResultIndex);
     } else {
-      GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, aFirstPoint, aSecondPoint);
+      std::shared_ptr<GeomAlgoAPI_Translation> aTranslationAlgo(
+        new GeomAlgoAPI_Translation(aBaseShape, aFirstPoint, aSecondPoint));
 
-      if (!aTranslationAlgo.check()) {
-        setError(aTranslationAlgo.getError());
+      if (!aTranslationAlgo->check()) {
+        setError(aTranslationAlgo->getError());
         return;
       }
 
-      aTranslationAlgo.build();
+      aTranslationAlgo->build();
 
       // Checking that the algorithm worked properly.
-      if(!aTranslationAlgo.isDone()) {
-        static const std::string aFeatureError = "Error: Translation algorithm failed.";
-        setError(aFeatureError);
-        break;
-      }
-      if(aTranslationAlgo.shape()->isNull()) {
-        static const std::string aShapeError = "Error: Resulting shape is Null.";
-        setError(aShapeError);
-        break;
-      }
-      if(!aTranslationAlgo.isValid()) {
-        std::string aFeatureError = "Error: Resulting shape is not valid.";
-        setError(aFeatureError);
+      if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+        setError(anError);
         break;
       }
 
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      loadNamingDS(aTranslationAlgo, aResultBody, aBaseShape);
+
+      ListOfShape aShapes;
+      aShapes.push_back(aBaseShape);
+      FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+                                               aShapes,
+                                               ListOfShape(),
+                                               aTranslationAlgo,
+                                               aTranslationAlgo->shape(),
+                                               "Translated");
       setResult(aResultBody, aResultIndex);
     }
     aResultIndex++;
@@ -360,19 +374,3 @@ void FeaturesPlugin_Translation::performTranslationByTwoPoints()
   // Remove the rest results if there were produced in the previous pass.
   removeResults(aResultIndex);
 }
-
-//=================================================================================================
-void FeaturesPlugin_Translation::loadNamingDS(GeomAlgoAPI_Translation& theTranslationAlgo,
-                                              std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                              std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
-  // Store result.
-  theResultBody->storeModified(theBaseShape, theTranslationAlgo.shape());
-
-  std::string aTranslatedName = "Translated";
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTranslationAlgo.mapOfSubShapes();
-
-  FeaturesPlugin_Tools::storeModifiedShapes(theTranslationAlgo, theResultBody,
-                                            theBaseShape, 1, 2, 3, aTranslatedName,
-                                            *aSubShapes.get());
-}
index 191f208ab2201124903c1d1c31d31c0422d3f4e0..257c681e09ca47bb78a14d0643e0f57f4c8056f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Translation_H_
@@ -149,10 +148,6 @@ private:
 
   ///Perform the translation usind two points
   void performTranslationByTwoPoints();
-
-  void loadNamingDS(GeomAlgoAPI_Translation& theTranslationAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
 };
 
 #endif
index 775da23a3416a93956b2801ec6f296d7a5165766..1a33cb12ada01d83f71cabc79b52ff6f4fa5e3ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Union.h"
@@ -23,6 +22,7 @@
 #include <GeomAlgoAPI_Boolean.h>
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_PaveFiller.h>
+#include <GeomAlgoAPI_Tools.h>
 #include <GeomAlgoAPI_UnifySameDomain.h>
 
 #include <GeomAPI_ShapeExplorer.h>
@@ -109,6 +109,7 @@ void FeaturesPlugin_Union::execute()
   }
 
   // Fuse objects.
+  std::string anError;
   std::shared_ptr<GeomAlgoAPI_MakeShape> anAlgo;
   ListOfShape aTools;
   if (anObjects.front()->shapeType() == GeomAPI_Shape::SOLID) {
@@ -121,23 +122,15 @@ void FeaturesPlugin_Union::execute()
   }
 
   // Checking that the algorithm worked properly.
-  GeomAlgoAPI_MakeShapeList aMakeShapeList;
+  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
   GeomAPI_DataMapOfShapeShape aMapOfShapes;
-  if(!anAlgo->isDone()) {
-    setError("Error: Boolean algorithm failed.");
-    return;
-  }
-  if(anAlgo->shape()->isNull()) {
-    setError("Error: Resulting shape is Null.");
-    return;
-  }
-  if(!anAlgo->isValid()) {
-    setError("Error: Resulting shape is not valid.");
+  if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(anAlgo, getKind(), anError)) {
+    setError(anError);
     return;
   }
 
   GeomShapePtr aShape = anAlgo->shape();
-  aMakeShapeList.appendAlgo(anAlgo);
+  aMakeShapeList->appendAlgo(anAlgo);
   aMapOfShapes.merge(anAlgo->mapOfSubShapes());
 
   // Store original shapes for naming.
@@ -149,44 +142,25 @@ void FeaturesPlugin_Union::execute()
     aShapesToAdd.push_back(aShape);
     std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
       new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
-    if(!aFillerAlgo->isDone()) {
-      setError("Error: PaveFiller algorithm failed.");
-      return;
-    }
-    if(aFillerAlgo->shape()->isNull()) {
-      setError("Error: Resulting shape is Null.");
-      return;
-    }
-    if(!aFillerAlgo->isValid()) {
-      setError("Error: Resulting shape is not valid.");
+    if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aFillerAlgo, getKind(), anError)) {
+      setError(anError);
       return;
     }
 
     aShape = aFillerAlgo->shape();
-    aMakeShapeList.appendAlgo(aFillerAlgo);
+    aMakeShapeList->appendAlgo(aFillerAlgo);
     aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
   }
   // workaround: make copy to name edges correctly
 
   // Store result and naming.
-  const int aModifyEdgeTag = 1;
-  const int aModifyFaceTag = 2;
-  const int aDeletedTag = 3;
-  /// sub solids will be placed at labels 4, 5 etc. if result is compound of solids
-  const int aSubsolidsTag = 4;
-  const std::string aModEName = "Modified_Edge";
-  const std::string aModFName = "Modified_Face";
 
   std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data());
-  aResultBody->storeModified(anObjects.front(), aShape, aSubsolidsTag);
+  aResultBody->storeModified(anObjects.front(), aShape);
 
   for(ListOfShape::const_iterator anIter = anObjects.begin(); anIter != anObjects.end(); ++anIter) {
-    aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::EDGE,
-                                             aModifyEdgeTag, aModEName, aMapOfShapes,
-                                             false, true, true);
-    aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE,
-                                             aModifyFaceTag, aModFName, aMapOfShapes,
-                                             false, true, true);
+    aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::EDGE);
+    aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::FACE);
     //aResultBody->loadDeletedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
   }
 
index d3b58c807c227519d2faaa6bdb4ae557da706db5..f0bd1d7220872379c50955bcd8118ccb4cf26b8c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Union_H_
old mode 100755 (executable)
new mode 100644 (file)
index 694915d..03a55a6
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_ValidatorTransform.h"
@@ -34,9 +33,11 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute
   bool aValid = true;
   std::string anAttributeType = theAttribute->attributeType();
   if (anAttributeType != ModelAPI_AttributeSelectionList::typeId()) {
+// LCOV_EXCL_START
     theError = "The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::shared_ptr<ModelAPI_AttributeSelectionList> aCurSelList =
old mode 100755 (executable)
new mode 100644 (file)
index c06e1a0..6dffcc2
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_ValidatorTransform_H
index aa78551d6b665e30f0dcf7a03d678694efa7bb1a..ee82a62f5c8c415cd3a897a4818c44d102358822 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "FeaturesPlugin_Validators.h"
@@ -68,8 +67,10 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
   AttributeSelectionPtr aPathAttrSelection =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
   if(!aPathAttrSelection.get()) {
+// LCOV_EXCL_START
     theError = "Error: This validator can only work with path selector in \"Pipe\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   GeomShapePtr aPathShape = aPathAttrSelection->value();
@@ -96,17 +97,21 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const AttributePtr& theAttri
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list attributes in \"Pipe\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
   std::shared_ptr<FeaturesPlugin_Pipe> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Pipe>(theAttribute->owner());
 
   AttributeSelectionPtr aPathSelection = aFeature->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID());
   if (!aPathSelection.get()) {
+// LCOV_EXCL_START
     theError = "Error: Path not selected.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   GeomShapePtr aPathShape = aPathSelection->value();
@@ -161,6 +166,7 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const AttributePtr& theAttri
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorPipeLocationsNumber::isValid(
   const std::shared_ptr<ModelAPI_Feature>& theFeature,
   const std::list<std::string>& theArguments,
@@ -209,16 +215,19 @@ bool FeaturesPlugin_ValidatorPipeLocationsNumber::isValid(
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theAttribute,
                                                         const std::list<std::string>& theArguments,
                                                         Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(theArguments.empty()) {
     theError = "Error: Validator parameters is empty.";
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Checking attribute.
   if(!isValidAttribute(theAttribute, theArguments, theError)) {
@@ -245,7 +254,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA
         std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
       if(!aResultConstruction.get()) {
         // It is not a result construction.
-        // If shape is compound check that it contains only faces and edges.
+        // If shape is compound check that it contains only faces, edges or vertices.
         GeomShapePtr aShape = aSelectionAttr->value();
         if(!aShape.get()) {
           if (aContext.get()) {
@@ -259,9 +268,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA
         if(aShape->shapeType() == GeomAPI_Shape::COMPOUND) {
           for(GeomAPI_ShapeIterator anIt(aShape); anIt.more(); anIt.next()) {
             GeomShapePtr aSubShape = anIt.current();
-            if(aSubShape->shapeType() != GeomAPI_Shape::EDGE
+            if(aSubShape->shapeType() != GeomAPI_Shape::VERTEX
+                && aSubShape->shapeType() != GeomAPI_Shape::EDGE
                 && aSubShape->shapeType() != GeomAPI_Shape::FACE) {
-              theError = "Error: Compound should contain only faces and edges.";
+              theError = "Error: Compound should contain only faces, edges or vertices.";
               return false;
             }
           }
@@ -309,9 +319,11 @@ bool FeaturesPlugin_ValidatorBaseForGenerationSketchOrSketchObjects::isValid(
 
   AttributeSelectionListPtr aListAttr = theFeature->selectionList(aBaseObjectsID);
   if(!aListAttr.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get \"%1\" attribute.";
     theError.arg(aBaseObjectsID);
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::set<ResultConstructionPtr> aSelectedSketches;
@@ -369,8 +381,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
                                                         Events_InfoMessage& theError) const
 {
   if(!theAttribute.get()) {
+// LCOV_EXCL_START
     theError = "Error: Empty attribute.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::string anAttributeType = theAttribute->attributeType();
@@ -411,7 +425,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     if (aContext.get())
       aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
     if(aConstruction.get()) {
-      // Construciotn selected. Check that is is not infinite.
+      // Construction selected. Check that it is not infinite.
       if(aConstruction->isInfinite()) {
         theError = "Error: Infinite constructions is not allowed as base.";
         return false;
@@ -430,7 +444,6 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
           return true;
         }
       }
-
       return false;
     }
 
@@ -458,15 +471,18 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute
     }
 
   } else {
+// LCOV_EXCL_START
     theError = "Error: Attribute \"%1\" does not supported by this validator.";
     theError.arg(anAttributeType);
     return false;
+// LCOV_EXCL_STOP
   }
 
   return true;
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theAttribute,
                                                         const std::list<std::string>& theArguments,
                                                         Events_InfoMessage& theError) const
@@ -513,6 +529,7 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA
   bool aValid = !aFeatureKind && aPlanarFace;
   return aValid;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
@@ -521,8 +538,10 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
                                                Events_InfoMessage& theError) const
 {
   if(theArguments.size() != 2) {
+// LCOV_EXCL_START
     theError = "Error: Validator should be used with 2 parameters for extrusion.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::list<std::string>::const_iterator
@@ -547,10 +566,16 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
       if(aContext.get()) {
         aDirShape = aContext->shape();
       }
+
+      if (aDirShape.get() && aDirShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aDirShape);
+        aDirShape = anIt.current();
+      }
     }
   }
 
-  if(!aDirShape.get()) {
+  if(!aDirShape.get() || aDirShape->isNull() ||
+     aDirShape->shapeType() != GeomAPI_Shape::EDGE) {
     // Check that dir can be empty.
     if(!isShapesCanBeEmpty(aCheckAttribute, theError)) {
       theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" "
@@ -615,9 +640,11 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
 bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr& theAttribute,
                                                               Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(!theAttribute.get()) {
     return true;
   }
+// LCOV_EXCL_STOP
 
   std::string anAttributeType = theAttribute->attributeType();
   if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
@@ -667,9 +694,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
   std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theAttribute->owner());
@@ -756,9 +785,11 @@ bool FeaturesPlugin_ValidatorFilletSelection::isValid(const AttributePtr& theAtt
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list attributes in \"Fillet\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
@@ -819,8 +850,10 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError = "Error: This validator can only work with selection list in \"Partition\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
@@ -877,9 +910,11 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
   AttributeSelectionListPtr aSubShapesAttrList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if(!aSubShapesAttrList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
     return false;
+// LCOV_EXCL_STOP
   }
 
   static const std::string aBaseShapeID = "base_shape";
@@ -887,9 +922,11 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
   AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID);
 
   if(!aShapeAttrSelection.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get \"%1\" attribute.";
     theError.arg(aBaseShapeID);
     return false;
+// LCOV_EXCL_STOP
   }
 
   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
@@ -936,6 +973,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
   static const std::string aBaseShapeID = "base_shape";
   static const std::string aSubShapesID = "subshapes_to_keep";
 
+// LCOV_EXCL_START
   if(theFeature->getKind() != "Remove_SubShapes") {
     theError = "Error: Feature \"%1\" does not supported by this validator.";
     theError.arg(theFeature->getKind());
@@ -955,6 +993,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
     theError.arg(aSubShapesID);
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Copy base shape.
   GeomShapePtr aBaseShape = aShapeAttrSelection->value();
@@ -986,6 +1025,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttribute,
                                                      const std::list<std::string>& theArguments,
                                                      Events_InfoMessage& theError) const
@@ -1035,6 +1075,7 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorUnionArguments::isValid(
@@ -1042,6 +1083,7 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   // Check feature kind.
   if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
     theError = "Error: This validator supports only \"%1\" feature.";
@@ -1057,6 +1099,7 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
     theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID());
     return false;
   }
+// LCOV_EXCL_STOP
 
   // Get all shapes.
   GeomAPI_Shape::ShapeType aType = GeomAPI_Shape::COMPSOLID;
@@ -1074,14 +1117,10 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(
 
   // Make compound and find connected.
   GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseShapesList);
-  ListOfShape aCombined, aFree;
-  GeomAlgoAPI_ShapeTools::combineShapes(
-    aCompound,
-    aType,
-    aCombined,
-    aFree);
-
-  if(aFree.size() > 0 || aCombined.size() > 1) {
+  ListOfShape aResults;
+  GeomAlgoAPI_ShapeTools::combineShapes(aCompound, aType, aResults);
+
+  if(aResults.size() > 1 || (aResults.size() == 1 && aResults.front()->shapeType() > aType)) {
     theError = "Error: Not all shapes have shared topology.";
     return false;
   }
@@ -1094,9 +1133,11 @@ bool FeaturesPlugin_ValidatorConcealedResult::isValid(const AttributePtr& theAtt
                                             Events_InfoMessage& theError) const
 {
   if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
+// LCOV_EXCL_START
     theError = "Error: The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return false;
+// LCOV_EXCL_STOP
   }
 
   AttributeReferencePtr aRefAttribute = std::dynamic_pointer_cast<ModelAPI_AttributeReference>
@@ -1157,81 +1198,52 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.size() != 2)
   {
     theError = "Wrong number of arguments (expected 2).";
     return false;
   }
+// LCOV_EXCL_STOP
 
-  int anObjectsNb = 0, aToolsNb = 0;
-  //int anOperationType = 0;
+  int anObjectsToolsNb[2] = { 0,  0 };
 
   std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
 
   bool isAllInSameCompSolid = true;
   ResultBodyPtr aCompSolid;
 
-  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    anObjectsNb = anAttrSelList->size();
-    for (int anIndex = 0; anIndex < anObjectsNb; ++anIndex)
-    {
-      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-      ResultPtr aContext = anAttr->context();
-      ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-      if (aResCompSolidPtr.get())
-      {
-        if (aCompSolid.get())
-        {
-          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
-        }
-        else
-        {
-          aCompSolid = aResCompSolidPtr;
-        }
-      }
-      else
-      {
-        isAllInSameCompSolid = false;
-        break;
-      }
-    }
-  }
-  anIt++;
-
-
-  anAttrSelList = theFeature->selectionList(*anIt);
-  if (anAttrSelList)
-  {
-    aToolsNb = anAttrSelList->size();
-    if (isAllInSameCompSolid)
+  for (int* anArgNbIt = anObjectsToolsNb; anIt != aLast; ++anIt, ++anArgNbIt) {
+    AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+    if (anAttrSelList)
     {
-      for (int anIndex = 0; anIndex < aToolsNb; ++anIndex)
-      {
-        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-        ResultPtr aContext = anAttr->context();
-        ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-        if (aResCompSolidPtr.get())
+      *anArgNbIt = anAttrSelList->size();
+      if (isAllInSameCompSolid) {
+        for (int anIndex = 0; anIndex < *anArgNbIt; ++anIndex)
         {
-          if (aCompSolid.get())
+          AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+          ResultPtr aContext = anAttr->context();
+          ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
+          if (aResCompSolidPtr.get())
           {
-            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            if (aCompSolid.get())
+            {
+              isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+            }
+            else
+            {
+              aCompSolid = aResCompSolidPtr;
+            }
           }
           else
           {
-            aCompSolid = aResCompSolidPtr;
+            isAllInSameCompSolid = false;
+            break;
           }
         }
-        else
-        {
-          isAllInSameCompSolid = false;
-          break;
-        }
       }
     }
   }
-  anIt++;
 
   std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theFeature);
@@ -1240,7 +1252,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   if (anOperationType == FeaturesPlugin_Boolean::BOOL_FUSE)
   {
     // Fuse operation
-    if (anObjectsNb + aToolsNb < 2)
+    if (anObjectsToolsNb[0] + anObjectsToolsNb[1] < 2)
     {
       theError = "Not enough arguments for Fuse operation.";
       return false;
@@ -1253,12 +1265,12 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
   }
   else
   {
-    if (anObjectsNb < 1)
+    if (anObjectsToolsNb[0] < 1) // check number of objects
     {
       theError = "Objects not selected.";
       return false;
     }
-    if (aToolsNb < 1)
+    if (anObjectsToolsNb[1] < 1) // check number of tools
     {
       theError = "Tools not selected.";
       return false;
@@ -1274,6 +1286,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
 }
 
 //=================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFeature,
                                                                std::string theAttribute)
 {
@@ -1284,6 +1297,7 @@ bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFe
 
   return false;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
 bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
@@ -1297,9 +1311,11 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
   AttributeSelectionListPtr anAttrSelectionList =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
   if (!aFeature.get() || !anAttrSelectionList.get()) {
+// LCOV_EXCL_START
     theError =
       "Error: Validator used in wrong feature or attribute";
     return false;
+// LCOV_EXCL_STOP
   }
 
   AttributeSelectionListPtr anOtherAttrSelectionList;
@@ -1325,9 +1341,12 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
 
     ResultPtr aContext = anAttrSelection->context();
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
-    GeomShapePtr aContextShape = aContext->shape();
     if (!aShape.get()) {
-      aShape = aContextShape;
+      if (!aContext.get()) {
+        theError = "Error: Empty selection.";
+        return false;
+      }
+      aShape = aContext->shape();
     }
 
     if (aShape->isSolid() || aShape->isCompSolid()) {
@@ -1407,15 +1426,6 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
         theError = "Error: Selected shapes should have the same type.";
         return false;
       }
-
-      ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
-      if (aResCompSolidPtr.get()) {
-        GeomShapePtr aCompSolidShape = aResCompSolidPtr->shape();
-        if (aSelectedCompSolidsInOtherList.isBound(aCompSolidShape)) {
-          theError = "Error: Solids from compsolid in other list not allowed.";
-          return false;
-        }
-      }
     } else {
       GeomAPI_Face aFace(aShape);
       GeomPlanePtr aPln = aFace.getPlane();
@@ -1436,6 +1446,7 @@ bool FeaturesPlugin_ValidatorBooleanSmashSelection::isValid(
 }
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_IntersectionSelection::isValid(const AttributePtr& theAttribute,
                                                    const std::list<std::string>& theArguments,
                                                    Events_InfoMessage& theError) const
@@ -1504,8 +1515,10 @@ bool FeaturesPlugin_IntersectionSelection::isValid(const AttributePtr& theAttrib
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanFuseSelection::isValid(
   const AttributePtr& theAttribute,
   const std::list<std::string>& theArguments,
@@ -1557,6 +1570,7 @@ bool FeaturesPlugin_ValidatorBooleanFuseSelection::isValid(
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //=================================================================================================
 bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid(
@@ -1564,10 +1578,12 @@ bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid(
   const std::list<std::string>& theArguments,
   Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.size() != 2) {
     theError = "Wrong number of arguments (expected 2).";
     return false;
   }
+// LCOV_EXCL_STOP
 
   std::shared_ptr<FeaturesPlugin_BooleanFuse> aFeature =
     std::dynamic_pointer_cast<FeaturesPlugin_BooleanFuse>(theFeature);
@@ -1639,6 +1655,7 @@ bool FeaturesPlugin_ValidatorBooleanFuseArguments::isValid(
 }
 
 //=================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanFuseArguments::isNotObligatory(
   std::string theFeature,
   std::string theAttribute)
@@ -1649,8 +1666,10 @@ bool FeaturesPlugin_ValidatorBooleanFuseArguments::isNotObligatory(
 
   return false;
 }
+// LCOV_EXCL_STOP
 
 //==================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
   const AttributePtr& theAttribute,
   const std::list<std::string>& theArguments,
@@ -1708,6 +1727,7 @@ bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
 
   return true;
 }
+// LCOV_EXCL_STOP
 
 //=================================================================================================
 bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid(
@@ -1716,8 +1736,10 @@ bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid(
   Events_InfoMessage& theError) const
 {
   if (theArguments.size() != 2) {
+// LCOV_EXCL_START
     theError = "Wrong number of arguments (expected 2).";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::shared_ptr<FeaturesPlugin_BooleanCommon> aFeature =
@@ -1754,9 +1776,11 @@ bool FeaturesPlugin_ValidatorBooleanCommonArguments::isValid(
 }
 
 //=================================================================================================
+// LCOV_EXCL_START
 bool FeaturesPlugin_ValidatorBooleanCommonArguments::isNotObligatory(
   std::string theFeature,
   std::string theAttribute)
 {
   return false;
 }
+// LCOV_EXCL_STOP
index 7b81dfb4708a34159a0f8ddc3a2b8c49d36e412b..a0a4006b5902c8ed3fba385373531d35dfcb55ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_Validators_H_
index aa489e3434478293e2c113f0f86cb64313399a84..0caebe362d418c7fe24000cbbeb1ccd5048a2b95 100644 (file)
   <context>
     <name>Extrusion:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>ExtrusionCut:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>Revolution:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>RevolutionCut:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>ExtrusionFuse:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>RevolutionFuse:base:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
   <context>
     <name>Pipe:base_objects:FeaturesPlugin_ValidatorBaseForGeneration</name>
     <message>
-      <source>Error: Compound should contain only faces and edges.</source>
-      <translation>Compound should contain only faces and edges.</translation>
+      <source>Error: Compound should contain only faces, edges or vertices.</source>
+      <translation>Compound should contain only faces, edges or vertices.</translation>
     </message>
   </context>
   <context>
index a9d0762a96791ab2139ecaa7924c286ce3ceabb9..287caa88ca7bf7ddaf3b637ee164d2d6c2ac90dc 100644 (file)
@@ -1,25 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
-from SketchAPI import *
 
 from salome.shaper import model
 
@@ -30,7 +28,7 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "OZ"), False
 SketchLine_1 = SketchProjection_1.createdFeature()
 SketchLine_1.setName("SketchLine_5")
 SketchLine_1.result().setName("SketchLine_5")
-SketchLine_2 = Sketch_1.addLine(0.008, 0.0005000000000000006, 0.0075, -1.258295422426014e-035)
+SketchLine_2 = Sketch_1.addLine(0.008, 0.0005000000000000006, 0.0075, -1.258295422426014e-35)
 SketchLine_2.setName("SketchLine_9")
 SketchLine_2.result().setName("SketchLine_9")
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "OX"), False)
@@ -39,7 +37,7 @@ SketchLine_3.setName("SketchLine_10")
 SketchLine_3.result().setName("SketchLine_10")
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.result())
 SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_12")
-SketchLine_4 = Sketch_1.addLine(0.0075, -1.258295422426014e-035, 0.005, 0)
+SketchLine_4 = Sketch_1.addLine(0.0075, -1.258295422426014e-35, 0.005, 0)
 SketchLine_4.setName("SketchLine_11")
 SketchLine_4.result().setName("SketchLine_11")
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_4.startPoint())
@@ -60,7 +58,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_5.result())
 SketchConstraintVertical_1.setName("SketchConstraintVertical_3")
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_6.result())
 SketchConstraintHorizontal_1.setName("SketchConstraintHorizontal_3")
-SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_2.result(), 45)
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_2.result(), 45.00000000000001)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_5.result(), 0.02)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), 0.005)
 SketchConstraintLength_2.setName("SketchConstraintLength_4")
@@ -95,14 +93,14 @@ SketchLine_11.setName("SketchLine_16")
 SketchLine_11.result().setName("SketchLine_16")
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
 SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_17")
-SketchLine_12 = Sketch_1.addLine(0.008999999999999999, 0.042, -5.446629538236431e-036, 0.042)
+SketchLine_12 = Sketch_1.addLine(0.008999999999999999, 0.042, -5.446629538236431e-36, 0.042)
 SketchLine_12.setName("SketchLine_17")
 SketchLine_12.result().setName("SketchLine_17")
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
 SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_18")
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_19")
-SketchLine_13 = Sketch_1.addLine(-5.446629538236431e-036, 0.042, 0, 0.02)
+SketchLine_13 = Sketch_1.addLine(-5.446629538236431e-36, 0.042, 0, 0.02)
 SketchLine_13.setName("SketchLine_18")
 SketchLine_13.result().setName("SketchLine_18")
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
@@ -141,16 +139,16 @@ SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_22")
 model.do()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_9r-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_7f-SketchLine_8f-SketchArc_1_2r-SketchLine_14f-SketchArc_2_2r-SketchLine_15f-SketchLine_16f-SketchLine_17f-SketchLine_18f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_7f-SketchLine_8f-SketchArc_1_2r-SketchLine_14f-SketchArc_2_2r-SketchLine_15f-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_9r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
-SketchLine_14 = Sketch_2.addLine(-5.446629538236431e-036, 0.042, 5.172728347136208e-022, 0.03963932022500211)
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/Vertex-SketchLine_18s-SketchLine_17e"), False)
+SketchLine_14 = Sketch_2.addLine(-5.446629538236431e-36, 0.042, 5.172728347136208e-22, 0.03963932022500211)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/SketchLine_17_EndVertex"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchPoint_1.result())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_18"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/Sketch_1/SketchLine_18"), False)
 SketchLine_15 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_15.result())
-SketchArc_3 = Sketch_2.addArc(0.02, 0.062, 5.172728347136208e-022, 0.03963932022500211, 0.02, 0.032, False)
+SketchArc_3 = Sketch_2.addArc(0.02, 0.062, 5.172728347136208e-22, 0.03963932022500211, 0.02, 0.032, False)
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchArc_3.startPoint())
 SketchLine_16 = Sketch_2.addLine(0.02, 0.032, 0.02, 0.042)
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_16.startPoint())
@@ -166,9 +164,9 @@ SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"
 SketchLine_18 = SketchProjection_5.createdFeature()
 SketchConstraintDistance_7 = Sketch_2.setDistance(SketchLine_18.result(), SketchArc_3.center(), 0.062, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchArc_1_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 0.008999999999999999, 0.008999999999999999)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 0.008999999999999999, 0.008999999999999999)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
-Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_13"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_7"))
 RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 10, 28, [model.selection("SOLID", "Fuse_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_19 = Sketch_3.addLine(0.029, 0.042, 0.029, 0.03267384683690003)
@@ -183,7 +181,7 @@ SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_19.result())
 SketchLine_21 = Sketch_3.addLine(0.008999999999999999, 0.042, 0.029, 0.042)
 SketchLine_21.setName("SketchLine_9")
 SketchLine_21.result().setName("SketchLine_9")
-SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_22 = SketchProjection_6.createdFeature()
 SketchLine_22.setName("SketchLine_10")
 SketchLine_22.result().setName("SketchLine_10")
@@ -195,9 +193,11 @@ SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_21.startPoint
 SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_11")
 SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_21.result())
 SketchConstraintAngle_2 = Sketch_3.setAngle(SketchLine_20.result(), SketchLine_21.result(), 25)
-SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/Vertex-SketchLine_17s-SketchLine_16e"), False)
+SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "PartSet/Sketch_1/SketchLine_16_EndVertex"), False)
+SketchPoint_2 = SketchProjection_7.createdFeature()
 SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_21.result(), 0.02)
 RevolutionCut_1.setNestedSketch(Sketch_3)
+model.do()
 model.end()
 
 # check that result was created
index 9347af3ff51c162aafb42bb4ae0af0c29587568d..5c5e1811381c02dc280fd85df503c8dd35bb5379 100644 (file)
@@ -1,32 +1,30 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
-# Create document
 model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-
-# Create base and path for pipe
 Point_2 = model.addPoint(Part_1_doc, 5, 20, 0)
 Point_3 = model.addPoint(Part_1_doc, 0, 40, 30)
 Point_4 = model.addPoint(Part_1_doc, 10, 50, 70)
@@ -59,7 +57,7 @@ SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_2.results()[1], Sketch
 SketchConstraintRigid_1 = Sketch_1.setFixed(SketchArc_1.startPoint())
 SketchConstraintRigid_2 = Sketch_1.setFixed(SketchLine_2.endPoint())
 model.do()
-Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")]
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchArc_1_2")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_4 = Sketch_2.addLine(9.525599451781, 2.539525405208, -21.231656152164, 2.539525405208)
@@ -87,18 +85,11 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_5.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_6.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_7.result())
 model.do()
-
-# Create pipe on the entire path (big pipe)
 Pipe_1 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("WIRE", "Wire_1_1"))
-
-# Create pipe on the fisrt segment of the path (small pipe)
-Pipe_2 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2"))
-
-# Cut big pipe from the small pipe
+Pipe_2 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_1/SketchArc_2_2"))
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Pipe_2_1")], [model.selection("SOLID", "Pipe_1_1")])
 model.do()
+model.end()
 
 # Check that the small pipe is a part of the big one
 assert(len(Cut_1.results()) == 0)
-
-model.end()
index 3fe9e47ee38298292739b4d0d4c192efd91bfb1a..2f22b1ba119aabe4c698e944ef8811e2f9023da9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # The test for correct selection of a whole feautre as argument of other feature: select all extrusions
 # produced from the scetch, then change the number of sketch contours, so, anytway all extrusions must
@@ -60,28 +59,28 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "Lgz")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), "Lgx")
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "Ray")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchArc_1_2f-SketchLine_4r-SketchLine_6r")], model.selection(), 0, "Lgy")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_4r-SketchArc_1_2f-SketchLine_3r-SketchLine_1r")], model.selection(), 0, "Lgy")
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"))
 SketchLine_7 = Sketch_2.addLine(0, -75, 0, 0)
-SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False)
 SketchPoint_2 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchPoint_2.result())
-SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"), False)
 SketchPoint_3 = SketchProjection_5.createdFeature()
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_3.result())
 SketchLine_8 = Sketch_2.addLine(0, 0, 60, 0)
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
-SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/From_Face]"), False)
 SketchPoint_4 = SketchProjection_6.createdFeature()
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchPoint_4.result())
 SketchLine_9 = Sketch_2.addLine(60, 0, 59.99999999999999, -62.5)
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
-SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/From_Face]"), False)
 SketchLine_10 = SketchProjection_7.createdFeature()
 SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.result())
 SketchLine_11 = Sketch_2.addLine(0, -75, 47.49999999999999, -75)
 SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_11.startPoint())
-SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"), False)
+SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), False)
 SketchLine_12 = SketchProjection_8.createdFeature()
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.result())
 SketchArc_2 = Sketch_2.addArc(47.49999999999999, -62.5, 59.99999999999999, -62.5, 47.49999999999999, -75, True)
@@ -91,8 +90,9 @@ SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchArc_2.endPoint(),
 SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_11.result())
 SketchConstraintTangent_4 = Sketch_2.setTangent(SketchLine_9.result(), SketchArc_2.results()[1])
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_11f-SketchArc_2_2f")], model.selection(), 0, "Lgx")
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchArc_2_2f-SketchLine_9r-SketchLine_8r-SketchLine_7r")], model.selection(), 0, "Lgx")
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
+model.do()
 model.end()
 
 assert(len(Common_1.results()) == 1)
diff --git a/src/FeaturesPlugin/Test/Test1876.py b/src/FeaturesPlugin/Test/Test1876.py
new file mode 100644 (file)
index 0000000..47709b5
--- /dev/null
@@ -0,0 +1,72 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(396.8373493975904, 115.9638554216867, -225.1506024096385, 115.9638554216867)
+SketchLine_2 = Sketch_1.addLine(-225.1506024096385, 115.9638554216867, -225.1506024096385, -149.0963855421687)
+SketchLine_3 = Sketch_1.addLine(-225.1506024096385, -149.0963855421687, 396.8373493975904, -149.0963855421687)
+SketchLine_4 = Sketch_1.addLine(396.8373493975904, -149.0963855421687, 396.8373493975904, 115.9638554216867)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_2.addCircle(-348.644578313253, 155.1204819277109, 207.6894050099908)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 100, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
+model.end()
+
+# move groups
+model.begin()
+Part_1_doc.moveFeature(Group_1.feature(), Partition_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# check each group contain two results: one is related to original body only, another - common part
+
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Group_1.feature()))
+assert(aFactory.validate(Group_2.feature()))
+aList1 = Group_1.feature().selectionList("group_list")
+aList2 = Group_2.feature().selectionList("group_list")
+assert(aList1.size() == 2)
+assert(aList2.size() == 2)
+assert(aList1.value(0).value().shapeTypeStr() == "SOLID")
+assert(aList1.value(1).value().shapeTypeStr() == "SOLID")
+assert(aList2.value(0).value().shapeTypeStr() == "SOLID")
+assert(aList2.value(1).value().shapeTypeStr() == "SOLID")
+assert(aList1.value(0).value().isSame(aList2.value(0).value()) or aList1.value(1).value().isSame(aList2.value(0).value()) or
+aList1.value(0).value().isSame(aList2.value(1).value()) or aList1.value(1).value().isSame(aList2.value(1).value()))
index 3d4de21bfc2ccac3a36cfb4cacc775594b39895a..de2a1fa4d6e1db464a7a18fd95be23e7b575c4d7 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -33,7 +34,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_2 = Sketch_2.addCircle(-111.0503834053735, -148.4878232655183, 89.21253106334201)
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1"), model.selection("COMPOUND", "Sketch_2")], model.selection(), 10, 0)
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_1_2_1")], [model.selection("SOLID", "Extrusion_1_1")])
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
+model.do()
 model.end()
 
 assert(model.checkPythonDump())
index 8b1fc660b7715b59a850e78602b78790d4e0671c..12e01b5ca1417a215c2fb3a650d32ae97e4a3370 100644 (file)
@@ -1,24 +1,24 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
-from ModelAPI import *
 from salome.shaper import model
 
 model.begin()
@@ -90,45 +90,47 @@ SketchPoint_11 = Sketch_1.addPoint(-342.6051560379917, -180.9380775505472)
 SketchPoint_11.setName("SketchPoint_13")
 SketchPoint_11.result().setName("SketchPoint_13")
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_11.coordinates(), SketchLine_5.result())
-SketchPoint_12 = Sketch_1.addPoint(-584.124830393487, -180.9380775505472)
+SketchPoint_12 = Sketch_1.addPoint(-584.1248303934869, -180.9380775505472)
 SketchPoint_12.setName("SketchPoint_14")
 SketchPoint_12.result().setName("SketchPoint_14")
 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchPoint_12.coordinates(), SketchLine_5.result())
 model.do()
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_7"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_11"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_10"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_8"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_9"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchLine_1e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_13"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_6e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_14"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_6"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_5")])
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2"), model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4"), model.selection("VERTEX", "Vertex_1_5"), model.selection("VERTEX", "Vertex_1_6"), model.selection("VERTEX", "Vertex_1_7"), model.selection("VERTEX", "Vertex_1_8"), model.selection("VERTEX", "Vertex_1_9"), model.selection("VERTEX", "Vertex_1_10"), model.selection("VERTEX", "Vertex_1_11"), model.selection("VERTEX", "Vertex_1_12"), model.selection("VERTEX", "Vertex_1_13"), model.selection("VERTEX", "Vertex_1_14"), model.selection("VERTEX", "Vertex_1_15"), model.selection("VERTEX", "Vertex_1_16"), model.selection("VERTEX", "Vertex_1_17"), model.selection("VERTEX", "Vertex_1_18")], model.selection("EDGE", "PartSet/OZ"), 100, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_1_12/To_Vertex_1"), model.selection("VERTEX", "Extrusion_1_13/To_Vertex_1"), model.selection("VERTEX", "Extrusion_1_3/To_Vertex_1"))
+Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_7"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_11"), model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_10"), model.selection("VERTEX", "Sketch_1/SketchPoint_8"), model.selection("VERTEX", "Sketch_1/SketchPoint_9"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_13"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchPoint_14"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_6"), model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_4"), model.selection("VERTEX", "Sketch_1/SketchPoint_5")]
+Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects)
+Extrusion_1_objects = [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2"), model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4"), model.selection("VERTEX", "Vertex_1_5"), model.selection("VERTEX", "Vertex_1_6"), model.selection("VERTEX", "Vertex_1_7"), model.selection("VERTEX", "Vertex_1_8"), model.selection("VERTEX", "Vertex_1_9"), model.selection("VERTEX", "Vertex_1_10"), model.selection("VERTEX", "Vertex_1_11"), model.selection("VERTEX", "Vertex_1_12"), model.selection("VERTEX", "Vertex_1_13"), model.selection("VERTEX", "Vertex_1_14"), model.selection("VERTEX", "Vertex_1_15"), model.selection("VERTEX", "Vertex_1_16"), model.selection("VERTEX", "Vertex_1_17"), model.selection("VERTEX", "Vertex_1_18")]
+Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OZ"), 100, 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_1_12/To_Vertex"), model.selection("VERTEX", "Extrusion_1_13/To_Vertex"), model.selection("VERTEX", "Extrusion_1_3/To_Vertex"))
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_7 = Sketch_2.addLine(-717.0963364993213, -45.06817090071282, -717.0963364993213, -180.9380775505473)
-SketchPoint_13 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_12/To_Vertex_1"))
+SketchPoint_13 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_12/To_Vertex"))
 SketchPoint_13.setName("SketchPoint_15")
 SketchPoint_13.result().setName("SketchPoint_15")
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchPoint_13.result())
-SketchPoint_14 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/To_Vertex_1"))
+SketchPoint_14 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/To_Vertex"))
 SketchPoint_14.setName("SketchPoint_16")
 SketchPoint_14.result().setName("SketchPoint_16")
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_14.result())
 SketchLine_8 = Sketch_2.addLine(-717.0963364993213, -180.9380775505473, -102.0809741405142, -180.9380775505473)
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
-SketchPoint_15 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_3/To_Vertex_1"))
+SketchPoint_15 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_3/To_Vertex"))
 SketchPoint_15.setName("SketchPoint_17")
 SketchPoint_15.result().setName("SketchPoint_17")
 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchPoint_15.result())
 SketchLine_9 = Sketch_2.addLine(-102.0809741405142, -180.9380775505473, -102.0809741405142, 193.0685819822336)
 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
-SketchPoint_16 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_10/To_Vertex_1"))
+SketchPoint_16 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_10/To_Vertex"))
 SketchPoint_16.setName("SketchPoint_18")
 SketchPoint_16.result().setName("SketchPoint_18")
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchPoint_16.result())
 SketchLine_10 = Sketch_2.addLine(-102.0809741405142, 193.0685819822336, -254.8675173043772, 193.0685819822336)
 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
-SketchPoint_17 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_5/To_Vertex_1"))
+SketchPoint_17 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_5/To_Vertex"))
 SketchPoint_17.setName("SketchPoint_19")
 SketchPoint_17.result().setName("SketchPoint_19")
 SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchPoint_17.result())
 SketchLine_11 = Sketch_2.addLine(-254.8675173043772, 193.0685819822336, -254.8675173043772, -45.06817090071281)
 SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
-SketchPoint_18 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_9/To_Vertex_1"))
+SketchPoint_18 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_9/To_Vertex"))
 SketchPoint_18.setName("SketchPoint_20")
 SketchPoint_18.result().setName("SketchPoint_20")
 SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_18.result())
@@ -136,18 +138,18 @@ SketchLine_12 = Sketch_2.addLine(-254.8675173043772, -45.06817090071281, -717.09
 SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
 SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_12.endPoint())
 SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchPoint_13.coordinates(), SketchLine_12.endPoint())
-SketchLine_13 = Sketch_2.addLine(-599.2405881202537, -45.06817090071282, -584.124830393487, -180.9380775505472)
+SketchLine_13 = Sketch_2.addLine(-599.2405881202537, -45.06817090071282, -584.1248303934869, -180.9380775505472)
 SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_13.startPoint(), SketchLine_12.result())
-SketchPoint_19 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_13/To_Vertex_1"))
+SketchPoint_19 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_13/To_Vertex"))
 SketchPoint_19.setName("SketchPoint_21")
 SketchPoint_19.result().setName("SketchPoint_21")
 SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchPoint_19.result())
 SketchLine_14 = Sketch_2.addLine(-356.1736770691994, -45.06817090071282, -342.6051560379917, -180.9380775505472)
-SketchPoint_20 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_15/To_Vertex_1"))
+SketchPoint_20 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_15/To_Vertex"))
 SketchPoint_20.setName("SketchPoint_22")
 SketchPoint_20.result().setName("SketchPoint_22")
 SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchPoint_20.result())
-SketchPoint_21 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_11/To_Vertex_1"))
+SketchPoint_21 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_11/To_Vertex"))
 SketchPoint_21.setName("SketchPoint_23")
 SketchPoint_21.result().setName("SketchPoint_23")
 SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchPoint_21.result())
@@ -157,12 +159,17 @@ SketchConstraintCoincidence_37 = Sketch_2.setCoincident(SketchPoint_18.coordinat
 SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchLine_12.startPoint(), SketchLine_15.startPoint())
 SketchConstraintCoincidence_39 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_9.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7f-SketchLine_8f-SketchLine_12f-SketchLine_13r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_8f-SketchLine_12f-SketchLine_13f-SketchLine_14r")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_8f-SketchLine_9f-SketchLine_12f-SketchLine_14f-SketchLine_15r")])
-Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_15f")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1"), model.selection("EDGE", "Extrusion_1_2"), model.selection("EDGE", "Extrusion_1_3"), model.selection("EDGE", "Extrusion_1_4"), model.selection("EDGE", "Extrusion_1_5"), model.selection("EDGE", "Extrusion_1_6"), model.selection("EDGE", "Extrusion_1_7"), model.selection("EDGE", "Extrusion_1_8"), model.selection("EDGE", "Extrusion_1_9"), model.selection("EDGE", "Extrusion_1_10"), model.selection("EDGE", "Extrusion_1_11"), model.selection("EDGE", "Extrusion_1_12"), model.selection("EDGE", "Extrusion_1_13"), model.selection("EDGE", "Extrusion_1_14"), model.selection("EDGE", "Extrusion_1_15"), model.selection("EDGE", "Extrusion_1_16"), model.selection("EDGE", "Extrusion_1_17"), model.selection("EDGE", "Extrusion_1_18"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_7r-SketchLine_8f-SketchLine_13r-SketchLine_12f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_8f-SketchLine_14r-SketchLine_12f-SketchLine_13f_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_8f-SketchLine_9f-SketchLine_15r-SketchLine_12f-SketchLine_14f_wire")])
+Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_15f_wire")])
+Partition_1_objects = [model.selection("EDGE", "Extrusion_1_1"), model.selection("EDGE", "Extrusion_1_2"), model.selection("EDGE", "Extrusion_1_3"), model.selection("EDGE", "Extrusion_1_4"), model.selection("EDGE", "Extrusion_1_5"), model.selection("EDGE", "Extrusion_1_6"), model.selection("EDGE", "Extrusion_1_7"), model.selection("EDGE", "Extrusion_1_8"), model.selection("EDGE", "Extrusion_1_9"), model.selection("EDGE", "Extrusion_1_10"), model.selection("EDGE", "Extrusion_1_11"), model.selection("EDGE", "Extrusion_1_12"), model.selection("EDGE", "Extrusion_1_13"), model.selection("EDGE", "Extrusion_1_14"), model.selection("EDGE", "Extrusion_1_15"), model.selection("EDGE", "Extrusion_1_16"), model.selection("EDGE", "Extrusion_1_17"), model.selection("EDGE", "Extrusion_1_18"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+model.do()
 model.end()
+
+from ModelAPI import *
+
 PartitionFeature = Partition_1.feature()
 assert(len(PartitionFeature.results()) == 1)
 PartitionResult = modelAPI_ResultBody(PartitionFeature.firstResult())
index b4ffe91438f218b9271aefe20685a41dd60527ba..50f9dffa9720a90209b66c71913468e4eee6e387 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -29,25 +30,25 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 model.addParameter(Part_1_doc, "a", "100")
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/Plane_4"))
-SketchLine_1 = Sketch_1.addLine(-5.023684372475525, -46.5755143466786, -14.75825153820805, -43.01597925234075)
+SketchLine_1 = Sketch_1.addLine(-5.024014514861164, -46.57477619916804, -15.03025649976126, -42.91660461599292)
 SketchLine_1.setName("SketchLine_9")
 SketchLine_1.result().setName("SketchLine_9")
-SketchLine_2 = Sketch_1.addLine(-33.96152175760117, -20.26294727816075, -38.72043789437247, 5.632510332222703)
+SketchLine_2 = Sketch_1.addLine(-34.15308715195452, -20.5925185611531, -39.51293324824182, 6.356619200673476)
 SketchLine_2.setName("SketchLine_10")
 SketchLine_2.result().setName("SketchLine_10")
-SketchLine_3 = Sketch_1.addLine(-5.023684372475525, -46.5755143466786, -30.86227207373359, -37.12739424591874)
+SketchLine_3 = Sketch_1.addLine(-5.024014514861164, -46.57477619916804, -30.86442523156243, -37.12780736470863)
 SketchLine_3.setName("SketchLine_1")
 SketchLine_3.result().setName("SketchLine_1")
 SketchLine_3.setAuxiliary(True)
-SketchLine_4 = Sketch_1.addLine(-30.86227207373359, -37.12739424591874, -38.72043789437247, 5.632510332222703)
+SketchLine_4 = Sketch_1.addLine(-30.86442523156243, -37.12780736470863, -39.51293324824182, 6.356619200673476)
 SketchLine_4.setName("SketchLine_2")
 SketchLine_4.result().setName("SketchLine_2")
 SketchLine_4.setAuxiliary(True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
-SketchLine_5 = Sketch_1.addLine(-20.37351638704503, 39.82660556161157, 5.515492360623621, 50.89855436380311)
+SketchLine_5 = Sketch_1.addLine(-21.88471935002519, 39.79243387785534, 5.516674902531107, 51.5099134867221)
 SketchLine_5.setName("SketchLine_4")
 SketchLine_5.result().setName("SketchLine_4")
-SketchLine_6 = Sketch_1.addLine(5.515492360623621, 50.89855436380311, 32.11790618078412, 35.7788047045564)
+SketchLine_6 = Sketch_1.addLine(5.516674902531107, 51.5099134867221, 32.11790618078412, 35.7788047045564)
 SketchLine_6.setName("SketchLine_5")
 SketchLine_6.result().setName("SketchLine_5")
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
@@ -57,19 +58,19 @@ SketchLine_7.setName("SketchLine_6")
 SketchLine_7.result().setName("SketchLine_6")
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
 SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_5")
-SketchLine_8 = Sketch_1.addLine(51.23593736581751, -10.42185420425237, 33.52439630860805, -30.08966199583723)
+SketchLine_8 = Sketch_1.addLine(51.23593736581751, -10.42185420425237, 33.52471395405271, -30.09043472300023)
 SketchLine_8.setName("SketchLine_7")
 SketchLine_8.result().setName("SketchLine_7")
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6")
-SketchLine_9 = Sketch_1.addLine(33.52439630860805, -30.08966199583723, -5.023684372475525, -46.5755143466786)
+SketchLine_9 = Sketch_1.addLine(33.52471395405271, -30.09043472300023, -5.024014514861164, -46.57477619916804)
 SketchLine_9.setName("SketchLine_8")
 SketchLine_9.result().setName("SketchLine_8")
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7")
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_9.endPoint())
 SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8")
-SketchArc_1 = Sketch_1.addArc(-4.455634849643539, -14.84052735945157, -33.96152175760117, -20.26294727816075, -14.75825153820805, -43.01597925234075, False)
+SketchArc_1 = Sketch_1.addArc(-4.72938863253667, -14.74051331180418, -34.15308715195452, -20.5925185611531, -15.03025649976126, -42.91660461599292, False)
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint())
@@ -85,7 +86,7 @@ SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_13")
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_4.result())
 SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_14")
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 30)
-SketchArc_2 = Sketch_1.addArc(-8.152231059872202, 11.25015706261054, -38.72043789437247, 5.632510332222703, -20.37351638704503, 39.82660556161157, True)
+SketchArc_2 = Sketch_1.addArc(-10.08923472882396, 12.20862445002239, -39.51293324824182, 6.356619200673476, -21.88471935002519, 39.79243387785534, True)
 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 30)
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_2.endPoint())
 SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_15")
@@ -175,14 +176,30 @@ SketchConstraintParallel_2 = Sketch_2.setParallel(SketchLine_10.result(), Sketch
 SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_7.coordinates())
 SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_34")
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_9r-SketchLine_10r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchArc_1_2f-SketchArc_2_2f-SketchArc_4_2r-SketchArc_3_2r")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_12"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchArc_2_2f-SketchLine_10r-SketchArc_1_2f-SketchLine_9r-SketchArc_3_2r-SketchArc_4_2r")], model.selection("EDGE", "Sketch_2/SketchLine_12"), 360, 0)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/Plane_4"), model.selection("SOLID", "Revolution_1_1")])
 Recover_1 = model.addRecover(Part_1_doc, Partition_1, [Revolution_1.result()])
 Plane_5 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/Axis_4"), model.selection("VERTEX", "PartSet/Point_2"), True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Recover_1_1"), model.selection("FACE", "Face_1_1")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_2_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_2"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_6_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_4_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_3"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_1_1"), model.selection("VERTEX", "Intersection_1_1/Generated_Vertex_4"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_3_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_7_1"), model.selection("VERTEX", "Intersection_1_1/Modified_Vertex_5_1")])
-Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Intersection_1_1_7"), model.selection("EDGE", "Intersection_1_1_6"), model.selection("EDGE", "Intersection_1_1_3"), model.selection("EDGE", "Intersection_1_1_11"), model.selection("EDGE", "Intersection_1_1_5"), model.selection("EDGE", "Intersection_1_1_1"), model.selection("EDGE", "Intersection_1_1_4"), model.selection("EDGE", "Intersection_1_1_2"), model.selection("EDGE", "Intersection_1_1_10"), model.selection("EDGE", "Intersection_1_1_9"), model.selection("EDGE", "Intersection_1_1_8")])
+Group_1_objects = [
+model.selection("VERTEX", "Intersection_1_1_3/Modified_Vertex&Sketch_1/SketchLine_1_StartVertex&Sketch_1/SketchLine_8_EndVertex"),
+model.selection("VERTEX", "[Intersection_1_1_1/Intersection_1_1_1]e[weak_name_2]"),
+model.selection("VERTEX", "Intersection_1_1_9/Modified_Vertex&Sketch_1/SketchLine_5_StartVertex&Sketch_1/SketchLine_4_EndVertex"),
+model.selection("VERTEX", "Intersection_1_1_7/Modified_Vertex&Sketch_1/SketchLine_7_StartVertex&Sketch_1/SketchLine_6_EndVertex"),
+model.selection("VERTEX", "[Intersection_1_1_4/Intersection_1_1_4]e[weak_name_2]"),
+model.selection("VERTEX", "[Intersection_1_1_1/Intersection_1_1_1]e[weak_name_1]"),
+model.selection("VERTEX", "Intersection_1_1_2/Modified_Vertex&Sketch_1/SketchLine_2_EndVertex&Sketch_1/SketchArc_2_2_EndVertex"),
+model.selection("VERTEX", "[Intersection_1_1_4/Intersection_1_1_4]e[weak_name_1]"),
+model.selection("VERTEX", "Intersection_1_1_6/Modified_Vertex&Sketch_1/SketchLine_8_StartVertex&Sketch_1/SketchLine_7_EndVertex"),
+model.selection("VERTEX", "Intersection_1_1_10/Modified_Vertex&Sketch_1/SketchLine_4_StartVertex&Sketch_1/SketchArc_2_2_StartVertex"),
+model.selection("VERTEX", "Intersection_1_1_8/Modified_Vertex&Sketch_1/SketchLine_6_StartVertex&Sketch_1/SketchLine_5_EndVertex")]
+
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("EDGE", "Intersection_1_1_7"), model.selection("EDGE", "Intersection_1_1_6"), model.selection("EDGE", "Intersection_1_1_3"), model.selection("EDGE", "Intersection_1_1_11"), model.selection("EDGE", "Intersection_1_1_5"), model.selection("EDGE", "Intersection_1_1_1"), model.selection("EDGE", "Intersection_1_1_4"), model.selection("EDGE", "Intersection_1_1_2"), model.selection("EDGE", "Intersection_1_1_10"), model.selection("EDGE", "Intersection_1_1_9"), model.selection("EDGE", "Intersection_1_1_8")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+model.do()
 model.end()
 
 aGroupFeature = Group_1.feature()
index cfde51a8180d3d226c77776801a989319f542b9e..a4ff0b2b4c172113624d76035df99708eaf3a864 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,8 +39,8 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchLine_5 = Sketch_2.addLine(99.48542024013722, 69.46826758147516, -34.30531732418524, 69.46826758147516)
 SketchLine_6 = Sketch_2.addLine(-34.30531732418524, 69.46826758147516, -34.30531732418524, -62.60720411663805)
 SketchLine_7 = Sketch_2.addLine(-34.30531732418524, -62.60720411663805, 99.48542024013722, -62.60720411663805)
@@ -53,9 +54,10 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 110)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 110)
 Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPOUND", "Intersection_1_1")], model.selection("EDGE", "PartSet/OZ"), 45)
+model.do()
 model.end()
 
 assert(model.checkPythonDump())
index 8a98df7e97ba911ace53474ea0d8a316dee7599d..10a341d4c5d5802e52ca7a9ed52cd98cdbe58e7b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -37,14 +38,14 @@ SketchLine_5 = Sketch_1.addLine(-379.073756432247, 108.9193825042881, -360.20583
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_5.endPoint())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_5r")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_5r")], model.selection(), 100, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f")], model.selection(), 100, 0)
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "PartSet/OX"), 50)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Translation_1_1"), model.selection("SOLID", "Extrusion_2_1")])
 Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1")], model.selection("EDGE", "PartSet/OZ"), 50)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Translation_2_1/Translated_Face_24"), model.selection("FACE", "Translation_2_1/Translated_Face_13"), model.selection("FACE", "Translation_2_1/Translated_Face_16"), model.selection("FACE", "Translation_2_1/Translated_Face_12"), model.selection("FACE", "Translation_2_1/Translated_Face_9"), model.selection("FACE", "Translation_2_1/Translated_Face_10"), model.selection("FACE", "Translation_2_1/Translated_Face_11"), model.selection("FACE", "Translation_2_1/Translated_Face_25"), model.selection("FACE", "Translation_2_1/Translated_Face_20"), model.selection("FACE", "Translation_2_1/Translated_Face_19"), model.selection("FACE", "Translation_2_1/Translated_Face_18"), model.selection("FACE", "Translation_2_1/Translated_Face_27"), model.selection("FACE", "Translation_2_1/Translated_Face_17"), model.selection("FACE", "Translation_2_1/Translated_Face_31"), model.selection("FACE", "Translation_2_1/Translated_Face_32"), model.selection("FACE", "Translation_2_1/Translated_Face_30"), model.selection("FACE", "Translation_2_1/Translated_Face_28"), model.selection("FACE", "Translation_2_1/Translated_Face_29"), model.selection("FACE", "Translation_2_1/Translated_Face_8"), model.selection("FACE", "Translation_2_1/Translated_Face_22"), model.selection("FACE", "Translation_2_1/Translated_Face_7"), model.selection("FACE", "Translation_2_1/Translated_Face_6"), model.selection("FACE", "Translation_2_1/Translated_Face_5"), model.selection("FACE", "Translation_2_1/Translated_Face_3"), model.selection("FACE", "Translation_2_1/Translated_Face_1"), model.selection("FACE", "Translation_2_1/Translated_Face_2"), model.selection("FACE", "Translation_2_1/Translated_Face_21"), model.selection("FACE", "Translation_2_1/Translated_Face_4"), model.selection("FACE", "Translation_2_1/Translated_Face_25"), model.selection("FACE", "Translation_2_1/Translated_Face_27"), model.selection("FACE", "Translation_2_1/Translated_Face_21"), model.selection("FACE", "Translation_2_1/Translated_Face_22"), model.selection("FACE", "Translation_2_1/Translated_Face_26"), model.selection("FACE", "Translation_2_1/Translated_Face_23"), model.selection("FACE", "Translation_2_1/Translated_Face_30"), model.selection("FACE", "Translation_2_1/Translated_Face_23"), model.selection("FACE", "Translation_2_1/Translated_Face_14"), model.selection("FACE", "Translation_2_1/Translated_Face_15")])
-#Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Translation_2_1_6/Translated_Face_1"), model.selection("FACE", "Translation_2_1_5/Translated_Face_1"), model.selection("FACE", "Translation_2_1_5/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_4"), model.selection("FACE", "Translation_2_1_5/Translated_Face_3"), model.selection("FACE", "Translation_2_1_5/Translated_Face_2"), model.selection("FACE", "Translation_2_1_5/Translated_Face_5"), model.selection("FACE", "Translation_2_1_7/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_5"), model.selection("FACE", "Translation_2_1_4/Translated_Face_1"), model.selection("FACE", "Translation_2_1_2/Translated_Face_2"), model.selection("FACE", "Translation_2_1_5/Translated_Face_5"), model.selection("FACE", "Translation_2_1_2/Translated_Face_1"), model.selection("FACE", "Translation_2_1_4/Translated_Face_5"), model.selection("FACE", "Translation_2_1_2/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_5"), model.selection("FACE", "Translation_2_1_1/Translated_Face_3"), model.selection("FACE", "Translation_2_1_4/Translated_Face_2"), model.selection("FACE", "Translation_2_1_2/Translated_Face_3"), model.selection("FACE", "Translation_2_1_1/Translated_Face_4"), model.selection("FACE", "Translation_2_1_1/Translated_Face_1"), model.selection("FACE", "Translation_2_1_1/Translated_Face_2"), model.selection("FACE", "Translation_2_1_3/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_5"), model.selection("FACE", "Translation_2_1_3/Translated_Face_2"), model.selection("FACE", "Translation_2_1_3/Translated_Face_3"), model.selection("FACE", "Translation_2_1_3/Translated_Face_1"), model.selection("FACE", "Translation_2_1_7/Translated_Face_3"), model.selection("FACE", "Translation_2_1_7/Translated_Face_5"), model.selection("FACE", "Translation_2_1_7/Translated_Face_4"), model.selection("FACE", "Translation_2_1_7/Translated_Face_1"), model.selection("FACE", "Translation_2_1_7/Translated_Face_2"), model.selection("FACE", "Translation_2_1_6/Translated_Face_4"), model.selection("FACE", "Translation_2_1_4/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_5"), model.selection("FACE", "Translation_2_1_6/Translated_Face_2"), model.selection("FACE", "Translation_2_1_6/Translated_Face_3")])
-
+Group_1_objects = [model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_3/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "(Translation_2_1_2/MF:Translated&Sketch_1/SketchLine_1)(Translation_2_1_2/MF:Translated&Extrusion_2_1/From_Face&Extrusion_1_1/From_Face)(Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face)(Translation_2_1_2/MF:Translated&Sketch_1/SketchLine_2)"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Extrusion_2_1/From_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Extrusion_2_1/To_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_4"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/To_Face&Extrusion_1_1/To_Face"), model.selection("FACE", "Translation_2_1_5/MF:Translated&Sketch_1/SketchLine_1"), model.selection("FACE", "Translation_2_1_6/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_3"), model.selection("FACE", "Translation_2_1_2/MF:Translated&Extrusion_2_1/From_Face&Extrusion_1_1/From_Face"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_1/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_7/MF:Translated&Sketch_1/SketchLine_5"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_2"), model.selection("FACE", "Translation_2_1_4/MF:Translated&Sketch_1/SketchLine_5")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 groupFeature = Group_1.feature()
index 72c1b77f1298b988b0dac10bd0ad60e4e2d47378..2608de839fc735741a56957e620a8b93d0a3753c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -31,9 +32,11 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(),
 model.do()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_3")])
+Wire_1_objects = [model.selection("EDGE", "PartSet/Sketch_1/SketchLine_1"), model.selection("EDGE", "PartSet/Sketch_1/SketchLine_2"), model.selection("EDGE", "PartSet/Sketch_1/SketchLine_3")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 100, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1")])
+Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 model.do()
 model.end()
 
index 993dceb2e55f66aea12ba82aa5cb2c9a6b87bca4..96412dffe8d035f29378c41cc156bfef7df17850 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -36,7 +37,7 @@ SketchLine_5 = Sketch_1.addLine(551.916977573864, -398.3514326277755, -18.083022
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchLine_6 = Sketch_1.addLine(-18.08302242613596, -398.3514326277755, -18.08302242613596, -98.35143262777552)
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
-SketchArc_1 = Sketch_1.addArc(0, -7.626897158721915e-023, -85.62958302127123, 51.64856737222455, -18.08302242613596, -98.35143262777552, False)
+SketchArc_1 = Sketch_1.addArc(0, -7.626897158721915e-23, -85.62958302127123, 51.64856737222455, -18.08302242613596, -98.35143262777552, False)
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.startPoint())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
@@ -50,8 +51,8 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), 570)
 SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_5.result(), SketchLine_4.result(), 139.9999999999999)
 SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_2.result(), 124.9999999999987)
 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_6.result(), 300)
-SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_2.result(), 350)
-SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_4.startPoint(), SketchLine_5.result(), 300)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_2.result(), 350, False)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_4.startPoint(), SketchLine_5.result(), 300, False)
 SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.center(), SketchPoint_1.coordinates())
 SketchCircle_1 = Sketch_1.addCircle(623.3624504738834, 247.4315530304268, 75)
@@ -68,13 +69,15 @@ SketchPoint_2 = Sketch_1.addPoint(557.3438493481349, 211.8430112592427)
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_8.startPoint())
 SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_7.result(), SketchLine_8.result())
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchCircle_2.results()[1])
-SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_2.center(), SketchLine_6.endPoint(), 325)
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_2.center(), SketchLine_6.endPoint(), 325, False)
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchCircle_1.results()[1])
-SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.endPoint(), 325)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.endPoint(), 325, False)
 model.do()
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2"), model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Base_Edge_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_8"), model.selection("EDGE", "Revolution_2_1/Base_Edge_8"), model.selection("EDGE", "Revolution_2_1/Lateral_2"), model.selection("EDGE", "Revolution_2_1/Lateral_4"), model.selection("EDGE", "Revolution_2_1/Base_Edge_10"), model.selection("EDGE", "Revolution_2_1/Base_Edge_12"), model.selection("EDGE", "Revolution_2_1/Lateral_6")])
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][weak_name_3]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8][weak_name_3]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][weak_name_3]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][weak_name_3]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7][weak_name_3]"), model.selection("EDGE", "[Revolution_2_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_2_1/Generated_Face&Sketch_1/SketchLine_7]")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index d42a091f4bbae90c466733cbd0661411913bdc5e..d948e1d7e6e1d8de983a162cf8c265fa915bca24 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,14 +28,15 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchCircle_1 = Sketch_1.addCircle(-79.57211859899775, 93.0358363165245, 69.46562387481423)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchCircle_2 = Sketch_2.addCircle(-111.8968837135755, 98.96901887198163, 6.57145775571253)
 SketchCircle_3 = Sketch_2.addCircle(-41.97827733564338, 89.35676702647821, 6.102067916018811)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0)
-Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Smash_1_1_1/Modified_Face_1"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
+Group_1_objects = [model.selection("FACE", "Extrusion_2_2/To_Face"), model.selection("FACE", "Extrusion_2_2/From_Face"), model.selection("FACE", "Extrusion_2_2/Generated_Face&Sketch_2/SketchCircle_3_2"), model.selection("FACE", "Extrusion_2_1/From_Face"), model.selection("FACE", "(Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2)(Extrusion_2_1/From_Face)(Extrusion_2_2/From_Face)_Smash_1_1_1"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Extrusion_2_2/From_Face"), model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchCircle_2_2"), model.selection("FACE", "Extrusion_2_1/From_Face"), model.selection("FACE", "Extrusion_2_1/To_Face")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 model.do()
 model.end()
 
index 4375edb71d180f9c4c732660e1128480e1b7d0b6..fe94c83801aeeda502dc61ad906d184196c7f677 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -25,12 +26,15 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
-SketchCircle_1 = Sketch_1.addCircle(-150, 79, -50, 79)
-SketchCircle_2 = Sketch_1.addCircle(-155, 278, -10, 278)
+SketchCircle_1 = Sketch_1.addCircle(-155, 278, 145)
+SketchCircle_2 = Sketch_1.addCircle(-150, 79, 100)
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2f-SketchCircle_2_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][weak_name_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][weak_name_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1][weak_name_1]")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_2][Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_2_2&weak_name_1]")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Base_Edge_8"), model.selection("EDGE", "Revolution_1_1/Base_Edge_10"), model.selection("EDGE", "Revolution_1_1/Base_Edge_12")])
-Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2"), model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Lateral_6")])
 model.end()
 
 # check that resulting group selection is valid
index cedd7f88f41aeb07d5e20fe4737f636e5c5291e1..e821a0ae5878bef3e6851c4132109efaa66b8ead 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,11 +28,12 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchCircle_1 = Sketch_1.addCircle(-150, 80, 100)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Base_Edge_4")])
-Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_2")])
-Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Revolution_1_1/Lateral_2&Revolution_1_1/Base_Edge_4")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][weak_name_1]")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][weak_name_2]")])
+Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchCircle_1_2]")])
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index dc6122bb31735e62789ffd2ccc7ccff959231d78..2daa47742511cc9fc80d3af5a7342c567e2c29e8 100644 (file)
@@ -1,24 +1,24 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # revolution of 3-edges contour (4th is used as axis of rotation) is checking for naming of edges
+
 from salome.shaper import model
 
 model.begin()
@@ -35,8 +35,10 @@ SketchLine_4 = Sketch_1.addLine(138, 234, 138, 47)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Lateral_4"), model.selection("EDGE", "Revolution_1_1/Base_Edge_10"), model.selection("EDGE", "Revolution_1_1/Lateral_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_12"), model.selection("EDGE", "Revolution_1_1/Base_Edge_14")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0)
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])2"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2])2")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index 23bb4ff7ba76e595bd3e94aa7ceba19f71a7b87b..2b429d36cae1750e7596347ae72e10572253ef1c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # revolution of 4-edges contour (5th is used as axis of rotation) is checking for naming of edges
 
@@ -51,8 +50,10 @@ SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6")
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_5.endPoint())
 SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7")
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5r-SketchLine_6r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&Revolution_1_1/Generated_Face_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_3&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Revolution_1_1/Base_Edge_6"), model.selection("EDGE", "Revolution_1_1/Base_Edge_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Revolution_1_1/Generated_Face_3")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5r-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Sketch_1/SketchLine_4"), 360, 0)
+Group_1_objects = [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])2"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])2"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])"), model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_6][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_5][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3])")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index 6c2b3f92d1989079887105630b04bd640ca9972f..beca087669858870335ed60c8b91cee7c4d122f3 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,8 +42,8 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL
 SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"), 25, True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"), 25, True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_5 = Sketch_2.addLine(84.67753244325934, -72.65003691291119, -28.95543815719345, -72.65003691291119)
 SketchLine_6 = Sketch_2.addLine(-28.95543815719345, -72.65003691291119, -28.95543815719345, 10.01640181835304)
@@ -57,7 +58,8 @@ SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_7")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
@@ -77,7 +79,7 @@ SketchConstraintParallel_3 = Sketch_3.setParallel(SketchLine_9.result(), SketchL
 SketchConstraintParallel_4 = Sketch_3.setParallel(SketchLine_10.result(), SketchLine_12.result())
 SketchConstraintPerpendicular_2 = Sketch_3.setPerpendicular(SketchLine_9.result(), SketchLine_12.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_9r-SketchLine_10r-SketchLine_11r-SketchLine_12r")], model.selection(), 50, 0)
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r")], model.selection(), 50, 0)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Partition_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
 model.do()
 model.end()
index ccbab14c6e810cb435fa59820a3cad3191ede6e7..98e490cbbc1f0e35bab787efd1f4970ec796f279 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # check that fac partitioned by plane has correctly named modified edges
 
@@ -40,10 +39,12 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 1, False)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Plane_1")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Partition_1_1_2/Modified_Edge_1_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Partition_1_1_2/Modified_Edge&Sketch_1/SketchLine_1")])
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index f51ba4f890fb8d65eca861c40696f1877f6e3749..46d3f689891daf402efdeb35b27ae9686ac07bff 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -72,7 +73,8 @@ SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_12.result())
 SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_13.result())
 SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_14.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_5f-SketchLine_6f-SketchLine_7f"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"), model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r"), model.selection("FACE", "Sketch_1/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")], model.selection(), 10, 0)
+Extrusion_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_5f-SketchLine_6f-SketchLine_7f"), model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_1/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")]
+Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection(), 10, 0)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")])
 model.do()
 model.end()
index c4015977df849cdfc993d76ef0967a62693ae033..7adb17f64a8d75f5ed1bec866590f82e3a7727c7 100644 (file)
@@ -1,24 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
-# check that revolution that produces a sphere has correctly named 2 vertices with different names
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -37,8 +36,9 @@ SketchLine_2 = Sketch_1.addLine(0, 50, 0, -50)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 360, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Revolution_1_1/Vertex_6"), model.selection("VERTEX", "Revolution_1_1/Vertex_8")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 360, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_1]"), model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][weak_name_2]")])
+model.do()
 model.end()
 
 # check that resulting group selection is valid and names are different
index dd709a1bc32703df044ecfce68fc61b82a5d7efc..84f82d7740b0a44674387d9a7bb22eff194d3047 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -52,20 +53,20 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
-SketchArc_1 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 81.26217508737108, 0, 0, 81.26217508737108, False)
+SketchArc_1 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 81.26217508737108, 0, 0, 81.26217508737108, False)
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_1.center())
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_1.startPoint())
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchArc_1.endPoint())
 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result())
-SketchArc_2 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 76.26217508737108, 0, 0, 76.26217508737108, False)
+SketchArc_2 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 76.26217508737108, 0, 0, 76.26217508737108, False)
 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_2.center())
 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_23")
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_9.result(), SketchArc_2.startPoint())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_24")
 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_10.result(), SketchArc_2.endPoint())
 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_25")
-SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5, False)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_7.result(), "2*length_assemblage")
 SketchConstraintLength_1.setName("SketchConstraintLength_2")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), "length_assemblage")
@@ -93,27 +94,35 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552
 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645)
 SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")])
-Face_4 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_9f-SketchArc_1_2f-SketchLine_10r-SketchArc_2_2r_wire")])
+Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")]
+Face_3 = model.addFace(Part_1_doc, Face_3_objects)
+Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")]
+Face_4 = model.addFace(Part_1_doc, Face_4_objects)
+Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 Group_1.result().setName("eau")
 Group_1.result().setColor(0, 170, 255)
 Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_4_1")])
 Group_2.result().setName("acier")
 Group_2.result().setColor(170, 85, 0)
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/XOY"))
+Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0)
-SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "Partition_1_1_1/Modified_Edge_14_15&Partition_1_1_1/Modified_Edge_14_16"))
+SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "[Partition_1_1_1/Modified_Edge&Sketch_1/SketchLine_9]e[Partition_1_1_1/Modified_Edge&Sketch_1/SketchLine_7]e"))
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19")
 SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10)
 SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10)
 SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0)
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20")
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22")
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26")
 SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result())
@@ -125,21 +134,23 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1")
 SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result())
 SketchConstraintEqual_5.setName("SketchConstraintEqual_1")
 model.do()
-Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")])
-MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
-Recover_1 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e"))
-MultiTranslation_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
-Recover_2 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"))
-MultiTranslation_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4)
-Recover_3 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1"))
-MultiTranslation_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3)
-Recover_4 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s"))
-MultiTranslation_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2)
-Partition_2 = model.addPartition(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")])
+Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r_wire")])
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
+Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"))
+LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
+Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"))
+LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4)
+Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "LinearCopy_3_1_1/MV:Translated&Sketch_3/SketchLine_13_EndVertex&Sketch_3/SketchLine_14_StartVertex"))
+LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3)
+Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"))
+LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2)
+Partition_2_objects = [model.selection("COMPOUND", "Partition_1_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]
+Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects)
+model.do()
 model.end()
 
 # check that partition constructed correctly
index c178e45ab6e5a74c8f21cb6c301ca77285661698..98cc14cde1eea5e5db4901503c8b098f4f39c8f5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # check that revolution that produces a sphere has correctly named 2 vertices with different names
 
@@ -37,9 +36,10 @@ SketchLine_2 = Sketch_1.addLine(0, -62, 0, 62)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 360, 0)
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], model.selection("EDGE", "PartSet/OY"), 150)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Translation_1_1/Translated_Vertex_1"), model.selection("VERTEX", "Translation_1_1/Translated_Vertex_2")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_1]"), model.selection("VERTEX", "[Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2][weak_name_2]")])
+model.do()
 model.end()
 
 # check that resulting group selection is valid, names exist and different
index 20e48f5b9a5f339618c0318eef7cf59d027fd460..3a6779b7e3d976f1c9ba6fa45c10edd8b3ba8b21 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # check that extrusion of sketch with intersected edges produces well-named edges
 
@@ -48,7 +47,56 @@ SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_3.result(), SketchArc
 SketchCircle_1 = Sketch_1.addCircle(-13.45056286489504, 169.4770920976776, 150.6703210346195)
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_2"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/To_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/From_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_9"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_7"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/Generated_Face_5"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_11&Extrusion_1_1/Generated_Face_10"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_10&Extrusion_1_1/Generated_Face_9"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&Extrusion_1_1/Generated_Face_8"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_7")])
+Group_1_objects = [
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_4/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_4/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1][(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/To_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/From_Face]"),
+model.selection("EDGE", "[(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_2_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2][Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_1_2]")
+]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index c2694960e9d1ce764fb7eed19616c8f1c8fe50f0..fd19c9547a626343516d6caca42ea7de20afa512 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # check that extrusion of sketch with intersected edges produces well-named faces
 
@@ -56,7 +55,54 @@ SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_3.results()[1], Sketch
 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.results()[1], SketchArc_4.endPoint())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/Generated_Face_19"), model.selection("FACE", "Extrusion_1_1/Generated_Face_18"), model.selection("FACE", "Extrusion_1_1/Generated_Face_16"), model.selection("FACE", "Extrusion_1_1/Generated_Face_15"), model.selection("FACE", "Extrusion_1_1/Generated_Face_15"), model.selection("FACE", "Extrusion_1_1/Generated_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/From_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/To_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_19"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/From_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_4"), model.selection("FACE", "Extrusion_1_1/Generated_Face_8"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Extrusion_1_1/From_Face_6"), model.selection("FACE", "Extrusion_1_1/Generated_Face_13"), model.selection("FACE", "Extrusion_1_1/To_Face_6"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "Extrusion_1_1/To_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_5"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_8"), model.selection("FACE", "Extrusion_1_1/Generated_Face_9"), model.selection("FACE", "Extrusion_1_1/Generated_Face_13"), model.selection("FACE", "Extrusion_1_1/Generated_Face_7"), model.selection("FACE", "Extrusion_1_1/Generated_Face_14"), model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), model.selection("FACE", "Extrusion_1_1/Generated_Face_18"), model.selection("FACE", "Extrusion_1_1/From_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_11"), model.selection("FACE", "Extrusion_1_1/Generated_Face_6"), model.selection("FACE", "Extrusion_1_1/To_Face_2"), model.selection("FACE", "Extrusion_1_1/Generated_Face_10"), model.selection("FACE", "Extrusion_1_1/Generated_Face_6"), model.selection("FACE", "Extrusion_1_1/To_Face_7"), model.selection("FACE", "Extrusion_1_1/From_Face_7"), model.selection("FACE", "Extrusion_1_1/Generated_Face_17"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/To_Face_1")])
+Group_1_objects = [
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"),
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_3/From_Face"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_3/To_Face"),
+model.selection("FACE", "(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4)(Extrusion_1_1_1/From_Face)(Extrusion_1_1_1/To_Face)(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_4_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1_1/Generated_Face&Sketch_1/SketchCircle_2_2)2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_4/From_Face"),
+model.selection("FACE", "Extrusion_1_1_4/To_Face"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchLine_2"),
+model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"),
+model.selection("FACE", "Extrusion_1_1_6/From_Face"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_6/To_Face"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_5/To_Face"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_5/From_Face"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_1"),
+model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchCircle_1_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_3_2"),
+model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchArc_4_2"),
+model.selection("FACE", "Extrusion_1_1_5/Generated_Face&Sketch_1/SketchArc_4_2"),
+model.selection("FACE", "Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_2"),
+model.selection("FACE", "Extrusion_1_1_2/From_Face"),
+model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_2/To_Face"),
+model.selection("FACE", "Extrusion_1_1_7/Generated_Face&Sketch_1/SketchCircle_2_2"),
+model.selection("FACE", "(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1_6/From_Face)(Extrusion_1_1_6/To_Face)(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchArc_1_2)2(Extrusion_1_1_6/Generated_Face&Sketch_1/SketchLine_3)2"),
+model.selection("FACE", "Extrusion_1_1_7/To_Face"),
+model.selection("FACE", "Extrusion_1_1_7/From_Face"),
+model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2&weak_name_1"),
+model.selection("FACE", "Extrusion_1_1_1/From_Face"),
+model.selection("FACE", "Extrusion_1_1_1/To_Face")
+]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index 92193a3a5dc60c0862c855a8e02c4426fa96859c..f3741bc174ab3a3d02e4de53030914328464ae10 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -42,12 +43,13 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchCircle_1 = Sketch_1.addCircle(0, 0, 24.97092001270093)
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.center())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_2_1")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], model.selection(), 50, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ"))
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_5 = Sketch_2.addLine(49.62901186301215, 25.3130971701971, 39.15939470736273, 25.3130971701971)
 SketchLine_6 = Sketch_2.addLine(39.15939470736273, 25.3130971701971, 39.15939470736273, 38.96586914453801)
 SketchLine_7 = Sketch_2.addLine(39.15939470736273, 38.96586914453801, 49.62901186301215, 38.96586914453801)
@@ -61,7 +63,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")], model.selection(), 50, 50, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 50, 50, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
 model.do()
 model.end()
 
index 90675d37ee7b3e55bb1be7354093e9338da7818a..d17b4f574538c3d03725892cd7f078bb27c94620 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -45,7 +46,8 @@ SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_2.result(), Sketc
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_3.result())
 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_5")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 10, 0)
 model.do()
 
index cd9c8d6890ac0be2a7539f75fafa6060bad08364..cf8520b211d5872d6db641608f76d2750b7be649 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -51,7 +52,8 @@ SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 100, 100)
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")])
 model.do()
 model.end()
index 0558504b80ece3a3047ce022ff57ae68e03d2a5c..b2cac420621f7a5a25dc37e069794bf4b12dfcb2 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -131,11 +132,11 @@ SketchConstraintAngle_2 = Sketch_1.setAngleComplementary(SketchLine_6.result(),
 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_5.startPoint(), SketchLine_12.endPoint(), 8.1, False)
 SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_12.result(), 45)
 model.do()
-Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")]
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")]
 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
 Face_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4")]
 Face_1 = model.addFace(Part_1_doc, Face_1_objects)
-Edge_2_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_16"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_15"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_13"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_14"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_9")]
+Edge_2_objects = [model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_16"), model.selection("EDGE", "Sketch_1/SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/SketchLine_15"), model.selection("EDGE", "Sketch_1/SketchCircle_2_2"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_13"), model.selection("EDGE", "Sketch_1/SketchLine_14"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_9")]
 Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
 Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3"), model.selection("EDGE", "Edge_2_4"), model.selection("EDGE", "Edge_2_5"), model.selection("EDGE", "Edge_2_6"), model.selection("EDGE", "Edge_2_7"), model.selection("EDGE", "Edge_2_8"), model.selection("EDGE", "Edge_2_9"), model.selection("EDGE", "Edge_2_10"), model.selection("EDGE", "Edge_2_11")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
index 1fbbd14c55c7ca53e434808b32df29144492f273..23cec0ded71bddc35c8f843f163166c0260236ce 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -56,9 +57,9 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), 2)
 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_3.result(), 1.5)
 SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_8.result(), 4)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1__cc"), False)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1"))
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]__cc"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(0, 0, 4.75)
 SketchCircle_1.setAuxiliary(True)
@@ -67,7 +68,7 @@ SketchCircle_2 = Sketch_2.addCircle(4.113620667976081, 2.375000000000003, 1.1)
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
 SketchCircle_3 = Sketch_2.addCircle(-4.113620667974014, 2.375000000003604, 1.1)
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_3.center())
-SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-012, -4.75000000000001, 1.1)
+SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-12, -4.75000000000001, 1.1)
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_4.center())
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchCircle_2.results()[1], SketchCircle_3.results()[1])
 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchCircle_3.results()[1], SketchCircle_4.results()[1])
@@ -79,12 +80,12 @@ SketchLine_10 = Sketch_2.addLine(-4.113620667974014, 2.375000000003604, 0, 0)
 SketchLine_10.setAuxiliary(True)
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_10.endPoint())
-SketchLine_11 = Sketch_2.addLine(4.163806340121522e-012, -4.75000000000001, 0, 0)
+SketchLine_11 = Sketch_2.addLine(4.163806340121522e-12, -4.75000000000001, 0, 0)
 SketchLine_11.setAuxiliary(True)
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchCircle_4.center(), SketchLine_11.startPoint())
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_11.endPoint())
 SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_2.results()[1], 1.1)
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_12 = SketchProjection_4.createdFeature()
 SketchConstraintAngle_1 = Sketch_2.setAngleBackward(SketchLine_9.result(), SketchLine_12.result(), 30.00000000000006)
 SketchConstraintAngle_2 = Sketch_2.setAngle(SketchLine_9.result(), SketchLine_10.result(), 119.9999999999498)
@@ -173,49 +174,43 @@ SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_16.center(), Sket
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_19).startPoint(), SketchCircle_17.center(), 5.2, True)
 model.do()
 ExtrusionCut_1_objects_1 = [model.selection("FACE", "Sketch_2/Face-SketchCircle_9_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_7_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_17_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_16_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")]
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
-ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_12_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_6_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_8_2f")]
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
+ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Face-SketchCircle_11_2f-SketchCircle_9_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_12_2f-SketchCircle_10_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_6_2f-SketchCircle_5_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_8_2f-SketchCircle_7_2r_wire")]
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_1_1")])
 Axis_4 = model.addAxis(Part_1_doc, 0, -1, -10)
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-ExtrusionCut_3.result().setDeflection(1e-005)
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+ExtrusionCut_3.result().setDeflection(1e-05)
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_21 = Sketch_3.addLine(3.5, 2.508501119175777, 3.5, 4.934853156880259)
 SketchLine_22 = Sketch_3.addLine(3.5, 4.934853156880259, 6.2, 4.934853156880259)
 SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
 SketchLine_23 = Sketch_3.addLine(6.2, 4.934853156880259, 6.2, 3.008501119175777)
 SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
-SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False)
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False)
 SketchLine_24 = SketchProjection_6.createdFeature()
 SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_24.result())
 SketchLine_25 = Sketch_3.addLine(6.2, 3.008501119175777, 3.5, 2.508501119175777)
 SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_25.startPoint())
 SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_25.endPoint())
-SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), False)
+SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_5"), False)
 SketchLine_26 = SketchProjection_7.createdFeature()
 SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_26.result())
 SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_26.result())
 SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_22.result())
 SketchConstraintCoincidence_56 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_24.result())
-SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_27 = SketchProjection_8.createdFeature()
 SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_25.result(), SketchLine_27.result())
-SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_28 = SketchProjection_9.createdFeature()
 SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_21.startPoint(), SketchLine_28.result(), 0.5, True)
 model.do()
 Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0)
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Common_1_1"), model.selection("SOLID", "Common_1_2")])
-# skip 3 vertices, limitation
-Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("VERTEX", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1")]
-Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
-# skip 3 edges, limitation
-Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_2/Modified_Face_2"), model.selection("EDGE", "Common_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_9&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Common_1_1/Modified_Edge_1"), model.selection("EDGE", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")]
-Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
-Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Common_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Common_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Cut_1_1/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "Common_1_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Common_1_2/Modified_Face_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")]
-Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+model.do()
+model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.end()
 
 assert(model.checkPythonDump())
index 36e38d9d5bed5148387d871352c3c412d6beac72..c4e627b867ef62291c5a5be60fa07f1358e5a0f2 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -32,11 +33,11 @@ SketchLine_3 = Sketch_1.addLine(46.08233276157804, -21.30874785591767, -1.039451
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"))
 SketchCircle_1 = Sketch_2.addCircle(-10.74792845018279, -51.46099937127247, 20.55678647017868)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "PartSet/YOZ"), 0, model.selection(), 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "PartSet/YOZ"), 0, model.selection(), 0)
 model.do()
 model.end()
 
index 13639bba72ffef82aa25760db388a5d75b4dde96..8c4def3934f7583f4ae66f399891b42beb7f32e4 100644 (file)
@@ -1,24 +1,23 @@
-# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# -*- coding: utf-8 -*-
 
 from GeomAPI import *
 from SketchAPI import *
@@ -29,7 +28,6 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-
 model.addParameter(Part_1_doc, "R", "58")
 model.addParameter(Part_1_doc, "cote_cube", "R/2")
 model.addParameter(Part_1_doc, "theta", "54")
@@ -41,7 +39,6 @@ model.addParameter(Part_1_doc, "z", "R*cos(phi/180*pi)")
 model.addParameter(Part_1_doc, "haut_ext_tuyau", "5")
 model.addParameter(Part_1_doc, "haut_int_tuyau", "14")
 Param_Diam = model.addParameter(Part_1_doc, "diam_tuyau", "10")
-
 Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 90, 0)
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
@@ -60,9 +57,8 @@ SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(),
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "R")
 Revolution_1.setNestedSketch(Sketch_1)
-
 Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 0, "cote_cube")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_2"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3"))
 SketchLine_4 = Sketch_2.addLine(29, 0, 0, 0)
 SketchLine_5 = Sketch_2.addLine(0, 0, 0, 29)
 SketchLine_6 = Sketch_2.addLine(0, 29, 29, 29)
@@ -77,25 +73,22 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_6.result())
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_7.result())
 SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_6.result(), "cote_cube")
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_6.result(), SketchLine_7.result())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/To_Face_1"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/To_Face]"), False)
 SketchLine_8 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_8.result())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/From_Face_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/From_Face]"), False)
 SketchLine_9 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.result())
 Extrusion_1.setNestedSketch(Sketch_2)
-
 Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
-
 Point_2 = model.addPoint(Part_1_doc, "x", "y", "-z")
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Fill_1_1_2/Modified_Face_3&Fill_1_1_2/Modified_Face_2&Fill_1_1_2/Modified_Face_1"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "[Fill_1_1_2/Modified_Face&Sketch_2/SketchLine_5&Revolution_1_1/To_Face][Fill_1_1_2/Modified_Face&Sketch_2/SketchLine_4&Revolution_1_1/From_Face][Fill_1_1_2/Modified_Face&Extrusion_1_1/To_Face&Sketch_1/SketchLine_3]"))
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Point_1"), True)
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "haut_ext_tuyau", True)
 Plane_5.result().setName("Plane_2 arrivee tuyau")
-Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), 45)
-Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), 45)
-Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"), "90+45")
-
+Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/From_Face]"), 45)
+Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/From_Face]"), 45)
+Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7]"), "90+45")
 Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_1")], [model.selection("FACE", "Plane_5")])
 Fill_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_2_1_2")], [model.selection("FACE", "Plane_3")])
 Fill_4 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_3_1_2")], [model.selection("FACE", "Plane_4")])
@@ -105,11 +98,8 @@ Fill_4.result().subResult(1).setColor(0, 204, 204)
 Fill_4.result().subResult(2).setColor(51, 51, 102)
 Fill_4.result().subResult(3).setColor(102, 204, 102)
 Fill_4.result().subResult(4).setColor(204, 204, 0)
-
 Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Fill_4_1_4"), model.selection("SOLID", "Fill_4_1_2")])
-
 Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("FACE", "Plane_2 arrivee tuyau"))
-
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2 arrivee tuyau"))
 SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Point_2"), False)
 SketchPoint_2 = SketchProjection_5.createdFeature()
@@ -147,15 +137,13 @@ SketchConstraintEqual_3 = Sketch_3.setEqual(SketchLine_14.result(), SketchLine_1
 SketchConstraintEqual_4 = Sketch_3.setEqual(SketchLine_17.result(), SketchLine_16.result())
 SketchConstraintLength_3 = Sketch_3.setLength(SketchLine_10.result(), "diam_tuyau")
 model.do()
-
-Extrusion_2_objects = [model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_11f-SketchLine_14r-SketchLine_16r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_10f-SketchLine_14f-SketchLine_17r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_13f-SketchLine_15r-SketchLine_17f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_12f-SketchLine_15f-SketchLine_16f")]
+Extrusion_2_objects = [model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_14r-SketchLine_11f-SketchLine_16r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchCircle_1_2f-SketchLine_17r-SketchLine_10f-SketchLine_14f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_15r-SketchLine_13f-SketchLine_17f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_1_2f-SketchLine_16f-SketchLine_12f-SketchLine_15f")]
 Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), 10, 0)
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), "haut_int_tuyau", 0)
-
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_3"))
-SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), False)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_10r")], model.selection(), "haut_int_tuyau", 0)
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1_3/To_Face"))
+SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1_3/To_Face]"), False)
 SketchPoint_3 = SketchProjection_6.createdFeature()
-SketchProjection_7 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), False)
+SketchProjection_7 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1_2/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_2/To_Face]"), False)
 SketchPoint_4 = SketchProjection_7.createdFeature()
 SketchArc_2 = Sketch_4.addArc(0, 0, -7.071067811865476, -7.071067811865472, 7.071067811865476, 7.071067811865472, True)
 SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchPoint_3.result(), SketchArc_2.startPoint())
@@ -163,48 +151,102 @@ SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchPoint_4.result(),
 SketchLine_18 = Sketch_4.addLine(7.071067811865476, 7.071067811865472, -7.071067811865476, -7.071067811865472)
 SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchLine_18.startPoint())
 SketchConstraintCoincidence_29 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_18.endPoint())
-SketchProjection_8 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), False)
+SketchProjection_8 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_14][Extrusion_2_1_1/To_Face]"), False)
 SketchPoint_5 = SketchProjection_8.createdFeature()
 SketchConstraintCoincidence_30 = Sketch_4.setCoincident(SketchArc_2.endPoint(), SketchAPI_Point(SketchPoint_5).coordinates())
 model.do()
-
-Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_18"), 0, 180)
-
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/SketchLine_18"), 0, 180)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
 Cut_1.result().setName("demi-sphere")
-
-Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/From_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_10&Extrusion_2_1/To_Face_4"))
-Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_12&Extrusion_2_1/Generated_Face_11&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/From_Face_1"))
-Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/From_Face_3"))
-Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/From_Face_4"))
-
+Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_16][Extrusion_2_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_16][Extrusion_2_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_16][Extrusion_2_1_1/To_Face]"))
+Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_14][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_11][Extrusion_2_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_14][Extrusion_2_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_1/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_1/Generated_Face&Sketch_3/SketchLine_14][Extrusion_2_1_1/From_Face]"))
+Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1_2/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_2/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_2/Generated_Face&Sketch_3/SketchLine_10][Extrusion_2_1_2/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_1_2&weak_name_1][Extrusion_2_1_2/Generated_Face&Sketch_3/SketchLine_17][Extrusion_2_1_2/From_Face]"))
+Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_13][Extrusion_2_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1_3/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_1_2][Extrusion_2_1_3/Generated_Face&Sketch_3/SketchLine_15][Extrusion_2_1_3/From_Face]"))
 Recover_1 = model.addRecover(Part_1_doc, Cut_1, [Extrusion_3.result()])
-
-Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape4"), model.selection("EDGE", "Recover_1_1/Shape4&Recover_1_1/Shape6"), "90+45")
-Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape1"), model.selection("EDGE", "Recover_1_1/Shape1&Recover_1_1/Shape6"), "90+45")
-Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape2"), model.selection("EDGE", "Recover_1_1/Shape2&Recover_1_1/Shape6"), "90+45")
-Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape6"), model.selection("EDGE", "Recover_1_1/Shape3&Recover_1_1/Shape6"), 45)
-
+Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Sketch_3/SketchLine_10"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_10][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), "90+45")
+Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Sketch_3/SketchLine_13"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_13][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), "90+45")
+Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Sketch_3/SketchLine_12"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_12][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), "90+45")
+Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Modified_Face&Extrusion_3_1/To_Face"), model.selection("EDGE", "[Recover_1_1/Modified_Face&Sketch_3/SketchLine_11][Recover_1_1/Modified_Face&Extrusion_3_1/To_Face]"), 45)
 Fill_5_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")]
 Fill_5 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Fill_5_objects_2)
-
+Fill_5.result().subResult(0).setName("Fill_5_1_1")
+Fill_5.result().subResult(1).setName("Fill_5_1_2")
+Fill_5.result().subResult(2).setName("Fill_5_1_3")
+Fill_5.result().subResult(3).setName("Fill_5_1_4")
+Fill_5.result().subResult(4).setName("Fill_5_1_5")
+Fill_5.result().subResult(5).setName("Fill_5_1_6")
+Fill_5.result().subResult(6).setName("Fill_5_1_7")
+Fill_5.result().subResult(7).setName("Fill_5_1_8")
+Fill_5.result().subResult(8).setName("Fill_5_1_9")
+Fill_5.result().subResult(9).setName("Fill_5_1_10")
+Fill_5.result().subResult(10).setName("Fill_5_1_11")
+Fill_5.result().subResult(11).setName("Fill_5_1_12")
+Fill_5.result().subResult(12).setName("Fill_5_1_13")
+Fill_5.result().subResult(13).setName("Fill_5_1_14")
+Fill_5.result().subResult(14).setName("Fill_5_1_15")
+Fill_5.result().subResult(15).setName("Fill_5_1_16")
 Union_2_objects = [model.selection("SOLID", "Fill_5_1_14"), model.selection("SOLID", "Fill_5_1_15"), model.selection("SOLID", "Fill_5_1_16")]
 Union_2 = model.addUnion(Part_1_doc, Union_2_objects)
-Union_3_objects = [model.selection("SOLID", "Fill_5_1_8/Fill_5_1_8"), model.selection("SOLID", "Fill_5_1_4/Fill_5_1_4"), model.selection("SOLID", "Fill_5_1_9/Fill_5_1_9"), model.selection("SOLID", "Fill_5_1_11/Fill_5_1_11")]
+Union_2.result().subResult(0).setName("Union_2_1_1")
+Union_2.result().subResult(1).setName("Union_2_1_2")
+Union_2.result().subResult(2).setName("Union_2_1_3")
+Union_2.result().subResult(3).setName("Union_2_1_4")
+Union_2.result().subResult(4).setName("Union_2_1_5")
+Union_2.result().subResult(5).setName("Union_2_1_6")
+Union_2.result().subResult(6).setName("Union_2_1_7")
+Union_2.result().subResult(7).setName("Union_2_1_8")
+Union_2.result().subResult(8).setName("Union_2_1_9")
+Union_2.result().subResult(9).setName("Union_2_1_10")
+Union_2.result().subResult(10).setName("Union_2_1_11")
+Union_2.result().subResult(11).setName("Union_2_1_12")
+Union_2.result().subResult(12).setName("Union_2_1_13")
+Union_2.result().subResult(13).setName("Union_2_1_14")
+Union_3_objects = [model.selection("SOLID", "Union_2_1_8"), model.selection("SOLID", "Union_2_1_4"), model.selection("SOLID", "Union_2_1_9"), model.selection("SOLID", "Union_2_1_11")]
 Union_3 = model.addUnion(Part_1_doc, Union_3_objects)
-Union_4_objects = [model.selection("SOLID", "Fill_5_1_6/Fill_5_1_6"), model.selection("SOLID", "Fill_5_1_10/Fill_5_1_10"), model.selection("SOLID", "Fill_5_1_13/Fill_5_1_13")]
+Union_3.result().subResult(0).setName("Union_3_1_1")
+Union_3.result().subResult(1).setName("Union_3_1_2")
+Union_3.result().subResult(2).setName("Union_3_1_3")
+Union_3.result().subResult(3).setName("Union_3_1_4")
+Union_3.result().subResult(4).setName("Union_3_1_5")
+Union_3.result().subResult(5).setName("Union_3_1_6")
+Union_3.result().subResult(6).setName("Union_3_1_7")
+Union_3.result().subResult(7).setName("Union_3_1_8")
+Union_3.result().subResult(8).setName("Union_3_1_9")
+Union_3.result().subResult(9).setName("Union_3_1_10")
+Union_3.result().subResult(10).setName("Union_3_1_11")
+Union_4_objects = [model.selection("SOLID", "Union_3_1_5"), model.selection("SOLID", "Union_3_1_7"), model.selection("SOLID", "Union_3_1_9")]
 Union_4 = model.addUnion(Part_1_doc, Union_4_objects)
-Union_5_objects = [model.selection("SOLID", "Fill_5_1_2/Fill_5_1_2"), model.selection("SOLID", "Fill_5_1_1/Fill_5_1_1"), model.selection("SOLID", "Fill_5_1_3/Fill_5_1_3")]
+Union_4.result().subResult(0).setName("Union_4_1_1")
+Union_4.result().subResult(1).setName("Union_4_1_2")
+Union_4.result().subResult(2).setName("Union_4_1_3")
+Union_4.result().subResult(3).setName("Union_4_1_4")
+Union_4.result().subResult(4).setName("Union_4_1_5")
+Union_4.result().subResult(5).setName("Union_4_1_6")
+Union_4.result().subResult(6).setName("Union_4_1_7")
+Union_4.result().subResult(7).setName("Union_4_1_8")
+Union_4.result().subResult(8).setName("Union_4_1_9")
+Union_5_objects = [model.selection("SOLID", "Union_4_1_2"), model.selection("SOLID", "Union_4_1_1"), model.selection("SOLID", "Union_4_1_3")]
 Union_5 = model.addUnion(Part_1_doc, Union_5_objects)
-Union_6_objects = [model.selection("SOLID", "Fill_5_1_5/Fill_5_1_5"), model.selection("SOLID", "Fill_5_1_7/Fill_5_1_7"), model.selection("SOLID", "Fill_5_1_12/Fill_5_1_12")]
+Union_5.result().subResult(0).setName("Union_5_1_1")
+Union_5.result().subResult(1).setName("Union_5_1_2")
+Union_5.result().subResult(2).setName("Union_5_1_3")
+Union_5.result().subResult(3).setName("Union_5_1_4")
+Union_5.result().subResult(4).setName("Union_5_1_5")
+Union_5.result().subResult(5).setName("Union_5_1_6")
+Union_5.result().subResult(6).setName("Union_5_1_7")
+Union_6_objects = [model.selection("SOLID", "Union_5_1_1"), model.selection("SOLID", "Union_5_1_2"), model.selection("SOLID", "Union_5_1_3")]
 Union_6 = model.addUnion(Part_1_doc, Union_6_objects)
 Union_6.result().setColor(0, 0, 204)
+Union_6.result().subResult(0).setName("Union_6_1_1")
 Union_6.result().subResult(0).setColor(204, 102, 102)
+Union_6.result().subResult(1).setName("Union_6_1_2")
 Union_6.result().subResult(1).setColor(127, 254, 127)
+Union_6.result().subResult(2).setName("Union_6_1_3")
 Union_6.result().subResult(2).setColor(102, 51, 102)
+Union_6.result().subResult(3).setName("Union_6_1_4")
 Union_6.result().subResult(3).setColor(76, 76, 153)
+Union_6.result().subResult(4).setName("Union_6_1_5")
 Union_6.result().subResult(4).setColor(0, 0, 254)
-
 Partition_1_objects = [model.selection("SOLID", "Recover_1_1"), model.selection("COMPSOLID", "Union_1_1"), model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "demi-sphere")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 Partition_1.result().setColor(102, 0, 0)
@@ -227,7 +269,6 @@ Partition_1.result().subResult(15).setColor(254, 127, 254)
 Partition_1.result().subResult(16).setColor(153, 153, 0)
 Partition_1.result().subResult(17).setColor(153, 153, 0)
 Partition_1.result().subResult(18).setColor(204, 0, 204)
-
 Folder_1 = model.addFolder(Part_1_doc, Revolution_1, Union_1)
 Folder_2 = model.addFolder(Part_1_doc, Point_3, Union_6)
 model.do()
@@ -255,4 +296,5 @@ model.testResultsVolumes(Partition_1, [103221.354557478349306620657444])
 
 model.end()
 
+# too long
 #assert(model.checkPythonDump())
index 5364304ea4166eafcf596a2e4dd676df86d88447..83a45753c4172e6c4379a37ac9f676a643279cbe 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -43,11 +44,11 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_5 = Sketch_2.addLine(0, 0, -37.87650574447493, 64.03712943185892)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_2s-SketchLine_1e"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchPoint_2.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")], model.selection("EDGE", "Sketch_2/SketchLine_5"), 100, 0)
 model.do()
 model.end()
 
index e1366fd36bdaeb30ca78c3c8ca26966db40dc34c..f6583457706da54786875d5eb92e2ef648ea219d 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -52,13 +53,13 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
-SketchArc_1 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 81.26217508737108, 0, 0, 81.26217508737108, False)
+SketchArc_1 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 81.26217508737108, 0, 0, 81.26217508737108, False)
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_1.center())
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_1.startPoint())
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchArc_1.endPoint())
 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result())
-SketchArc_2 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 76.26217508737108, 0, 0, 76.26217508737108, False)
+SketchArc_2 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 76.26217508737108, 0, 0, 76.26217508737108, False)
 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_2.center())
 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_23")
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_9.result(), SketchArc_2.startPoint())
@@ -79,15 +80,18 @@ SketchConstraintEqual_3.setName("SketchConstraintEqual_4")
 SketchConstraintEqual_4 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_1.result())
 SketchConstraintEqual_4.setName("SketchConstraintEqual_5")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_11 = Sketch_2.addLine(40, 0, 30, 0)
 SketchLine_12 = Sketch_2.addLine(30, 0, 30, 10)
 SketchLine_13 = Sketch_2.addLine(30, 10, 40, 10)
 SketchLine_14 = Sketch_2.addLine(40, 10, 40, 0)
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19")
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20")
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26")
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_11.result())
@@ -101,23 +105,22 @@ SketchConstraintEqual_5.setName("SketchConstraintEqual_1")
 model.do()
 Sketch_2.setName("Sketch_3")
 Sketch_2.result().setName("Sketch_3")
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r_wire")])
 Face_2.setName("Face_5")
 Face_2.result().setName("Face_5_1")
-LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), 10, 2)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), 10, 2)
 LinearCopy_1.result().setName("LinearCopy")
-LinearCopy_1.result().subResult(0).setName("LinearCopy_1_1_1")
-LinearCopy_1.result().subResult(1).setName("LinearCopy_1_1_2")
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("COMPOUND", "LinearCopy")])
+model.do()
 model.end()
 
 from GeomAPI import  GeomAPI_Shape
 
-model.testNbResults(Boolean_1, 1)
-model.testNbSubResults(Boolean_1, [3])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [3])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [20])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [40])
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [3])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [20])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [40])
 
 assert(model.checkPythonDump())
index 4f591ed016aafcc5c2d607921f5ae8b473f65376..4aa76fd6eedca1cf74bf71de394708b8a71335e0 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -93,11 +94,11 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552
 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645)
 SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")])
-Face_3_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")]
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_9f-SketchArc_1_2f-SketchLine_10r-SketchArc_2_2r_wire")])
+Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")]
 Face_3 = model.addFace(Part_1_doc, Face_3_objects)
-Face_4_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]
+Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")]
 Face_4 = model.addFace(Part_1_doc, Face_4_objects)
 Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
@@ -108,15 +109,19 @@ Group_2.result().setName("acier")
 Group_2.result().setColor(170, 85, 0)
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0)
-SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), False)
+SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19")
 SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10)
 SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10)
 SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0)
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20")
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22")
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26")
 SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result())
@@ -128,33 +133,33 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1")
 SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result())
 SketchConstraintEqual_5.setName("SketchConstraintEqual_1")
 model.do()
-Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")])
-LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
+Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r_wire")])
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
 Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e"))
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"))
 LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
 Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"))
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"))
 LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4)
 Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1"))
+Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "LinearCopy_3_1_1/MV:Translated&Sketch_3/SketchLine_13_EndVertex&Sketch_3/SketchLine_14_StartVertex"))
 LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3)
 Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s"))
+Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"))
 LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Boolean_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1")], Boolean_1_objects_2)
+Fill_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]
+Fill_1 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Partition_1_1")], Fill_1_objects_2)
 model.do()
 model.end()
 
 from GeomAPI import  GeomAPI_Shape
 
-model.testNbResults(Boolean_1, 1)
-model.testNbSubResults(Boolean_1, [60])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [60])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [273])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [546])
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [60])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [60])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [273])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [546])
 
 assert(model.checkPythonDump())
index dd6e4c4e914b3e3de3018130af3d6d047d006d45..9ddfe5e979bd642ade75e0a0b5ac56aaf0f59c2c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -93,11 +94,11 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552
 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645)
 SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")])
-Face_3_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")]
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_9f-SketchArc_1_2f-SketchLine_10r-SketchArc_2_2r_wire")])
+Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")]
 Face_3 = model.addFace(Part_1_doc, Face_3_objects)
-Face_4_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")]
+Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")]
 Face_4 = model.addFace(Part_1_doc, Face_4_objects)
 Group_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
@@ -108,15 +109,19 @@ Group_2.result().setName("acier")
 Group_2.result().setColor(170, 85, 0)
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0)
-SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), False)
+SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19")
 SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10)
 SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10)
 SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0)
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20")
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22")
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26")
 SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result())
@@ -128,33 +133,33 @@ SketchConstraintLength_3.setName("SketchConstraintLength_1")
 SketchConstraintEqual_5 = Sketch_3.setEqual(SketchLine_13.result(), SketchLine_14.result())
 SketchConstraintEqual_5.setName("SketchConstraintEqual_1")
 model.do()
-Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")])
-LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
+Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r_wire")])
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "Sketch_1/SketchLine_9"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
 Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_5e"))
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"))
 LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4, model.selection("EDGE", "PartSet/OY"), "length_assemblage", 2)
 Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/Vertex-SketchProjection_1-SketchPoint_1-SketchLine_12s-SketchLine_11e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"))
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Sketch_3/SketchLine_11_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"))
 LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 4)
 Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_1"))
+Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "LinearCopy_3_1_1/MV:Translated&Sketch_3/SketchLine_13_EndVertex&Sketch_3/SketchLine_14_StartVertex"))
 LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 3)
 Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
-Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_9s-SketchLine_7e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_10s"))
+Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"))
 LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "length_assemblage", 2)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Boolean_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], Boolean_1_objects_2)
+Fill_1_objects_2 = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("FACE", "Face_4_1"), model.selection("COMPOUND", "LinearCopy_1_1"), model.selection("COMPOUND", "LinearCopy_2_1"), model.selection("COMPOUND", "LinearCopy_3_1"), model.selection("COMPOUND", "LinearCopy_4_1"), model.selection("COMPOUND", "LinearCopy_5_1")]
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], Fill_1_objects_2)
 model.do()
 model.end()
 
 from GeomAPI import  GeomAPI_Shape
 
-model.testNbResults(Boolean_1, 1)
-model.testNbSubResults(Boolean_1, [0])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [0])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [60])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [273])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [546])
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [0])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [60])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [273])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [546])
 
 assert(model.checkPythonDump())
index d23abdd5e3243bbf78d45debdceaa60d0d3fe458..0f2dcbe8261746e0a59ff041853539d2c3e6c0c8 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -26,7 +27,8 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Ellipsoid_1 = model.addEllipsoid(Part_1_doc, 10, 20, 40)
 Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3)
-LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Ellipsoid_1_1")], model.selection("EDGE", "Ellipsoid_1_1/Face_1"), 10, 2)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Ellipsoid_1_1")], model.selection("EDGE", "[Ellipsoid_1_1/Face_1][weak_name_3]"), 10, 2)
+model.do()
 model.end()
 
 # check that for the linear copy direction the elliptical edge is invalid
index 8154bd4bd411c14afd7496f1e1e61ba6c090076e..4ff0d3903c3c60bedb998fcbf5886ad56db4f4e7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -36,7 +35,7 @@ SketchLine_1 = Sketch_1.addLine(153.5, 27.7, -153.5, 27.7)
 SketchLine_2 = Sketch_1.addLine(-153.5, 27.7, -153.5, 16.19999999999975)
 SketchLine_3 = Sketch_1.addLine(-151.5000000000398, -24.69999999999951, 151.5000000000377, -24.69999999999977)
 SketchLine_4 = Sketch_1.addLine(153.5000000000001, -22.70000000003736, 153.5, -15.80000000000003)
-SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
@@ -44,20 +43,20 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 307)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 11.50000000000025)
 SketchPoint_1 = Sketch_1.addPoint(0, 27.7)
-SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result())
-SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_5")
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_5")
 SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_5 = SketchProjection_1.createdFeature()
-SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_5.result())
-SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6")
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_5.result())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_6")
 SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchLine_1.result(), SketchPoint_1.coordinates())
 SketchPoint_2 = Sketch_1.addPoint(153.5, 0)
-SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result())
-SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7")
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_7")
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_6 = SketchProjection_2.createdFeature()
-SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_6.result())
-SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_6.result())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_8")
 SketchLine_7 = Sketch_1.addLine(-108.1499999999999, 23.04999999999991, -109.8500000000001, 23.04999999999991)
 SketchLine_8 = Sketch_1.addLine(-109.8500000000001, 19.75000000000008, -108.1499999999999, 19.75000000000008)
 SketchLine_8.setName("SketchLine_9")
@@ -65,15 +64,15 @@ SketchLine_8.result().setName("SketchLine_9")
 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_7.result())
 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_8.result())
 SketchArc_1 = Sketch_1.addArc(-109.8500000000001, 21.39999999999999, -109.8500000000001, 19.75000000000008, -109.8500000000001, 23.04999999999991, True)
-SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchArc_1.startPoint())
-SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_9")
 SketchArc_2 = Sketch_1.addArc(-108.1499999999999, 21.39999999999999, -108.1499999999999, 19.75000000000008, -108.1499999999999, 23.04999999999991, False)
-SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchArc_2.startPoint())
-SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10")
-SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_7.startPoint())
-SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_11")
-SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.endPoint())
-SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_12")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchArc_2.startPoint())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_10")
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_11")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_12")
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_7.result())
 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_8.result(), SketchArc_2.results()[1])
 SketchConstraintTangent_3 = Sketch_1.setTangent(SketchLine_8.result(), SketchArc_1.results()[1])
@@ -82,24 +81,24 @@ SketchLine_9 = Sketch_1.addLine(-111.5, 21.39999999999998, -106.5, 21.4000000000
 SketchLine_9.setName("SketchLine_10")
 SketchLine_9.result().setName("SketchLine_10")
 SketchLine_9.setAuxiliary(True)
-SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_9.startPoint(), SketchArc_1.results()[1])
-SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_13")
-SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_2.results()[1])
-SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_14")
-SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_9.result())
-SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_15")
-SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_9.result())
-SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_16")
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_9.startPoint(), SketchArc_1.results()[1])
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_13")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_2.results()[1])
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_14")
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_9.result())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_15")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_9.result())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_16")
 SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_9.result(), 5)
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_7.result(), 3.3, True)
 SketchPoint_3 = Sketch_1.addPoint(0, 21.40000000000294)
-SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_5.result())
-SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_17")
-SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_9.result())
-SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_18")
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_5.result())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_17")
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_9.result())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_18")
 SketchPoint_4 = Sketch_1.addPoint(-109, 21.4)
-SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_9.result())
-SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_19")
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_9.result())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_19")
 SketchConstraintMiddle_2 = Sketch_1.setMiddlePoint(SketchPoint_4.coordinates(), SketchLine_9.result())
 SketchConstraintMiddle_2.setName("SketchConstraintMiddle_3")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchPoint_4.coordinates(), SketchPoint_3.coordinates(), 109)
@@ -122,8 +121,8 @@ SketchArc_4.result().setName("SketchArc_5")
 SketchArc_4.results()[1].setName("SketchArc_5_2")
 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchPoint_4.coordinates(), SketchLine_6.result(), 21.4, True)
 SketchPoint_5 = Sketch_1.addPoint(0, -21)
-SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchPoint_5.coordinates(), SketchLine_5.result())
-SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_20")
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_5.coordinates(), SketchLine_5.result())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_20")
 SketchConstraintDistance_3 = Sketch_1.setDistance(SketchPoint_5.coordinates(), SketchLine_6.result(), 21, True)
 SketchMultiTranslation_2_objects = [SketchArc_1.results()[1], SketchLine_7.result(), SketchLine_8.result(), SketchArc_2.results()[1], SketchLine_10.result(), SketchArc_5.results()[1], SketchLine_12.result(), SketchArc_3.results()[1], SketchArc_4.results()[1], SketchLine_13.result(), SketchLine_11.result(), SketchArc_6.results()[1]]
 SketchMultiTranslation_2 = Sketch_1.addTranslation(SketchMultiTranslation_2_objects, SketchPoint_3.coordinates(), SketchPoint_5.coordinates(), 2)
@@ -160,49 +159,49 @@ SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_20.result(), 37)
 SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_21.result(), 8)
 SketchArc_13 = Sketch_1.addArc(-146.43, 15.7, -145.43, 15.69999999999999, -146.43, 14.7, False)
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_13.results()[1], 1)
-SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchArc_13.startPoint())
-SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_31")
-SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_13.endPoint(), SketchLine_21.startPoint())
-SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_29")
-SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_20.result())
-SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_30")
-SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_21.result())
-SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_32")
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchArc_13.startPoint())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_31")
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_13.endPoint(), SketchLine_21.startPoint())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_29")
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_20.result())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_30")
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_13.center(), SketchLine_21.result())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_32")
 SketchArc_14 = Sketch_1.addArc(-146.43, 5.699999999999998, -146.43, 6.699999999999998, -145.43, 5.7, False)
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_13.results()[1], SketchArc_14.results()[1])
-SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchArc_14.startPoint(), SketchLine_21.endPoint())
-SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_35")
-SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchLine_22.startPoint())
-SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_34")
-SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_22.result())
-SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_33")
-SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_21.result())
-SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_36")
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_14.startPoint(), SketchLine_21.endPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_35")
+SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchLine_22.startPoint())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_34")
+SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_22.result())
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_33")
+SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchArc_14.center(), SketchLine_21.result())
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_36")
 SketchArc_15 = Sketch_1.addArc(-107.43, 15.69999999999999, -107.43, 14.69999999999999, -108.43, 15.69999999999999, False)
 SketchConstraintEqual_2 = Sketch_1.setEqual(SketchArc_15.results()[1], SketchArc_13.results()[1])
-SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchLine_20.startPoint())
-SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_39")
-SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchLine_23.endPoint())
-SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_37")
-SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_20.result())
-SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_38")
-SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_23.result())
-SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_40")
+SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchLine_20.startPoint())
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_39")
+SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchLine_23.endPoint())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_37")
+SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_20.result())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_38")
+SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchArc_15.center(), SketchLine_23.result())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_40")
 SketchArc_16 = Sketch_1.addArc(-107.43, 5.7, -108.43, 5.7, -107.43, 6.7, False)
 SketchConstraintEqual_3 = Sketch_1.setEqual(SketchArc_15.results()[1], SketchArc_16.results()[1])
-SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_16.startPoint(), SketchLine_22.endPoint())
-SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_43")
-SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_16.endPoint(), SketchLine_23.startPoint())
-SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_42")
-SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_22.result())
-SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_41")
-SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_23.result())
-SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_44")
+SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_16.startPoint(), SketchLine_22.endPoint())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_43")
+SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_16.endPoint(), SketchLine_23.startPoint())
+SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_42")
+SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_22.result())
+SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_41")
+SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchArc_16.center(), SketchLine_23.result())
+SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_44")
 SketchConstraintDistance_4 = Sketch_1.setDistance(SketchArc_15.center(), SketchLine_5.result(), 107.43, True)
 SketchConstraintDistance_5 = Sketch_1.setDistance(SketchArc_16.center(), SketchLine_6.result(), 5.7, True)
 SketchPoint_6 = Sketch_1.addPoint(-95.65000000000001, 15.7)
-SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchPoint_6.coordinates(), SketchLine_20.result())
-SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_45")
+SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchPoint_6.coordinates(), SketchLine_20.result())
+SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_45")
 SketchConstraintDistance_6 = Sketch_1.setDistance(SketchArc_15.center(), SketchPoint_6.coordinates(), "5.89*2", True)
 SketchMultiTranslation_3_objects = [SketchLine_23.result(), SketchArc_13.results()[1], SketchLine_21.result(), SketchArc_14.results()[1], SketchArc_16.results()[1], SketchLine_22.result(), SketchLine_20.result(), SketchArc_15.results()[1]]
 SketchMultiTranslation_3 = Sketch_1.addTranslation(SketchMultiTranslation_3_objects, SketchArc_13.center(), SketchPoint_6.coordinates(), 6)
@@ -293,8 +292,8 @@ SketchLine_25.result().setName("SketchLine_29")
 SketchLine_24.setName("SketchLine_25")
 SketchLine_24.result().setName("SketchLine_25")
 SketchPoint_7 = Sketch_1.addPoint(-107.43, -5.3)
-SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchPoint_7.coordinates(), SketchLine_23.result())
-SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_46")
+SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchPoint_7.coordinates(), SketchLine_23.result())
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_46")
 SketchConstraintDistance_7 = Sketch_1.setDistance(SketchPoint_7.coordinates(), SketchLine_6.result(), 5.3, True)
 SketchMultiTranslation_4_objects = [SketchLine_20.result(), SketchArc_21.results()[1], SketchLine_22.result(), SketchArc_16.results()[1], SketchLine_41.result(), SketchLine_37.result(), SketchLine_38.result(), SketchArc_33.results()[1], SketchLine_43.result(), SketchLine_24.result(), SketchLine_42.result(), SketchArc_13.results()[1], SketchArc_31.results()[1], SketchLine_36.result(), SketchLine_28.result(), SketchArc_19.results()[1], SketchLine_21.result(), SketchArc_36.results()[1], SketchArc_14.results()[1], SketchArc_24.results()[1], SketchLine_31.result(), SketchArc_32.results()[1], SketchArc_20.results()[1], SketchLine_27.result(), SketchLine_34.result(), SketchArc_30.results()[1], SketchLine_39.result(), SketchArc_25.results()[1], SketchArc_34.results()[1], SketchArc_18.results()[1], SketchLine_40.result(), SketchLine_35.result(), SketchArc_35.results()[1], SketchArc_28.results()[1], SketchLine_32.result(), SketchArc_22.results()[1], SketchArc_26.results()[1], SketchLine_26.result(), SketchLine_30.result(), SketchArc_15.results()[1], SketchLine_33.result(), SketchLine_29.result(), SketchLine_23.result(), SketchLine_25.result(), SketchArc_29.results()[1], SketchArc_23.results()[1], SketchArc_27.results()[1], SketchArc_17.results()[1]]
 SketchMultiTranslation_4 = Sketch_1.addTranslation(SketchMultiTranslation_4_objects, SketchArc_15.center(), SketchPoint_7.coordinates(), 2)
@@ -360,17 +359,17 @@ SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_68.result())
 SketchConstraintHorizontal_8 = Sketch_1.setHorizontal(SketchLine_70.result())
 SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_69.result())
 SketchArc_61 = Sketch_1.addArc(-152.2999999999999, 14.70000000000002, -150.7999999999999, 14.70000000000003, -152.2999999999999, 16.20000000000002, False)
-SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchArc_61.startPoint(), SketchLine_69.startPoint())
-SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_47")
-SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_61.endPoint(), SketchLine_68.endPoint())
-SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_50")
+SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchArc_61.startPoint(), SketchLine_69.startPoint())
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_47")
+SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchArc_61.endPoint(), SketchLine_68.endPoint())
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_50")
 SketchConstraintTangent_5 = Sketch_1.setTangent(SketchArc_61.results()[1], SketchLine_69.result())
 SketchConstraintTangent_6 = Sketch_1.setTangent(SketchArc_61.results()[1], SketchLine_68.result())
 SketchArc_62 = Sketch_1.addArc(-152.2999999999999, 9.699999999999999, -152.2999999999999, 8.199999999999999, -150.7999999999999, 9.699999999999999, False)
-SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchArc_62.startPoint(), SketchLine_70.startPoint())
-SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_48")
-SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchArc_62.endPoint(), SketchLine_69.endPoint())
-SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_51")
+SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_62.startPoint(), SketchLine_70.startPoint())
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_48")
+SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchArc_62.endPoint(), SketchLine_69.endPoint())
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_51")
 SketchConstraintTangent_7 = Sketch_1.setTangent(SketchArc_62.results()[1], SketchLine_69.result())
 SketchConstraintTangent_8 = Sketch_1.setTangent(SketchArc_62.results()[1], SketchLine_70.result())
 SketchConstraintDistance_8 = Sketch_1.setDistance(SketchLine_70.startPoint(), SketchLine_68.result(), 8, True)
@@ -379,8 +378,8 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_61.results()[1], 1.5)
 SketchConstraintEqual_4 = Sketch_1.setEqual(SketchArc_61.results()[1], SketchArc_62.results()[1])
 SketchConstraintDistance_10 = Sketch_1.setDistance(SketchLine_70.endPoint(), SketchLine_6.result(), 8.199999999999999, True)
 SketchPoint_8 = Sketch_1.addPoint(-153.5, -7.799999999999999)
-SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchPoint_8.coordinates(), SketchLine_2.result())
-SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_53")
+SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchPoint_8.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_53")
 SketchConstraintDistance_11 = Sketch_1.setDistance(SketchPoint_8.coordinates(), SketchLine_6.result(), 7.8, True)
 SketchMultiTranslation_5_objects = [SketchLine_68.result(), SketchArc_61.results()[1], SketchLine_69.result(), SketchArc_62.results()[1], SketchLine_70.result()]
 SketchMultiTranslation_5 = Sketch_1.addTranslation(SketchMultiTranslation_5_objects, SketchLine_68.startPoint(), SketchPoint_8.coordinates(), 2)
@@ -410,23 +409,24 @@ SketchLine_80 = Sketch_1.addLine(-153.4999999999999, 8.199999999999999, -153.5,
 SketchLine_80.setName("SketchLine_81")
 SketchLine_80.result().setName("SketchLine_81")
 SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_2.result(), SketchLine_80.result())
-SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_70.endPoint(), SketchLine_80.startPoint())
-SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_54")
-SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchLine_68.startPoint(), SketchLine_2.endPoint())
-SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_55")
+SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchLine_70.endPoint(), SketchLine_80.startPoint())
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_54")
+SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_68.startPoint(), SketchLine_2.endPoint())
+SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_55")
 SketchLine_81 = Sketch_1.addLine(-153.4999999999999, -15.79999999999969, -153.5, -22.70000000003739)
 SketchLine_81.setName("SketchLine_82")
 SketchLine_81.result().setName("SketchLine_82")
 SketchConstraintCollinear_2 = Sketch_1.setCollinear(SketchLine_80.result(), SketchLine_81.result())
-SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_81.startPoint(), SketchLine_73.result())
-SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_49")
-SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_80.endPoint(), SketchPoint_8.result())
-SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_52")
+SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchLine_81.startPoint(), SketchLine_73.result())
+SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_49")
+SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_80.endPoint(), SketchPoint_8.result())
+SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_52")
 SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_80.result())
 SketchLine_82 = Sketch_1.addLine(153.5, 16.19999999999975, 153.5, 27.7)
 SketchLine_82.setName("SketchLine_83")
 SketchLine_82.result().setName("SketchLine_83")
-SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_82.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_82.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_56")
 SketchConstraintCollinear_3 = Sketch_1.setCollinear(SketchLine_4.result(), SketchLine_82.result())
 SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchLine_82.startPoint(), SketchLine_74.result())
 SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_56")
@@ -443,7 +443,7 @@ SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_59")
 SketchLine_84 = Sketch_1.addLine(-153.5, -22.70000000003739, -151.5000000000398, -24.69999999999951)
 SketchLine_84.setName("SketchLine_85")
 SketchLine_84.result().setName("SketchLine_85")
-SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_84.result(), SketchLine_3.result(), 45)
+SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_84.result(), SketchLine_3.result(), 45.0000000000272)
 SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_84.startPoint(), SketchLine_81.endPoint())
 SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_62")
 SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_84.endPoint(), SketchLine_3.startPoint())
@@ -459,14 +459,14 @@ SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_61")
 SketchConstraintCoincidence_53 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_85.result())
 SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_63")
 model.do()
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4e-SketchLine_80e"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"))
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_83e"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False)
 SketchPoint_9 = SketchProjection_3.createdFeature()
 SketchArc_69 = Sketch_2.addArc(27.70000001097709, 0.85, 27.7, 0, 28.55000001097708, 0.85, False)
 SketchConstraintCoincidence_54 = Sketch_2.setCoincident(SketchPoint_9.result(), SketchArc_69.startPoint())
 SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_64")
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_83"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_83"), False)
 SketchLine_86 = SketchProjection_4.createdFeature()
 SketchLine_86.setName("SketchLine_87")
 SketchLine_86.result().setName("SketchLine_87")
@@ -489,13 +489,13 @@ SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_67")
 SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_88.result())
 SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_88.result(), 10)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchArc_69_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_89")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchArc_69_2"), model.selection("EDGE", "Sketch_2/SketchLine_89")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")], model.selection("EDGE", "PartSet/OX"), 0, 307)
-Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3e-SketchLine_86e"))
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"))
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
-SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3e-SketchLine_86e"), False)
+SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False)
 SketchPoint_10 = SketchProjection_5.createdFeature()
-SketchArc_70 = Sketch_3.addArc(-24.69999999999951, 1.85, -24.69999999999928, -3.648414406296559e-014, -26.54999999999951, 1.85, True)
+SketchArc_70 = Sketch_3.addArc(-24.69999999999951, 1.85, -24.69999999999928, -3.648414406296559e-14, -26.54999999999951, 1.85, True)
 SketchConstraintCoincidence_58 = Sketch_3.setCoincident(SketchPoint_10.result(), SketchArc_70.startPoint())
 SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_68")
 SketchLine_89 = Sketch_3.addLine(-26.54999999999951, 1.85, -24.69999999999951, 1.85)
@@ -525,18 +525,18 @@ SketchConstraintVertical_9 = Sketch_3.setVertical(SketchLine_91.result())
 SketchConstraintRadius_4 = Sketch_3.setRadius(SketchArc_70.results()[1], "rext_2-ep/2")
 SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_91.result(), 10)
 model.do()
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_92"), model.selection("EDGE", "Sketch_3/Edge-SketchArc_70_2")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_92"), model.selection("EDGE", "Sketch_3/SketchArc_70_2")])
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2")], model.selection("EDGE", "PartSet/OX"), 0, 299)
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Extrusion_2_2"), model.selection("FACE", "Extrusion_2_1")], model.selection("EDGE", "PartSet/OX"), -2)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_7r-SketchLine_9r-SketchArc_1_2r-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11r-SketchLine_12r-SketchArc_4_2r-SketchArc_5_2r-SketchLine_13r-SketchLine_14r-SketchArc_6_2r-SketchArc_7_2r-SketchLine_15r-SketchLine_16r-SketchArc_8_2r-SketchLine_17r-SketchArc_9_2r-SketchLine_18r-SketchArc_10_2r-SketchArc_11_2r-SketchLine_19r-SketchLine_20r-SketchArc_12_2r-SketchLine_21r-SketchLine_22r-SketchLine_23r-SketchLine_24r-SketchArc_13_2r-SketchArc_14_2r-SketchArc_15_2r-SketchArc_16_2r-SketchLine_25r-SketchArc_17_2r-SketchLine_26r-SketchArc_18_2r-SketchArc_19_2r-SketchLine_27r-SketchLine_28r-SketchArc_20_2r-SketchLine_29r-SketchLine_30r-SketchLine_31r-SketchLine_32r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_23_2r-SketchArc_24_2r-SketchLine_33r-SketchLine_34r-SketchLine_35r-SketchLine_36r-SketchArc_25_2r-SketchArc_26_2r-SketchArc_27_2r-SketchArc_28_2r-SketchArc_29_2r-SketchArc_30_2r-SketchArc_31_2r-SketchArc_32_2r-SketchLine_37r-SketchLine_38r-SketchLine_39r-SketchLine_40r-SketchLine_41r-SketchLine_42r-SketchLine_43r-SketchLine_44r-SketchArc_33_2r-SketchArc_34_2r-SketchArc_35_2r-SketchArc_36_2r-SketchLine_45r-SketchArc_37_2r-SketchLine_46r-SketchArc_38_2r-SketchLine_47r-SketchLine_48r-SketchLine_49r-SketchArc_39_2r-SketchLine_50r-SketchLine_51r-SketchLine_52r-SketchArc_40_2r-SketchArc_41_2r-SketchLine_53r-SketchLine_54r-SketchArc_42_2r-SketchLine_55r-SketchArc_43_2r-SketchArc_44_2r-SketchArc_45_2r-SketchLine_56r-SketchArc_46_2r-SketchArc_47_2r-SketchLine_57r-SketchLine_58r-SketchArc_48_2r-SketchLine_59r-SketchArc_49_2r-SketchArc_50_2r-SketchArc_51_2r-SketchLine_60r-SketchLine_61r-SketchArc_52_2r-SketchArc_53_2r-SketchLine_62r-SketchArc_54_2r-SketchArc_55_2r-SketchLine_63r-SketchLine_64r-SketchArc_56_2r-SketchLine_65r-SketchLine_66r-SketchLine_67r-SketchLine_68r-SketchArc_57_2r-SketchArc_58_2r-SketchArc_59_2r-SketchArc_60_2r-SketchLine_69f-SketchLine_70f-SketchLine_71f-SketchArc_61_2r-SketchArc_62_2r-SketchLine_72f-SketchArc_63_2r-SketchLine_73f-SketchArc_64_2r-SketchLine_74f-SketchLine_75r-SketchArc_65_2r-SketchLine_76r-SketchArc_66_2r-SketchLine_77r-SketchLine_78r-SketchArc_67_2r-SketchLine_79r-SketchArc_68_2r-SketchLine_80r-SketchLine_81f-SketchLine_82f-SketchLine_83f-SketchLine_84f-SketchLine_85f-SketchLine_86r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_69f-SketchArc_61_2r-SketchLine_70f-SketchArc_62_2r-SketchLine_71f-SketchLine_81f-SketchLine_72f-SketchArc_63_2r-SketchLine_73f-SketchArc_64_2r-SketchLine_74f-SketchLine_82f-SketchLine_85f-SketchLine_3f-SketchLine_86r-SketchLine_4f-SketchLine_80r-SketchArc_68_2r-SketchLine_79r-SketchArc_67_2r-SketchLine_78r-SketchLine_84f-SketchLine_77r-SketchArc_66_2r-SketchLine_76r-SketchArc_65_2r-SketchLine_75r-SketchLine_83f-SketchLine_15r-SketchArc_8_2r-SketchLine_16r-SketchArc_7_2r-SketchArc_2_2r-SketchLine_9r-SketchArc_1_2r-SketchLine_7r-SketchLine_11r-SketchArc_4_2r-SketchLine_12r-SketchArc_3_2r-SketchArc_32_2r-SketchLine_40r-SketchArc_28_2r-SketchLine_36r-SketchArc_24_2r-SketchLine_44r-SketchArc_36_2r-SketchLine_32r-SketchLine_50r-SketchArc_43_2r-SketchLine_54r-SketchArc_41_2r-SketchLine_49r-SketchArc_55_2r-SketchLine_65r-SketchArc_37_2r-SketchLine_13r-SketchArc_6_2r-SketchLine_14r-SketchArc_5_2r-SketchArc_9_2r-SketchLine_18r-SketchArc_10_2r-SketchLine_17r-SketchLine_20r-SketchArc_12_2r-SketchLine_19r-SketchArc_11_2r-SketchArc_29_2r-SketchLine_37r-SketchArc_25_2r-SketchLine_33r-SketchArc_21_2r-SketchLine_41r-SketchArc_33_2r-SketchLine_29r-SketchArc_30_2r-SketchLine_38r-SketchArc_26_2r-SketchLine_34r-SketchArc_22_2r-SketchLine_42r-SketchArc_34_2r-SketchLine_30r-SketchLine_68r-SketchArc_53_2r-SketchLine_61r-SketchArc_58_2r-SketchLine_64r-SketchArc_51_2r-SketchLine_60r-SketchArc_39_2r-SketchArc_50_2r-SketchLine_63r-SketchArc_57_2r-SketchLine_53r-SketchArc_45_2r-SketchLine_56r-SketchArc_42_2r-SketchLine_47r-SketchArc_49_2r-SketchLine_62r-SketchArc_47_2r-SketchLine_52r-SketchArc_52_2r-SketchLine_57r-SketchArc_48_2r-SketchLine_48r-SketchArc_31_2r-SketchLine_39r-SketchArc_27_2r-SketchLine_35r-SketchArc_23_2r-SketchLine_43r-SketchArc_35_2r-SketchLine_31r-SketchArc_59_2r-SketchLine_58r-SketchArc_54_2r-SketchLine_66r-SketchArc_60_2r-SketchLine_59r-SketchArc_46_2r-SketchLine_51r-SketchArc_19_2r-SketchLine_27r-SketchArc_18_2r-SketchLine_26r-SketchArc_17_2r-SketchLine_28r-SketchArc_20_2r-SketchLine_25r-SketchArc_56_2r-SketchLine_67r-SketchArc_38_2r-SketchLine_46r-SketchArc_44_2r-SketchLine_55r-SketchArc_40_2r-SketchLine_45r-SketchArc_15_2r-SketchLine_24r-SketchArc_16_2r-SketchLine_23r-SketchArc_14_2r-SketchLine_22r-SketchArc_13_2r-SketchLine_21r")])
 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Translation_1_2"))
 SketchCircle_1 = Sketch_4.addCircle(96.50000000003769, 5.5, 1.65)
-SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "Translation_1_2/Translated_Edge_1"), False)
+SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "Translation_1_2/ME:Translated&Extrusion_2_1/To_Edge"), False)
 SketchLine_92 = SketchProjection_6.createdFeature()
 SketchLine_92.setName("SketchLine_93")
 SketchLine_92.result().setName("SketchLine_93")
 SketchConstraintDistance_14 = Sketch_4.setDistance(SketchCircle_1.center(), SketchLine_92.result(), 53, True)
-SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_2/To_Edge_1"), False)
+SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_2/To_Edge"), False)
 SketchLine_93 = SketchProjection_7.createdFeature()
 SketchLine_93.setName("SketchLine_94")
 SketchLine_93.result().setName("SketchLine_94")
@@ -560,11 +560,11 @@ SketchConstraintLength_8 = Sketch_4.setLength(SketchLine_95.result(), 67)
 SketchMultiTranslation_6 = Sketch_4.addTranslation([SketchCircle_1.results()[1]], SketchLine_95.endPoint(), SketchLine_95.startPoint(), 4)
 [SketchCircle_2, SketchCircle_3, SketchCircle_4] = SketchMultiTranslation_6.translated()
 model.do()
-Face_2_objects = [model.selection("EDGE", "Sketch_4/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_4/Edge-SketchCircle_3_2"), model.selection("WIRE", "Sketch_4/Wire-SketchCircle_2_2f"), model.selection("EDGE", "Sketch_4/Edge-SketchCircle_1_2")]
+Face_2_objects = [model.selection("EDGE", "Sketch_4/SketchCircle_4_2"), model.selection("EDGE", "Sketch_4/SketchCircle_3_2"), model.selection("WIRE", "[Sketch_4/SketchCircle_2_2]"), model.selection("EDGE", "Sketch_4/SketchCircle_1_2")]
 Face_2 = model.addFace(Part_1_doc, Face_2_objects)
 Partition_1_objects = [model.selection("FACE", "Extrusion_1_1"), model.selection("FACE", "Extrusion_1_2"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2"), model.selection("FACE", "Face_2_3"), model.selection("FACE", "Face_2_4")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
-Remove_SubShapes_1_objects_2 = [model.selection("FACE", "Face_2_1/Face_2_1"), model.selection("FACE", "Face_2_2/Face_2_2"), model.selection("FACE", "Face_2_3/Face_2_3"), model.selection("FACE", "Face_2_4/Face_2_4")]
+Remove_SubShapes_1_objects_2 = [model.selection("FACE", "Partition_1_1_5"), model.selection("FACE", "Partition_1_1_6"), model.selection("FACE", "Partition_1_1_7"), model.selection("FACE", "Partition_1_1_8")]
 Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPOUND", "Partition_1_1"))
 Remove_SubShapes_1.setSubShapesToRemove(Remove_SubShapes_1_objects_2)
 model.do()
index d8ea46b65b5c9a7376a79740af9dfa756ebb3e02..a012edf709c1919d83beae53696e68b4cb88da73 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -88,14 +87,14 @@ SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_16")
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.result())
 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_17")
 model.do()
-Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_9")]
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_9")]
 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
 Revolution_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5"), model.selection("EDGE", "Edge_1_6"), model.selection("EDGE", "Edge_1_7")]
 Revolution_1 = model.addRevolution(Part_1_doc, Revolution_1_objects, model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2e"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_9 = SketchProjection_4.createdFeature()
 SketchLine_9.setName("SketchLine_11")
 SketchLine_9.result().setName("SketchLine_11")
@@ -122,197 +121,198 @@ SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchLine_13.endPoint())
 SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_22")
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_12.result())
-SketchPoint_2 = Sketch_2.addPoint(-5.903605550615992e-026, -5)
-SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_12.result())
-SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_24")
+SketchPoint_2 = Sketch_2.addPoint(-5.903605550615992e-26, -5)
+SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_12.result())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24")
 SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchPoint_2.coordinates(), SketchLine_12.result())
-SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
-SketchLine_15 = SketchProjection_6.createdFeature()
-SketchLine_15.setName("SketchLine_16")
-SketchLine_15.result().setName("SketchLine_16")
-SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_15.result())
-SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_25")
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_14 = SketchProjection_5.createdFeature()
+SketchLine_14.setName("SketchLine_16")
+SketchLine_14.result().setName("SketchLine_16")
+SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_14.result())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_25")
 SketchConstraintDistance_2 = Sketch_2.setDistance(SketchLine_11.endPoint(), SketchLine_10.result(), 2, True)
 SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_10.result(), 3)
 SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchAPI_Line(SketchLine_9).endPoint(), SketchLine_10.result())
 SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_12.result(), 2)
 model.do()
-Edge_2_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchLine_12"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_13"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_14"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10")]
+Edge_2_objects = [model.selection("EDGE", "Sketch_2/SketchLine_12"), model.selection("EDGE", "Sketch_2/SketchLine_13"), model.selection("EDGE", "Sketch_2/SketchLine_14"), model.selection("EDGE", "Sketch_2/SketchLine_10")]
 Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
 Extrusion_1_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3"), model.selection("EDGE", "Edge_2_4")]
 Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OY"), 3, 3)
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_6"))
-SketchLine_16 = Sketch_3.addLine(-15, 0, -10, 2.951677693621839e-024)
-SketchLine_16.setName("SketchLine_17")
-SketchLine_16.result().setName("SketchLine_17")
-SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Revolution_1_6/Generated_Edge_1"), False)
-SketchCircle_1 = SketchProjection_7.createdFeature()
-SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchCircle_1.results()[1])
-SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26")
-SketchLine_17 = Sketch_3.addLine(-10, 2.951677693621839e-024, -10, -3)
-SketchLine_17.setName("SketchLine_18")
-SketchLine_17.result().setName("SketchLine_18")
+SketchLine_15 = Sketch_3.addLine(-15, 0, -10, 2.951677693621839e-24)
+SketchLine_15.setName("SketchLine_17")
+SketchLine_15.result().setName("SketchLine_17")
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Revolution_1_6/Generated_Edge&Sketch_1/SketchLine_2_StartVertex"), False)
+SketchCircle_1 = SketchProjection_6.createdFeature()
+SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_15.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26")
+SketchLine_16 = Sketch_3.addLine(-10, 2.951677693621839e-24, -10, -3)
+SketchLine_16.setName("SketchLine_18")
+SketchLine_16.result().setName("SketchLine_18")
+SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_27")
+SketchLine_17 = Sketch_3.addLine(-10, -3, -14.69693845669907, -3)
+SketchLine_17.setName("SketchLine_19")
+SketchLine_17.result().setName("SketchLine_19")
 SketchConstraintCoincidence_24 = Sketch_3.setCoincident(SketchLine_16.endPoint(), SketchLine_17.startPoint())
-SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_27")
-SketchLine_18 = Sketch_3.addLine(-10, -3, -14.69693845669907, -3)
-SketchLine_18.setName("SketchLine_19")
-SketchLine_18.result().setName("SketchLine_19")
-SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
-SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_28")
-SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_18.endPoint(), SketchCircle_1.results()[1])
-SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_29")
-SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_17.result())
-SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_16.result(), SketchAPI_Circle(SketchCircle_1).center())
-SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_30")
-SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_16.result(), SketchLine_18.result())
-SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_16.result(), 5)
-SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_17.result(), 3)
-SketchConstraintMirror_1 = Sketch_3.addMirror(SketchLine_16.result(), [SketchLine_17.result(), SketchLine_18.result()])
-[SketchLine_19, SketchLine_20] = SketchConstraintMirror_1.mirrored()
-SketchLine_20.setName("SketchLine_21")
-SketchLine_20.result().setName("SketchLine_21")
-SketchLine_19.setName("SketchLine_20")
-SketchLine_19.result().setName("SketchLine_20")
-SketchLine_21 = Sketch_3.addLine(-1.5, -2, 2, -2)
-SketchLine_21.setName("SketchLine_22")
-SketchLine_21.result().setName("SketchLine_22")
-SketchLine_22 = Sketch_3.addLine(2, -2, 2, 2)
-SketchLine_22.setName("SketchLine_23")
-SketchLine_22.result().setName("SketchLine_23")
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_28")
+SketchConstraintCoincidence_25 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29")
+SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_16.result())
+SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_15.result(), SketchAPI_Circle(SketchCircle_1).center())
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30")
+SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_15.result(), SketchLine_17.result())
+SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_15.result(), 5)
+SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_16.result(), 3)
+SketchConstraintMirror_1 = Sketch_3.addMirror(SketchLine_15.result(), [SketchLine_16.result(), SketchLine_17.result()])
+[SketchLine_18, SketchLine_19] = SketchConstraintMirror_1.mirrored()
+SketchLine_19.setName("SketchLine_21")
+SketchLine_19.result().setName("SketchLine_21")
+SketchLine_18.setName("SketchLine_20")
+SketchLine_18.result().setName("SketchLine_20")
+SketchLine_20 = Sketch_3.addLine(-1.5, -2, 2, -2)
+SketchLine_20.setName("SketchLine_22")
+SketchLine_20.result().setName("SketchLine_22")
+SketchLine_21 = Sketch_3.addLine(2, -2, 2, 2)
+SketchLine_21.setName("SketchLine_23")
+SketchLine_21.result().setName("SketchLine_23")
+SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_31")
+SketchLine_22 = Sketch_3.addLine(2, 2, -1.5, 2)
+SketchLine_22.setName("SketchLine_24")
+SketchLine_22.result().setName("SketchLine_24")
 SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
-SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_31")
-SketchLine_23 = Sketch_3.addLine(2, 2, -1.5, 2)
-SketchLine_23.setName("SketchLine_24")
-SketchLine_23.result().setName("SketchLine_24")
-SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
-SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_32")
-SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
-SketchLine_24 = SketchProjection_8.createdFeature()
-SketchLine_24.setName("SketchLine_25")
-SketchLine_24.result().setName("SketchLine_25")
-SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchLine_24.result())
-SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_33")
-SketchConstraintHorizontal_3 = Sketch_3.setHorizontal(SketchLine_23.result())
-SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_21.result())
-SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_22.result())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_32")
+SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_23 = SketchProjection_7.createdFeature()
+SketchLine_23.setName("SketchLine_25")
+SketchLine_23.result().setName("SketchLine_25")
+SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_15.startPoint(), SketchLine_23.result())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_33")
+SketchConstraintHorizontal_3 = Sketch_3.setHorizontal(SketchLine_22.result())
+SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_20.result())
+SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_21.result())
 SketchArc_2 = Sketch_3.addArc(0, 0, -1.5, -2, -1.5, 2, True)
-SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchAPI_Circle(SketchCircle_1).center(), SketchArc_2.center())
-SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_34")
-SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchArc_2.startPoint(), SketchLine_21.startPoint())
-SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_35")
-SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchArc_2.endPoint(), SketchLine_23.endPoint())
-SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_36")
+SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchAPI_Circle(SketchCircle_1).center(), SketchArc_2.center())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_34")
+SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchArc_2.startPoint(), SketchLine_20.startPoint())
+SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_35")
+SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchArc_2.endPoint(), SketchLine_22.endPoint())
+SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_36")
 SketchPoint_3 = Sketch_3.addPoint(2, 0)
-SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_22.result())
-SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_37")
-SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_24.result())
-SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_38")
-SketchConstraintMiddle_3 = Sketch_3.setMiddlePoint(SketchPoint_3.coordinates(), SketchLine_22.result())
-SketchLine_25 = Sketch_3.addLine(-1.5, -2, -1.5, 2)
-SketchLine_25.setName("SketchLine_26")
-SketchLine_25.result().setName("SketchLine_26")
-SketchLine_25.setAuxiliary(True)
-SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_25.startPoint())
-SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_39")
-SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_25.endPoint())
-SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_40")
-SketchProjection_9 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_12s-SketchLine_10e"), False)
-SketchPoint_4 = SketchProjection_9.createdFeature()
-SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_25.result())
-SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_41")
-SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_25.result(), 4)
-SketchProjection_10 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_10s-SketchLine_14e"), False)
-SketchPoint_5 = SketchProjection_10.createdFeature()
-SketchConstraintDistance_3 = Sketch_3.setDistance(SketchAPI_Point(SketchPoint_5).coordinates(), SketchLine_22.result(), 0.5, True)
-SketchLine_26 = Sketch_3.addLine(-7.5, -7.382311001750988e-022, -7.5, -3)
-SketchLine_26.setName("SketchLine_27")
-SketchLine_26.result().setName("SketchLine_27")
-SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_26.result())
-SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchLine_26.startPoint(), SketchLine_16.result())
-SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_42")
-SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_26.endPoint(), SketchLine_18.result())
-SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_43")
-SketchLine_27 = Sketch_3.addLine(-7.5, -7.382311001750988e-022, -2.500000000000019, -5.187200122832181e-016)
-SketchLine_27.setName("SketchLine_28")
-SketchLine_27.result().setName("SketchLine_28")
-SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_26.startPoint(), SketchLine_27.startPoint())
-SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_44")
-SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchArc_2.results()[1])
-SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_45")
-SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_27.result())
-SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 2.5, True)
-SketchLine_28 = Sketch_3.addLine(2, 0, 11, 0)
-SketchLine_28.setName("SketchLine_29")
-SketchLine_28.result().setName("SketchLine_29")
-SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_28.startPoint())
-SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_46")
-SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_24.result())
-SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_47")
-SketchLine_29 = Sketch_3.addLine(15, 0, 14, 0)
-SketchLine_29.setName("SketchLine_30")
-SketchLine_29.result().setName("SketchLine_30")
-SketchProjection_11 = Sketch_3.addProjection(model.selection("VERTEX", "Revolution_1_6/Generated_Edge_1"), False)
-SketchPoint_6 = SketchProjection_11.createdFeature()
-SketchConstraintCoincidence_45 = Sketch_3.setCoincident(SketchLine_29.startPoint(), SketchPoint_6.result())
-SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_48")
-SketchConstraintCoincidence_46 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_24.result())
-SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_49")
-SketchConstraintDistance_5 = Sketch_3.setDistance(SketchLine_28.endPoint(), SketchLine_29.endPoint(), 3, True)
-SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_29.result(), 1)
-SketchLine_30 = Sketch_3.addLine(11, 0, 11, -2.000000000000004)
-SketchLine_30.setName("SketchLine_31")
-SketchLine_30.result().setName("SketchLine_31")
-SketchConstraintCoincidence_47 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_30.startPoint())
-SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_50")
-SketchLine_31 = Sketch_3.addLine(9.500000000000002, 2.627360613063856e-019, 9.5, -2.000000000000004)
-SketchLine_31.setName("SketchLine_32")
-SketchLine_31.result().setName("SketchLine_32")
-SketchConstraintCoincidence_48 = Sketch_3.setCoincident(SketchLine_31.startPoint(), SketchLine_28.result())
-SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_51")
-SketchLine_32 = Sketch_3.addLine(8, -1.882265929199326e-020, 8, -2.000000000000004)
-SketchLine_32.setName("SketchLine_33")
-SketchLine_32.result().setName("SketchLine_33")
-SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_32.startPoint(), SketchLine_28.result())
-SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_52")
-SketchLine_33 = Sketch_3.addLine(5, -3.396138881322731e-022, 5, -2.000000000000004)
-SketchLine_33.setName("SketchLine_34")
-SketchLine_33.result().setName("SketchLine_34")
-SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_33.startPoint(), SketchLine_28.result())
-SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_53")
-SketchLine_34 = Sketch_3.addLine(5, -2.000000000000004, 11, -2.000000000000004)
-SketchLine_34.setName("SketchLine_35")
-SketchLine_34.result().setName("SketchLine_35")
-SketchLine_34.setAuxiliary(True)
-SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_33.endPoint(), SketchLine_34.startPoint())
-SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_54")
-SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_34.endPoint())
-SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_55")
-SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_33.result())
-SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_32.result())
-SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_31.result())
-#SketchConstraintVertical_9 = Sketch_3.setVertical(SketchLine_30.result())
-SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_34.result())
-SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_34.result())
-SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_56")
-SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_31.endPoint(), SketchLine_34.result())
-SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_57")
-SketchConstraintDistance_6 = Sketch_3.setDistance(SketchLine_21.endPoint(), SketchLine_33.result(), 3, True)
-SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_33.endPoint(), SketchLine_32.result(), 3, True)
-SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_32.endPoint(), SketchLine_31.result(), 1.5, True)
-SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_31.endPoint(), SketchLine_30.result(), 1.5, True)
-SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_33.endPoint(), SketchLine_21.result())
-SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_58")
-SketchConstraintMirror_2_objects = [SketchLine_33.result(), SketchLine_32.result(), SketchLine_31.result(), SketchLine_30.result()]
-SketchConstraintMirror_2 = Sketch_3.addMirror(SketchLine_24.result(), SketchConstraintMirror_2_objects)
-[SketchLine_35, SketchLine_36, SketchLine_37, SketchLine_38] = SketchConstraintMirror_2.mirrored()
-SketchLine_38.setName("SketchLine_39")
-SketchLine_38.result().setName("SketchLine_39")
-SketchLine_37.setName("SketchLine_38")
-SketchLine_37.result().setName("SketchLine_38")
-SketchLine_36.setName("SketchLine_37")
-SketchLine_36.result().setName("SketchLine_37")
-SketchLine_35.setName("SketchLine_36")
-SketchLine_35.result().setName("SketchLine_36")
+SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_21.result())
+SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_37")
+SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_23.result())
+SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_38")
+SketchConstraintMiddle_3 = Sketch_3.setMiddlePoint(SketchPoint_3.coordinates(), SketchLine_21.result())
+SketchLine_24 = Sketch_3.addLine(-1.5, -2, -1.5, 2)
+SketchLine_24.setName("SketchLine_26")
+SketchLine_24.result().setName("SketchLine_26")
+SketchLine_24.setAuxiliary(True)
+SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_24.startPoint())
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_39")
+SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_24.endPoint())
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_40")
+SketchProjection_8 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_EndVertex"), False)
+SketchPoint_4 = SketchProjection_8.createdFeature()
+SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_24.result())
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_41")
+SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_24.result(), 4)
+SketchProjection_9 = Sketch_3.addProjection(model.selection("VERTEX", "Sketch_2/SketchLine_10_StartVertex"), False)
+SketchPoint_5 = SketchProjection_9.createdFeature()
+SketchConstraintDistance_3 = Sketch_3.setDistance(SketchAPI_Point(SketchPoint_5).coordinates(), SketchLine_21.result(), 0.5, True)
+SketchLine_25 = Sketch_3.addLine(-7.5, -7.382311001750988e-22, -7.5, -3)
+SketchLine_25.setName("SketchLine_27")
+SketchLine_25.result().setName("SketchLine_27")
+SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_25.result())
+SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchLine_25.startPoint(), SketchLine_15.result())
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_42")
+SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchLine_25.endPoint(), SketchLine_17.result())
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43")
+SketchLine_26 = Sketch_3.addLine(-7.5, -7.382311001750988e-22, -2.500000000000019, -5.187200122832181e-16)
+SketchLine_26.setName("SketchLine_28")
+SketchLine_26.result().setName("SketchLine_28")
+SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_25.startPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44")
+SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_26.endPoint(), SketchArc_2.results()[1])
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45")
+SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_26.result())
+SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_16.startPoint(), SketchLine_25.result(), 2.5, True)
+SketchLine_27 = Sketch_3.addLine(2, 0, 11, 0)
+SketchLine_27.setName("SketchLine_29")
+SketchLine_27.result().setName("SketchLine_29")
+SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchPoint_3.coordinates(), SketchLine_27.startPoint())
+SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_46")
+SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_23.result())
+SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_47")
+SketchLine_28 = Sketch_3.addLine(15, 0, 14, 0)
+SketchLine_28.setName("SketchLine_30")
+SketchLine_28.result().setName("SketchLine_30")
+SketchProjection_10 = Sketch_3.addProjection(model.selection("VERTEX", "[Revolution_1_6/Revolution_1_6&Sketch_1/SketchLine_2]"), False)
+SketchPoint_6 = SketchProjection_10.createdFeature()
+SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_28.startPoint(), SketchPoint_6.result())
+SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_48")
+SketchConstraintCoincidence_45 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_23.result())
+SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_49")
+SketchConstraintDistance_5 = Sketch_3.setDistance(SketchLine_27.endPoint(), SketchLine_28.endPoint(), 3, True)
+SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_28.result(), 1)
+SketchLine_29 = Sketch_3.addLine(11, 0, 11, -2.000000000000004)
+SketchLine_29.setName("SketchLine_31")
+SketchLine_29.result().setName("SketchLine_31")
+SketchConstraintCoincidence_46 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_29.startPoint())
+SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_50")
+SketchLine_30 = Sketch_3.addLine(9.500000000000002, 2.627360613063856e-19, 9.5, -2.000000000000004)
+SketchLine_30.setName("SketchLine_32")
+SketchLine_30.result().setName("SketchLine_32")
+SketchConstraintCoincidence_47 = Sketch_3.setCoincident(SketchLine_30.startPoint(), SketchLine_27.result())
+SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_51")
+SketchLine_31 = Sketch_3.addLine(8, -1.882265929199326e-20, 8, -2.000000000000004)
+SketchLine_31.setName("SketchLine_33")
+SketchLine_31.result().setName("SketchLine_33")
+SketchConstraintCoincidence_48 = Sketch_3.setCoincident(SketchLine_31.startPoint(), SketchLine_27.result())
+SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_52")
+SketchLine_32 = Sketch_3.addLine(5, -3.396138881322731e-22, 5, -2.000000000000004)
+SketchLine_32.setName("SketchLine_34")
+SketchLine_32.result().setName("SketchLine_34")
+SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_32.startPoint(), SketchLine_27.result())
+SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_53")
+SketchLine_33 = Sketch_3.addLine(5, -2.000000000000004, 11, -2.000000000000004)
+SketchLine_33.setName("SketchLine_35")
+SketchLine_33.result().setName("SketchLine_35")
+SketchLine_33.setAuxiliary(True)
+SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_54")
+SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_33.endPoint())
+SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_55")
+SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_32.result())
+SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_31.result())
+SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_30.result())
+SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_33.result())
+SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_31.endPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_56")
+SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_57")
+SketchConstraintDistance_6 = Sketch_3.setDistance(SketchLine_20.endPoint(), SketchLine_32.result(), 3, True)
+SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_32.endPoint(), SketchLine_31.result(), 3, True)
+SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_31.endPoint(), SketchLine_30.result(), 1.5, True)
+SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_30.endPoint(), SketchLine_29.result(), 1.5, True)
+SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_20.result())
+SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_58")
+SketchConstraintMirror_2_objects = [SketchLine_32.result(), SketchLine_31.result(), SketchLine_30.result(), SketchLine_29.result()]
+SketchConstraintMirror_2 = Sketch_3.addMirror(SketchLine_23.result(), SketchConstraintMirror_2_objects)
+[SketchLine_34, SketchLine_35, SketchLine_36, SketchLine_37] = SketchConstraintMirror_2.mirrored()
+SketchLine_37.setName("SketchLine_39")
+SketchLine_37.result().setName("SketchLine_39")
+SketchLine_36.setName("SketchLine_38")
+SketchLine_36.result().setName("SketchLine_38")
+SketchLine_35.setName("SketchLine_37")
+SketchLine_35.result().setName("SketchLine_37")
+SketchLine_34.setName("SketchLine_36")
+SketchLine_34.result().setName("SketchLine_36")
+model.do()
+model.do()
 model.end()
 
 assert(model.checkPythonDump())
index 206998debee7594ad60020901280267da282c421..933c012cd20af1f00ebcc04f25d9dd9aea71cce1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -29,7 +28,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_1 = Sketch_1.addLine(7.823413936076148e-032, 6, 18, 6)
+SketchLine_1 = Sketch_1.addLine(7.823413936076148e-32, 6, 18, 6)
 SketchLine_2 = Sketch_1.addLine(18, 6, 18, 10)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchLine_3 = Sketch_1.addLine(18, 10, 63, 10)
@@ -46,11 +45,11 @@ SketchLine_8 = Sketch_1.addLine(70, 18, 70, 6.999999999999999)
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchLine_9 = Sketch_1.addLine(70, 6.999999999999999, 38, 6.999999999999999)
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
-SketchLine_10 = Sketch_1.addLine(38, 6.999999999999999, 34, 1.232595164407831e-032)
+SketchLine_10 = Sketch_1.addLine(38, 6.999999999999999, 34, 1.232595164407831e-32)
 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
-SketchLine_11 = Sketch_1.addLine(34, 1.232595164407831e-032, 7.823413936076148e-032, 1.232595164407831e-032)
+SketchLine_11 = Sketch_1.addLine(34, 1.232595164407831e-32, 7.823413936076148e-32, 1.232595164407831e-32)
 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
-SketchLine_12 = Sketch_1.addLine(7.823413936076148e-032, 1.232595164407831e-032, 7.823413936076148e-032, 6)
+SketchLine_12 = Sketch_1.addLine(7.823413936076148e-32, 1.232595164407831e-32, 7.823413936076148e-32, 6)
 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_12.endPoint())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_11.result())
@@ -84,7 +83,7 @@ SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_13.startPoint
 SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_13.result())
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_8.result())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r-SketchLine_11r-SketchLine_12r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_13"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "Sketch_1/SketchLine_13"), 360, 0)
 model.do()
 # check that naming of the revolution is correct
 model.testHaveNamingSubshapes(Revolution_1, model, Part_1_doc)
index dcc1b884c2ed1aac1cc46c2a5078329c2744d20b..d4e35ab95a9319f70ab4d03bf8451261ae09b7d4 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 import math
@@ -30,7 +31,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchArc_1 = Sketch_1.addArc(-47.73523320343703, -72.31551328948351, 43.26553250145439, -30.85636904935887, -50.76060275488791, 27.63871192924931, False)
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")])
 model.do()
 
 radius = model.measureRadius(Part_1_doc, model.selection("EDGE", "Edge_1_1"))
index b0a4da97f4682e4f7f956fbfbdd9a610ab6aba72..a443ebd7efd1fa32b340b6cf83c2b713b8768e2e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -33,10 +34,11 @@ SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 2)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
-Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("VERTEX", "Sketch_1/Edge-SketchCircle_1_2__cc"), True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"), True)
 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPOUND", "all-in-Symmetry_1")], model.selection("EDGE", "PartSet/OY"), 5, 3)
 AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-LinearCopy_1")], model.selection("EDGE", "PartSet/OZ"), 45, 8)
+model.do()
 model.end()
 
 from GeomAPI import  GeomAPI_Shape
index d102679c5441fb5521502cf28fd8b3ed04a9513d..3bb6ad81b837844c526ae1b2365cc4ad393c3703 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -25,8 +26,9 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"), True)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), True)
 Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1_1")], model.selection("EDGE", "PartSet/OX"), True)
+model.do()
 model.end()
 
 # check python dump failed before the bug fix: selection in symmetry 2 changed to the whole symmetry 1 compound
index 529861ae1997270c4abb4abb287d7c68b266f31c..70e7ae568f3d7e0ea1d1a302612c5b8680b8d99b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,7 +42,7 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
 Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_1_2")])
 model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/Test2617.py b/src/FeaturesPlugin/Test/Test2617.py
new file mode 100644 (file)
index 0000000..a0cb238
--- /dev/null
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "PartSet/OX"), 5)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), True)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1_2"), model.selection("SOLID", "Symmetry_1_1_1")])
+model.do()
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [0])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [8])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [16])
+model.testResultsVolumes(Common_1, [461.055845803990962394891539589])
+
+assert(model.checkPythonDump())
index a254a07235c6a5d799562704efda0ec804b4b064..d10f80c57db855fee80a835e45c7b40d81818ece 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -33,18 +34,18 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(),
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_3 = Sketch_2.addLine(31.90519577166173, 58.11303515552675, 60.012153951459, 58.11303515552675)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_4 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.startPoint(), SketchLine_4.result())
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_4).endPoint(), SketchLine_3.endPoint())
 SketchLine_5 = Sketch_2.addLine(60.012153951459, 58.11303515552675, 60.012153951459, 33.0446670492211)
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_5.startPoint())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_6 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_5")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")], [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/Test2636.py b/src/FeaturesPlugin/Test/Test2636.py
new file mode 100644 (file)
index 0000000..8ad1eea
--- /dev/null
@@ -0,0 +1,437 @@
+## Copyright (C) 2019-20xx  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "epsilon", "0.1")
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchLine_1.setName("SketchLine_2")
+SketchLine_1.result().setName("SketchLine_2")
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchLine_2.setName("SketchLine_3")
+SketchLine_2.result().setName("SketchLine_3")
+SketchLine_3 = Sketch_1.addLine(0, 0, 0, -21)
+SketchLine_3.setName("SketchLine_4")
+SketchLine_3.result().setName("SketchLine_4")
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(0, -21, 54, -21)
+SketchLine_4.setName("SketchLine_5")
+SketchLine_4.result().setName("SketchLine_5")
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(54, -21, 57, -18)
+SketchLine_5.setName("SketchLine_6")
+SketchLine_5.result().setName("SketchLine_6")
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), "42/2")
+SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_4.result(), SketchLine_5.result(), 45)
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_3.endPoint(), 57)
+SketchLine_6 = Sketch_1.addLine(57, -18, 159.1, -18)
+SketchLine_6.setName("SketchLine_7")
+SketchLine_6.result().setName("SketchLine_7")
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_6.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_1.result(), "36/2", True)
+SketchLine_7 = Sketch_1.addLine(162.1, -21, 162.1, -31.5)
+SketchLine_7.setName("SketchLine_8")
+SketchLine_7.result().setName("SketchLine_8")
+SketchLine_8 = Sketch_1.addLine(162.1, -31.5, 204.1, -31.5)
+SketchLine_8.setName("SketchLine_9")
+SketchLine_8.result().setName("SketchLine_9")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchLine_9 = Sketch_1.addLine(204.1, -31.5, 204.1, -21)
+SketchLine_9.setName("SketchLine_10")
+SketchLine_9.result().setName("SketchLine_10")
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchLine_10 = Sketch_1.addLine(204.1, -21, 181.1, -21)
+SketchLine_10.setName("SketchLine_11")
+SketchLine_10.result().setName("SketchLine_11")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchLine_11 = Sketch_1.addLine(181.1, -21, 168.9756443470179, 0)
+SketchLine_11.setName("SketchLine_12")
+SketchLine_11.result().setName("SketchLine_12")
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchLine_12 = Sketch_1.addLine(168.9756443470179, 0, 0, 0)
+SketchLine_12.setName("SketchLine_13")
+SketchLine_12.result().setName("SketchLine_13")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_12.endPoint())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_12.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_10.result())
+SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_8.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_7.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_9.result())
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_12.startPoint(), SketchLine_8.endPoint(), "63/2")
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_12.startPoint(), SketchLine_10.startPoint(), "42/2")
+SketchConstraintAngle_2 = Sketch_1.setAngleComplementary(SketchLine_12.result(), SketchLine_11.result(), 60)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_10.result(), 23)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_8.result(), 42)
+SketchLine_13 = Sketch_1.addLine(54, -21, 54, 0)
+SketchLine_13.setName("SketchLine_14")
+SketchLine_13.result().setName("SketchLine_14")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_1.result())
+SketchLine_14 = Sketch_1.addLine(57, -18, 57, 0)
+SketchLine_14.setName("SketchLine_15")
+SketchLine_14.result().setName("SketchLine_15")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_1.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_14.result())
+SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_13.result())
+SketchLine_15 = Sketch_1.addLine(181.1, -21, 181.1, -31.5)
+SketchLine_15.setName("SketchLine_18")
+SketchLine_15.result().setName("SketchLine_18")
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_8.result())
+SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_15.result())
+SketchArc_1 = Sketch_1.addArc(159.1, -21, 162.1, -21, 159.1, -18, False)
+SketchPoint_1 = Sketch_1.addPoint(162.1, -18)
+SketchPoint_1.setName("SketchPoint_2")
+SketchPoint_1.result().setName("SketchPoint_2")
+SketchPoint_1.setAuxiliary(True)
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_6.result())
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_7.result())
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_6.startPoint(), SketchPoint_1.coordinates(), "105+epsilon", False)
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_6.endPoint())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_6.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_7.result())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 3)
+SketchLine_16 = Sketch_1.addLine(162.1, -21, 181.1, -21)
+SketchLine_16.setName("SketchLine_36")
+SketchLine_16.result().setName("SketchLine_36")
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchLine_16.startPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_15.startPoint())
+SketchLine_17 = Sketch_1.addLine(159.1, -18, 159.1, 0)
+SketchLine_17.setName("SketchLine_35")
+SketchLine_17.result().setName("SketchLine_35")
+SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_17.startPoint())
+SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchLine_12.result())
+SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_17.result())
+SketchLine_18 = Sketch_1.addLine(159.1, -18, 175.3264973081038, -11)
+SketchLine_18.setName("SketchLine_37")
+SketchLine_18.result().setName("SketchLine_37")
+SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchLine_18.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchLine_18.startPoint(), SketchLine_6.endPoint())
+SketchLine_19 = Sketch_1.addLine(168.9756443470179, 0, 168.9756443470179, -5)
+SketchLine_19.setName("SketchLine_38")
+SketchLine_19.result().setName("SketchLine_38")
+SketchLine_19.setAuxiliary(True)
+SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_19.startPoint())
+SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_19.result())
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_19.result(), 5)
+SketchConstraintDistanceVertical_3 = Sketch_1.setVerticalDistance(SketchLine_18.endPoint(), SketchLine_12.startPoint(), 11)
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "Sketch_1/SketchLine_13"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_4"))
+SketchPoint_2 = Sketch_2.addPoint(0, 0)
+SketchPoint_2.setName("SketchPoint_3")
+SketchPoint_2.result().setName("SketchPoint_3")
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_5]__cc"), False)
+SketchProjection_3.setName("SketchProjection_4")
+SketchProjection_3.result().setName("SketchProjection_4")
+SketchPoint_3 = SketchProjection_3.createdFeature()
+SketchPoint_3.setName("SketchPoint_4")
+SketchPoint_3.result().setName("SketchPoint_4")
+SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchPoint_3.result())
+model.do()
+Sketch_2.setName("Sketch_3")
+Sketch_2.result().setName("Sketch_3")
+model.do()
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Sketch_3 = model.addSketch(Part_2_doc, model.defaultPlane("XOY"))
+SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_20 = SketchProjection_4.createdFeature()
+SketchLine_20.setName("SketchLine_2")
+SketchLine_20.result().setName("SketchLine_2")
+SketchProjection_5 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_21 = SketchProjection_5.createdFeature()
+SketchLine_21.setName("SketchLine_3")
+SketchLine_21.result().setName("SketchLine_3")
+SketchLine_22 = Sketch_3.addLine(0, 0, 0, -21)
+SketchLine_22.setName("SketchLine_4")
+SketchLine_22.result().setName("SketchLine_4")
+SketchConstraintCoincidence_30 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_20).startPoint(), SketchLine_22.startPoint())
+SketchLine_23 = Sketch_3.addLine(0, -21, 54, -21)
+SketchLine_23.setName("SketchLine_5")
+SketchLine_23.result().setName("SketchLine_5")
+SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_3.addLine(54, -21, 57, -18)
+SketchLine_24.setName("SketchLine_6")
+SketchLine_24.result().setName("SketchLine_6")
+SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_24.startPoint())
+SketchConstraintVertical_9 = Sketch_3.setVertical(SketchLine_22.result())
+SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_23.result())
+SketchConstraintLength_5 = Sketch_3.setLength(SketchLine_22.result(), "42/2")
+SketchConstraintAngle_3 = Sketch_3.setAngleComplementary(SketchLine_23.result(), SketchLine_24.result(), 45)
+SketchConstraintDistanceHorizontal_2 = Sketch_3.setHorizontalDistance(SketchLine_24.endPoint(), SketchLine_22.endPoint(), 57)
+SketchLine_25 = Sketch_3.addLine(57, -18, 159.1, -18)
+SketchLine_25.setName("SketchLine_7")
+SketchLine_25.result().setName("SketchLine_7")
+SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchLine_24.endPoint(), SketchLine_25.startPoint())
+SketchConstraintHorizontal_7 = Sketch_3.setHorizontal(SketchLine_25.result())
+SketchConstraintDistance_3 = Sketch_3.setDistance(SketchLine_24.endPoint(), SketchLine_20.result(), "36/2", True)
+SketchLine_26 = Sketch_3.addLine(162.1, -21, 162.1, -31.5)
+SketchLine_26.setName("SketchLine_8")
+SketchLine_26.result().setName("SketchLine_8")
+SketchLine_27 = Sketch_3.addLine(162.1, -31.5, 204.1, -31.5)
+SketchLine_27.setName("SketchLine_9")
+SketchLine_27.result().setName("SketchLine_9")
+SketchConstraintCoincidence_34 = Sketch_3.setCoincident(SketchLine_26.endPoint(), SketchLine_27.startPoint())
+SketchLine_28 = Sketch_3.addLine(204.1, -31.5, 204.1, -21)
+SketchLine_28.setName("SketchLine_10")
+SketchLine_28.result().setName("SketchLine_10")
+SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
+SketchLine_29 = Sketch_3.addLine(204.1, -21, 181.1, -21)
+SketchLine_29.setName("SketchLine_11")
+SketchLine_29.result().setName("SketchLine_11")
+SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchLine_30 = Sketch_3.addLine(181.1, -21, 168.9756443470179, 0)
+SketchLine_30.setName("SketchLine_12")
+SketchLine_30.result().setName("SketchLine_12")
+SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_30.startPoint())
+SketchLine_31 = Sketch_3.addLine(168.9756443470179, 0, 0, 0)
+SketchLine_31.setName("SketchLine_13")
+SketchLine_31.result().setName("SketchLine_13")
+SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
+SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_20).startPoint(), SketchLine_31.endPoint())
+SketchConstraintHorizontal_8 = Sketch_3.setHorizontal(SketchLine_31.result())
+SketchConstraintHorizontal_9 = Sketch_3.setHorizontal(SketchLine_29.result())
+SketchConstraintHorizontal_10 = Sketch_3.setHorizontal(SketchLine_27.result())
+SketchConstraintVertical_10 = Sketch_3.setVertical(SketchLine_26.result())
+SketchConstraintVertical_11 = Sketch_3.setVertical(SketchLine_28.result())
+SketchConstraintDistanceVertical_4 = Sketch_3.setVerticalDistance(SketchLine_31.startPoint(), SketchLine_27.endPoint(), "63/2")
+SketchConstraintDistanceVertical_5 = Sketch_3.setVerticalDistance(SketchLine_31.startPoint(), SketchLine_29.startPoint(), "42/2")
+SketchConstraintAngle_4 = Sketch_3.setAngleComplementary(SketchLine_31.result(), SketchLine_30.result(), 60)
+SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_29.result(), 23)
+SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_27.result(), 42)
+SketchLine_32 = Sketch_3.addLine(54, -21, 54, 0)
+SketchLine_32.setName("SketchLine_14")
+SketchLine_32.result().setName("SketchLine_14")
+SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_32.startPoint())
+SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_32.endPoint(), SketchLine_20.result())
+SketchLine_33 = Sketch_3.addLine(57, -18, 57, 0)
+SketchLine_33.setName("SketchLine_15")
+SketchLine_33.result().setName("SketchLine_15")
+SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchLine_24.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchLine_33.endPoint(), SketchLine_20.result())
+SketchConstraintVertical_12 = Sketch_3.setVertical(SketchLine_33.result())
+SketchConstraintVertical_13 = Sketch_3.setVertical(SketchLine_32.result())
+SketchLine_34 = Sketch_3.addLine(181.1, -21, 181.1, -31.5)
+SketchLine_34.setName("SketchLine_18")
+SketchLine_34.result().setName("SketchLine_18")
+SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_29.endPoint(), SketchLine_34.startPoint())
+SketchConstraintCoincidence_45 = Sketch_3.setCoincident(SketchLine_34.endPoint(), SketchLine_27.result())
+SketchConstraintVertical_14 = Sketch_3.setVertical(SketchLine_34.result())
+SketchArc_2 = Sketch_3.addArc(159.1, -21, 162.1, -21, 159.1, -18, False)
+SketchPoint_4 = Sketch_3.addPoint(162.1, -18)
+SketchPoint_4.setName("SketchPoint_2")
+SketchPoint_4.result().setName("SketchPoint_2")
+SketchPoint_4.setAuxiliary(True)
+SketchConstraintCoincidence_46 = Sketch_3.setCoincident(SketchPoint_4.coordinates(), SketchLine_25.result())
+SketchConstraintCoincidence_47 = Sketch_3.setCoincident(SketchPoint_4.coordinates(), SketchLine_26.result())
+SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_25.startPoint(), SketchPoint_4.coordinates(), "105+epsilon", False)
+SketchConstraintCoincidence_48 = Sketch_3.setCoincident(SketchArc_2.startPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchArc_2.endPoint(), SketchLine_25.endPoint())
+SketchConstraintTangent_3 = Sketch_3.setTangent(SketchArc_2.results()[1], SketchLine_25.result())
+SketchConstraintTangent_4 = Sketch_3.setTangent(SketchArc_2.results()[1], SketchLine_26.result())
+SketchConstraintRadius_2 = Sketch_3.setRadius(SketchArc_2.results()[1], 3)
+SketchLine_35 = Sketch_3.addLine(162.1, -21, 181.1, -21)
+SketchLine_35.setName("SketchLine_36")
+SketchLine_35.result().setName("SketchLine_36")
+SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_35.endPoint(), SketchLine_30.result())
+SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_35.startPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_35.endPoint(), SketchLine_34.startPoint())
+SketchLine_36 = Sketch_3.addLine(159.1, -18, 159.1, 0)
+SketchLine_36.setName("SketchLine_35")
+SketchLine_36.result().setName("SketchLine_35")
+SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_25.endPoint(), SketchLine_36.startPoint())
+SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_36.endPoint(), SketchLine_31.result())
+SketchConstraintVertical_15 = Sketch_3.setVertical(SketchLine_36.result())
+SketchLine_37 = Sketch_3.addLine(159.1, -18, 175.3264973081038, -11)
+SketchLine_37.setName("SketchLine_37")
+SketchLine_37.result().setName("SketchLine_37")
+SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_37.endPoint(), SketchLine_30.result())
+SketchConstraintCoincidence_56 = Sketch_3.setCoincident(SketchLine_37.startPoint(), SketchLine_25.endPoint())
+SketchLine_38 = Sketch_3.addLine(168.9756443470179, 0, 168.9756443470179, -5)
+SketchLine_38.setName("SketchLine_38")
+SketchLine_38.result().setName("SketchLine_38")
+SketchLine_38.setAuxiliary(True)
+SketchConstraintCoincidence_57 = Sketch_3.setCoincident(SketchLine_30.endPoint(), SketchLine_38.startPoint())
+SketchConstraintVertical_16 = Sketch_3.setVertical(SketchLine_38.result())
+SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_38.result(), 5)
+SketchConstraintDistanceVertical_6 = Sketch_3.setVerticalDistance(SketchLine_37.endPoint(), SketchLine_31.startPoint(), 11)
+model.do()
+Revolution_2 = model.addRevolution(Part_2_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "Sketch_1/SketchLine_13"), 360, 0)
+Sketch_4 = model.addSketch(Part_2_doc, model.selection("FACE", "Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_4"))
+SketchLine_39 = Sketch_4.addLine(50, 0, -50, 0)
+SketchLine_39.setName("SketchLine_19")
+SketchLine_39.result().setName("SketchLine_19")
+SketchConstraintHorizontal_11 = Sketch_4.setHorizontal(SketchLine_39.result())
+SketchProjection_6 = Sketch_4.addProjection(model.selection("VERTEX", "[Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_4][Revolution_1_1_1/Generated_Face&Sketch_1/SketchLine_5]__cc"), False)
+SketchPoint_5 = SketchProjection_6.createdFeature()
+SketchPoint_5.setName("SketchPoint_1")
+SketchPoint_5.result().setName("SketchPoint_1")
+SketchConstraintLength_9 = Sketch_4.setLength(SketchLine_39.result(), 100)
+SketchLine_40 = Sketch_4.addLine(0, -50, 0, 50)
+SketchLine_40.setName("SketchLine_20")
+SketchLine_40.result().setName("SketchLine_20")
+SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_41 = SketchProjection_7.createdFeature()
+SketchLine_41.setName("SketchLine_21")
+SketchLine_41.result().setName("SketchLine_21")
+SketchConstraintCoincidence_58 = Sketch_4.setCoincident(SketchLine_40.startPoint(), SketchLine_41.result())
+SketchConstraintVertical_17 = Sketch_4.setVertical(SketchLine_40.result())
+SketchConstraintLength_10 = Sketch_4.setLength(SketchLine_40.result(), 100)
+SketchCircle_1 = Sketch_4.addCircle(0, 0, 7)
+SketchCircle_1.setAuxiliary(True)
+SketchConstraintCoincidence_59 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_5).coordinates(), SketchCircle_1.center())
+SketchConstraintRadius_3 = Sketch_4.setRadius(SketchCircle_1.results()[1], 7)
+SketchLine_42 = Sketch_4.addLine(0, 0, -4.949747468305834, -4.949747468305832)
+SketchLine_42.setName("SketchLine_22")
+SketchLine_42.result().setName("SketchLine_22")
+SketchLine_42.setAuxiliary(True)
+SketchConstraintCoincidence_60 = Sketch_4.setCoincident(SketchAPI_Point(SketchPoint_5).coordinates(), SketchLine_42.startPoint())
+SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchLine_42.endPoint(), SketchCircle_1.results()[1])
+SketchConstraintAngle_5 = Sketch_4.setAngleComplementary(SketchLine_42.result(), SketchLine_39.result(), 45)
+SketchLine_43 = Sketch_4.addLine(0, -7, -4.949747468305834, -4.949747468305832)
+SketchLine_43.setName("SketchLine_23")
+SketchLine_43.result().setName("SketchLine_23")
+SketchConstraintCoincidence_62 = Sketch_4.setCoincident(SketchLine_43.startPoint(), SketchLine_41.result())
+SketchConstraintCoincidence_63 = Sketch_4.setCoincident(SketchLine_42.endPoint(), SketchLine_43.endPoint())
+SketchLine_44 = Sketch_4.addLine(-4.949747468305834, -4.949747468305832, -7, 0)
+SketchLine_44.setName("SketchLine_24")
+SketchLine_44.result().setName("SketchLine_24")
+SketchConstraintCoincidence_64 = Sketch_4.setCoincident(SketchLine_42.endPoint(), SketchLine_44.startPoint())
+SketchConstraintCoincidence_65 = Sketch_4.setCoincident(SketchLine_44.endPoint(), SketchLine_39.result())
+SketchLine_45 = Sketch_4.addLine(-4.949747468305834, -4.949747468305832, -33.23401871576774, -33.23401871576773)
+SketchLine_45.setName("SketchLine_25")
+SketchLine_45.result().setName("SketchLine_25")
+SketchConstraintCoincidence_66 = Sketch_4.setCoincident(SketchLine_42.endPoint(), SketchLine_45.startPoint())
+SketchConstraintCollinear_1 = Sketch_4.setCollinear(SketchLine_45.result(), SketchLine_42.result())
+SketchConstraintCoincidence_67 = Sketch_4.setCoincident(SketchLine_43.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_68 = Sketch_4.setCoincident(SketchLine_44.endPoint(), SketchCircle_1.results()[1])
+SketchConstraintLength_11 = Sketch_4.setLength(SketchLine_45.result(), 40)
+SketchMultiRotation_1_objects = [SketchLine_43.result(), SketchLine_45.result(), SketchLine_44.result()]
+SketchMultiRotation_1 = Sketch_4.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_41).startPoint(), 90, 4)
+[SketchLine_46, SketchLine_47, SketchLine_48, SketchLine_49, SketchLine_50, SketchLine_51, SketchLine_52, SketchLine_53, SketchLine_54] = SketchMultiRotation_1.rotated()
+SketchLine_54.setName("SketchLine_34")
+SketchLine_54.result().setName("SketchLine_34")
+SketchLine_53.setName("SketchLine_33")
+SketchLine_53.result().setName("SketchLine_33")
+SketchLine_52.setName("SketchLine_28")
+SketchLine_52.result().setName("SketchLine_28")
+SketchLine_51.setName("SketchLine_32")
+SketchLine_51.result().setName("SketchLine_32")
+SketchLine_50.setName("SketchLine_31")
+SketchLine_50.result().setName("SketchLine_31")
+SketchLine_49.setName("SketchLine_27")
+SketchLine_49.result().setName("SketchLine_27")
+SketchLine_48.setName("SketchLine_30")
+SketchLine_48.result().setName("SketchLine_30")
+SketchLine_47.setName("SketchLine_29")
+SketchLine_47.result().setName("SketchLine_29")
+SketchLine_46.setName("SketchLine_26")
+SketchLine_46.result().setName("SketchLine_26")
+model.do()
+Edge_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_27"), model.selection("EDGE", "Sketch_2/SketchLine_26"), model.selection("EDGE", "Sketch_2/SketchLine_28"), model.selection("EDGE", "Sketch_2/SketchLine_19"), model.selection("EDGE", "Sketch_2/SketchLine_25"), model.selection("EDGE", "Sketch_2/SketchLine_23"), model.selection("EDGE", "Sketch_2/SketchLine_24"), model.selection("EDGE", "Sketch_2/SketchLine_30"), model.selection("EDGE", "Sketch_2/SketchLine_34"), model.selection("EDGE", "Sketch_2/SketchLine_29"), model.selection("EDGE", "Sketch_2/SketchLine_33"), model.selection("EDGE", "Sketch_2/SketchLine_31"), model.selection("EDGE", "Sketch_2/SketchLine_20"), model.selection("EDGE", "Sketch_2/SketchLine_32")]
+Edge_1 = model.addEdge(Part_2_doc, Edge_1_objects)
+Extrusion_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5"), model.selection("EDGE", "Edge_1_6"), model.selection("EDGE", "Edge_1_7"), model.selection("EDGE", "Edge_1_8"), model.selection("EDGE", "Edge_1_9"), model.selection("EDGE", "Edge_1_10"), model.selection("EDGE", "Edge_1_11"), model.selection("EDGE", "Edge_1_12"), model.selection("EDGE", "Edge_1_13"), model.selection("EDGE", "Edge_1_14")]
+Extrusion_1 = model.addExtrusion(Part_2_doc, Extrusion_1_objects, model.selection("EDGE", "PartSet/OX"), 300, 0)
+Fill_1_objects_2 = [model.selection("FACE", "Extrusion_1_1"), model.selection("FACE", "Extrusion_1_2"), model.selection("FACE", "Extrusion_1_3"), model.selection("FACE", "Extrusion_1_4"), model.selection("FACE", "Extrusion_1_5"), model.selection("FACE", "Extrusion_1_6"), model.selection("FACE", "Extrusion_1_7"), model.selection("FACE", "Extrusion_1_8"), model.selection("FACE", "Extrusion_1_9"), model.selection("FACE", "Extrusion_1_10"), model.selection("FACE", "Extrusion_1_11"), model.selection("FACE", "Extrusion_1_12"), model.selection("FACE", "Extrusion_1_13"), model.selection("FACE", "Extrusion_1_14")]
+Fill_1 = model.addFill(Part_2_doc, [model.selection("COMPSOLID", "Revolution_1_1")], Fill_1_objects_2)
+Group_1_objects = [model.selection("SOLID", "Fill_1_1_25"), model.selection("SOLID", "Fill_1_1_28"), model.selection("SOLID", "Fill_1_1_26"), model.selection("SOLID", "Fill_1_1_27"), model.selection("SOLID", "Fill_1_1_31"), model.selection("SOLID", "Fill_1_1_35"), model.selection("SOLID", "Fill_1_1_36"), model.selection("SOLID", "Fill_1_1_32"), model.selection("SOLID", "Fill_1_1_34"), model.selection("SOLID", "Fill_1_1_30"), model.selection("SOLID", "Fill_1_1_33"), model.selection("SOLID", "Fill_1_1_29")]
+Group_1 = model.addGroup(Part_2_doc, Group_1_objects)
+Group_1.setName("CORPS")
+Group_1.result().setName("CORPS")
+Group_2_objects = [model.selection("SOLID", "Fill_1_1_41"), model.selection("SOLID", "Fill_1_1_49"), model.selection("SOLID", "Fill_1_1_69"), model.selection("SOLID", "Fill_1_1_71"), model.selection("SOLID", "Fill_1_1_51"), model.selection("SOLID", "Fill_1_1_43"), model.selection("SOLID", "Fill_1_1_44"), model.selection("SOLID", "Fill_1_1_67"), model.selection("SOLID", "Fill_1_1_39"), model.selection("SOLID", "Fill_1_1_47"), model.selection("SOLID", "Fill_1_1_45"), model.selection("SOLID", "Fill_1_1_37"), model.selection("SOLID", "Fill_1_1_65"), model.selection("SOLID", "Fill_1_1_66"), model.selection("SOLID", "Fill_1_1_38"), model.selection("SOLID", "Fill_1_1_46"), model.selection("SOLID", "Fill_1_1_48"), model.selection("SOLID", "Fill_1_1_40"), model.selection("SOLID", "Fill_1_1_68"), model.selection("SOLID", "Fill_1_1_42"), model.selection("SOLID", "Fill_1_1_70"), model.selection("SOLID", "Fill_1_1_50"), model.selection("SOLID", "Fill_1_1_52"), model.selection("SOLID", "Fill_1_1_72"), model.selection("SOLID", "Fill_1_1_63"), model.selection("SOLID", "Fill_1_1_64"), model.selection("SOLID", "Fill_1_1_61"), model.selection("SOLID", "Fill_1_1_62"), model.selection("SOLID", "Fill_1_1_58"), model.selection("SOLID", "Fill_1_1_57"), model.selection("SOLID", "Fill_1_1_54"), model.selection("SOLID", "Fill_1_1_53"), model.selection("SOLID", "Fill_1_1_55"), model.selection("SOLID", "Fill_1_1_56"), model.selection("SOLID", "Fill_1_1_60"), model.selection("SOLID", "Fill_1_1_59")]
+Group_2 = model.addGroup(Part_2_doc, Group_2_objects)
+Group_2.setName("TETE")
+Group_2.result().setName("TETE")
+Group_3_objects = [model.selection("SOLID", "Fill_1_1_2"), model.selection("SOLID", "Fill_1_1_1"), model.selection("SOLID", "Fill_1_1_5"), model.selection("SOLID", "Fill_1_1_9"), model.selection("SOLID", "Fill_1_1_13"), model.selection("SOLID", "Fill_1_1_14"), model.selection("SOLID", "Fill_1_1_15"), model.selection("SOLID", "Fill_1_1_19"), model.selection("SOLID", "Fill_1_1_11"), model.selection("SOLID", "Fill_1_1_12"), model.selection("SOLID", "Fill_1_1_24"), model.selection("SOLID", "Fill_1_1_23"), model.selection("SOLID", "Fill_1_1_16"), model.selection("SOLID", "Fill_1_1_8"), model.selection("SOLID", "Fill_1_1_20"), model.selection("SOLID", "Fill_1_1_4"), model.selection("SOLID", "Fill_1_1_3"), model.selection("SOLID", "Fill_1_1_7"), model.selection("SOLID", "Fill_1_1_10"), model.selection("SOLID", "Fill_1_1_6")]
+Group_3 = model.addGroup(Part_2_doc, Group_3_objects)
+Group_3.setName("PIED")
+Group_3.result().setName("PIED")
+Group_4 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_36/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_7")])
+Group_4.setName("corps_hauteur")
+Group_4.result().setName("corps_hauteur")
+Group_5 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_11/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_5")])
+Group_5.setName("pied_hauteur")
+Group_5.result().setName("pied_hauteur")
+Group_6 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_24/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_6")])
+Group_6.setName("chanfrein")
+Group_6.result().setName("chanfrein")
+Group_7 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_72/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchArc_1_2")])
+Group_7.setName("filet")
+Group_7.result().setName("filet")
+Group_8 = model.addGroup(Part_2_doc, [model.selection("EDGE", "Fill_1_1_42/Generated_Edge&Sketch_2/SketchLine_31&Sketch_1/SketchLine_9")])
+Group_8.setName("tete_bas")
+Group_8.result().setName("tete_bas")
+Group_9_objects = [model.selection("FACE", "Fill_1_1_12/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_11/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_9/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_8/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_4/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_1/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_2/Modified_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Fill_1_1_5/Modified_Face&Sketch_1/SketchLine_5")]
+Group_9 = model.addGroup(Part_2_doc, Group_9_objects)
+Group_9.setName("ADH_PIEDS")
+Group_9.result().setName("ADH_PIEDS")
+Group_10_objects = [model.selection("FACE", "Fill_1_1_13/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_14/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_25/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_26/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_15/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_27/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_19/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_31/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_23/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_35/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_24/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_36/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_32/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_20/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_16/Modified_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Fill_1_1_28/Modified_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Fill_1_1_70/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_42/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_68/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_40/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_66/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_38/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_37/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_65/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_39/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_67/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_69/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_41/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_43/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_71/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_44/Modified_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Fill_1_1_72/Modified_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Fill_1_1_52/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_44/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_43/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_51/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_50/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_42/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_40/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_48/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_46/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_38/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_37/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_45/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_39/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_47/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_49/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Fill_1_1_41/Modified_Face&Sketch_1/SketchLine_9")]
+Group_10 = model.addGroup(Part_2_doc, Group_10_objects)
+Group_10.setName("CONTACT_VIS")
+Group_10.result().setName("CONTACT_VIS")
+Translation_1 = model.addTranslation(Part_2_doc, [model.selection("COMPSOLID", "Fill_1_1")], 0, 100, 0)
+AngularCopy_1 = model.addMultiRotation(Part_2_doc, [model.selection("COMPSOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), 4)
+model.do()
+
+# move groups to the end
+Part_2_doc.moveFeature(Group_1.feature(), AngularCopy_1.feature())
+Part_2_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_2_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_2_doc.moveFeature(Group_4.feature(), Group_3.feature())
+Part_2_doc.moveFeature(Group_5.feature(), Group_4.feature())
+Part_2_doc.moveFeature(Group_6.feature(), Group_5.feature())
+Part_2_doc.moveFeature(Group_7.feature(), Group_6.feature())
+Part_2_doc.moveFeature(Group_8.feature(), Group_7.feature())
+Part_2_doc.moveFeature(Group_9.feature(), Group_8.feature())
+Part_2_doc.moveFeature(Group_10.feature(), Group_9.feature())
+model.end()
+
+from ModelAPI import *
+
+aFactory = ModelAPI_Session.get().validators()
+
+# Check groups
+a = 0
+num_in_groups = [48, 144, 80, 4, 4, 4, 4, 4, 32, 192]
+for i in range(Part_2_doc.size("Groups")):
+  GroupFeature = Part_2_doc.feature(objectToResult(Part_2_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
+  assert(GroupFeature.selectionList("group_list").size() == num_in_groups[a])
+  a = a + 1
+
+assert(model.checkPythonDump())
index 8d7c256e6eb0d3e2e1a0defbefa5284211dafa3c..cd60f0935d7a7c38de5b4263be836a5f3a390675 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -37,7 +38,7 @@ SketchLine_5 = Sketch_2.addLine(64.54729867171925, -32.684941224703, 20.69511709
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_5.endPoint())
 model.do()
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"))
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_6 = Sketch_3.addLine(18.78449167586506, 11.40320166178118, 18.60732592394469, -15.47067574876233)
 SketchLine_7 = Sketch_3.addLine(18.60732592394469, -15.47067574876233, 57.06415928764967, -9.455161348995592)
@@ -48,7 +49,7 @@ SketchLine_9 = Sketch_3.addLine(56.5687276408287, 11.2362868340608, 18.784491675
 SketchConstraintCoincidence_7 = Sketch_3.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_8 = Sketch_3.setCoincident(SketchLine_6.startPoint(), SketchLine_9.endPoint())
 model.do()
-Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_3/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")])
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_3/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection("EDGE", "Sketch_1/SketchLine_1"), [model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")])
 model.do()
 model.end()
 
diff --git a/src/FeaturesPlugin/Test/Test2681.py b/src/FeaturesPlugin/Test/Test2681.py
new file mode 100644 (file)
index 0000000..21f2bdd
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(30.99434204882063, 26.80840312072785, -30.86519895695055, 26.80840312072785)
+SketchLine_2 = Sketch_1.addLine(-30.86519895695055, 26.80840312072785, -30.86519895695055, -19.3714637805129)
+SketchLine_3 = Sketch_1.addLine(-30.86519895695055, -19.3714637805129, 30.99434204882063, -19.3714637805129)
+SketchLine_4 = Sketch_1.addLine(30.99434204882063, -19.3714637805129, 30.99434204882063, 26.80840312072785)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchArc_1 = Sketch_1.addArc(-7.617093567666898, 26.80840312072785, -19.24336125977736, 26.80840312072785, 4.009174124443563, 26.80840312072785, False)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.center())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+model.do()
+model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2686.py b/src/FeaturesPlugin/Test/Test2686.py
new file mode 100644 (file)
index 0000000..57850b7
--- /dev/null
@@ -0,0 +1,215 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from GeomAPI import GeomAPI_Pnt
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "angle", "27.5")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(0, 4, 6.2, 4)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_2 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result())
+SketchLine_3 = Sketch_1.addLine(6.2, 4, 6.2, 2.5)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(6.2, 2.5, 3.5, 2)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(3.5, 2, 3.5, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_6 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
+SketchLine_7 = Sketch_1.addLine(3.5, 0, 0, 0)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_7.endPoint())
+SketchLine_8 = Sketch_1.addLine(0, 4, 0, 0)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_8.endPoint())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_7.result(), 3.5)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), 6.2)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 1.5)
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_8.result(), 4)
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_5.result(), 2)
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", GeomAPI_Pnt(3.1, 0, 2))], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", GeomAPI_Pnt(0, 0, 4)))
+SketchCircle_1 = Sketch_2.addCircle(4.027018127601872, 2.325000000002457, 1.1)
+SketchCircle_2 = Sketch_2.addCircle(-4.027018127597639, 2.325000000000002, 1.1)
+SketchCircle_3 = Sketch_2.addCircle(7.188370358619843e-12, -4.650000000090492, 1.1)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", GeomAPI_Pnt(0, 0, 4)), False)
+SketchPoint_1 = SketchProjection_3.createdFeature()
+SketchCircle_4 = Sketch_2.addCircle(0, 0, 4.65)
+SketchCircle_4.setAuxiliary(True)
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchPoint_1.result(), SketchCircle_4.center())
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_9 = SketchProjection_4.createdFeature()
+SketchLine_10 = Sketch_2.addLine(0, 0, 4.027018127601872, 2.325000000002457)
+SketchLine_10.setAuxiliary(True)
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchLine_10.endPoint())
+SketchLine_11 = Sketch_2.addLine(0, 0, -4.027018127597639, 2.325000000000002)
+SketchLine_11.setAuxiliary(True)
+SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchLine_11.endPoint())
+SketchLine_12 = Sketch_2.addLine(0, 0, 7.188370358619843e-12, -4.650000000090492)
+SketchLine_12.setAuxiliary(True)
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchLine_12.endPoint())
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchCircle_4.results()[1])
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchCircle_4.results()[1])
+SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchCircle_4.results()[1])
+SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_4.results()[1], 4.65)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], 1.1)
+SketchConstraintEqual_1 = Sketch_2.setEqual(SketchCircle_1.results()[1], SketchCircle_2.results()[1])
+SketchConstraintEqual_2 = Sketch_2.setEqual(SketchCircle_2.results()[1], SketchCircle_3.results()[1])
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", GeomAPI_Pnt(3.1, 0, 4)), False)
+SketchLine_13 = SketchProjection_5.createdFeature()
+SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_13.result(), SketchLine_10.result(), 30)
+SketchConstraintAngle_2 = Sketch_2.setAngle(SketchLine_10.result(), SketchLine_11.result(), 120)
+SketchConstraintAngle_3 = Sketch_2.setAngle(SketchLine_11.result(), SketchLine_12.result(), 120)
+SketchCircle_5 = Sketch_2.addCircle(4.645574230355638, 0.2028301512488116, 0.8)
+SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchCircle_4.results()[1], SketchCircle_5.center())
+SketchCircle_6 = Sketch_2.addCircle(4.645574230355638, 0.2028301512488116, 0.65)
+SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchCircle_5.center(), SketchCircle_6.center())
+SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_6.results()[1], 0.65)
+SketchConstraintRadius_4 = Sketch_2.setRadius(SketchCircle_5.results()[1], 0.8)
+SketchLine_14 = Sketch_2.addLine(0, 0, 4.645574230355638, 0.2028301512488116)
+SketchLine_14.setAuxiliary(True)
+SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchCircle_5.center(), SketchLine_14.endPoint())
+SketchConstraintAngle_4 = Sketch_2.setAngle(SketchLine_14.result(), SketchLine_10.result(), "angle")
+SketchCircle_7 = Sketch_2.addCircle(2.498443178812738, 3.921770223029927, 0.65)
+SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchCircle_4.results()[1], SketchCircle_7.center())
+SketchCircle_8 = Sketch_2.addCircle(2.498443178812738, 3.921770223029927, 0.8)
+SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchCircle_4.results()[1], SketchCircle_8.center())
+SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchCircle_7.center(), SketchCircle_8.center())
+SketchConstraintEqual_3 = Sketch_2.setEqual(SketchCircle_6.results()[1], SketchCircle_7.results()[1])
+SketchConstraintEqual_4 = Sketch_2.setEqual(SketchCircle_8.results()[1], SketchCircle_5.results()[1])
+SketchLine_15 = Sketch_2.addLine(0, 0, 2.498443178812738, 3.921770223029927)
+SketchLine_15.setAuxiliary(True)
+SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchCircle_7.center(), SketchLine_15.endPoint())
+SketchConstraintAngle_5 = Sketch_2.setAngle(SketchLine_10.result(), SketchLine_15.result(), "angle")
+SketchMultiRotation_1 = Sketch_2.addRotation([SketchCircle_8.results()[1], SketchCircle_5.results()[1]], SketchCircle_4.center(), 360, 3, True)
+[SketchCircle_9, SketchCircle_10, SketchCircle_11, SketchCircle_12] = SketchMultiRotation_1.rotated()
+SketchCircle_12.setName("SketchCircle_13")
+SketchCircle_12.result().setName("SketchCircle_13")
+SketchCircle_12.results()[1].setName("SketchCircle_13_2")
+SketchCircle_11.setName("SketchCircle_12")
+SketchCircle_11.result().setName("SketchCircle_12")
+SketchCircle_11.results()[1].setName("SketchCircle_12_2")
+SketchMultiRotation_2 = Sketch_2.addRotation([SketchCircle_6.results()[1], SketchCircle_7.results()[1]], SketchAPI_Line(SketchLine_9).startPoint(), 120, 2)
+[SketchCircle_13, SketchCircle_14] = SketchMultiRotation_2.rotated()
+SketchCircle_14.setName("SketchCircle_17")
+SketchCircle_14.result().setName("SketchCircle_17")
+SketchCircle_14.results()[1].setName("SketchCircle_17_2")
+SketchCircle_13.setName("SketchCircle_14")
+SketchCircle_13.result().setName("SketchCircle_14")
+SketchCircle_13.results()[1].setName("SketchCircle_14_2")
+SketchCircle_15 = Sketch_2.addCircle(0, 5, 0.45)
+SketchCircle_15.setName("SketchCircle_15")
+SketchCircle_15.result().setName("SketchCircle_15")
+SketchCircle_15.results()[1].setName("SketchCircle_15_2")
+SketchLine_16 = Sketch_2.addLine(0, 0, 0, 5)
+SketchLine_16.setAuxiliary(True)
+SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_16.startPoint())
+SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchCircle_15.center(), SketchLine_16.endPoint())
+SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_16.result(), 5)
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_17 = SketchProjection_6.createdFeature()
+SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchCircle_15.center(), SketchLine_17.result())
+SketchConstraintRadius_5 = Sketch_2.setRadius(SketchCircle_15.results()[1], 0.45)
+SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", GeomAPI_Pnt(-6.2, 7.59281015471359e-16, 4)), False)
+SketchCircle_16 = SketchProjection_7.createdFeature()
+SketchCircle_16.setName("SketchCircle_16")
+SketchCircle_16.result().setName("SketchCircle_16")
+SketchCircle_16.results()[1].setName("SketchCircle_16_2")
+SketchCircle_17 = Sketch_2.addCircle(4.259590630302756, -2.982597469025441, 0.5)
+SketchCircle_17.setName("SketchCircle_18")
+SketchCircle_17.result().setName("SketchCircle_18")
+SketchCircle_17.results()[1].setName("SketchCircle_18_2")
+SketchCircle_18 = Sketch_2.addCircle(3.276608177155966, -2.294305745404186, 0.3)
+SketchCircle_18.setName("SketchCircle_19")
+SketchCircle_18.result().setName("SketchCircle_19")
+SketchCircle_18.results()[1].setName("SketchCircle_19_2")
+SketchLine_18 = Sketch_2.addLine(0, 0, 4.259590630302756, -2.982597469025441)
+SketchLine_18.setAuxiliary(True)
+SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchCircle_17.center(), SketchLine_18.endPoint())
+SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchCircle_18.center(), SketchLine_18.result())
+SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", GeomAPI_Pnt(3.1, 0, 4)), False)
+SketchLine_19 = SketchProjection_8.createdFeature()
+SketchConstraintAngle_6 = Sketch_2.setAngleBackward(SketchLine_19.result(), SketchLine_18.result(), 35)
+SketchConstraintRadius_6 = Sketch_2.setRadius(SketchCircle_17.results()[1], 0.5)
+SketchConstraintRadius_7 = Sketch_2.setRadius(SketchCircle_18.results()[1], 0.3)
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchCircle_4.center(), SketchCircle_18.center(), 4, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_4.center(), SketchLine_18.endPoint(), 5.2, True)
+model.do()
+ExtrusionCut_1_objects_1 = [model.selection("WIRE", GeomAPI_Pnt(2.927018127601872, 2.325000000002457, 4)), model.selection("WIRE", GeomAPI_Pnt(1.848443178812738, 3.921770223029927, 4)), model.selection("WIRE", GeomAPI_Pnt(3.995574230355639, 0.2028301512488117, 4)), model.selection("WIRE_2", GeomAPI_Pnt(-3.148443178812729, 3.921770223029919, 4)), model.selection("WIRE", GeomAPI_Pnt(-5.127018127597639, 2.325000000000002, 4)), model.selection("WIRE_2", GeomAPI_Pnt(-5.29557423035565, 0.2028301512488154, 4)), model.selection("FACE", GeomAPI_Pnt(7.188472039842964e-12, -4.650000000090492, 4)), model.selection("FACE", GeomAPI_Pnt(4.259590630302756, -2.982597469025441, 4)), model.selection("FACE", GeomAPI_Pnt(3.276608177155966, -2.294305745404186, 4))]
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", GeomAPI_Pnt(0, 0, 0)), 0, model.selection(), 0, [model.selection("SOLID", GeomAPI_Pnt(-7.561538823095622e-16, 6.008767139946657e-17, 2.62684985301323))])
+ExtrusionCut_2_objects_1 = [model.selection("WIRE", GeomAPI_Pnt(-5.44557423035565, 0.2028301512488154, 4)), model.selection("WIRE", GeomAPI_Pnt(-3.298443178812729, 3.921770223029919, 4)), model.selection("WIRE", GeomAPI_Pnt(1.698443178812738, 3.921770223029927, 4)), model.selection("WIRE", GeomAPI_Pnt(3.845574230355639, 0.2028301512488117, 4))]
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 0.75, [model.selection("SOLID", GeomAPI_Pnt(0.06663461012735418, 0.05143712897449785, 2.675990079155852))])
+Axis_4 = model.addAxis(Part_1_doc, 0, -1, -10)
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", GeomAPI_Pnt(-0.45, 5, 4))], model.selection("EDGE", GeomAPI_Pnt(0, -0.5, -5)), 10, 10, [model.selection("SOLID", GeomAPI_Pnt(0.06614791498027658, 0.06612435067467369, 2.67762623401837))])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", GeomAPI_Pnt(-2.14713105154291, -4.124600374278729, 4)), model.selection("FACE", GeomAPI_Pnt(2.14713105154291, -4.124600374278742, 4))], model.selection(), model.selection("FACE", GeomAPI_Pnt(0, 0, 0)), 0, model.selection(), 0)
+Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
+SketchLine_20 = Sketch_3.addLine(3.5, 2.508501119175777, 3.5, 4)
+SketchLine_21 = Sketch_3.addLine(3.5, 4, 6.2, 4)
+SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
+SketchLine_22 = Sketch_3.addLine(6.2, 4, 6.2, 3.008501119175777)
+SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
+SketchLine_23 = Sketch_3.addLine(6.2, 3.008501119175777, 3.5, 2.508501119175777)
+SketchConstraintCoincidence_37 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchConstraintCoincidence_38 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_20.startPoint())
+SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_20.result())
+SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE_9", GeomAPI_Pnt(3.5, 0, 1)), False)
+SketchLine_24 = SketchProjection_9.createdFeature()
+SketchConstraintCoincidence_39 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_24.result())
+SketchProjection_10 = Sketch_3.addProjection(model.selection("EDGE_3", GeomAPI_Pnt(4.85, 0, 2.25)), False)
+SketchLine_25 = SketchProjection_10.createdFeature()
+SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_23.result(), SketchLine_25.result())
+SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_22.result())
+SketchProjection_11 = Sketch_3.addProjection(model.selection("EDGE_9", GeomAPI_Pnt(6.2, 0, 3.25)), False)
+SketchLine_26 = SketchProjection_11.createdFeature()
+SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchLine_23.startPoint(), SketchLine_26.result())
+SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_21.result())
+SketchConstraintDistance_3 = Sketch_3.setDistance(SketchLine_20.startPoint(), SketchLine_25.result(), 0.5, True)
+SketchProjection_12 = Sketch_3.addProjection(model.selection("EDGE_5", GeomAPI_Pnt(3.1, 0, 4)), False)
+SketchLine_27 = SketchProjection_12.createdFeature()
+SketchConstraintCoincidence_41 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_27.result())
+model.do()
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", GeomAPI_Pnt(4.850000000000001, 0, 3.254250559587889))], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", GeomAPI_Pnt(-2.14713105154291, -4.124600374278729, 2)), model.selection("SOLID", GeomAPI_Pnt(2.14713105154291, -4.124600374278742, 2))], [model.selection("SOLID", GeomAPI_Pnt(-1.278142456973851e-15, 2.734224632526547e-16, 3.386836255166113))])
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", GeomAPI_Pnt(0.06552679693747457, 0.1115566065149892, 2.681859907222054))], [model.selection("SOLID", GeomAPI_Pnt(-2.134018078943279, -4.099410579753945, 3.358593616213623)), model.selection("SOLID", GeomAPI_Pnt(2.134018071503405, -4.099410583757958, 3.358593616233432))])
+model.do()
+model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2689.py b/src/FeaturesPlugin/Test/Test2689.py
new file mode 100644 (file)
index 0000000..fef0a59
--- /dev/null
@@ -0,0 +1,99 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "hh", "20")
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-14.44396674123619, 36.663, -34.44396674123619, 36.663)
+SketchLine_2 = Sketch_1.addLine(-34.44396674123619, 36.663, -34.44396674123619, 14.29964516129033)
+SketchLine_3 = Sketch_1.addLine(-34.44396674123619, 14.29964516129033, -14.44396674123619, 14.29964516129033)
+SketchLine_4 = Sketch_1.addLine(-14.44396674123619, 14.29964516129033, -14.44396674123619, 36.663)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(34.94274193548387, 39.45841935483872, 18.60029032258063, 39.45841935483872)
+SketchLine_6 = Sketch_1.addLine(18.60029032258063, 39.45841935483872, 18.60029032258063, 13.00945161290323)
+SketchLine_7 = Sketch_1.addLine(18.60029032258063, 13.00945161290323, 34.94274193548387, 13.00945161290323)
+SketchLine_8 = Sketch_1.addLine(34.94274193548387, 13.00945161290323, 34.94274193548387, 39.45841935483872)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
+SketchLine_9 = Sketch_1.addLine(-7.633645161290328, -5.05325806451613, -33.00745161290323, -5.05325806451613)
+SketchLine_10 = Sketch_1.addLine(-33.00745161290323, -5.05325806451613, -33.00745161290323, -31.71725806451613)
+SketchLine_11 = Sketch_1.addLine(-33.00745161290323, -31.71725806451613, -7.633645161290328, -31.71725806451613)
+SketchLine_12 = Sketch_1.addLine(-7.633645161290328, -31.71725806451613, -7.633645161290328, -5.05325806451613)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_12.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_10.result())
+SketchConstraintHorizontal_6 = Sketch_1.setHorizontal(SketchLine_11.result())
+SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_12.result())
+SketchLine_13 = Sketch_1.addLine(36.44796774193549, -7.848677419354839, 19.46041935483872, -7.848677419354839)
+SketchLine_14 = Sketch_1.addLine(19.46041935483872, -7.848677419354839, 19.46041935483872, -34.29764516129033)
+SketchLine_15 = Sketch_1.addLine(19.46041935483872, -34.29764516129033, 36.44796774193549, -34.29764516129033)
+SketchLine_16 = Sketch_1.addLine(36.44796774193549, -34.29764516129033, 36.44796774193549, -7.848677419354839)
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_13.result())
+SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_14.result())
+SketchConstraintHorizontal_8 = Sketch_1.setHorizontal(SketchLine_15.result())
+SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_16.result())
+SketchCircle_1 = Sketch_1.addCircle(-24.6211935483871, 23.331, 4.515677419354841)
+SketchCircle_2 = Sketch_1.addCircle(27.20158064516131, 20.96564516129033, 4.091267733479863)
+SketchCircle_3 = Sketch_1.addCircle(-16.23493548387097, -18.60029032258065, 7.50151366286372)
+SketchCircle_4 = Sketch_1.addCircle(27.84667741935485, -22.90093548387097, 5.414373911476542)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "hh")
+model.do()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "hh", "15")
+model.addParameter(Part_1_doc, "hh_1", "26")
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchCircle_1_2r")], model.selection(), "hh", 0)
+Extrusion_2_objects = [model.selection("WIRE", "PartSet/Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchCircle_1_2r_wire"), model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchCircle_2_2r"), model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16f-SketchCircle_4_2r"), model.selection("FACE", "PartSet/Sketch_1/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f-SketchCircle_3_2r")]
+Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), 10, "hh_1")
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_2_4"), model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "PartSet/OX"), 40)
+Fuse_1_objects_1 = [model.selection("SOLID", "Translation_1_2"), model.selection("SOLID", "Translation_1_1"), model.selection("SOLID", "Extrusion_2_1")]
+Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1)
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_2_3")], model.selection("EDGE", "PartSet/OX"), 30)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_2_2"), model.selection("SOLID", "Translation_2_1")])
+model.do()
+model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2692.py b/src/FeaturesPlugin/Test/Test2692.py
new file mode 100644 (file)
index 0000000..19b9d00
--- /dev/null
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OY"), 20, 3)
+ExtrusionCut_1_objects_2 = [model.selection("SOLID", "LinearCopy_1_1_2"), model.selection("SOLID", "LinearCopy_1_1_1"), model.selection("SOLID", "LinearCopy_1_1_3")]
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 10, ExtrusionCut_1_objects_2)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "LinearCopy_1_1_2/MF:Translated_Face&Box_1_1/Top"))
+SketchCircle_1 = Sketch_1.addCircle(4.871972805908816, 24.69028692663239, 2.754280056405151)
+SketchCircle_2 = Sketch_1.addCircle(4.956613458332676, 4.459837610261877, 1.82794741094275)
+SketchCircle_3 = Sketch_1.addCircle(4.842959508111481, 44.32940059836771, 3.136980464700132)
+ExtrusionCut_1.setNestedSketch(Sketch_1)
+model.do()
+model.testHaveNamingSubshapes(ExtrusionCut_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(ExtrusionCut_1, 1)
+model.testNbSubResults(ExtrusionCut_1, [3])
+model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.FACE, [21])
+model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [90])
+model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [180])
+model.testResultsVolumes(ExtrusionCut_1, [2347.550996571865198347950354218])
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2693.py b/src/FeaturesPlugin/Test/Test2693.py
new file mode 100644 (file)
index 0000000..76901c8
--- /dev/null
@@ -0,0 +1,155 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "hh", "20")
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-17.23654191510748, 16.36770059625795, -4.760492650097712, 19.4251823602345)
+SketchLine_2 = Sketch_1.addLine(20, 2.414080216212369e-15, 20, -31)
+SketchLine_3 = Sketch_1.addLine(2.928932188134523, -38.07106781186548, -8.677669529663685, -26.46446609406726)
+SketchLine_4 = Sketch_1.addLine(-12.21320343559642, -25, -20.00000000000047, -25)
+SketchArc_1 = Sketch_1.addArc(10, -31, 20, -31, 2.928932188134523, -38.07106781186548, True)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_2")
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchLine_2.result(), SketchArc_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_3")
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_3.result(), SketchArc_1.results()[1])
+SketchArc_2 = Sketch_1.addArc(-12.21320343559642, -30, -8.677669529663685, -26.46446609406726, -12.21320343559642, -25, False)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_3.endPoint())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_4")
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_5")
+SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_4.result())
+SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_3.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchArc_3 = Sketch_1.addArc(5.671735138196638e-24, 3.298692290329323e-23, -4.760492650097712, 19.4251823602345, 20, 2.414080216212369e-15, True)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_6")
+SketchConstraintTangent_5 = Sketch_1.setTangent(SketchLine_1.result(), SketchArc_3.results()[1])
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_7")
+SketchConstraintTangent_6 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_2.result())
+SketchArc_4 = Sketch_1.addArc(-12, -5, -22.35294117647118, -24.41176470588231, -17.23654191510748, 16.36770059625795, True)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
+SketchConstraintTangent_7 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchLine_1.result())
+SketchConstraintTangent_7.setName("SketchConstraintTangent_8")
+SketchCircle_1 = Sketch_1.addCircle(-22, -5, 7.5)
+SketchCircle_2 = Sketch_1.addCircle(5.671735138196638e-24, 3.298692290329323e-23, 10)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_3.center(), SketchCircle_2.center())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10")
+SketchCircle_3 = Sketch_1.addCircle(7, -25, 7.5)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 10)
+SketchConstraintRadius_1.setName("SketchConstraintRadius_2")
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_4.result(), SketchLine_3.result(), 134.9999999999999)
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 5)
+SketchConstraintRadius_2.setName("SketchConstraintRadius_3")
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_4.results()[1], 22)
+SketchConstraintRadius_3.setName("SketchConstraintRadius_4")
+SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_3.results()[1], 20)
+SketchConstraintRadius_4.setName("SketchConstraintRadius_5")
+SketchPoint_1 = Sketch_1.addPoint(-20.00000000000047, -25)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_4.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_12")
+SketchArc_5 = Sketch_1.addArc(-20.00000000000047, -20, -20.00000000000047, -25, -22.35294117647118, -24.41176470588231, True)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchArc_5.startPoint())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11")
+SketchConstraintTangent_8 = Sketch_1.setTangent(SketchLine_4.result(), SketchArc_5.results()[1])
+SketchConstraintTangent_8.setName("SketchConstraintTangent_9")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchArc_4.startPoint(), SketchArc_5.endPoint())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_13")
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchArc_4.center(), SketchCircle_2.center(), 12)
+SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchArc_3.center(), 22)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchArc_3.center(), SketchArc_4.center(), 5)
+SketchLine_5 = Sketch_1.addLine(-22, -5, -12, -5)
+SketchLine_5.setAuxiliary(True)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_14")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_4.center(), SketchLine_5.endPoint())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_15")
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintRadius_5 = Sketch_1.setRadius(SketchCircle_1.results()[1], 7.5)
+SketchConstraintRadius_5.setName("SketchConstraintRadius_6")
+SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchCircle_2.center(), SketchCircle_3.center(), 7)
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchCircle_2.center(), SketchCircle_3.center(), 25)
+SketchConstraintDistanceVertical_3 = Sketch_1.setVerticalDistance(SketchArc_3.center(), SketchArc_1.center(), 31)
+SketchConstraintRadius_6 = Sketch_1.setRadius(SketchCircle_3.results()[1], 7.5)
+SketchConstraintRadius_6.setName("SketchConstraintRadius_7")
+SketchConstraintRadius_7 = Sketch_1.setRadius(SketchCircle_2.results()[1], 10)
+SketchConstraintRadius_7.setName("SketchConstraintRadius_8")
+SketchConstraintRadius_8 = Sketch_1.setRadius(SketchArc_5.results()[1], 5)
+SketchConstraintRadius_8.setName("SketchConstraintRadius_9")
+SketchConstraintTangent_9 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchArc_5.results()[1])
+SketchConstraintTangent_9.setName("SketchConstraintTangent_10")
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_3.center(), SketchAPI_Point(SketchPoint_2).coordinates())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_16")
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_5.startPoint(), SketchLine_4.result(), 20, True)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_4_2f-SketchArc_5_2f-SketchLine_4r-SketchArc_2_2r-SketchLine_3r-SketchArc_1_2f-SketchLine_2r-SketchArc_3_2f-SketchLine_1r-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 6.5, 0)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 100, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"))
+SketchLine_6 = Sketch_2.addLine(12.25, 6.5, -12.25, 6.5)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"), False)
+SketchLine_7 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.result())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_17")
+SketchLine_8 = Sketch_2.addLine(-12.25, 6.5, -12.25, 4.5)
+SketchLine_9 = Sketch_2.addLine(-12.25, 4.5, 12.25, 4.5)
+SketchLine_10 = Sketch_2.addLine(12.25, 4.5, 12.25, 6.5)
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_18")
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_19")
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_20")
+SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_21")
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_6.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_8.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_10.result())
+SketchConstraintLength_1 = Sketch_2.setLength(SketchLine_9.result(), 24.5)
+SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_8.result(), 2)
+SketchPoint_3 = Sketch_2.addPoint(2.442490654175344e-15, 6.499999999999999)
+SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_6.result())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_22")
+SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchPoint_3.coordinates(), SketchLine_6.result())
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2]"), False)
+SketchLine_11 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_11.result())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_23")
+ExtrusionCut_1.setNestedSketch(Sketch_2)
+model.do()
+model.testHaveNamingSubshapes(ExtrusionCut_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2698.py b/src/FeaturesPlugin/Test/Test2698.py
new file mode 100644 (file)
index 0000000..ce7718d
--- /dev/null
@@ -0,0 +1,350 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "hh", "20")
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(0, -3.45, 0, -6.45)
+SketchLine_2 = Sketch_1.addLine(0, -6.45, 7.781999999999999, -6.45)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(7.781999999999999, -6.45, 7.781999999999999, -3.45)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(7.781999999999999, -3.45, 6.537999941088452, -3.45)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(6.537999941088452, -3.45, 6.537999999999999, -2.4)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(6.537999999999999, -2.4, 6.375999999999999, -2.25)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(6.375999999999999, -2.25, 6.375999999999999, 9.025)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(6.375999999999999, 9.025, 6.537999999999998, 9.186999999999999)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchLine_9 = Sketch_1.addLine(6.537999999999998, 9.186999999999999, 6.537999999999998, 10.256)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchLine_10 = Sketch_1.addLine(6.537999999999998, 10.256, 6.187999999999998, 10.256)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchLine_11 = Sketch_1.addLine(6.187999999999998, 10.256, 4.9175, 10.94235984621995)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_12 = SketchProjection_1.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 2.425, 0, 12.26, 4.9175, 10.94235984621995, True)
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_12.result(), SketchArc_1.center())
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_12.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchArc_1.endPoint())
+SketchLine_13 = Sketch_1.addLine(0, 12.26, 0, 12.096)
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_13.startPoint())
+SketchLine_14 = Sketch_1.addLine(0, -3.45, 6.187999958006518, -3.45)
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_14.startPoint())
+SketchLine_15 = Sketch_1.addLine(6.187999958006518, -3.45, 6.188, 9.025)
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
+SketchLine_16 = Sketch_1.addLine(6.188, 9.025, 6.082, 9.532)
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_14.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_2.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_10.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_9.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_7.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_15.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_14.result())
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_12.result())
+SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_14.endPoint(), SketchLine_5.result(), 0.35, True)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_6.endPoint(), SketchLine_15.result(), 0.188, True)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 3)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_17 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_17.result(), 3.45, True)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.result(), 6.188, True)
+SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_7.endPoint(), SketchLine_17.result(), 9.025, True)
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_12.result())
+SketchLine_18 = Sketch_1.addLine(6.188, 9.025, 6.375999999999999, 9.025)
+SketchLine_18.setAuxiliary(True)
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_18.endPoint())
+SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_18.result())
+SketchConstraintDistance_6 = Sketch_1.setDistance(SketchLine_10.startPoint(), SketchLine_17.result(), 10.256, True)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_10.result(), 0.35)
+SketchConstraintAngle_1 = Sketch_1.setAngleComplementary(SketchLine_18.result(), SketchLine_8.result(), 45)
+SketchConstraintDistance_7 = Sketch_1.setDistance(SketchLine_8.endPoint(), SketchLine_17.result(), 9.186999999999999, True)
+SketchConstraintDistance_8 = Sketch_1.setDistance(SketchLine_16.endPoint(), SketchLine_15.result(), 0.106, True)
+SketchConstraintDistance_9 = Sketch_1.setDistance(SketchLine_16.endPoint(), SketchLine_17.result(), 9.532, True)
+SketchArc_2 = Sketch_1.addArc(4.793786120242238, 9.263, 6.082, 9.532, 5.676067550792405, 10.23944020672409, False)
+SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchArc_2.startPoint())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_2.results()[1], 1.316)
+SketchConstraintDistance_10 = Sketch_1.setDistance(SketchArc_2.center(), SketchLine_17.result(), 9.263, True)
+SketchLine_19 = Sketch_1.addLine(4.793786120242238, 9.263, 6.082, 9.532)
+SketchLine_19.setAuxiliary(True)
+SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_19.startPoint())
+SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_19.endPoint())
+SketchLine_20 = Sketch_1.addLine(4.793786120242238, 9.263, 5.676067550792405, 10.23944020672409)
+SketchLine_20.setAuxiliary(True)
+SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_20.startPoint())
+SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_20.endPoint())
+SketchLine_21 = Sketch_1.addLine(4.793786120242238, 9.263, 4.79378612024245, 10.72808112087842)
+SketchLine_21.setAuxiliary(True)
+SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_21.startPoint())
+SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_21.result())
+SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_20.result(), SketchLine_21.result(), 42.09999999999906)
+SketchLine_22 = Sketch_1.addLine(5.676067550792282, 10.23944020672395, 5.404900443923878, 10.43809443685872)
+SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_22.startPoint())
+SketchLine_23 = Sketch_1.addLine(5.404900443923878, 10.43809443685872, 5.12663857042824, 10.62933672216996)
+SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_1.addLine(5.12663857042824, 10.62933672216996, 4.835500000000001, 10.80033167999931)
+SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchLine_23.endPoint(), SketchLine_24.startPoint())
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_13.result(), "0.082*2")
+SketchArc_3 = Sketch_1.addArc(0, 2.425, 0, 12.096, 4.835500000000001, 10.80033167999931, True)
+SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_1.center(), SketchArc_3.center())
+SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchLine_24.endPoint(), SketchArc_3.endPoint())
+SketchConstraintDistance_11 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_17.result(), 2.425, True)
+SketchLine_25 = Sketch_1.addLine(0, 2.425, 4.9175, 10.94235984621995)
+SketchLine_25.setName("SketchLine_26")
+SketchLine_25.result().setName("SketchLine_26")
+SketchLine_25.setAuxiliary(True)
+SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_25.startPoint())
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_37")
+SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchLine_25.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_38")
+SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_25.result())
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_39")
+SketchLine_26 = Sketch_1.addLine(0, 2.425, 5.220090907696442, 10.77889172431985)
+SketchLine_26.setName("SketchLine_27")
+SketchLine_26.result().setName("SketchLine_27")
+SketchLine_26.setAuxiliary(True)
+SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_40")
+SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchLine_26.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_41")
+SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchLine_24.startPoint(), SketchLine_26.result())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_42")
+SketchLine_27 = Sketch_1.addLine(0, 2.425, 5.524022094217663, 10.61469954608912)
+SketchLine_27.setName("SketchLine_28")
+SketchLine_27.result().setName("SketchLine_28")
+SketchLine_27.setAuxiliary(True)
+SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_27.startPoint())
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_43")
+SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchLine_27.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_44")
+SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchLine_27.result(), SketchLine_23.startPoint())
+SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_45")
+SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_25.endPoint(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_46")
+SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_25.result(), SketchLine_12.result(), 30.00000000000003)
+SketchConstraintAngle_4 = Sketch_1.setAngle(SketchLine_26.result(), SketchLine_12.result(), 32.00000000000001)
+SketchConstraintAngle_5 = Sketch_1.setAngle(SketchLine_27.result(), SketchLine_12.result(), 33.99999999999999)
+SketchConstraintDistance_12 = Sketch_1.setDistance(SketchLine_23.endPoint(), SketchLine_11.result(), "0.088*2", True)
+SketchConstraintDistance_13 = Sketch_1.setDistance(SketchLine_22.endPoint(), SketchLine_11.result(), "0.106*2", True)
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], 9.835000000000001)
+SketchLine_28 = Sketch_1.addLine(7.031999999999999, -4.05, 5.531999999999999, -4.05)
+SketchLine_28.setName("SketchLine_29")
+SketchLine_28.result().setName("SketchLine_29")
+SketchLine_29 = Sketch_1.addLine(5.531999999999999, -4.05, 5.531999999999999, -5.85)
+SketchLine_29.setName("SketchLine_30")
+SketchLine_29.result().setName("SketchLine_30")
+SketchLine_30 = Sketch_1.addLine(5.531999999999999, -5.85, 7.031999999999999, -5.85)
+SketchLine_30.setName("SketchLine_31")
+SketchLine_30.result().setName("SketchLine_31")
+SketchLine_31 = Sketch_1.addLine(7.031999999999999, -5.85, 7.031999999999999, -4.05)
+SketchLine_31.setName("SketchLine_32")
+SketchLine_31.result().setName("SketchLine_32")
+SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchLine_31.endPoint(), SketchLine_28.startPoint())
+SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_47")
+SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_48")
+SketchConstraintCoincidence_47 = Sketch_1.setCoincident(SketchLine_29.endPoint(), SketchLine_30.startPoint())
+SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_49")
+SketchConstraintCoincidence_48 = Sketch_1.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
+SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_50")
+SketchConstraintHorizontal_6 = Sketch_1.setHorizontal(SketchLine_28.result())
+SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_29.result())
+SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_30.result())
+SketchConstraintVertical_9 = Sketch_1.setVertical(SketchLine_31.result())
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_30.result(), 1.5)
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_29.result(), 1.8)
+SketchConstraintDistance_14 = Sketch_1.setDistance(SketchLine_29.startPoint(), SketchLine_14.result(), 0.6, True)
+SketchLine_32 = Sketch_1.addLine(6.281999999999999, 9.025000000000009, 6.281999999999999, -4.049999999999998)
+SketchLine_32.setName("SketchLine_33")
+SketchLine_32.result().setName("SketchLine_33")
+SketchLine_32.setAuxiliary(True)
+SketchConstraintCoincidence_49 = Sketch_1.setCoincident(SketchLine_32.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_51")
+SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_32.endPoint(), SketchLine_28.result())
+SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_52")
+SketchConstraintVertical_10 = Sketch_1.setVertical(SketchLine_32.result())
+SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchLine_32.endPoint(), SketchLine_28.result())
+SketchConstraintMiddle_2 = Sketch_1.setMiddlePoint(SketchLine_32.startPoint(), SketchLine_18.result())
+SketchConstraintDistance_15 = Sketch_1.setDistance(SketchLine_32.endPoint(), SketchLine_3.result(), 1.5, True)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_6.endPoint(), SketchLine_5.endPoint(), 0.15)
+SketchConstraintDistance_16 = Sketch_1.setDistance(SketchLine_6.endPoint(), SketchLine_17.result(), 2.25, True)
+SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_21.result(), SketchLine_21.endPoint())
+SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_53")
+SketchConstraintCoincidence_52 = Sketch_1.setCoincident(SketchLine_25.result(), SketchLine_21.endPoint())
+SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_54")
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchArc_1_2f-SketchLine_13f-SketchArc_3_2r-SketchLine_24r-SketchLine_23r-SketchLine_22r-SketchArc_2_2r-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_32r-SketchLine_31r-SketchLine_30r-SketchLine_29r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_33 = Sketch_2.addLine(0, 2.425, 3.282538500974061, 11.74164236673401)
+SketchLine_33.setName("SketchLine_34")
+SketchLine_33.result().setName("SketchLine_34")
+SketchLine_33.setAuxiliary(True)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_28_StartVertex"), False)
+SketchPoint_1 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_53 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_55")
+SketchPoint_2 = Sketch_2.addPoint(3.241, 11.6237460014939)
+SketchConstraintCoincidence_54 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_33.result())
+SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_56")
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_34 = SketchProjection_4.createdFeature()
+SketchLine_34.setName("SketchLine_36")
+SketchLine_34.result().setName("SketchLine_36")
+SketchConstraintDistance_17 = Sketch_2.setDistance(SketchPoint_2.coordinates(), SketchLine_34.result(), 3.241, True)
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_13"), False)
+SketchLine_35 = SketchProjection_5.createdFeature()
+SketchLine_35.setName("SketchLine_37")
+SketchLine_35.result().setName("SketchLine_37")
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_28"), False)
+SketchLine_36 = SketchProjection_6.createdFeature()
+SketchLine_36.setName("SketchLine_38")
+SketchLine_36.result().setName("SketchLine_38")
+SketchArc_4 = Sketch_2.addArc(0, 2.425, 0, 12.178, 5.453808387550194, 10.51060344512932, True)
+SketchArc_4.setAuxiliary(True)
+SketchConstraintCoincidence_55 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchArc_4.center())
+SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_58")
+SketchConstraintCoincidence_56 = Sketch_2.setCoincident(SketchLine_35.result(), SketchArc_4.startPoint())
+SketchConstraintCoincidence_56.setName("SketchConstraintCoincidence_59")
+SketchConstraintCoincidence_57 = Sketch_2.setCoincident(SketchLine_36.result(), SketchArc_4.endPoint())
+SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_60")
+SketchConstraintMiddle_3 = Sketch_2.setMiddlePoint(SketchLine_35.result(), SketchArc_4.startPoint())
+SketchConstraintCoincidence_58 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_61")
+SketchArc_5 = Sketch_2.addArc(0, 2.425, 3.28253850097406, 11.74164236673401, 4.139817701932777, 11.39365616437401, True)
+SketchConstraintCoincidence_59 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchArc_5.center())
+SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_62")
+SketchConstraintCoincidence_60 = Sketch_2.setCoincident(SketchLine_33.result(), SketchArc_5.startPoint())
+SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_63")
+SketchLine_37 = Sketch_2.addLine(4.139817701932777, 11.39365616437401, 4.459277785066624, 11.1909606795611)
+SketchLine_37.setName("SketchLine_39")
+SketchLine_37.result().setName("SketchLine_39")
+SketchConstraintCoincidence_61 = Sketch_2.setCoincident(SketchArc_5.endPoint(), SketchLine_37.startPoint())
+SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_64")
+SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_1_2"), False)
+SketchArc_6 = SketchProjection_7.createdFeature()
+SketchConstraintCoincidence_62 = Sketch_2.setCoincident(SketchLine_37.endPoint(), SketchArc_6.results()[1])
+SketchConstraintCoincidence_62.setName("SketchConstraintCoincidence_65")
+SketchLine_38 = Sketch_2.addLine(4.459277785066624, 11.1909606795611, 4.390495384356073, 11.041947909785)
+SketchLine_38.setName("SketchLine_40")
+SketchLine_38.result().setName("SketchLine_40")
+SketchConstraintCoincidence_63 = Sketch_2.setCoincident(SketchLine_37.endPoint(), SketchLine_38.startPoint())
+SketchConstraintCoincidence_63.setName("SketchConstraintCoincidence_66")
+SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_3_2"), False)
+SketchArc_7 = SketchProjection_8.createdFeature()
+SketchConstraintCoincidence_64 = Sketch_2.setCoincident(SketchLine_38.endPoint(), SketchArc_7.results()[1])
+SketchConstraintCoincidence_64.setName("SketchConstraintCoincidence_67")
+SketchLine_39 = Sketch_2.addLine(4.390495384356073, 11.041947909785, 4.035044020470619, 11.16667053559354)
+SketchLine_39.setName("SketchLine_41")
+SketchLine_39.result().setName("SketchLine_41")
+SketchConstraintCoincidence_65 = Sketch_2.setCoincident(SketchLine_38.endPoint(), SketchLine_39.startPoint())
+SketchConstraintCoincidence_65.setName("SketchConstraintCoincidence_68")
+SketchArc_8 = Sketch_2.addArc(0, 2.425, 3.199461499025941, 11.5058496362538, 4.035044020470619, 11.16667053559354, True)
+SketchConstraintCoincidence_66 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchArc_8.center())
+SketchConstraintCoincidence_66.setName("SketchConstraintCoincidence_69")
+SketchConstraintCoincidence_67 = Sketch_2.setCoincident(SketchLine_33.result(), SketchArc_8.startPoint())
+SketchConstraintCoincidence_67.setName("SketchConstraintCoincidence_70")
+SketchConstraintCoincidence_68 = Sketch_2.setCoincident(SketchArc_8.endPoint(), SketchLine_39.endPoint())
+SketchConstraintCoincidence_68.setName("SketchConstraintCoincidence_71")
+SketchLine_40 = Sketch_2.addLine(0, 2.425, 4.139817701932777, 11.39365616437401)
+SketchLine_40.setName("SketchLine_42")
+SketchLine_40.result().setName("SketchLine_42")
+SketchLine_40.setAuxiliary(True)
+SketchConstraintCoincidence_69 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchLine_40.startPoint())
+SketchConstraintCoincidence_69.setName("SketchConstraintCoincidence_72")
+SketchConstraintCoincidence_70 = Sketch_2.setCoincident(SketchArc_5.endPoint(), SketchLine_40.endPoint())
+SketchConstraintCoincidence_70.setName("SketchConstraintCoincidence_73")
+SketchConstraintCoincidence_71 = Sketch_2.setCoincident(SketchArc_8.endPoint(), SketchLine_40.result())
+SketchConstraintCoincidence_71.setName("SketchConstraintCoincidence_74")
+SketchConstraintParallel_1 = Sketch_2.setParallel(SketchLine_38.result(), SketchLine_40.result())
+SketchLine_41 = Sketch_2.addLine(0, 2.425, 3.9115060144283, 11.49555702253678)
+SketchLine_41.setName("SketchLine_43")
+SketchLine_41.result().setName("SketchLine_43")
+SketchLine_41.setAuxiliary(True)
+SketchConstraintCoincidence_72 = Sketch_2.setCoincident(SketchLine_33.startPoint(), SketchLine_41.startPoint())
+SketchConstraintCoincidence_72.setName("SketchConstraintCoincidence_75")
+SketchConstraintCoincidence_73 = Sketch_2.setCoincident(SketchLine_41.endPoint(), SketchArc_5.results()[1])
+SketchConstraintCoincidence_73.setName("SketchConstraintCoincidence_76")
+SketchPoint_3 = Sketch_2.addPoint(3.812510620258724, 11.26599240868436)
+SketchConstraintCoincidence_74 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_41.result())
+SketchConstraintCoincidence_74.setName("SketchConstraintCoincidence_77")
+SketchConstraintCoincidence_75 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchArc_8.results()[1])
+SketchConstraintCoincidence_75.setName("SketchConstraintCoincidence_78")
+SketchLine_42 = Sketch_2.addLine(3.812510620258724, 11.26599240868436, 3.9115060144283, 11.49555702253678)
+SketchLine_42.setName("SketchLine_44")
+SketchLine_42.result().setName("SketchLine_44")
+SketchConstraintCoincidence_76 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_42.startPoint())
+SketchConstraintCoincidence_76.setName("SketchConstraintCoincidence_79")
+SketchConstraintCoincidence_77 = Sketch_2.setCoincident(SketchLine_41.endPoint(), SketchLine_42.endPoint())
+SketchConstraintCoincidence_77.setName("SketchConstraintCoincidence_80")
+SketchPoint_4 = Sketch_2.addPoint(3.862008317343517, 11.38077471561057)
+SketchConstraintCoincidence_78 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchLine_42.result())
+SketchConstraintCoincidence_78.setName("SketchConstraintCoincidence_81")
+SketchConstraintMiddle_4 = Sketch_2.setMiddlePoint(SketchPoint_4.coordinates(), SketchLine_42.result())
+SketchConstraintCoincidence_79 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_79.setName("SketchConstraintCoincidence_82")
+SketchConstraintDistance_18 = Sketch_2.setDistance(SketchLine_42.endPoint(), SketchLine_40.result(), 0.25, True)
+SketchConstraintDistance_19 = Sketch_2.setDistance(SketchArc_5.endPoint(), SketchLine_38.result(), 0.375, True)
+SketchConstraintDistance_20 = Sketch_2.setDistance(SketchArc_5.startPoint(), SketchLine_42.result(), "1.35/2", True)
+SketchConstraintDistance_21 = Sketch_2.setDistance(SketchArc_8.startPoint(), SketchArc_5.startPoint(), 0.25, True)
+SketchConstraintCoincidence_80 = Sketch_2.setCoincident(SketchLine_33.endPoint(), SketchArc_5.startPoint())
+SketchConstraintCoincidence_80.setName("SketchConstraintCoincidence_83")
+SketchLine_43 = Sketch_2.addLine(3.199461499025942, 11.5058496362538, 3.28253850097406, 11.74164236673401)
+SketchLine_43.setName("SketchLine_45")
+SketchLine_43.result().setName("SketchLine_45")
+SketchConstraintCoincidence_81 = Sketch_2.setCoincident(SketchArc_8.startPoint(), SketchLine_43.startPoint())
+SketchConstraintCoincidence_81.setName("SketchConstraintCoincidence_84")
+SketchConstraintCoincidence_82 = Sketch_2.setCoincident(SketchLine_33.endPoint(), SketchLine_43.endPoint())
+SketchConstraintCoincidence_82.setName("SketchConstraintCoincidence_85")
+model.do()
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_45r-SketchArc_8_2r-SketchLine_44f")], model.selection("EDGE", "Sketch_2/SketchLine_34"), 360, 0)
+Revolution_2.result().setName("Cut_tool")
+Revolution_3 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_44r-SketchArc_8_2r-SketchLine_41r-SketchLine_40r-SketchLine_39r_wire")], model.selection("EDGE", "Sketch_2/SketchLine_34"), 360, 0)
+Revolution_3.result().setName("Fuse_tool")
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cut_tool"), model.selection("SOLID", "Fuse_tool")], model.selection("EDGE", "PartSet/OZ"), True)
+Symmetry_1.result().subResult(0).setName("Symmetry_1_1_1")
+Symmetry_1.result().subResult(1).setName("Symmetry_1_1_2")
+Symmetry_1.results()[1].subResult(0).setName("Symmetry_1_2_1")
+Symmetry_1.results()[1].subResult(1).setName("Symmetry_1_2_2")
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("COMPOUND", "Cut_tool")])
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("COMPOUND", "Fuse_tool")], True)
+model.do()
+model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2701.py b/src/FeaturesPlugin/Test/Test2701.py
new file mode 100644 (file)
index 0000000..a1f8a9f
--- /dev/null
@@ -0,0 +1,117 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "a", "10")
+model.addParameter(Part_1_doc, "b", "8")
+model.addParameter(Part_1_doc, "c", "2*a")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-48.37423594569039, -43.07420401522882, -48.37423594569039, -8.074204015228814)
+SketchLine_2 = Sketch_1.addLine(-40.38893648559045, -0.07421752185518632, -2.793802518897851e-22, 0)
+SketchLine_3 = Sketch_1.addLine(-2.793802518897851e-22, 0, 37.58770483143633, -13.68080573302675)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_2")
+SketchLine_4 = Sketch_1.addLine(37.58770483143633, -13.68080573302675, 19.91003530177265, -31.35847526269043)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_3")
+SketchLine_5 = Sketch_1.addLine(-8.374235945690391, -43.07420401522882, -48.37423594569039, -43.07420401522882)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_5")
+SketchArc_1 = Sketch_1.addArc(-40.37423594569039, -8.074204015228817, -40.38893648559045, -0.07421752185518632, -48.37423594569039, -8.074204015228814, False)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_7")
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_1.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_2.result())
+SketchArc_2 = Sketch_1.addArc(-8.374235945690213, -3.074204015227884, -8.374235945690391, -43.07420401522882, 19.91003530177265, -31.35847526269043, False)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_4.endPoint())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
+SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_4.result())
+SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_5.result())
+SketchLine_6 = Sketch_1.addLine(-2.793802518897851e-22, 0, 0, 35)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10")
+SketchLine_7 = Sketch_1.addLine(30.00000000001173, 65.00000000001097, 42.00000000001173, 65.00000000001097)
+SketchLine_8 = Sketch_1.addLine(65.00000000000007, 42, 65.00000000000007, 30)
+SketchLine_9 = Sketch_1.addLine(35.00000000000009, 0, -2.793802518897851e-22, 0)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_9.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_14")
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_8.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_6.result())
+SketchArc_3 = Sketch_1.addArc(30.00000000000873, 35.00000000000306, 30.00000000001173, 65.00000000001097, 0, 35, False)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_15")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_6.endPoint())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_16")
+SketchConstraintTangent_5 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_6.result())
+SketchConstraintTangent_6 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_7.result())
+SketchArc_4 = Sketch_1.addArc(42.00000000000008, 41.99999999999999, 65.00000000000007, 42, 42.00000000001173, 65.00000000001097, False)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_4.startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_17")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_7.endPoint())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_18")
+SketchConstraintTangent_7 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchLine_7.result())
+SketchConstraintTangent_8 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchLine_8.result())
+SketchArc_5 = Sketch_1.addArc(35.00000000000006, 30.00000000000001, 35.00000000000009, 0, 65.00000000000007, 30, False)
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_5.startPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_19")
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchArc_5.endPoint(), SketchLine_8.endPoint())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_20")
+SketchConstraintTangent_9 = Sketch_1.setTangent(SketchArc_5.results()[1], SketchLine_8.result())
+SketchConstraintTangent_10 = Sketch_1.setTangent(SketchArc_5.results()[1], SketchLine_9.result())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_6.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_21")
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintAngle_1 = Sketch_1.setAngleBackward(SketchLine_4.result(), SketchLine_3.result(), 65.00000000000011)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), "2*c")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), 25)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), "4*a")
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_1.result(), 35)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 8)
+SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_9.result(), 20.00000000000001)
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 40)
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_6.result(), 35)
+SketchConstraintLength_6 = Sketch_1.setLength(SketchLine_7.result(), 12)
+SketchConstraintLength_7 = Sketch_1.setLength(SketchLine_8.result(), 12)
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_3.results()[1], 30)
+SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_5.results()[1], 30)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+model.do()
+model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc)
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2724.py b/src/FeaturesPlugin/Test/Test2724.py
new file mode 100644 (file)
index 0000000..c498ef4
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "b", "80")
+model.addParameter(partSet, "a", "100")
+model.addParameter(partSet, "c", "b-a")
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-60, -20, -60.00000000000001, 80)
+SketchLine_2 = Sketch_1.addLine(-60.00000000000001, 80, 0, 0)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(0, 0, 0, -100)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(0, -100, -60, -20)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_3.result())
+SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_3.result())
+SketchConstraintEqual_3 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_3.startPoint(), "a", True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.endPoint(), SketchLine_2.endPoint(), 60)
+SketchConstraintMirror_1_objects = [SketchLine_4.result(), SketchLine_1.result(), SketchLine_2.result()]
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_3.result(), SketchConstraintMirror_1_objects)
+[SketchLine_5, SketchLine_6, SketchLine_7] = SketchConstraintMirror_1.mirrored()
+SketchMultiTranslation_1_objects = [SketchLine_1.result(), SketchLine_4.result(), SketchLine_3.result(), SketchLine_5.result(), SketchLine_6.result()]
+SketchMultiTranslation_1 = Sketch_1.addTranslation(SketchMultiTranslation_1_objects, SketchLine_2.endPoint(), SketchLine_4.startPoint(), 4)
+[SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_5, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_6, SketchLine_20, SketchLine_21, SketchLine_22] = SketchMultiTranslation_1.translated()
+model.do()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1_objects = [model.selection("FACE", (-30, -10, 0)), model.selection("FACE", (30, -110, 0)), model.selection("FACE", (-30, -210, 0)), model.selection("FACE", (30, -310, 0))]
+Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection(), "c", 0)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", (30, -310, -9.999999999999998))], model.selection("EDGE", (-30, -360, 0)), "-c")
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", (-30.00000000000001, -10, -10))], model.selection("FACE", (5, 10, 5)), model.selection("FACE", (-30, 40, -10)), True, True)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", (-30.00000000000001, -210, -10)), model.selection("SOLID", (18, -293.9999999999999, -9.999999999999998))])
+model.do()
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_WEAK))
+model.end()
diff --git a/src/FeaturesPlugin/Test/Test2729.py b/src/FeaturesPlugin/Test/Test2729.py
new file mode 100644 (file)
index 0000000..0995b8f
--- /dev/null
@@ -0,0 +1,253 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "B", "46")
+model.addParameter(Part_1_doc, "B1", "36")
+model.addParameter(Part_1_doc, "B2", "25.5")
+model.addParameter(Part_1_doc, "B3", "10")
+model.addParameter(Part_1_doc, "D", "4.2")
+model.addParameter(Part_1_doc, "D1", "4")
+model.addParameter(Part_1_doc, "D2", "0")
+model.addParameter(Part_1_doc, "H", "95")
+model.addParameter(Part_1_doc, "H1", "86")
+model.addParameter(Part_1_doc, "H2", "4.7")
+model.addParameter(Part_1_doc, "H4", "86")
+model.addParameter(Part_1_doc, "H5", "71")
+model.addParameter(Part_1_doc, "H6", "40")
+model.addParameter(Part_1_doc, "H7", "26.75")
+model.addParameter(Part_1_doc, "H8", "51.5")
+model.addParameter(Part_1_doc, "H9", "15")
+model.addParameter(Part_1_doc, "H10", "1.5")
+model.addParameter(Part_1_doc, "L1", "23")
+model.addParameter(Part_1_doc, "L2", "30")
+model.addParameter(Part_1_doc, "L3", "4")
+model.addParameter(Part_1_doc, "L4", "2.3")
+model.addParameter(Part_1_doc, "L5", "6.5")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(29.99999999999995, 0, -16.00000000000005, 0)
+SketchLine_2 = Sketch_1.addLine(-16.00000000000005, 0, -16.00000000000005, 4.7)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-16.00000000000005, 4.7, 1.946471204593173e-17, 4.7)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(1.946471204593173e-17, 4.7, 4.235164736271502e-22, 95)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(4.235164736271502e-22, 95, 7, 95)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(7, 95, 7, 80)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(7, 80, 9, 80)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(9, 80, 9, 8.999999999999996)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchLine_9 = Sketch_1.addLine(9, 8.999999999999996, 17, 9.000000000000002)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchLine_10 = Sketch_1.addLine(17, 9.000000000000002, 17, 4.7)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchLine_11 = Sketch_1.addLine(17, 4.7, 30, 4.7)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchLine_12 = Sketch_1.addLine(30, 4.7, 29.99999999999995, 0)
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_12.endPoint())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_13 = SketchProjection_1.createdFeature()
+SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_13.result(), SketchLine_1.result())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_14 = SketchProjection_2.createdFeature()
+SketchConstraintCollinear_2 = Sketch_1.setCollinear(SketchLine_4.result(), SketchLine_14.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_8.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_10.result())
+SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_12.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_9.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_11.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "H2")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), "B")
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_3.endPoint(), SketchLine_1.startPoint(), "L2")
+SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_11.endPoint(), "L1")
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_7.result(), 2)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_6.startPoint(), SketchLine_1.startPoint(), "H")
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_8.startPoint(), SketchLine_9.endPoint(), "H5")
+SketchConstraintDistanceVertical_3 = Sketch_1.setVerticalDistance(SketchLine_6.startPoint(), SketchLine_9.endPoint(), "H1")
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_12.result(), "H2")
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_11.result(), "L5*2")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), "B/2", "B/2")
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, "L5", [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8"))
+SketchLine_15 = Sketch_2.addLine(-8.985867605559861e-16, 8.999999999999996, 1.535230276239474e-15, 80)
+SketchLine_15.setAuxiliary(True)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7]"), False)
+SketchLine_16 = SketchProjection_3.createdFeature()
+SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchLine_16.result(), SketchLine_15.endPoint())
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8]"), False)
+SketchLine_17 = SketchProjection_4.createdFeature()
+SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchLine_15.startPoint(), SketchLine_17.result())
+SketchLine_18 = Sketch_2.addLine(-4.999999999999998, 13.00000000000012, -4.999999999999999, 94.99999999999999)
+SketchLine_19 = Sketch_2.addLine(-4.999999999999999, 94.99999999999999, -13.00000000000988, 95.00000000000222)
+SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
+SketchLine_20 = Sketch_2.addLine(-13.00000000000988, 95.00000000000222, -13, 78.5)
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_19.endPoint(), SketchLine_20.startPoint())
+SketchLine_21 = Sketch_2.addLine(-13, 78.5, -23.00000000000001, 78.5)
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
+SketchLine_22 = Sketch_2.addLine(-23.00000000000001, 78.5, -23.00000000000001, 72.5)
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
+SketchLine_23 = Sketch_2.addLine(-23.00000000000001, 72.5, -15, 72.5)
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_2.addLine(-13, 70.5, -13, 23)
+SketchLine_25 = Sketch_2.addLine(-15, 21, -22.99999999999999, 21)
+SketchLine_26 = Sketch_2.addLine(-22.99999999999999, 21, -22.99999999999999, 15)
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_25.endPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_20")
+SketchLine_27 = Sketch_2.addLine(-22.99999999999999, 15, -13, 15)
+SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_26.endPoint(), SketchLine_27.startPoint())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_21")
+SketchLine_28 = Sketch_2.addLine(-13, 15, -13.00000000000024, 13.00000000000012)
+SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_22")
+SketchArc_1 = Sketch_2.addArc(-9.000000000000117, 13.00000000000012, -4.999999999999998, 13.00000000000012, -13.00000000000024, 13.00000000000012, True)
+SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_18.startPoint(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_23")
+SketchConstraintTangent_1 = Sketch_2.setTangent(SketchLine_18.result(), SketchArc_1.results()[1])
+SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_28.endPoint(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_24")
+SketchConstraintTangent_2 = Sketch_2.setTangent(SketchLine_28.result(), SketchArc_1.results()[1])
+SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_18.result())
+SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_28.result())
+SketchConstraintCollinear_3 = Sketch_2.setCollinear(SketchLine_28.result(), SketchLine_24.result())
+SketchConstraintCollinear_4 = Sketch_2.setCollinear(SketchLine_20.result(), SketchLine_24.result())
+SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_27.result())
+SketchConstraintHorizontal_7 = Sketch_2.setHorizontal(SketchLine_25.result())
+SketchConstraintHorizontal_8 = Sketch_2.setHorizontal(SketchLine_23.result())
+SketchConstraintHorizontal_9 = Sketch_2.setHorizontal(SketchLine_21.result())
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/To_Face]"), False)
+SketchLine_29 = SketchProjection_5.createdFeature()
+SketchConstraintCollinear_5 = Sketch_2.setCollinear(SketchLine_22.result(), SketchLine_29.result())
+SketchConstraintCollinear_5.setName("SketchConstraintCollinear_7")
+SketchConstraintCollinear_6 = Sketch_2.setCollinear(SketchLine_26.result(), SketchLine_29.result())
+SketchConstraintCollinear_6.setName("SketchConstraintCollinear_8")
+SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_1.results()[1], SketchLine_17.result())
+SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_22.result(), 6)
+SketchConstraintLength_7 = Sketch_2.setLength(SketchLine_26.result(), 6)
+SketchConstraintDistanceHorizontal_3 = Sketch_2.setHorizontalDistance(SketchLine_18.endPoint(), SketchLine_15.endPoint(), "B3/2")
+SketchConstraintLength_8 = Sketch_2.setLength(SketchLine_19.result(), 8)
+SketchConstraintLength_8.setName("SketchConstraintLength_9")
+SketchArc_2 = Sketch_2.addArc(-15, 70.5, -13, 70.5, -15, 72.5, False)
+SketchPoint_1 = Sketch_2.addPoint(-13, 72.5)
+SketchPoint_1.setAuxiliary(True)
+SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchPoint_1.coordinates(), SketchLine_23.result())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_25")
+SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchPoint_1.coordinates(), SketchLine_24.result())
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_26")
+SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchArc_2.startPoint(), SketchLine_24.startPoint())
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_27")
+SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_23.endPoint())
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_28")
+SketchConstraintTangent_4 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_23.result())
+SketchConstraintTangent_5 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_24.result())
+SketchArc_3 = Sketch_2.addArc(-15, 23, -15, 21, -13, 23, False)
+SketchPoint_2 = Sketch_2.addPoint(-13, 21)
+SketchPoint_2.setAuxiliary(True)
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchPoint_2.coordinates(), "H8", False)
+SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_25.result())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_29")
+SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_24.result())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_30")
+SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchArc_3.startPoint(), SketchLine_25.startPoint())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_31")
+SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_24.endPoint())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_32")
+SketchConstraintTangent_6 = Sketch_2.setTangent(SketchArc_3.results()[1], SketchLine_25.result())
+SketchConstraintTangent_7 = Sketch_2.setTangent(SketchArc_3.results()[1], SketchLine_24.result())
+SketchConstraintRadius_1 = Sketch_2.setRadius(SketchArc_3.results()[1], 2)
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_2.results()[1], 2)
+SketchLine_30 = Sketch_2.addLine(13.00000000000001, 78.49999999999866, 23, 78.49999999999866)
+SketchLine_30.setName("SketchLine_32")
+SketchLine_30.result().setName("SketchLine_32")
+SketchLine_31 = Sketch_2.addLine(23, 78.49999999999866, 23, 72.49999999999866)
+SketchLine_31.setName("SketchLine_33")
+SketchLine_31.result().setName("SketchLine_33")
+SketchLine_32 = Sketch_2.addLine(23, 72.49999999999866, 14.99999999999993, 72.5)
+SketchLine_32.setName("SketchLine_34")
+SketchLine_32.result().setName("SketchLine_34")
+SketchArc_4 = Sketch_2.addArc(14.99999999999997, 70.5, 12.99999999999997, 70.50000000000004, 14.99999999999993, 72.5, True)
+SketchLine_33 = Sketch_2.addLine(12.99999999999997, 70.50000000000004, 12.99999999999995, 22.99999999999997)
+SketchLine_33.setName("SketchLine_35")
+SketchLine_33.result().setName("SketchLine_35")
+SketchArc_5 = Sketch_2.addArc(14.99999999999996, 23.00000000000001, 14.99999999999992, 21, 12.99999999999995, 22.99999999999997, True)
+SketchLine_34 = Sketch_2.addLine(14.99999999999992, 21, 23, 20.99999999999866)
+SketchLine_34.setName("SketchLine_36")
+SketchLine_34.result().setName("SketchLine_36")
+SketchLine_35 = Sketch_2.addLine(23, 20.99999999999866, 23, 14.99999999999866)
+SketchLine_35.setName("SketchLine_37")
+SketchLine_35.result().setName("SketchLine_37")
+SketchLine_36 = Sketch_2.addLine(23, 14.99999999999866, 13.00000000000001, 14.99999999999866)
+SketchLine_36.setName("SketchLine_38")
+SketchLine_36.result().setName("SketchLine_38")
+SketchLine_37 = Sketch_2.addLine(13.00000000000001, 14.99999999999866, 13.00000000000024, 13.00000000000011)
+SketchLine_37.setName("SketchLine_39")
+SketchLine_37.result().setName("SketchLine_39")
+SketchArc_6 = Sketch_2.addArc(9.000000000000117, 13.00000000000012, 4.999999999999996, 13.00000000000012, 13.00000000000024, 13.00000000000011, False)
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"), True)
+SketchLine_38 = SketchProjection_6.createdFeature()
+SketchLine_38.setName("SketchLine_41")
+SketchLine_38.result().setName("SketchLine_41")
+SketchConstraintCollinear_7 = Sketch_2.setCollinear(SketchLine_19.result(), SketchLine_38.result())
+SketchConstraintCollinear_7.setName("SketchConstraintCollinear_9")
+SketchConstraintDistanceVertical_4 = Sketch_2.setVerticalDistance(SketchAPI_Line(SketchLine_29).startPoint(), SketchLine_22.startPoint(), "H10")
+SketchConstraintMirror_1_objects = [SketchLine_18.result(), SketchLine_20.result(), SketchLine_19.result()]
+SketchConstraintMirror_1 = Sketch_2.addMirror(SketchLine_15.result(), SketchConstraintMirror_1_objects)
+[SketchLine_39, SketchLine_40, SketchLine_41] = SketchConstraintMirror_1.mirrored()
+SketchLine_41.setName("SketchLine_43")
+SketchLine_41.result().setName("SketchLine_43")
+SketchLine_40.setName("SketchLine_42")
+SketchLine_40.result().setName("SketchLine_42")
+SketchLine_39.setName("SketchLine_40")
+SketchLine_39.result().setName("SketchLine_40")
+ExtrusionCut_1.setNestedSketch(Sketch_2)
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 20, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_23)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_25)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchArc_2_2)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_24)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_11)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)2(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4)2(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_5)2(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9)2(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_21)2(ExtrusionCut_1_1/From_Face_1)2(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_27)2"))
+SketchCircle_1 = Sketch_3.addCircle(-19.86097902097902, 65.28094405594405, 2.5)
+SketchCircle_2 = Sketch_3.addCircle(-18.51902097902098, 27.57192307692308, 2)
+SketchCircle_3 = Sketch_3.addCircle(-19.0558041958042, 85.54451048951049, 3)
+SketchConstraintRadius_3 = Sketch_3.setRadius(SketchCircle_2.results()[1], 2)
+SketchConstraintRadius_4 = Sketch_3.setRadius(SketchCircle_1.results()[1], 2.5)
+SketchConstraintRadius_5 = Sketch_3.setRadius(SketchCircle_3.results()[1], 3)
+ExtrusionCut_2.setNestedSketch(Sketch_3)
+model.end()
+
+# check that radius constraint is valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(SketchConstraintRadius_3.feature()))
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2738.py b/src/FeaturesPlugin/Test/Test2738.py
new file mode 100644 (file)
index 0000000..d8f8da2
--- /dev/null
@@ -0,0 +1,75 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from GeomAlgoAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "d", "8")
+model.addParameter(Part_1_doc, "nb", "3")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-34.12026714434272, 28.71281409244911, 1.619211673722419)
+SketchCircle_2 = Sketch_1.addCircle(-34.12026714434272, 28.71281409244911, 3.180589706721861)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchCircle_2.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE_2", (-35.73947881806514, 28.71281409244911, 0))], model.selection(), 2, -1)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", (-37.30085685106458, 28.71281409244911, 0))], model.selection(), 5, 0)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1"), model.selection("COMPOUND", "all-in-Extrusion_2")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", (-34.12026714434272, 28.71281409244911, 1.5))])
+Group_1.setName("Group_dechets")
+Group_1.result().setName("Group_dechets")
+Group_2 = model.addGroup(Part_1_doc, [model.selection("SOLID", (-34.12026714434272, 28.71281409244911, 2.35984679315518))])
+Group_2.setName("Group_colis")
+Group_2.result().setName("Group_colis")
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPSOLID", (-34.12026714434272, 28.71281409244911, 2.5))], model.selection("EDGE", "PartSet/OX"), "d", "nb", model.selection("EDGE", "PartSet/OY"), "d", "nb")
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), LinearCopy_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+
+# number of solids should be multiplyed by linear copy
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 9)
+assert(aFactory.validate(Group_1.feature()))
+# checkthat solids in the first group are small, like the origin
+for i in range(9):
+  delta = GeomAlgoAPI_ShapeTools_volume(selectionList.value(i).value()) - 8.236773528312948
+  assert(fabs(delta) < 1.e-5)
+
+# same-plane faces should be merged
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 9)
+assert(aFactory.validate(Group_2.feature()))
+
+# checkthat solids in the secong group are big, like the origin
+for i in range(9):
+  delta = GeomAlgoAPI_ShapeTools_volume(selectionList.value(i).value()) - 150.66735294710597
+  assert(fabs(delta) < 1.e-5)
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2751.py b/src/FeaturesPlugin/Test/Test2751.py
new file mode 100644 (file)
index 0000000..debebb1
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "r", "20")
+model.addParameter(Part_1_doc, "l", "40")
+model.addParameter(Part_1_doc, "r2", "3")
+model.addParameter(Part_1_doc, "a", "10")
+model.addParameter(Part_1_doc, "h", "5")
+model.addParameter(Part_1_doc, "n", "2")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_2.createdFeature()
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_3.createdFeature()
+SketchArc_1 = Sketch_1.addArc(0, 0, 20, 0, 0, 20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
+SketchArc_2 = Sketch_1.addArc(0, 0, 60, 0, 0, 60, False)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchAPI_Line(SketchLine_2).startPoint(), SketchArc_2.center())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.result(), SketchArc_2.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_2.endPoint())
+SketchLine_3 = Sketch_1.addLine(0, 20, 0, 60)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_3.endPoint())
+SketchLine_4 = Sketch_1.addLine(20, 0, 60, 0)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_4.endPoint())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_4.result(), "l")
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "r")
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", (30, 30, 0))])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE_2", (30, 30, 0)))
+SketchCircle_1 = Sketch_2.addCircle(24.6201938253052, 4.341204441673258, 3)
+SketchLine_5 = Sketch_2.addLine(24.6201938253052, 4.341204441673258, 54.16442641567144, 9.550649771681169)
+SketchLine_5.setAuxiliary(True)
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchLine_5.startPoint())
+SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], "r2")
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_6 = SketchProjection_4.createdFeature()
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", (20, 0, 0)), False)
+SketchPoint_2 = SketchProjection_5.createdFeature()
+SketchMultiTranslation_1 = Sketch_2.addTranslation([SketchCircle_1.results()[1]], SketchCircle_1.center(), SketchLine_5.endPoint(), "n")
+[SketchCircle_2] = SketchMultiTranslation_1.translated()
+SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_5.result(), "(l-2*h)/(n-1)")
+SketchLine_7 = Sketch_2.addLine(0, 0, 24.6201938253052, 4.341204441673258)
+SketchLine_7.setAuxiliary(True)
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_6).startPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchLine_7.endPoint())
+SketchConstraintCollinear_1 = Sketch_2.setCollinear(SketchLine_5.result(), SketchLine_7.result())
+SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_6.result(), SketchLine_7.result(), "a")
+SketchPoint_3 = Sketch_2.addPoint(19.69615506024416, 3.472963553338606)
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_7.result())
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", (14.14213562373095, 14.14213562373095, 0)), False)
+SketchArc_3 = SketchProjection_6.createdFeature()
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchArc_3.results()[1])
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchPoint_3.coordinates(), SketchLine_7.endPoint(), "h", True)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), 10, 0)
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], model.selection("EDGE", "PartSet/OZ"), "(90-2*a)/(n-1)", "n")
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", (30, 30, 0))], [model.selection("COMPOUND", (29.25281542867235, 29.25281542867235, 5))])
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/Test2826.py b/src/FeaturesPlugin/Test/Test2826.py
new file mode 100644 (file)
index 0000000..dc1cdd0
--- /dev/null
@@ -0,0 +1,463 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(6.188, 9.025, 6.188, -3.45)
+SketchLine_2 = Sketch_1.addLine(6.188, -3.45, 0, -3.45)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(0, -3.45, 0, -6.449999999999999)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(0, -6.449999999999999, 7.782, -6.45)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(7.782, -6.45, 7.782, -3.45)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(7.782, -3.45, 6.538, -3.45)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(6.538, -3.45, 6.538, -2.4)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(6.538, -2.4, 6.375999999999999, -2.25)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchLine_9 = Sketch_1.addLine(6.375999999999999, -2.25, 6.375999999999999, 9.025)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchLine_10 = Sketch_1.addLine(6.375999999999999, 9.025, 6.188, 9.025)
+SketchLine_10.setAuxiliary(True)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_10.endPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_10.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_2.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_9.result())
+SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_7.result())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_11 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_3.startPoint(), SketchLine_11.result())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_11).startPoint(), SketchLine_2.result(), 3.45, True)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 3)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_12 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_12.result(), 9.025, True)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_10.result(), 0.188)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_8.endPoint(), SketchLine_7.endPoint(), 0.15)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_2.result())
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_6.endPoint(), SketchLine_1.result(), 0.35, True)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchLine_8.endPoint(), SketchLine_12.result(), 2.25, True)
+SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_11.result(), 6.188, True)
+SketchLine_13 = Sketch_1.addLine(7.032, -4.050000000000001, 5.532, -4.050000000000001)
+SketchLine_14 = Sketch_1.addLine(5.532, -4.050000000000001, 5.532, -5.850000000000001)
+SketchLine_15 = Sketch_1.addLine(5.532, -5.850000000000001, 7.032, -5.850000000000001)
+SketchLine_16 = Sketch_1.addLine(7.032, -5.850000000000001, 7.032, -4.050000000000001)
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_16.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_13.result())
+SketchConstraintVertical_6 = Sketch_1.setVertical(SketchLine_14.result())
+SketchConstraintHorizontal_6 = Sketch_1.setHorizontal(SketchLine_15.result())
+SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_16.result())
+SketchLine_17 = Sketch_1.addLine(6.282, 9.025000000000013, 6.282, -4.050000000000002)
+SketchLine_17.setAuxiliary(True)
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_17.startPoint(), SketchLine_10.result())
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_17.endPoint(), SketchLine_13.result())
+SketchConstraintVertical_8 = Sketch_1.setVertical(SketchLine_17.result())
+SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchLine_17.startPoint(), SketchLine_10.result())
+SketchConstraintMiddle_2 = Sketch_1.setMiddlePoint(SketchLine_17.endPoint(), SketchLine_13.result())
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_13.result(), 1.5)
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_16.result(), 1.8)
+SketchConstraintDistance_6 = Sketch_1.setDistance(SketchLine_17.endPoint(), SketchLine_5.result(), 1.5, True)
+SketchConstraintDistance_7 = Sketch_1.setDistance(SketchLine_14.startPoint(), SketchLine_2.result(), 0.6, True)
+SketchLine_18 = Sketch_1.addLine(6.375999999999999, 9.025, 6.537999999999999, 9.186999999999999)
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchLine_18.startPoint())
+SketchLine_19 = Sketch_1.addLine(6.537999999999999, 9.186999999999999, 6.537999999999999, 10.256)
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
+SketchLine_20 = Sketch_1.addLine(6.537999999999999, 10.256, 6.188, 10.256)
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchLine_19.endPoint(), SketchLine_20.startPoint())
+SketchLine_21 = Sketch_1.addLine(6.188, 10.256, 4.938, 10.97786688777512)
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
+SketchLine_22 = Sketch_1.addLine(6.188, 9.025, 6.082, 9.532)
+SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_22.startPoint())
+SketchArc_1 = Sketch_1.addArc(4.793854309433998, 9.262673655435936, 6.082, 9.532, 5.676829966640704, 10.23848613167324, False)
+SketchConstraintCoincidence_24 = Sketch_1.setCoincident(SketchLine_22.endPoint(), SketchArc_1.startPoint())
+SketchLine_23 = Sketch_1.addLine(5.676829966640704, 10.23848613167324, 5.417460848824595, 10.45671600291324)
+SketchConstraintCoincidence_25 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_1.addLine(5.417460848824595, 10.45671600291324, 5.143396378647488, 10.65615482129427)
+SketchConstraintCoincidence_26 = Sketch_1.setCoincident(SketchLine_23.endPoint(), SketchLine_24.startPoint())
+SketchLine_25 = Sketch_1.addLine(5.143396378647488, 10.65615482129427, 4.856000000000001, 10.83583872155447)
+SketchConstraintCoincidence_27 = Sketch_1.setCoincident(SketchLine_24.endPoint(), SketchLine_25.startPoint())
+SketchArc_2 = Sketch_1.addArc(0, 2.425, 4.856000000000001, 10.83583872155447, 0, 12.137, False)
+SketchConstraintCoincidence_28 = Sketch_1.setCoincident(SketchLine_25.endPoint(), SketchArc_2.startPoint())
+SketchArc_3 = Sketch_1.addArc(0, 2.425, 4.938, 10.97786688777512, 0, 12.301, False)
+SketchConstraintCoincidence_29 = Sketch_1.setCoincident(SketchLine_21.endPoint(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_3.center(), SketchArc_2.center())
+SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_11.result())
+SketchArc_4 = Sketch_1.addArc(0, 2.425, 0, 12.219, 6.538, 9.717255618119815, True)
+SketchArc_4.setAuxiliary(True)
+SketchConstraintCoincidence_32 = Sketch_1.setCoincident(SketchArc_2.center(), SketchArc_4.center())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_4.results()[1], 9.794)
+SketchLine_26 = Sketch_1.addLine(0, 12.301, 0, 12.137)
+SketchConstraintCoincidence_33 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_34 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_26.endPoint())
+SketchConstraintCoincidence_35 = Sketch_1.setCoincident(SketchLine_26.startPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_36 = Sketch_1.setCoincident(SketchLine_26.endPoint(), SketchArc_2.endPoint())
+SketchConstraintCoincidence_37 = Sketch_1.setCoincident(SketchLine_11.result(), SketchLine_26.endPoint())
+SketchConstraintCoincidence_38 = Sketch_1.setCoincident(SketchArc_4.startPoint(), SketchLine_26.result())
+SketchConstraintMiddle_3 = Sketch_1.setMiddlePoint(SketchArc_4.startPoint(), SketchLine_26.result())
+SketchConstraintDistance_8 = Sketch_1.setDistance(SketchLine_26.startPoint(), SketchArc_4.startPoint(), 0.082, True)
+SketchConstraintHorizontal_7 = Sketch_1.setHorizontal(SketchLine_20.result())
+SketchConstraintVertical_9 = Sketch_1.setVertical(SketchLine_19.result())
+SketchConstraintDistance_9 = Sketch_1.setDistance(SketchArc_3.center(), SketchLine_12.result(), 2.425, True)
+SketchLine_27 = Sketch_1.addLine(4.856000000000001, 10.83583872155447, 0, 2.425)
+SketchLine_27.setAuxiliary(True)
+SketchConstraintCoincidence_39 = Sketch_1.setCoincident(SketchLine_25.endPoint(), SketchLine_27.startPoint())
+SketchConstraintCoincidence_40 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_27.endPoint())
+SketchLine_28 = Sketch_1.addLine(5.143396378647488, 10.65615482129427, 0, 2.425)
+SketchLine_28.setAuxiliary(True)
+SketchConstraintCoincidence_41 = Sketch_1.setCoincident(SketchLine_24.endPoint(), SketchLine_28.startPoint())
+SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_28.endPoint())
+SketchLine_29 = Sketch_1.addLine(0, 2.425, 5.417460848824595, 10.45671600291324)
+SketchLine_29.setAuxiliary(True)
+SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_29.startPoint())
+SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_23.endPoint(), SketchLine_29.endPoint())
+SketchLine_30 = Sketch_1.addLine(5.676829966640704, 10.23848613167324, 0, 2.425)
+SketchLine_30.setAuxiliary(True)
+SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_30.startPoint())
+SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchArc_2.center(), SketchLine_30.endPoint())
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_27.result(), SketchLine_11.result(), 29.99999999999999)
+SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_28.result(), SketchLine_11.result(), 32.00000000000001)
+SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_29.result(), SketchLine_11.result(), 34.00000000000001)
+SketchConstraintAngle_4 = Sketch_1.setAngle(SketchLine_30.result(), SketchLine_11.result(), 36.00000000000001)
+SketchConstraintAngle_5 = Sketch_1.setAngleComplementary(SketchLine_18.result(), SketchLine_10.result(), 44.99999999999972)
+SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_20.result(), 0.35)
+SketchConstraintDistance_10 = Sketch_1.setDistance(SketchLine_20.startPoint(), SketchLine_12.result(), 10.256, True)
+SketchConstraintDistance_10.setName("SketchConstraintDistance_13")
+SketchConstraintDistance_11 = Sketch_1.setDistance(SketchLine_22.endPoint(), SketchLine_1.result(), 0.106, True)
+SketchConstraintDistance_11.setName("SketchConstraintDistance_14")
+SketchConstraintDistance_12 = Sketch_1.setDistance(SketchLine_22.endPoint(), SketchLine_12.result(), 9.532, True)
+SketchConstraintDistance_12.setName("SketchConstraintDistance_15")
+SketchLine_31 = Sketch_1.addLine(4.856000000000001, 10.83583872155447, 4.938, 10.97786688777512)
+SketchLine_31.setAuxiliary(True)
+SketchConstraintCoincidence_47 = Sketch_1.setCoincident(SketchLine_25.endPoint(), SketchLine_31.startPoint())
+SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_48")
+SketchConstraintCoincidence_48 = Sketch_1.setCoincident(SketchLine_21.endPoint(), SketchLine_31.endPoint())
+SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_49")
+SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_31.result(), SketchLine_27.result())
+SketchConstraintCoincidence_49 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_19.result())
+SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_50")
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], 1.316)
+SketchLine_32 = Sketch_1.addLine(5.143396378647488, 10.65615482129427, 5.236653048654413, 10.80539669036974)
+SketchLine_32.setAuxiliary(True)
+SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_24.endPoint(), SketchLine_32.startPoint())
+SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_51")
+SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_32.endPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_52")
+SketchLine_33 = Sketch_1.addLine(5.417460848824595, 10.45671600291324, 5.536033128724348, 10.63250663704018)
+SketchLine_33.setAuxiliary(True)
+SketchConstraintCoincidence_52 = Sketch_1.setCoincident(SketchLine_23.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_53")
+SketchConstraintCoincidence_53 = Sketch_1.setCoincident(SketchLine_33.endPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_54")
+SketchLine_34 = Sketch_1.addLine(5.676829966640704, 10.23848613167324, 5.836876630976977, 10.4587714668974)
+SketchLine_34.setAuxiliary(True)
+SketchConstraintCoincidence_54 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_34.startPoint())
+SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_55")
+SketchConstraintCoincidence_55 = Sketch_1.setCoincident(SketchLine_34.endPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_56")
+SketchConstraintCollinear_2 = Sketch_1.setCollinear(SketchLine_32.result(), SketchLine_28.result())
+SketchConstraintCollinear_3 = Sketch_1.setCollinear(SketchLine_33.result(), SketchLine_29.result())
+SketchConstraintCollinear_4 = Sketch_1.setCollinear(SketchLine_34.result(), SketchLine_30.result())
+SketchPoint_1 = Sketch_1.addPoint(5.190029273900029, 10.73078305375602)
+SketchConstraintCoincidence_56 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_56.setName("SketchConstraintCoincidence_57")
+SketchConstraintCoincidence_57 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_32.result())
+SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_58")
+SketchConstraintDistance_13 = Sketch_1.setDistance(SketchLine_25.startPoint(), SketchPoint_1.coordinates(), 0.08799999999999999, True)
+SketchConstraintDistance_13.setName("SketchConstraintDistance_16")
+SketchPoint_2 = Sketch_1.addPoint(5.476735296592504, 10.54459398560407)
+SketchConstraintCoincidence_58 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_59")
+SketchConstraintCoincidence_59 = Sketch_1.setCoincident(SketchLine_33.result(), SketchPoint_2.coordinates())
+SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_60")
+SketchConstraintDistance_14 = Sketch_1.setDistance(SketchLine_24.startPoint(), SketchPoint_2.coordinates(), 0.106, True)
+SketchConstraintDistance_14.setName("SketchConstraintDistance_17")
+SketchPoint_3 = Sketch_1.addPoint(5.756768760952494, 10.34851244290823)
+SketchConstraintCoincidence_60 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_61")
+SketchConstraintCoincidence_61 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_34.result())
+SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_62")
+SketchConstraintDistance_15 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchPoint_3.coordinates(), 0.136, True)
+SketchConstraintDistance_15.setName("SketchConstraintDistance_18")
+SketchConstraintCoincidence_62 = Sketch_1.setCoincident(SketchLine_21.startPoint(), SketchLine_1.result())
+SketchConstraintCoincidence_62.setName("SketchConstraintCoincidence_63")
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_18f-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_3_2f-SketchLine_26f-SketchArc_2_2r-SketchLine_25r-SketchLine_24r-SketchLine_23r-SketchArc_1_2r-SketchLine_22r-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_4")])
+Group_1.setName("Base")
+Group_1.result().setName("Base")
+Group_2_objects = [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_24"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchArc_2_2"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_25"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_23"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_22"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_2.setName("Faces_int")
+Group_2.result().setName("Faces_int")
+Group_3_objects = [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_16"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_13"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_14"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_15")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_3.setName("Faces_gallerie")
+Group_3.result().setName("Faces_gallerie")
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_35 = Sketch_2.addLine(3.397674805046317, 12.11397308570391, 3.082152448528626, 11.21424138021434)
+SketchLine_36 = Sketch_2.addLine(3.241000000000001, 12.09482302308413, 3.241000000000001, 11.06850194037818)
+SketchLine_36.setAuxiliary(True)
+SketchConstraintVertical_10 = Sketch_2.setVertical(SketchLine_36.result())
+SketchPoint_4 = Sketch_2.addPoint(3.241, 11.66720509403099)
+SketchConstraintCoincidence_63 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchLine_35.result())
+SketchConstraintCoincidence_63.setName("SketchConstraintCoincidence_64")
+SketchConstraintCoincidence_64 = Sketch_2.setCoincident(SketchLine_36.result(), SketchPoint_4.coordinates())
+SketchConstraintCoincidence_64.setName("SketchConstraintCoincidence_65")
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_4_2"), False)
+SketchArc_5 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_65 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchArc_5.results()[1])
+SketchConstraintCoincidence_65.setName("SketchConstraintCoincidence_66")
+SketchConstraintAngle_6 = Sketch_2.setAngleComplementary(SketchLine_35.result(), SketchLine_36.result(), 160.675)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_37 = SketchProjection_4.createdFeature()
+SketchConstraintDistance_16 = Sketch_2.setDistance(SketchPoint_4.coordinates(), SketchLine_37.result(), 3.241, True)
+SketchConstraintDistance_16.setName("SketchConstraintDistance_19")
+SketchLine_38 = Sketch_2.addLine(3.911629569238839, 11.53981731861503, 3.828898026216406, 11.30390315670624)
+SketchLine_39 = Sketch_2.addLine(3.828898026216406, 11.30390315670624, 4.057270795192212, 11.20218846558286)
+SketchConstraintCoincidence_66 = Sketch_2.setCoincident(SketchLine_38.endPoint(), SketchLine_39.startPoint())
+SketchConstraintCoincidence_66.setName("SketchConstraintCoincidence_67")
+SketchLine_40 = Sketch_2.addLine(4.057270795192212, 11.20218846558286, 4.140002338214646, 11.43810262749166)
+SketchLine_40.setAuxiliary(True)
+SketchConstraintCoincidence_67 = Sketch_2.setCoincident(SketchLine_39.endPoint(), SketchLine_40.startPoint())
+SketchConstraintCoincidence_67.setName("SketchConstraintCoincidence_68")
+SketchLine_41 = Sketch_2.addLine(4.140002338214646, 11.43810262749166, 3.911629569238839, 11.53981731861503)
+SketchConstraintCoincidence_68 = Sketch_2.setCoincident(SketchLine_40.endPoint(), SketchLine_41.startPoint())
+SketchConstraintCoincidence_68.setName("SketchConstraintCoincidence_69")
+SketchConstraintCoincidence_69 = Sketch_2.setCoincident(SketchLine_38.startPoint(), SketchLine_41.endPoint())
+SketchConstraintCoincidence_69.setName("SketchConstraintCoincidence_70")
+SketchLine_42 = Sketch_2.addLine(4.057270795192212, 11.20218846558286, 4.410949215071502, 11.07754130426779)
+SketchConstraintCoincidence_70 = Sketch_2.setCoincident(SketchLine_39.endPoint(), SketchLine_42.startPoint())
+SketchConstraintCoincidence_70.setName("SketchConstraintCoincidence_71")
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_2_2"), False)
+SketchArc_6 = SketchProjection_5.createdFeature()
+SketchConstraintCoincidence_71 = Sketch_2.setCoincident(SketchLine_42.endPoint(), SketchArc_6.results()[1])
+SketchConstraintCoincidence_71.setName("SketchConstraintCoincidence_72")
+SketchLine_43 = Sketch_2.addLine(4.410949215071502, 11.07754130426779, 4.465704943014801, 11.23368068225505)
+SketchConstraintCoincidence_72 = Sketch_2.setCoincident(SketchLine_42.endPoint(), SketchLine_43.startPoint())
+SketchConstraintCoincidence_72.setName("SketchConstraintCoincidence_73")
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_3_2"), False)
+SketchArc_7 = SketchProjection_6.createdFeature()
+SketchConstraintCoincidence_73 = Sketch_2.setCoincident(SketchLine_43.endPoint(), SketchArc_7.results()[1])
+SketchConstraintCoincidence_73.setName("SketchConstraintCoincidence_74")
+SketchLine_44 = Sketch_2.addLine(4.465704943014801, 11.23368068225505, 4.140002338214646, 11.43810262749166)
+SketchConstraintCoincidence_74 = Sketch_2.setCoincident(SketchLine_43.endPoint(), SketchLine_44.startPoint())
+SketchConstraintCoincidence_74.setName("SketchConstraintCoincidence_75")
+SketchConstraintCoincidence_75 = Sketch_2.setCoincident(SketchLine_40.endPoint(), SketchLine_44.endPoint())
+SketchConstraintCoincidence_75.setName("SketchConstraintCoincidence_76")
+SketchConstraintParallel_1 = Sketch_2.setParallel(SketchLine_38.result(), SketchLine_35.result())
+SketchConstraintParallel_2 = Sketch_2.setParallel(SketchLine_40.result(), SketchLine_38.result())
+SketchConstraintParallel_3 = Sketch_2.setParallel(SketchLine_43.result(), SketchLine_40.result())
+SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_40.result(), 0.25)
+SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_40.result(), SketchLine_38.result())
+SketchPoint_5 = Sketch_2.addPoint(3.87026379772762, 11.42186023766063)
+SketchConstraintCoincidence_76 = Sketch_2.setCoincident(SketchPoint_5.coordinates(), SketchLine_38.result())
+SketchConstraintCoincidence_76.setName("SketchConstraintCoincidence_77")
+SketchConstraintMiddle_4 = Sketch_2.setMiddlePoint(SketchPoint_5.coordinates(), SketchLine_38.result())
+SketchConstraintCoincidence_77 = Sketch_2.setCoincident(SketchPoint_5.coordinates(), SketchArc_5.results()[1])
+SketchConstraintCoincidence_77.setName("SketchConstraintCoincidence_78")
+SketchPoint_6 = Sketch_2.addPoint(4.09863656670343, 11.32014554653726)
+SketchConstraintCoincidence_78 = Sketch_2.setCoincident(SketchPoint_6.coordinates(), SketchLine_40.result())
+SketchConstraintCoincidence_78.setName("SketchConstraintCoincidence_79")
+SketchConstraintCoincidence_79 = Sketch_2.setCoincident(SketchPoint_6.coordinates(), SketchArc_5.results()[1])
+SketchConstraintCoincidence_79.setName("SketchConstraintCoincidence_80")
+SketchConstraintMiddle_5 = Sketch_2.setMiddlePoint(SketchPoint_6.coordinates(), SketchLine_40.result())
+SketchConstraintLength_7 = Sketch_2.setLength(SketchLine_41.result(), 0.25)
+SketchConstraintDistance_17 = Sketch_2.setDistance(SketchLine_38.startPoint(), SketchLine_35.result(), "1.35/2", True)
+SketchConstraintDistance_17.setName("SketchConstraintDistance_20")
+SketchConstraintDistance_18 = Sketch_2.setDistance(SketchLine_41.startPoint(), SketchLine_43.result(), 0.375, True)
+SketchConstraintDistance_18.setName("SketchConstraintDistance_21")
+SketchLine_45 = Sketch_2.addLine(3.911629569238839, 11.53981731861503, 3.397674805046317, 12.11397308570391)
+SketchConstraintCoincidence_80 = Sketch_2.setCoincident(SketchLine_38.startPoint(), SketchLine_45.startPoint())
+SketchConstraintCoincidence_80.setName("SketchConstraintCoincidence_81")
+SketchConstraintCoincidence_81 = Sketch_2.setCoincident(SketchLine_35.startPoint(), SketchLine_45.endPoint())
+SketchConstraintCoincidence_81.setName("SketchConstraintCoincidence_82")
+SketchLine_46 = Sketch_2.addLine(3.082152448528626, 11.21424138021434, 3.828898026216406, 11.30390315670624)
+SketchConstraintCoincidence_82 = Sketch_2.setCoincident(SketchLine_35.endPoint(), SketchLine_46.startPoint())
+SketchConstraintCoincidence_82.setName("SketchConstraintCoincidence_83")
+SketchConstraintCoincidence_83 = Sketch_2.setCoincident(SketchLine_38.endPoint(), SketchLine_46.endPoint())
+SketchConstraintCoincidence_83.setName("SketchConstraintCoincidence_84")
+model.do()
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_35r-SketchLine_46f-SketchLine_38r-SketchLine_45f")], model.selection("EDGE", "Sketch_2/SketchLine_35"), 360, 0)
+AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], model.selection("EDGE", "PartSet/OZ"), 2)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("COMPOUND", "AngularCopy_1_1")])
+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", "Plane_1"))
+SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_9][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8]"), True)
+SketchCircle_1 = SketchProjection_7.createdFeature()
+SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2]"), True)
+SketchCircle_2 = SketchProjection_8.createdFeature()
+SketchLine_47 = Sketch_3.addLine(6.067916611160706, -1.958, 6.166614630411087, -1.958)
+SketchConstraintCoincidence_84 = Sketch_3.setCoincident(SketchLine_47.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_84.setName("SketchConstraintCoincidence_85")
+SketchArc_8 = Sketch_3.addArc(0, 0, 6.166614630411087, -1.958, 6.47, 0, False)
+SketchConstraintCoincidence_85 = Sketch_3.setCoincident(SketchLine_47.endPoint(), SketchArc_8.startPoint())
+SketchConstraintCoincidence_85.setName("SketchConstraintCoincidence_87")
+SketchConstraintHorizontal_8 = Sketch_3.setHorizontal(SketchLine_47.result())
+SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_48 = SketchProjection_9.createdFeature()
+SketchLine_48.setName("SketchLine_49")
+SketchLine_48.result().setName("SketchLine_49")
+SketchConstraintDistance_19 = Sketch_3.setDistance(SketchLine_47.endPoint(), SketchLine_48.result(), 1.958, True)
+SketchConstraintDistance_19.setName("SketchConstraintDistance_23")
+SketchLine_49 = Sketch_3.addLine(5.870057921349673, -1.957999999999988, 5.858998207885032, -1.675999999999991)
+SketchLine_49.setName("SketchLine_50")
+SketchLine_49.result().setName("SketchLine_50")
+SketchConstraintCoincidence_86 = Sketch_3.setCoincident(SketchLine_49.startPoint(), SketchCircle_2.results()[1])
+SketchConstraintCoincidence_86.setName("SketchConstraintCoincidence_89")
+SketchConstraintCoincidence_87 = Sketch_3.setCoincident(SketchArc_8.endPoint(), SketchLine_48.result())
+SketchConstraintCoincidence_87.setName("SketchConstraintCoincidence_88")
+SketchArc_9 = Sketch_3.addArc(0, 0, 5.858998207885032, -1.675999999999991, 6.093999999999999, 0, False)
+SketchConstraintCoincidence_88 = Sketch_3.setCoincident(SketchLine_49.endPoint(), SketchArc_9.startPoint())
+SketchConstraintCoincidence_88.setName("SketchConstraintCoincidence_90")
+SketchConstraintCoincidence_89 = Sketch_3.setCoincident(SketchLine_48.result(), SketchArc_9.endPoint())
+SketchConstraintCoincidence_89.setName("SketchConstraintCoincidence_91")
+SketchConstraintCoincidence_90 = Sketch_3.setCoincident(SketchArc_9.center(), SketchAPI_Line(SketchLine_48).startPoint())
+SketchConstraintCoincidence_90.setName("SketchConstraintCoincidence_92")
+SketchConstraintCoincidence_91 = Sketch_3.setCoincident(SketchArc_8.result(), SketchAPI_Line(SketchLine_48).startPoint())
+SketchConstraintCoincidence_91.setName("SketchConstraintCoincidence_93")
+SketchPoint_7 = Sketch_3.addPoint(6.188, 0)
+SketchConstraintCoincidence_92 = Sketch_3.setCoincident(SketchPoint_7.coordinates(), SketchCircle_2.results()[1])
+SketchConstraintCoincidence_92.setName("SketchConstraintCoincidence_94")
+SketchConstraintCoincidence_93 = Sketch_3.setCoincident(SketchPoint_7.coordinates(), SketchLine_48.result())
+SketchConstraintCoincidence_93.setName("SketchConstraintCoincidence_95")
+SketchPoint_8 = Sketch_3.addPoint(6.375999999999999, 0)
+SketchConstraintCoincidence_94 = Sketch_3.setCoincident(SketchPoint_8.coordinates(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_94.setName("SketchConstraintCoincidence_96")
+SketchConstraintCoincidence_95 = Sketch_3.setCoincident(SketchPoint_8.coordinates(), SketchLine_48.result())
+SketchConstraintCoincidence_95.setName("SketchConstraintCoincidence_97")
+SketchConstraintDistance_20 = Sketch_3.setDistance(SketchPoint_8.coordinates(), SketchArc_8.endPoint(), 0.094, True)
+SketchConstraintDistance_20.setName("SketchConstraintDistance_22")
+SketchConstraintDistance_21 = Sketch_3.setDistance(SketchArc_9.endPoint(), SketchPoint_7.coordinates(), 0.094, True)
+SketchConstraintDistance_21.setName("SketchConstraintDistance_24")
+SketchConstraintDistance_22 = Sketch_3.setDistance(SketchArc_9.startPoint(), SketchLine_47.result(), 0.282, True)
+SketchConstraintDistance_22.setName("SketchConstraintDistance_25")
+SketchConstraintCoincidence_96 = Sketch_3.setCoincident(SketchLine_49.startPoint(), SketchLine_47.result())
+SketchConstraintCoincidence_96.setName("SketchConstraintCoincidence_98")
+SketchConstraintMirror_1_objects = [SketchArc_9.results()[1], SketchLine_49.result(), SketchLine_47.result(), SketchArc_8.results()[1]]
+SketchConstraintMirror_1 = Sketch_3.addMirror(SketchLine_48.result(), SketchConstraintMirror_1_objects)
+[SketchArc_10, SketchLine_50, SketchLine_51, SketchArc_11] = SketchConstraintMirror_1.mirrored()
+SketchLine_51.setName("SketchLine_52")
+SketchLine_51.result().setName("SketchLine_52")
+SketchLine_50.setName("SketchLine_51")
+SketchLine_50.result().setName("SketchLine_51")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchProjection_8f-SketchProjection_8f-SketchLine_51f-SketchArc_10_2r-SketchArc_9_2r-SketchLine_50r"), model.selection("FACE", "Sketch_3/Face-SketchProjection_7r-SketchLine_47f-SketchArc_8_2f-SketchArc_11_2f-SketchLine_52r-SketchProjection_7r")], model.selection(), 0, 4.2)
+Sketch_4 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
+SketchLine_52 = Sketch_4.addLine(0.75, 2.1, -0.75, 2.1)
+SketchLine_52.setName("SketchLine_53")
+SketchLine_52.result().setName("SketchLine_53")
+SketchLine_53 = Sketch_4.addLine(-0.75, 2.1, -0.75, 0.3)
+SketchLine_53.setName("SketchLine_54")
+SketchLine_53.result().setName("SketchLine_54")
+SketchLine_54 = Sketch_4.addLine(-0.75, 0.3, 0.75, 0.3)
+SketchLine_54.setName("SketchLine_55")
+SketchLine_54.result().setName("SketchLine_55")
+SketchLine_55 = Sketch_4.addLine(0.75, 0.3, 0.75, 2.1)
+SketchLine_55.setName("SketchLine_56")
+SketchLine_55.result().setName("SketchLine_56")
+SketchConstraintCoincidence_97 = Sketch_4.setCoincident(SketchLine_55.endPoint(), SketchLine_52.startPoint())
+SketchConstraintCoincidence_97.setName("SketchConstraintCoincidence_99")
+SketchConstraintCoincidence_98 = Sketch_4.setCoincident(SketchLine_52.endPoint(), SketchLine_53.startPoint())
+SketchConstraintCoincidence_98.setName("SketchConstraintCoincidence_100")
+SketchConstraintCoincidence_99 = Sketch_4.setCoincident(SketchLine_53.endPoint(), SketchLine_54.startPoint())
+SketchConstraintCoincidence_99.setName("SketchConstraintCoincidence_101")
+SketchConstraintCoincidence_100 = Sketch_4.setCoincident(SketchLine_54.endPoint(), SketchLine_55.startPoint())
+SketchConstraintCoincidence_100.setName("SketchConstraintCoincidence_102")
+SketchConstraintHorizontal_9 = Sketch_4.setHorizontal(SketchLine_52.result())
+SketchConstraintVertical_11 = Sketch_4.setVertical(SketchLine_53.result())
+SketchConstraintHorizontal_10 = Sketch_4.setHorizontal(SketchLine_54.result())
+SketchConstraintVertical_12 = Sketch_4.setVertical(SketchLine_55.result())
+SketchProjection_10 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_56 = SketchProjection_10.createdFeature()
+SketchLine_56.setName("SketchLine_57")
+SketchLine_56.result().setName("SketchLine_57")
+SketchConstraintDistance_23 = Sketch_4.setDistance(SketchLine_52.startPoint(), SketchLine_56.result(), 2.1, True)
+SketchConstraintDistance_23.setName("SketchConstraintDistance_26")
+SketchConstraintDistance_24 = Sketch_4.setDistance(SketchLine_54.endPoint(), SketchLine_56.result(), 0.3, True)
+SketchConstraintDistance_24.setName("SketchConstraintDistance_27")
+SketchPoint_9 = Sketch_4.addPoint(0, 2.1)
+SketchConstraintCoincidence_101 = Sketch_4.setCoincident(SketchPoint_9.coordinates(), SketchLine_52.result())
+SketchConstraintCoincidence_101.setName("SketchConstraintCoincidence_103")
+SketchProjection_11 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_57 = SketchProjection_11.createdFeature()
+SketchLine_57.setName("SketchLine_58")
+SketchLine_57.result().setName("SketchLine_58")
+SketchConstraintCoincidence_102 = Sketch_4.setCoincident(SketchPoint_9.coordinates(), SketchLine_57.result())
+SketchConstraintCoincidence_102.setName("SketchConstraintCoincidence_104")
+SketchConstraintMiddle_6 = Sketch_4.setMiddlePoint(SketchPoint_9.coordinates(), SketchLine_52.result())
+SketchConstraintDistance_25 = Sketch_4.setDistance(SketchPoint_9.coordinates(), SketchLine_52.startPoint(), 0.75, True)
+SketchConstraintDistance_25.setName("SketchConstraintDistance_28")
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_53r-SketchLine_54f-SketchLine_55f-SketchLine_56f")], model.selection(), 10, 0)
+Rotation_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_2_1")]
+Rotation_1 = model.addRotation(Part_1_doc, Rotation_1_objects, model.selection("EDGE", "PartSet/OZ"), -90)
+Cut_2_objects_1 = [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Rotation_1_1"), model.selection("SOLID", "Rotation_1_2")]
+Cut_2 = model.addCut(Part_1_doc, Cut_2_objects_1, [model.selection("SOLID", "Rotation_1_3")])
+Fuse_2_objects_1 = [model.selection("SOLID", "Cut_2_1"), model.selection("SOLID", "Cut_2_2"), model.selection("SOLID", "Cut_2_3")]
+Fuse_2 = model.addFuse(Part_1_doc, Fuse_2_objects_1, True)
+model.do()
+# move groups to the end
+Part_1_doc.moveFeature(Group_1.feature(), Fuse_2.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+model.end()
+
+# check groups are correct
+from ModelAPI import *
+from GeomAPI import *
+aFactory = ModelAPI_Session.get().validators()
+
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+assert(Group_1.groupList().value(0).value().shapeType() == GeomAPI_Shape.FACE)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 8)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(8):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_3.feature()))
+for i in range(4):
+  assert(Group_3.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
diff --git a/src/FeaturesPlugin/Test/Test2854.py b/src/FeaturesPlugin/Test/Test2854.py
new file mode 100644 (file)
index 0000000..02db645
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test for the order of extrusion results: even compsolids or solids, they depend on the order
+# of created sketch entities
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(20.52339901477833, 44.52955665024631, -23.88177339901478, 44.52955665024631)
+SketchLine_2 = Sketch_1.addLine(-23.88177339901478, 44.52955665024631, -23.88177339901478, 15.29926108374386)
+SketchLine_3 = Sketch_1.addLine(-23.88177339901478, 15.29926108374386, 20.52339901477833, 15.29926108374386)
+SketchLine_4 = Sketch_1.addLine(20.52339901477833, 15.29926108374386, 20.52339901477833, 44.52955665024631)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(29.23029556650247, 27.36453201970445, -5.970443349753695, 27.36453201970445)
+SketchLine_6 = Sketch_1.addLine(-5.970443349753695, 27.36453201970445, -5.970443349753695, -13.80665024630542)
+SketchLine_7 = Sketch_1.addLine(-5.970443349753695, -13.80665024630542, 29.23029556650247, -13.80665024630542)
+SketchLine_8 = Sketch_1.addLine(29.23029556650247, -13.80665024630542, 29.23029556650247, 27.36453201970445)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_7"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_8"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Extrusion_1_1_3/From_Face"), model.selection("FACE", "Extrusion_1_1_3/To_Face"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_6"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_5"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_4")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+model.do()
+# add a circle to the sketch
+SketchCircle_1 = Sketch_1.addCircle(-26.84625185927467, -13.07763963304469, 9.031583682868897)
+model.end()
+
+# check group is valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Group_1.feature()))
+
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 22)
+for i in range(22):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
diff --git a/src/FeaturesPlugin/Test/Test2878.py b/src/FeaturesPlugin/Test/Test2878.py
new file mode 100644 (file)
index 0000000..8d9dd76
--- /dev/null
@@ -0,0 +1,56 @@
+## Copyright (C) 2019-20xx  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(68.30992366412212, 32.22748091603054, -50.73129770992366, 32.22748091603054)
+SketchLine_2 = Sketch_1.addLine(-50.73129770992366, 32.22748091603054, -50.73129770992366, -43.02137404580152)
+SketchLine_3 = Sketch_1.addLine(-50.73129770992366, -43.02137404580152, 68.30992366412212, -43.02137404580152)
+SketchLine_4 = Sketch_1.addLine(68.30992366412212, -43.02137404580152, 68.30992366412212, 32.22748091603054)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/SketchLine_2_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex")]
+Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Vertex_1")], model.selection("EDGE", "PartSet/OZ"), 10, 0)
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Extrusion_1, 1)
+model.testNbSubResults(Extrusion_1, [4])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [0])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8])
+
+assert(model.checkPythonDump())
\ No newline at end of file
diff --git a/src/FeaturesPlugin/Test/TestBoolean.py b/src/FeaturesPlugin/Test/TestBoolean.py
deleted file mode 100644 (file)
index 84c893e..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-"""
-      TestBoolean.py
-      Unit test of FeaturesPlugin_Boolean class
-
-      class FeaturesPlugin_Boolean
-        static const std::string MY_ID("Boolean");
-        static const std::string MY_OBJECT_ID("main_object");
-        static const std::string MY_TOOL_ID("tool_object");
-        static const std::string MY_TYPE_ID("bool_type");
-
-        data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId());
-        data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId());
-        data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
-"""
-#=========================================================================
-# Initialization of the test
-#=========================================================================
-from ModelAPI import *
-from GeomDataAPI import *
-from GeomAlgoAPI import *
-from GeomAPI import *
-
-__updated__ = "2014-12-16"
-
-aSession = ModelAPI_Session.get()
-# Create a part for extrusions & boolean
-aSession.startOperation()
-aPartFeature = aSession.moduleDocument().addFeature("Part")
-aSession.finishOperation()
-aPart = aSession.activeDocument()
-#=========================================================================
-# Create a sketch with circle to extrude
-#=========================================================================
-aSession.startOperation()
-aCircleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin"))
-origin.setValue(0, 0, 0)
-dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
-dirx.setValue(1, 0, 0)
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
-norm.setValue(0, 0, 1)
-aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
-anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
-aCircleRadius = aSketchCircle.real("circle_radius")
-anCircleCentr.setValue(10., 10.)
-aCircleRadius.setValue(50.)
-aSession.finishOperation()
-#=========================================================================
-# Create a sketch with triangle to extrude
-#=========================================================================
-aSession.startOperation()
-aTriangleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
-origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin"))
-origin.setValue(0, 0, 0)
-dirx = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX"))
-dirx.setValue(1, 0, 0)
-norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm"))
-norm.setValue(0, 0, 1)
-aSketchLineA = aTriangleSketchFeature.addFeature("SketchLine")
-aSketchLineB = aTriangleSketchFeature.addFeature("SketchLine")
-aSketchLineC = aTriangleSketchFeature.addFeature("SketchLine")
-aLineAStartPoint = geomDataAPI_Point2D(aSketchLineA.attribute("StartPoint"))
-aLineAEndPoint = geomDataAPI_Point2D(aSketchLineA.attribute("EndPoint"))
-aLineBStartPoint = geomDataAPI_Point2D(aSketchLineB.attribute("StartPoint"))
-aLineBEndPoint = geomDataAPI_Point2D(aSketchLineB.attribute("EndPoint"))
-aLineCStartPoint = geomDataAPI_Point2D(aSketchLineC.attribute("StartPoint"))
-aLineCEndPoint = geomDataAPI_Point2D(aSketchLineC.attribute("EndPoint"))
-aLineAStartPoint.setValue(25., 25.)
-aLineAEndPoint.setValue(100., 25.)
-aLineBStartPoint.setValue(100., 25.)
-aLineBEndPoint.setValue(60., 75.)
-aLineCStartPoint.setValue(60., 75.)
-aLineCEndPoint.setValue(25., 25.)
-aSession.finishOperation()
-#=========================================================================
-# Make extrusion on circle (cylinder) and triangle (prism)
-#=========================================================================
-# Build shape from sketcher results
-aSession.startOperation()
-extrudedObjects = []
-for eachSketchFeature in [aCircleSketchFeature, aTriangleSketchFeature]:
-    # Build sketch faces
-    aSketchResult = eachSketchFeature.firstResult()
-    aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-    origin = geomDataAPI_Point(eachSketchFeature.attribute("Origin")).pnt()
-    dirX = geomDataAPI_Dir(eachSketchFeature.attribute("DirX")).dir()
-    norm = geomDataAPI_Dir(eachSketchFeature.attribute("Norm")).dir()
-    aSketchFaces = ShapeList()
-    GeomAlgoAPI_SketchBuilder.createFaces(
-        origin, dirX, norm, aSketchEdges, aSketchFaces)
-    # Create extrusion on them
-    anExtrusionFt = aPart.addFeature("Extrusion")
-    anExtrusionFt.selectionList("base").append(
-        aSketchResult, aSketchFaces[0])
-    anExtrusionFt.string("CreationMethod").setValue("BySizes")
-    anExtrusionFt.real("from_size").setValue(0)
-    anExtrusionFt.real("to_size").setValue(50)
-    anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
-    anExtrusionFt.execute()
-    extrudedObjects.append(modelAPI_ResultBody(anExtrusionFt.firstResult()))
-aSession.finishOperation()
-#=========================================================================
-# Create a pacman as boolean cut of the prism from the cylinder
-#=========================================================================
-aSession.startOperation()
-aBooleanFt = aPart.addFeature("Cut")
-aBooleanFt.selectionList("main_objects").append(extrudedObjects[0], extrudedObjects[0].shape())
-aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], extrudedObjects[1].shape())
-aBooleanFt.execute()
-aSession.finishOperation()
-
-assert (len(aBooleanFt.results()) > 0)
-aBooleanResult = modelAPI_ResultBody(aBooleanFt.firstResult())
-assert (aBooleanResult is not None)
-#=========================================================================
-# End of test
-#=========================================================================
-
-from salome.shaper import model
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067)
-model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791)
-model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0)
-Boolean_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
-model.end()
-assert(len(Boolean_1.results()) > 0)
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067)
-model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791)
-model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0)
-Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
-model.end()
-assert(len(Boolean_1.results()) > 0)
-
-assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBoolean1.py b/src/FeaturesPlugin/Test/TestBoolean1.py
new file mode 100644 (file)
index 0000000..0c0b931
--- /dev/null
@@ -0,0 +1,133 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+      TestBoolean.py
+      Unit test of FeaturesPlugin_Boolean class
+
+      class FeaturesPlugin_Boolean
+        static const std::string MY_ID("Boolean");
+        static const std::string MY_OBJECT_ID("main_object");
+        static const std::string MY_TOOL_ID("tool_object");
+        static const std::string MY_TYPE_ID("bool_type");
+
+        data()->addAttribute(FeaturesPlugin_Boolean::OBJECT_ID(), ModelAPI_AttributeReference::typeId());
+        data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::typeId());
+        data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
+"""
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+# Create a part for extrusions & boolean
+aSession.startOperation()
+aPartFeature = aSession.moduleDocument().addFeature("Part")
+aSession.finishOperation()
+aPart = aSession.activeDocument()
+#=========================================================================
+# Create a sketch with circle to extrude
+#=========================================================================
+aSession.startOperation()
+aCircleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
+anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
+aCircleRadius = aSketchCircle.real("circle_radius")
+anCircleCentr.setValue(10., 10.)
+aCircleRadius.setValue(50.)
+aSession.finishOperation()
+#=========================================================================
+# Create a sketch with triangle to extrude
+#=========================================================================
+aSession.startOperation()
+aTriangleSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aTriangleSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aTriangleSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aTriangleSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aSketchLineA = aTriangleSketchFeature.addFeature("SketchLine")
+aSketchLineB = aTriangleSketchFeature.addFeature("SketchLine")
+aSketchLineC = aTriangleSketchFeature.addFeature("SketchLine")
+aLineAStartPoint = geomDataAPI_Point2D(aSketchLineA.attribute("StartPoint"))
+aLineAEndPoint = geomDataAPI_Point2D(aSketchLineA.attribute("EndPoint"))
+aLineBStartPoint = geomDataAPI_Point2D(aSketchLineB.attribute("StartPoint"))
+aLineBEndPoint = geomDataAPI_Point2D(aSketchLineB.attribute("EndPoint"))
+aLineCStartPoint = geomDataAPI_Point2D(aSketchLineC.attribute("StartPoint"))
+aLineCEndPoint = geomDataAPI_Point2D(aSketchLineC.attribute("EndPoint"))
+aLineAStartPoint.setValue(25., 25.)
+aLineAEndPoint.setValue(100., 25.)
+aLineBStartPoint.setValue(100., 25.)
+aLineBEndPoint.setValue(60., 75.)
+aLineCStartPoint.setValue(60., 75.)
+aLineCEndPoint.setValue(25., 25.)
+aSession.finishOperation()
+#=========================================================================
+# Make extrusion on circle (cylinder) and triangle (prism)
+#=========================================================================
+# Build shape from sketcher results
+aSession.startOperation()
+extrudedObjects = []
+for eachSketchFeature in [aCircleSketchFeature, aTriangleSketchFeature]:
+    # Build sketch faces
+    aSketchResult = modelAPI_ResultConstruction(eachSketchFeature.firstResult())
+    # Create extrusion on them
+    anExtrusionFt = aPart.addFeature("Extrusion")
+    anExtrusionFt.selectionList("base").append(
+        aSketchResult, aSketchResult.face(0))
+    anExtrusionFt.string("CreationMethod").setValue("BySizes")
+    anExtrusionFt.real("from_size").setValue(0)
+    anExtrusionFt.real("to_size").setValue(50)
+    anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+    anExtrusionFt.execute()
+    extrudedObjects.append(modelAPI_ResultBody(anExtrusionFt.firstResult()))
+aSession.finishOperation()
+#=========================================================================
+# Create a pacman as boolean cut of the prism from the cylinder
+#=========================================================================
+aSession.startOperation()
+aBooleanFt = aPart.addFeature("Cut")
+aBooleanFt.selectionList("main_objects").append(extrudedObjects[0], extrudedObjects[0].shape())
+aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], extrudedObjects[1].shape())
+aBooleanFt.execute()
+aSession.finishOperation()
+
+assert (len(aBooleanFt.results()) > 0)
+aBooleanResult = modelAPI_ResultBody(aBooleanFt.firstResult())
+assert (aBooleanResult is not None)
+#=========================================================================
+# End of test
+#=========================================================================
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBoolean2.py b/src/FeaturesPlugin/Test/TestBoolean2.py
new file mode 100644 (file)
index 0000000..8717b79
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067)
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")], model.selection(), 10, 0)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
+model.do()
+model.end()
+assert(len(Common_1.results()) > 0)
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBoolean3.py b/src/FeaturesPlugin/Test/TestBoolean3.py
new file mode 100644 (file)
index 0000000..1738575
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067)
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")], model.selection(), 10, 0)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
+model.do()
+model.end()
+assert(len(Smash_1.results()) > 0)
+
+assert(model.checkPythonDump())
index c74354f89f5bb3ad8a518833d84ccbcc164af6ce..6f30be6a2172dbe1df321a2eb366612b8eab9319 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
index 4ed9772d10344bbeef59e8114a4fce5b2314a75e..abe2a353b17282d850b4f69b265c998be5afdf06 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -71,7 +72,7 @@ SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result())
 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_13f-SketchLine_14f")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPOUND", "Compound_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
index 474ee4f0d83d1b87391b1422c9439e58a76e562a..ec138cd415cfcff24aaf5d0170ea802ca4855551 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -75,7 +76,7 @@ SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_15.endPoint()
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")])
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_13f-SketchLine_14f-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_15r")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_15f-SketchLine_13f-SketchLine_14f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_13f-SketchLine_15r")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPOUND", "Compound_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index 30e2a876b8cdf5f351074703d7ed269f1db6d982..39af8f7b7259dea103a5cde55e74ca0a4169f9e0 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
index 8799458b1dd61c93916acde7ce324c3e3ce73f84..8f0a65f3b39deca79d8a446a08f1137e16aa4633 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -56,7 +57,7 @@ SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_9.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPSOLID", "Extrusion_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index f43929d82564b294f377ce89a5c77f52b440d54f..e3af57283f09ef3081c654f87bcdf8369466800c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -42,9 +43,9 @@ SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint()
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_6 = Sketch_2.addLine(26.29086071781277, 6.827405438264643, 9.220324256871813, 6.827405438264643)
-SketchLine_7 = Sketch_2.addLine(9.220324256871813, 6.827405438264643, 9.220324256871813, -3.640935176083419)
-SketchLine_8 = Sketch_2.addLine(9.220324256871813, -3.640935176083419, 26.29086071781277, -3.640935176083419)
+SketchLine_6 = Sketch_2.addLine(26.29086071781277, 6.827405438264643, 9.220324256871812, 6.827405438264643)
+SketchLine_7 = Sketch_2.addLine(9.220324256871812, 6.827405438264643, 9.220324256871812, -3.640935176083419)
+SketchLine_8 = Sketch_2.addLine(9.220324256871812, -3.640935176083419, 26.29086071781277, -3.640935176083419)
 SketchLine_9 = Sketch_2.addLine(26.29086071781277, -3.640935176083419, 26.29086071781277, 6.827405438264643)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_6.startPoint())
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
@@ -59,7 +60,7 @@ SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.startPoint
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_8.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10)
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_10r"), model.selection("FACE", "Sketch_2/Face-SketchLine_6f-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_10r"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_10f-SketchLine_8f-SketchLine_9f")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPSOLID", "Extrusion_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index ad29cd18de332fd19cca99098e09f944cc9f6d2e..c4056c8e4d644286fd037c0862d7347fe9b88113 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -34,8 +35,8 @@ SketchLine_4 = Sketch_1.addLine(31.27467463593981, 24.52070441885453, 55.1316738
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_3.result())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_3.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_2_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_2_1")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
index 69b8e39f81d1399205edd9411bc6fcf00297ebb4..d279e2d96a42066402c832b7d67c736ebe844fcd 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,7 @@ SketchLine_2 = Sketch_1.addLine(-81.47249047471176, -8.020952206935315, 40.54932
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.endPoint())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanCommon_ErrorMsg.py
new file mode 100644 (file)
index 0000000..d1bc621
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Box_1_1")])
+assert(Common_1.feature().error() != "")
+Part_1_doc.removeFeature(Common_1.feature())
+
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [])
+assert(Common_1.feature().error() != "")
+Part_1_doc.removeFeature(Common_1.feature())
+
+model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Common_1 = Part_1_doc.addFeature("Common")
+Common_1.execute()
+assert(Common_1.error() != "")
+aSession.finishOperation()
index 23195447d2848cf50a456160257b8df7fddb864c..7b314f9933e9ea0ff4830454bb1c12e3dfc2582d 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -76,8 +77,8 @@ SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_14.result())
 SketchConstraintHorizontal_8 = Sketch_2.setHorizontal(SketchLine_15.result())
 SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_16.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10f-SketchLine_11f-SketchLine_12f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16f")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
index 0c2edd99de6c58df3d840e5301d7921671803cea..db050aaf77d9879dc0b1abda180abe9eb665add3 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -52,7 +53,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Plane.py b/src/FeaturesPlugin/Test/TestBooleanCommon_Face_Plane.py
new file mode 100644 (file)
index 0000000..2bf3d9e
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(32.87583448774056, -21.97399556638079, -28.86536213173501, -21.97399556638079)
+SketchLine_2 = Sketch_1.addLine(-28.86536213173501, -21.97399556638079, -28.86536213173501, 32.11012709159006)
+SketchLine_3 = Sketch_1.addLine(-28.86536213173501, 32.11012709159006, 32.87583448774056, 32.11012709159006)
+SketchLine_4 = Sketch_1.addLine(32.87583448774056, 32.11012709159006, 32.87583448774056, -21.97399556638079)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 0, False)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_1")])
+model.do()
+model.end()
+
+from GeomAPI import  GeomAPI_Shape
+
+model.testNbResults(Common_1, 0)
+
+assert(model.checkPythonDump())
index 8cb5b9078dfe24dea5bdfae20877faa027dba5c6..808825847f2549538a1277c35d1adf18f6289fa2 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -88,9 +89,9 @@ SketchLine_20 = Sketch_2.addLine(62.43123950606181, 3.491482965931855, 86.073169
 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_20.startPoint(), SketchLine_17.result())
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_19.result())
 model.do()
-Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_9r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_9f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_10f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_10r")]
+Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_9r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_9f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_10f"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_10r-SketchLine_7f-SketchLine_8f")]
 Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
-Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_14f-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_19f-SketchLine_20f"), model.selection("FACE", "Sketch_2/Face-SketchLine_17f-SketchLine_18f-SketchLine_19f-SketchLine_20r")]
+Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12f-SketchLine_15f-SketchLine_14f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_20f-SketchLine_19f"), model.selection("FACE", "Sketch_2/Face-SketchLine_17f-SketchLine_18f-SketchLine_19f-SketchLine_20r")]
 Shell_2 = model.addShell(Part_1_doc, Shell_2_objects)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("SHELL", "Shell_2_2")])
index 5930b955ed324a51a121b7f2073a7c9b04d0c8fd..a28e3f73b73e84a79cbff0a6020dfe33244932e1 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -58,8 +59,8 @@ SketchLine_10 = Sketch_2.addLine(-61.96570844393754, -12.80210420841683, -27.699
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchLine_7.result())
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_9.result())
 model.do()
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")])
-Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_9r-SketchLine_10r")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")])
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_10f-SketchLine_9r-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10r-SketchLine_7r-SketchLine_6r")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_2_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index 29b3e910984cba64a5e73751ff914628529a2445..68927bf051c8e7839b550c2310529e04794081c3 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -65,8 +66,8 @@ SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_10.result())
 SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_11.result())
 SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_12.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9f-SketchLine_10f-SketchLine_11f-SketchLine_12f")])
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10f-SketchLine_11f-SketchLine_12f")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("COMPOUND", "Compound_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index 7435166fdabd5c431ded43efd5351d0357175761..f20e9e74ee5b2815a4f999e0bed67b02d2b2003e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -68,7 +69,7 @@ SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_13.endPoint()
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_15.endPoint())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 10)
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10r-SketchLine_14r-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_15r")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_15f-SketchLine_10r-SketchLine_9r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15r-SketchLine_13r-SketchLine_12r-SketchLine_11r")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("COMPOUND", "Compound_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
index 37bf47049d74489d81d29decf760b37215157cb3..4d1af81efc91b366f94f23c46878c61cec779686 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
index 36cee473df69de1eec2a0edd66042539c65b2fdd..b8398ba9a2852d6591cc8737a7ca1ff9f88ce944 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,7 +28,7 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(-19.01903137581643, 2.528314065029049, 44.55011038017909)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")])
 Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10)
 Common_1 = model.addCommon(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Sphere_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
index c9364c2bc541d291c44f4847103afc93b7769af5..fd26b4ce735de56d6e828ef09bb756f9d0a91fa1 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,7 +42,7 @@ SketchLine_5 = Sketch_1.addLine(4.250501002003999, 22.87174348697394, 4.25050100
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
 model.do()
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")])
 Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 10)
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SOLID", "Sphere_1_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
index cd4fd2adeb6569ba9ae6c56231ec08bde17b0a7a..f45b0a487af0953d4a851a3a77ce15ca09084972 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SolidsHistory.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SolidsHistory.py
new file mode 100644 (file)
index 0000000..5fd15d8
--- /dev/null
@@ -0,0 +1,132 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that the history of Common operation works correctly after movement of groups after this Common feature
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(5, 5, 7.071067811865464)
+SketchCircle_2 = Sketch_1.addCircle(0, 10, 7.071067811865464)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchCircle_2.results()[1])
+SketchCircle_3 = Sketch_1.addCircle(-5, 5, 7.071067811865464)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchCircle_3.results()[1])
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchCircle_3.center(), SketchCircle_2.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
+SketchCircle_4 = Sketch_1.addCircle(0, 0, 7.071067811865464)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_4.center(), SketchCircle_3.results()[1])
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchCircle_4.results()[1], SketchCircle_3.center())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchCircle_4.results()[1], SketchCircle_1.center())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_1.center(), SketchCircle_3.center(), 10, True)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchCircle_2.center(), SketchCircle_4.center(), 10, True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchCircle_4.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_1 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchLine_1.result())
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_2 = Sketch_2.addLine(-5, 5, 0, 0)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchCircle_3_2__cc"), False)
+SketchPoint_2 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchPoint_2.result())
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchCircle_4_2__cc"), False)
+SketchPoint_3 = SketchProjection_4.createdFeature()
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchPoint_3.result())
+SketchLine_3 = Sketch_2.addLine(0, 0, 5, 5)
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"), False)
+SketchPoint_4 = SketchProjection_5.createdFeature()
+SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchPoint_4.result())
+SketchLine_4 = Sketch_2.addLine(-5, 5, 5, 5)
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.endPoint())
+SketchArc_1 = Sketch_2.addArc(-1.474514954580286e-16, 5, -5, 5, 5, 5, True)
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_4.result(), SketchArc_1.center())
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchArc_1.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), 5, 5)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_13"), model.selection("SOLID", "Extrusion_1_1_10"), model.selection("SOLID", "Extrusion_1_1_7"), model.selection("SOLID", "Extrusion_1_1_9"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_5"), model.selection("SOLID", "Extrusion_1_1_4"), model.selection("SOLID", "Extrusion_1_1_12"), model.selection("SOLID", "Extrusion_1_1_11"), model.selection("SOLID", "Extrusion_1_1_8"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Extrusion_1_1_6"), model.selection("SOLID", "Extrusion_1_1_2")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1_2"), model.selection("SOLID", "Extrusion_2_1_1")])
+Group_3_objects = [model.selection("FACE", "Extrusion_1_1_7/From_Face"), model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_9/From_Face"), model.selection("FACE", "Extrusion_1_1_12/From_Face"), model.selection("FACE", "Extrusion_1_1_4/From_Face"), model.selection("FACE", "Extrusion_1_1_5/From_Face"), model.selection("FACE", "Extrusion_1_1_8/From_Face"), model.selection("FACE", "Extrusion_1_1_11/From_Face"), model.selection("FACE", "Extrusion_1_1_6/From_Face"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_3/From_Face"), model.selection("FACE", "Extrusion_1_1_10/From_Face")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("FACE", "Extrusion_2_1_2/Generated_Face&Sketch_2/SketchLine_4"), model.selection("FACE", "Extrusion_2_1_2/Generated_Face&Sketch_2/SketchArc_1_2"), model.selection("FACE", "Extrusion_2_1_2/From_Face"), model.selection("FACE", "Extrusion_2_1_2/To_Face"), model.selection("FACE", "Extrusion_2_1_1/Generated_Face&Sketch_2/SketchLine_2"), model.selection("FACE", "Extrusion_2_1_1/To_Face"), model.selection("FACE", "Extrusion_2_1_1/From_Face"), model.selection("FACE", "Extrusion_2_1_1/Generated_Face&Sketch_2/SketchLine_4"), model.selection("FACE", "Extrusion_2_1_1/Generated_Face&Sketch_2/SketchLine_3")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_2_1")])
+Common_1.result().subResult(0).setColor(254, 254, 127)
+Common_1.result().subResult(1).setColor(204, 102, 204)
+Common_1.result().subResult(2).setColor(51, 102, 102)
+Common_1.result().subResult(3).setColor(0, 153, 0)
+Common_1.result().subResult(4).setColor(254, 0, 0)
+Common_1.result().subResult(5).setColor(204, 0, 204)
+Common_1.result().subResult(6).setColor(102, 0, 0)
+Common_1.result().subResult(7).setColor(0, 0, 153)
+Common_1.result().subResult(8).setColor(0, 0, 204)
+Common_1.result().subResult(9).setColor(0, 0, 204)
+Common_1.result().subResult(10).setColor(0, 153, 0)
+Common_1.result().subResult(11).setColor(127, 127, 254)
+model.do()
+# move groups after the Common
+Part_1_doc.moveFeature(Group_1.feature(), Common_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(12):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(12):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 12)
+assert(aFactory.validate(Group_3.feature()))
+for i in range(12):
+  assert(Group_3.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 22)
+assert(aFactory.validate(Group_4.feature()))
+for i in range(22):
+  assert(Group_4.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SubCompound_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SubCompound_Solid.py
new file mode 100644 (file)
index 0000000..71ba923
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(3.367708126821666, -16.14093028927689, 18.51144913400999)
+SketchCircle_2 = Sketch_1.addCircle(37.37680688568888, 37.3768068856889, 21.5270932014419)
+SketchCircle_3 = Sketch_1.addCircle(-3.554756249974806, 10.65828989222541, 8.503732568675463)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Compound_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3")]
+Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1"), model.selection("SOLID", "Compound_1_1_3")], [model.selection("SOLID", "Box_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [14])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [48])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [96])
+model.testResultsVolumes(Common_1, [15007.623169576811051229014992714])
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBooleanCommon_SubSolid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCommon_SubSolid_Solid.py
new file mode 100644 (file)
index 0000000..b85992b
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5, True)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], 3, 3, 3)
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Partition_1_1_2")], [model.selection("SOLID", "Translation_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Common_1, 1)
+model.testNbSubResults(Common_1, [2])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [13])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [56])
+model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [112])
+model.testResultsVolumes(Common_1, [745])
+
+assert(model.checkPythonDump())
index e3389a1178f4980ed55b665ccb16c44bd0a16e20..9861841496efd24f902b3bdf7183369506b38458 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -29,8 +30,8 @@ SketchPoint_1 = Sketch_1.addPoint(-28.13426853707415, 23.27655310621242)
 SketchPoint_2 = Sketch_1.addPoint(10.32264529058116, 23.27655310621242)
 SketchPoint_3 = Sketch_1.addPoint(47.56513026052106, 23.27655310621242)
 model.do()
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")])
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1"), model.selection("VERTEX", "Vertex_2_2")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
index c89dda3f3c9fb52759bde8886d311d7d2cae3c90..04b2502b1c88f4e07922b272da8ca34768b723b6 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,16 +29,16 @@ Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchPoint_1 = Sketch_1.addPoint(15.05904629113425, 12.50050543761873)
 SketchPoint_2 = Sketch_1.addPoint(47.25352258215165, 31.63008715695855)
 model.do()
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchPoint_3 = Sketch_2.addPoint(15.05904629113425, 12.50050543761873)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchPoint_1"), False)
 SketchPoint_4 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchPoint_4.result())
 model.do()
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchPoint_3-SketchProjection_1-SketchPoint_4")])
-Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_3")])
+Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
 Common_2 = model.addCommon(Part_1_doc, [model.selection("VERTEX", "Vertex_2_1"), model.selection("VERTEX", "Vertex_3_1")])
 model.testHaveNamingSubshapes(Common_2, model, Part_1_doc)
 model.do()
index 5d06579a22497b0194fbe1e5c10ea31da8d49ee9..adb0410592ff402ad8256a095063725d196ae14e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -36,30 +37,30 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(),
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_5 = Sketch_2.addLine(-75.23467769579756, 14.76574658950986, -60.62456998069012, -7.998839850308684)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_6 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_6.result())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_6).endPoint(), SketchLine_5.endPoint())
 SketchLine_7 = Sketch_2.addLine(-60.62456998069012, -7.998839850308684, -47.51524103341781, 13.8500417284785)
 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_7.startPoint())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_8 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.result())
 SketchLine_9 = Sketch_2.addLine(35.74952364371219, 12.81217486039606, 47.60078384600371, -9.954719738742909)
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False)
 SketchLine_10 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchLine_10.result())
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_10).endPoint(), SketchLine_9.endPoint())
 SketchLine_11 = Sketch_2.addLine(47.60078384600371, -9.954719738742909, 64.13719888777418, 18.68151118724985)
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_11.startPoint())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_12 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.result())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")])
-Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_11")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
+Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_7")])
+Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchLine_11")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
index 0e802ce833f9d46ea53b5b9bab7de9d8086d5f31..1391272de257892bf7e06849a613fe1eca2eca8c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -33,18 +34,18 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(),
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_3 = Sketch_2.addLine(-15.313984501828, -1.226571041729713, -1.296213364851965, -18.43019925529121)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_4 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.startPoint(), SketchLine_4.result())
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_4).endPoint(), SketchLine_3.endPoint())
 SketchLine_5 = Sketch_2.addLine(-1.296213364851965, -18.43019925529121, 20.70651786493702, 7.831125115747244)
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_5.startPoint())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_6 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.result())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_5")])
 Common_1 = model.addCommon(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")])
 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
 model.do()
index 638f279557ec244a12aa07c93a6be96bb12095aa..a100292a0f481f8302aea9d4381f391e1d4e9150 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -93,14 +92,7 @@ aSession.startOperation()
 extrudedObjects = []
 for eachSketchFeature in [aCircleSketchFeature, aTriangleSketchFeature]:
     # Build sketch faces
-    aSketchResult = eachSketchFeature.firstResult()
-    aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-    origin = geomDataAPI_Point(eachSketchFeature.attribute("Origin")).pnt()
-    dirX = geomDataAPI_Dir(eachSketchFeature.attribute("DirX")).dir()
-    norm = geomDataAPI_Dir(eachSketchFeature.attribute("Norm")).dir()
-    aSketchFaces = ShapeList()
-    GeomAlgoAPI_SketchBuilder.createFaces(
-        origin, dirX, norm, aSketchEdges, aSketchFaces)
+    aSketchResult = modelAPI_ResultConstruction(eachSketchFeature.firstResult())
     # Create extrusion on them
     anExtrusionFt = aPart.addFeature("Extrusion")
     anExtrusionFt.selectionList("base").append(
index 3df97a6129be61790d7cfa16dfa596645a61c95b..3173952cd2a83434043886995386a2ad714c7b0e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,7 +48,7 @@ model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 20, 20)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")])
-Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "Extrusion_2_2")])
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_2"), model.selection("COMPSOLID", "Extrusion_2_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 5d20e521f90954557bf81823bbe2ab708ea8ec07..62d957a3ed6e94d3cecece132bade567f06785d7 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -32,7 +33,7 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(),
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_2 = Sketch_2.addCircle(32.08143103297851, 1.286314091165838, 40.2404383217231)
-SketchLine_2 = Sketch_2.addLine(-8.153954725266397, 0.6486549270159857, 72.23884334545456, 3.869938036363647)
+SketchLine_2 = Sketch_2.addLine(-8.153954725266397, 0.6486549270159857, 72.23884334545455, 3.869938036363647)
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchCircle_2.results()[1])
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchCircle_2.results()[1])
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_Compound_Solid.py b/src/FeaturesPlugin/Test/TestBooleanCut_Compound_Solid.py
new file mode 100644 (file)
index 0000000..2c2e2b3
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 20)
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Translation_1_1")])
+Box_3 = model.addBox(Part_1_doc, 20, 6, 20)
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], -5, 2, -5)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1")], [model.selection("SOLID", "Translation_2_1")])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [3])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.FACE, [18])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.EDGE, [72])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [144])
+model.testResultsVolumes(Cut_1, [1400])
index 45674c70092084e9532a8f5a60c192ae6dc3beba..a1738f330db193c2308791780c8ba73616219ee8 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,8 +31,8 @@ SketchLine_2 = Sketch_1.addLine(-13.21145377197118, 31.16583469441819, 14.897138
 SketchLine_3 = Sketch_1.addLine(-5.074756009927738, 49.65832960815328, -4.828189411077946, 26.48106931627197)
 SketchLine_4 = Sketch_1.addLine(7.993273729111718, 49.41176300930348, 8.23984032796152, 26.48106931627197)
 model.do()
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 9d51ddc1cd1e0aeb9ee7fecb2ec8009e8d0f738e..1d96a18cef55a333f5ca651d70fc3fd450bb0298 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,7 +29,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-28.62948623265935, 53.77363153293705, 40.23707952134417, 53.11775947813702)
 SketchLine_2 = Sketch_1.addLine(-26.66187006825925, 26.22700523133564, 40.89295157614425, 26.22700523133564)
 model.do()
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 10)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_3 = Sketch_2.addLine(14.6580693841429, 60.98822413573743, -10.2650686982584, 60.98822413573743)
index ccd2c2c307d53dc7a049d5159aa531ca6000cbea..74c8c272124a0b6657ed4aec460e3db1b193aa1b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,7 +29,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-25.12006861063466, 20.61578044596912, 27.54545454545454, 58.72898799313897)
 SketchLine_2 = Sketch_1.addLine(-19.22984562607204, 56.30360205831907, 22.69468267581474, 22.00171526586621)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_1_2")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 5e8d25fe15cc5986326ad224c0b721f080c93435..bbe4b9c1b77e5037ca1f6bf33de6bb9a5f3bfe0a 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,8 +42,8 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_3.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_4.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_5.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f_wire")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanCut_ErrorMsg.py
new file mode 100644 (file)
index 0000000..65a5a9e
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Cut_1 = aPart.addFeature("Cut")
+Cut_1.execute()
+assert(Cut_1.error() != "")
+aSession.finishOperation()
index d3c727e67532f17652215063ae17407b4f094f30..b042f37e22df802632e02b63cd943bc4d673886b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -32,8 +33,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_3 = Sketch_2.addCircle(-15.35052744425385, 1.145561749571189, 23.35148318113706)
 SketchCircle_4 = Sketch_2.addCircle(82.70955831903943, -3.436685248713552, 26.06650182177207)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2"), model.selection("EDGE", "Sketch_1/SketchCircle_2_2")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_2_2")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
index f314c44d58f97772a12d5b94523bc7bf3f450580..b1cea1a25626fb7006cce96c032f7a37ffd46b33 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -25,9 +26,9 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_1 = Sketch_1.addCircle(-6.063464837049752, 0.8662092624356818, 32.2304349637617)
+SketchCircle_1 = Sketch_1.addCircle(-6.063464837049752, 0.8662092624356817, 32.2304349637617)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
index bd0752f91b101abb32d68756fd3f8ff824e389fd..1aa04ef74d9b8ad7c7bb04963ffe1c6a96d92ec5 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,7 +28,7 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(-8.850181926352695, 1.062021831162306, 46.73432400996293)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_1 = Sketch_2.addLine(64.95207814695526, 55.29739830292169, -8.272875875352462, 55.29739830292169)
 SketchLine_2 = Sketch_2.addLine(-8.272875875352462, 55.29739830292169, -8.272875875352462, -5.036618941767999)
@@ -42,11 +43,11 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
-Group_1_objects = [model.selection("VERTEX", "Cut_1_1/Modified_Edge_divided_2_v_2_1"), model.selection("FACE", "Cut_1_1"), model.selection("FACE", "Cut_1_1"), model.selection("VERTEX", "Cut_1_1/Modified_Face_divided_4_v_3_1")]
+Group_1_objects = [model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Sketch_2/SketchLine_3&Sketch_1/SketchCircle_1_2"), model.selection("FACE", "Cut_1_1"), model.selection("FACE", "Cut_1_1"), model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Face_1_1/Face_1_1")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
-Group_2_objects = [model.selection("FACE", "Cut_1_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_divided_3_e_2_1"), model.selection("VERTEX", "Cut_1_1/Modified_Face_divided_4_v_3_1"), model.selection("FACE", "Cut_1_1")]
+Group_2_objects = [model.selection("FACE", "Cut_1_1"), model.selection("EDGE", "Cut_1_1/Generated_Edge&Sketch_2/SketchLine_3&Face_1_1/Face_1_1"), model.selection("VERTEX", "Cut_1_1/Generated_Vertex&Face_1_1/Face_1_1"), model.selection("FACE", "Cut_1_1")]
 Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
 Group_3 = model.addGroup(Part_1_doc, [model.selection("FACE", "Cut_1_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
index 9bed1636b1d15510bdf09603d14effb736e1b6c6..ef5e7087fca43b8280e7e069a9cd77fdd43a52ca 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -44,9 +45,9 @@ SketchLine_4 = Sketch_2.addLine(207.6267015097382, 3.521847530670962, 440.264781
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchCircle_4.results()[1])
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchCircle_4.results()[1])
 model.do()
-Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2f")]
+Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_1_2r-SketchLine_1f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_2_2f-SketchLine_2f")]
 Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
-Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f-SketchLine_3f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f-SketchLine_3r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4r")]
+Shell_2_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r-SketchLine_3f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r-SketchCircle_3_2r-SketchLine_3r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchCircle_4_2f-SketchLine_4f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f-SketchLine_4r")]
 Shell_2 = model.addShell(Part_1_doc, Shell_2_objects)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("SHELL", "Shell_2_2")])
index 0757d3a9b3515cd85e5d08e16c9ac5d76e6137fd..8eac15af3117d5dc043af9443a388716f2f93739 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -36,7 +37,7 @@ SketchLine_2 = Sketch_2.addLine(112.0898160449407, 1.460291967886176, -7.7048053
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchCircle_2.results()[1])
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchCircle_2.results()[1])
 model.do()
-Shell_1_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f-SketchLine_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_1f")]
+Shell_1_objects = [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r-SketchCircle_2_2r-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r-SketchLine_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_1_2r-SketchLine_1f")]
 Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SHELL", "Shell_1_2")], [model.selection("SHELL", "Shell_1_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
index 987532453d0d32bcf3a0bb93ad5382f750c7de34..003321448fbc0328d1528d7133123c7d79025b06 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -34,8 +35,8 @@ SketchCircle_4 = Sketch_2.addCircle(78.03127953954764, -3.93858425080257, 22.765
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 20, 20)
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
-Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")])
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_2"), model.selection("SOLID", "Extrusion_2_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 602d704bf38384ed0f1b48cf1029bf2e3ce2b44e..ce9205832ec19b6646b16e404997c919c4cf2924 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
diff --git a/src/FeaturesPlugin/Test/TestBooleanCut_SolidsHistory.py b/src/FeaturesPlugin/Test/TestBooleanCut_SolidsHistory.py
new file mode 100644 (file)
index 0000000..5fc9567
--- /dev/null
@@ -0,0 +1,77 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that the history of Cut operation works correctly after movement of groups after this Cut feature:
+# cut tools are deleted, cut objects are correctly transformed to and divided if needed
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-10.57884322822754, 25.90966115484096, 9.63424990252037)
+SketchLine_1 = Sketch_1.addLine(-18.29572175958338, 20.14177099321736, -2.288684850537554, 30.81802598002054)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_2 = Sketch_2.addLine(7.424373233594292, 20.04016872303595, -10.19950738916256, 28.60837438423646)
+SketchLine_3 = Sketch_2.addLine(-10.19950738916256, 28.60837438423646, 10.7835313495703, 29.11992811073657)
+SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_2.addLine(10.7835313495703, 29.11992811073657, 7.424373233594292, 20.04016872303595)
+SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_4.endPoint())
+SketchLine_5 = Sketch_2.addLine(-10.19950738916256, 28.60837438423646, 9.111243103183778, 24.59975538297626)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1"), model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_2_2"), model.selection("SOLID", "Extrusion_1_2_1")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_2_2/To_Face")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("SOLID", "Extrusion_1_2_2")])
+model.do()
+# move groups after the Cut
+Part_1_doc.moveFeature(Group_1.feature(), Cut_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(2):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(3):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump())
index 681a33893af0a4fee9fdd4a9cdff56f06bd754d2..2cc5e0212be868016547ddc09ec3294f46a4f25b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,7 @@ SketchPoint_2 = Sketch_1.addPoint(-27.26436963979418, 34.59596483704974)
 SketchPoint_3 = Sketch_1.addPoint(25.43147084048027, 34.59596483704974)
 SketchPoint_4 = Sketch_1.addPoint(54.29962692967411, 33.67951543739281)
 model.do()
-Compound_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4")]
+Compound_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_4")]
 Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_2.addLine(42.11715050385933, 45.75316349699826, -43.32915483490565, 45.75316349699826)
@@ -46,7 +47,7 @@ SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 10)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 702fa1e9c5669f2ef2e10d75945ace6837197f64..37a99d399680f186756e7b8a276e76314a83a357 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,9 +31,9 @@ SketchPoint_2 = Sketch_1.addPoint(-27.26436963979418, 34.59596483704974)
 SketchPoint_3 = Sketch_1.addPoint(25.43147084048027, 34.59596483704974)
 SketchPoint_4 = Sketch_1.addPoint(54.29962692967411, 33.67951543739281)
 model.do()
-Compound_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4")]
+Compound_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_4")]
 Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
-Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3")])
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_3")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index cc53f7725b05b789ef23dd1d55e5274c267ce6aa..bd7027271d788d9a1fbd45a7ba6a418c3b94401c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,13 +29,12 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchPoint_1 = Sketch_1.addPoint(0, 50)
 SketchPoint_2 = Sketch_1.addPoint(0, 25)
 model.do()
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")])
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")])
-Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")])
-Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
+Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
+Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], [model.selection("VERTEX", "Vertex_2_1")])
 Cut_2 = model.addCut(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], [model.selection("VERTEX", "Vertex_4_1")])
-model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.testHaveNamingSubshapes(Cut_2, model, Part_1_doc)
 model.do()
 model.end()
index baf9bc9211db7bfa2e9a7aad13109b0c46a3e78b..2f080b4ed37f89d5abfbf41fe6989e5820339678 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -33,17 +34,17 @@ SketchLine_4 = Sketch_1.addLine(33.43567753001715, 55.95711835334479, 50.7598627
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_5 = Sketch_2.addLine(-67.39108061749573, 66.6981132075472, -42.44425385934821, 35.51457975986279)
-SketchLine_6 = Sketch_2.addLine(-42.44425385934821, 35.51457975986279, -16.1114922813036, 69.1234991423671)
+SketchLine_5 = Sketch_2.addLine(-67.39108061749573, 66.69811320754719, -42.44425385934821, 35.51457975986279)
+SketchLine_6 = Sketch_2.addLine(-42.44425385934821, 35.51457975986279, -16.1114922813036, 69.12349914236709)
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
-SketchLine_7 = Sketch_2.addLine(12.64665523156088, 66.6981132075472, 35.16809605488852, 36.5540308747856)
+SketchLine_7 = Sketch_2.addLine(12.64665523156088, 66.69811320754719, 35.16809605488852, 36.5540308747856)
 SketchLine_8 = Sketch_2.addLine(35.16809605488852, 36.5540308747856, 52.49228130360206, 66.35162950257292)
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6")])
-Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
+Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6")])
+Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], [model.selection("COMPOUND", "Compound_2_1")])
index 9739b75fa074b6765c33ac66f7f492d7f592590f..f6a531877a94017fed4dd2f451f481e652938f2b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -34,9 +35,9 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_2.addCircle(3.984562607204112, 58.72898799313897, 38.16357190022508)
 model.do()
-Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")]
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_1_2")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 0944b7ea5cb942175ca64deb190e552166a535e6..04a2e5cd67d3b8d9d8afebfd401baa2ad6dfc45a 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -34,9 +35,9 @@ SketchLine_4 = Sketch_1.addLine(-58.79960075346089, 25.5711331765356, 3.50824445
 SketchLine_5 = Sketch_1.addLine(3.508244452542322, 60.3323520809374, 63.1926014393454, 22.94764495733547)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 model.do()
-Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")]
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")])
 model.testHaveNamingSubshapes(Cut_1, model, Part_1_doc)
 model.do()
index 449508b034dfe25afd308d53386aacc3a791b734..c0ae6b123c178449a36434998a102ed0895009bd 100644 (file)
@@ -1,67 +1,41 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-"""
-Test case for Boolean Fill feature. Written on High API.
-"""
-from ModelAPI import *
-from GeomAPI import *
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
-# Get session
-aSession = ModelAPI_Session.get()
-
-# Create a part
-aDocument = aSession.activeDocument()
-aSession.startOperation()
-model.addPart(aDocument)
-aDocument = aSession.activeDocument()
-aSession.finishOperation()
-
-# Create a sketch with circle to extrude
-aSession.startOperation()
-anOrigin = GeomAPI_Pnt(0, 0, 0)
-aDirX = GeomAPI_Dir(1, 0, 0)
-aNorm = GeomAPI_Dir(0, 0, 1)
-aCircleSketch = model.addSketch(aDocument, GeomAPI_Ax3(anOrigin, aDirX, aNorm))
-aCircleSketch.addCircle(0, 0, 50)
-aSession.finishOperation()
-
-# Create a sketch with triangle to extrude
-aSession.startOperation()
-aTriangleSketch = model.addSketch(aDocument, GeomAPI_Ax3(anOrigin, aDirX, aNorm))
-aTriangleSketch.addLine(25, 25, 100, 25)
-aTriangleSketch.addLine(100, 25, 60, 75)
-aTriangleSketch.addLine(60, 75, 25, 25)
-aSession.finishOperation()
-
-# Make extrusion on circle (cylinder) and triangle (prism)
-aSession.startOperation()
-anExtrusion = model.addExtrusion(aDocument, aCircleSketch.results() + aTriangleSketch.results(), 100)
-aSession.finishOperation()
-
-# Fill prism with cylinder
-aSession.startOperation()
-aBoolean = model.addFill(aDocument, [anExtrusion.results()[0]], [anExtrusion.results()[1]])
-assert (len(aBoolean.results()) > 0)
-aSession.finishOperation()
-
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 50)
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_2.addLine(25, 25, 100, 25)
+SketchLine_2 = Sketch_2.addLine(100, 25, 60, 75)
+SketchLine_3 = Sketch_2.addLine(60, 75, 25, 25)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1"), model.selection("COMPOUND", "Sketch_2")], model.selection(), 100, 0)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
+model.do()
+model.end()
+assert (len(Fill_1.results()) > 0)
 assert(model.checkPythonDump())
index eeb22406402956a5b299d6f40175f0e17548a016..9a38e4daeded5522ab50e561687c41c750cba858 100644 (file)
@@ -1,22 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from GeomAPI import GeomAPI_Pnt
 
 from salome.shaper import model
 
@@ -50,22 +53,20 @@ SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0)
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/YOZ")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", GeomAPI_Pnt(17.35551764280096, -11.01190794150899, 0))], model.selection(), 100, 0)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", GeomAPI_Pnt(-0.3180832609141306, -28.0220443670531, 50.00000000000001))], [model.selection("FACE", "PartSet/YOZ")])
 model.do()
-
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
-
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 model.end()
 
 from GeomAPI import  GeomAPI_Shape
 
-model.testNbResults(Boolean_1, 1)
-model.testNbSubResults(Boolean_1, [4])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [4])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [30])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [132])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [264])
-model.testResultsVolumes(Boolean_1, [11003613.329450136050581932067871094])
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [4])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [4])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [30])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [132])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [264])
+model.testResultsVolumes(Fill_1, [11003613.329450136050581932067871094])
 
 assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBooleanFill_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanFill_ErrorMsg.py
new file mode 100644 (file)
index 0000000..2c933bf
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+aSession.startOperation()
+Fill_1 = aPart.addFeature("Fill")
+Fill_1.execute()
+assert(Fill_1.error() != "")
+aSession.finishOperation()
index ca8aae00d59c1a1176a1f9e92fca7a11983d007f..f0be4211418fcdabf9f097440013d4a07b317285 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -74,8 +75,8 @@ SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_17.endPoint()
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 50, -20)
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("COMPSOLID", "Extrusion_1_2")])
-Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "Extrusion_2_2")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_2"), model.selection("COMPSOLID", "Extrusion_1_1")])
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_2"), model.selection("COMPSOLID", "Extrusion_2_1")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")], True)
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
index a5d5577e062e6a6b3911284400fbdd758acc6eb8..4814bac216c68ad43265d3af13347a1aaadacb0e 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_Face.py b/src/FeaturesPlugin/Test/TestBooleanFuse_CompSolid_Face.py
new file mode 100644 (file)
index 0000000..6ed3822
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(52.27216563767099, 0, 18.66006927176168)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+SketchCircle_2 = Sketch_1.addCircle(79.68333887668101, 0, 24.16077154338278)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
+SketchLine_2 = Sketch_2.addLine(73.13136007081269, -14.25937060400964, 2.118687665902372, -14.25937060400964)
+SketchLine_3 = Sketch_2.addLine(2.118687665902372, -14.25937060400964, 2.118687665902372, 26.70061277610758)
+SketchLine_4 = Sketch_2.addLine(2.118687665902372, 26.70061277610758, 73.13136007081269, 26.70061277610758)
+SketchLine_5 = Sketch_2.addLine(73.13136007081269, 26.70061277610758, 73.13136007081269, -14.25937060400964)
+SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_2.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_3.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_5.result())
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r")])
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], [model.selection("FACE", "Face_1_1")])
+
+model.testNbResults(Fuse_1, 1)
+model.testNbSubResults(Fuse_1, [2])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.FACE, [4])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.EDGE, [16])
+model.testNbSubShapes(Fuse_1, GeomAPI_Shape.VERTEX, [32])
+model.testResultsVolumes(Fuse_1, [785.398163397447774514148477465])
+
+Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("FACE", "Fuse_1_1_1")])
+assert(Fuse_2.feature().error() != "")
+
+model.end()
index 14a1cb14020efb99c13be5bff30261d55c4e9447..8454a6c9407019c31736245d7b9859b207358371 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -32,7 +33,7 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_3 = Sketch_2.addLine(-70.53968253968257, 29.92592592592593, -31.52910052910054, -5.343915343915344)
 SketchLine_4 = Sketch_2.addLine(14.96296296296294, 26.18518518518519, 50.23280423280426, -8.015873015873021)
 model.do()
-Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")]
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")]
 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4")])
index 3a3a78be3a06928a9434df3f5275ab133aeb6a6c..925056246a1a857136fb5a9a0ac10e1e41d6e519 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,7 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_2 = Sketch_2.addLine(-24.04761904761907, 40.07936507936508, 39.54497354497357, -14.96296296296296)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_2/SketchLine_2")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_1")])
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py
new file mode 100644 (file)
index 0000000..d69e793
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1"), model.selection("FACE", "PartSet/XOZ")])
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Fuse_1 = Part_1_doc.addFeature("Fuse")
+Fuse_1.execute()
+assert(Fuse_1.error() != "")
+aSession.finishOperation()
index d9cebddfda8e2d8b43e6f1cbd7032ed7fedb9dcd..bed817847a737412a77d580191b88110f344ab10 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -32,9 +33,9 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_3 = Sketch_2.addCircle(-36.12101408450705, -7.148950704225357, 25.24032590912034)
 SketchCircle_4 = Sketch_2.addCircle(51.92395774647893, -12.41659859154929, 31.3630728131964)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2r")])
 Face_4 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")])
index a7f012ab28f7540d79473f817dc9aedafe20ed85..539c70bd4b2db794a988b0dad5f3ec80829010af 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -31,8 +31,8 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_2 = Sketch_2.addCircle(22.86792452830187, 26.50600343053173, 30.90704565816075)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")], True)
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
index 6065be8052ccf087b060ece5a64f4173a27c7f35..9b37ee06dfe48570522cc6b3018b6e419467ced3 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
index df924e429125c32bf839796acd4af9c28af0ddc5..d52065fab8faf40dadf04002cc30a90274beacd6 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -72,7 +73,7 @@ SketchLine_20 = Sketch_2.addLine(31.63598289786226, 11.9441976247031, 52.2962166
 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_16.startPoint(), SketchLine_20.startPoint())
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchLine_20.endPoint())
 model.do()
-Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_3r-SketchLine_5f"), model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_9r-SketchLine_10r"), model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_8r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12r-SketchLine_15f"), model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchLine_14r-SketchLine_15r"), model.selection("FACE", "Sketch_2/Face-SketchLine_16r-SketchLine_17r-SketchLine_20f"), model.selection("FACE", "Sketch_2/Face-SketchLine_18r-SketchLine_19r-SketchLine_20r")]
+Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_5r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_1/Face-SketchLine_9r-SketchLine_10r-SketchLine_6r"), model.selection("FACE", "Sketch_1/Face-SketchLine_10f-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15f-SketchLine_12r-SketchLine_11r"), model.selection("FACE", "Sketch_2/Face-SketchLine_15r-SketchLine_14r-SketchLine_13r"), model.selection("FACE", "Sketch_2/Face-SketchLine_20f-SketchLine_17r-SketchLine_16r"), model.selection("FACE", "Sketch_2/Face-SketchLine_20r-SketchLine_19r-SketchLine_18r")]
 Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("SHELL", "Shell_1_3"), model.selection("SHELL", "Shell_1_4")])
index 49575672344c269228314f494e49db782cafc762..9762164dd6cb34dd332271f271fb60ee6397fb51 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -50,7 +51,7 @@ SketchLine_10 = Sketch_2.addLine(-84.57783182897859, 11.29856532066509, -60.6894
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_10.endPoint())
 model.do()
-Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_4r-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_3r-SketchLine_5f"), model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_10f"), model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9r-SketchLine_10r")]
+Shell_1_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_5r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r"), model.selection("FACE", "Sketch_2/Face-SketchLine_10f-SketchLine_7r-SketchLine_6r"), model.selection("FACE", "Sketch_2/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r")]
 Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SHELL", "Shell_1_1"), model.selection("SHELL", "Shell_1_2")], True)
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
index e985d287609861d47fb35f6b8edf1a84d9403bda..9ed87cedd8661661a72b7973eec44e381be14e6f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
index 3cd98f2ef0ae29d1b054f6402d22b3d0ec851437..95fc2c9ef61a7c21af170c8203e6770e10d26ec6 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -79,7 +79,7 @@ SketchConstraintHorizontal_8 = Sketch_2.setHorizontal(SketchLine_15.result())
 SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_16.result())
 model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 40, -20)
-Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
index 809ff19f6d320b684da721bbb7820cf33da292d8..951096687b73c3de3fac0f57e79bb895724c99e9 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,7 +39,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_5 = Sketch_2.addLine(-38.01624011480907, 11.11021000825241, -18.03083750064881, 11.11021000825241)
 SketchLine_6 = Sketch_2.addLine(-18.03083750064881, 11.11021000825241, -18.03083750064881, 22.05701811772883)
@@ -53,7 +54,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 30, -20)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f_wire")], model.selection(), 30, -20)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_SolidsHistory.py b/src/FeaturesPlugin/Test/TestBooleanFuse_SolidsHistory.py
new file mode 100644 (file)
index 0000000..0bc77e0
--- /dev/null
@@ -0,0 +1,81 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-9.826354679802961, 29.97660098522167, -30.22536945812809, 29.97660098522167)
+SketchLine_2 = Sketch_1.addLine(-30.22536945812809, 29.97660098522167, -30.22536945812809, 11.69211822660099)
+SketchLine_3 = Sketch_1.addLine(-30.22536945812809, 11.69211822660099, -9.826354679802961, 11.69211822660099)
+SketchLine_4 = Sketch_1.addLine(-9.826354679802961, 11.69211822660099, -9.826354679802961, 29.97660098522167)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(-30.22536945812809, 11.69211822660099, -9.826354679802961, 29.97660098522167)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint())
+SketchCircle_1 = Sketch_1.addCircle(9.328817733990148, 6.841133004926101, 8.342093824373531)
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_2 = Sketch_2.addCircle(-5.846059113300496, 9.453201970443347, 11.01344978196573)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), 11, 1)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_2")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("FACE", "Extrusion_1_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_2_1/To_Face"), model.selection("FACE", "Extrusion_1_2/To_Face")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Fuse_1_objects_1 = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_2")]
+Fuse_1 = model.addFuse(Part_1_doc, Fuse_1_objects_1)
+model.do()
+# move group
+Part_1_doc.moveFeature(Group_1.feature(), Fuse_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# All solids are merged to one - result
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 1)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(1):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+# Check group 2: 3 faces
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(3):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump())
index 3a497f317e1c71081223c6cc5eaac070362b685a..7b18a77fac89b57affed143ef0c29d57a9a101f1 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,7 @@ SketchPoint_2 = Sketch_1.addPoint(18.16931216931219, 17.1005291005291)
 SketchPoint_3 = Sketch_1.addPoint(-19.77248677248678, -16.03174603174603)
 SketchPoint_4 = Sketch_1.addPoint(21.37566137566138, -16.03174603174603)
 model.do()
-Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_3"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_4"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")]
+Vertex_1_objects = [model.selection("VERTEX", "Sketch_1/SketchPoint_3"), model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_4"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")]
 Vertex_1 = model.addVertex(Part_1_doc, Vertex_1_objects)
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("VERTEX", "Vertex_1_3"), model.selection("VERTEX", "Vertex_1_4")])
index 70ce3aad8eaa6218ec7de2287f71696807b528fc..756d77f9b5dfd840ae5527cc640446f9b68544b8 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,7 +29,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchPoint_1 = Sketch_1.addPoint(-6.078627161807992, -0.4501231771005025)
 SketchPoint_2 = Sketch_1.addPoint(7.482208269631659, 3.929326826374309)
 model.do()
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchPoint_2"), model.selection("VERTEX", "Sketch_1/SketchPoint_1")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_1_2")])
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
index b7473f690e96961f63ae4335add40a43b7ee0fa2..d24ab12842878d0a143d595281e79ae034567bb1 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,10 +41,10 @@ SketchLine_7 = Sketch_2.addLine(13.49417304964538, 51.08508368794326, 35.9844614
 SketchLine_8 = Sketch_2.addLine(35.98446146572105, 27.95221560283687, 53.3341125295508, 47.87218534278959)
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6")])
-Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
+Wire_3 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6")])
+Wire_4 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")])
 Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")])
 Compound_2 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Wire_3_1"), model.selection("WIRE", "Wire_4_1")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1"), model.selection("COMPOUND", "Compound_2_1")])
index 0cb778f8e526cdb850f8aa13304bb305308b1cbe..d74f6ba275fd17d35023185ddcb223411908461f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -34,8 +35,8 @@ SketchLine_3 = Sketch_2.addLine(-23.92129524945932, 7.630068312327553, -4.124361
 SketchLine_4 = Sketch_2.addLine(-4.124361249906777, 34.02598031173091, 14.43526437467373, 6.392759937355498)
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")])
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("WIRE", "Wire_1_1"), model.selection("WIRE", "Wire_2_1")])
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
 model.do()
index 4be9090f0e551b493dc458e67340fb9c5939cab5..831ad1c420e02eeee349bdcd5c0d99f9d8e4cc38 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -84,18 +83,11 @@ aSession.startOperation()
 extrudedObjects = []
 for eachSketchFeature in [aCircleSketchFeature, aTriangleSketchFeature]:
     # Build sketch faces
-    aSketchResult = eachSketchFeature.firstResult()
-    aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-    origin = geomDataAPI_Point(eachSketchFeature.attribute("Origin")).pnt()
-    dirX = geomDataAPI_Dir(eachSketchFeature.attribute("DirX")).dir()
-    norm = geomDataAPI_Dir(eachSketchFeature.attribute("Norm")).dir()
-    aSketchFaces = ShapeList()
-    GeomAlgoAPI_SketchBuilder.createFaces(
-        origin, dirX, norm, aSketchEdges, aSketchFaces)
+    aSketchResult = modelAPI_ResultConstruction(eachSketchFeature.firstResult())
     # Create extrusion on them
     anExtrusionFt = aPart.addFeature("Extrusion")
     anExtrusionFt.selectionList("base").append(
-        aSketchResult, aSketchFaces[0])
+        aSketchResult, aSketchResult.face(0))
     anExtrusionFt.string("CreationMethod").setValue("BySizes")
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(50)
diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_CompSolid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanSmash_CompSolid_Solid.py
new file mode 100644 (file)
index 0000000..90d7824
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-0.820365148699405, 7.40718257641344, 6.028904154999336)
+SketchCircle_2 = Sketch_1.addCircle(10.62009910116713, 13.94078752172051, 10.99163472554975)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("SOLID", "Box_1_1")])
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Smash_1, 1)
+model.testNbSubResults(Smash_1, [4])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.SOLID, [4])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.FACE, [28])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.EDGE, [120])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.VERTEX, [240])
+model.testResultsVolumes(Smash_1, [4980.404017506245509139262139797])
diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanSmash_ErrorMsg.py
new file mode 100644 (file)
index 0000000..36c97b0
--- /dev/null
@@ -0,0 +1,70 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_1")], [model.selection("SOLID", "Cylinder_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_1")])
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Cylinder_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], [model.selection("FACE", "Face_1_1")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(5, -6, 7)
+SketchCircle_2 = Sketch_1.addCircle(14, 0, 8)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1")], [model.selection("SOLID", "Extrusion_1_1_2")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Extrusion_1_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1_1/To_Face")])
+
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_2_1")], [model.selection("FACE", "Face_2_2")])
+assert(Smash_1.feature().error() != "")
+Part_1_doc.removeFeature(Smash_1.feature())
+
+model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Smash_1 = Part_1_doc.addFeature("Smash")
+Smash_1.execute()
+assert(Smash_1.error() != "")
+aSession.finishOperation()
index 06198375b931082a2f44d06e9b4fd903b0bbe182..225084c2a53979f305e354b00390ded8dbf55f45 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,7 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_2 = Sketch_2.addCircle(12.30017152658664, 14.37907375643225, 29.61574408620473)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")])
 Smash_1 = model.addSmash(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_1_2")])
 model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc)
 model.do()
diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_SolidsHistory.py b/src/FeaturesPlugin/Test/TestBooleanSmash_SolidsHistory.py
new file mode 100644 (file)
index 0000000..44354bf
--- /dev/null
@@ -0,0 +1,122 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that the history of Smash operation works correctly after movement of groups after this Smash feature
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(26.49384236453203, 25.42805779478775, -23.25985221674878, 25.42805779478775)
+SketchLine_2 = Sketch_1.addLine(-23.25985221674878, 25.42805779478775, -23.25985221674878, -22.79086009461325)
+SketchLine_3 = Sketch_1.addLine(-23.25985221674878, -22.79086009461325, 26.49384236453203, -22.79086009461325)
+SketchLine_4 = Sketch_1.addLine(26.49384236453203, -22.79086009461325, 26.49384236453203, 25.42805779478775)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(-23.25985221674878, -22.79086009461325, -4.602216748768477, 25.42805779478775)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.result())
+SketchLine_6 = Sketch_1.addLine(-4.602216748768477, 25.42805779478775, 8.458128078817737, -22.79086009461324)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_3.result())
+SketchLine_7 = Sketch_1.addLine(8.458128078817737, -22.79086009461324, 26.49384236453203, 25.42805779478775)
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_7.endPoint())
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_8 = Sketch_2.addLine(38.18596059113301, 15.79679802955666, -30.91800131851275, 15.79679802955666)
+SketchLine_9 = Sketch_2.addLine(-30.91800131851275, 15.79679802955666, -30.91800131851275, -10.07512315270936)
+SketchLine_10 = Sketch_2.addLine(-30.91800131851275, -10.07512315270936, 38.18596059113301, -10.07512315270936)
+SketchLine_11 = Sketch_2.addLine(38.18596059113301, -10.07512315270936, 38.18596059113301, 15.79679802955666)
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_8.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_9.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_10.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_11.result())
+SketchLine_12 = Sketch_2.addLine(38.18596059113301, 15.79679802955666, -30.91800131851275, 1.368226600985215)
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_9.result())
+SketchLine_13 = Sketch_2.addLine(-30.91800131851275, 1.368226600985215, 38.18596059113301, -10.07512315270936)
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_13.endPoint())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_2")], model.selection(), 5, 5)
+Group_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_4"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("SOLID", "Extrusion_2_1_2"), model.selection("SOLID", "Extrusion_2_1_3"), model.selection("SOLID", "Extrusion_2_1_1")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Group_3_objects = [model.selection("FACE", "Extrusion_1_1_4/From_Face"), model.selection("FACE", "Extrusion_1_1_2/From_Face"), model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1_4/To_Face"), model.selection("FACE", "Extrusion_1_1_2/To_Face")]
+Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
+Group_4_objects = [model.selection("FACE", "Extrusion_2_1_2/To_Face"), model.selection("FACE", "Extrusion_2_1_3/To_Face"), model.selection("FACE", "Extrusion_2_1_1/To_Face")]
+Group_4 = model.addGroup(Part_1_doc, Group_4_objects)
+Smash_1_objects_1 = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_4"), model.selection("SOLID", "Extrusion_1_1_2")]
+Smash_1 = model.addSmash(Part_1_doc, Smash_1_objects_1, [model.selection("SOLID", "Extrusion_2_1_1"), model.selection("SOLID", "Extrusion_2_1_2")])
+model.do()
+# move groups after the Smash
+Part_1_doc.moveFeature(Group_1.feature(), Smash_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+Part_1_doc.moveFeature(Group_3.feature(), Group_2.feature())
+Part_1_doc.moveFeature(Group_4.feature(), Group_3.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 4)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(4):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(2):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_3.feature().selectionList("group_list")
+assert(selectionList.size() == 10)
+assert(aFactory.validate(Group_3.feature()))
+for i in range(10):
+  assert(Group_3.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+selectionList = Group_4.feature().selectionList("group_list")
+assert(selectionList.size() == 10)
+assert(aFactory.validate(Group_4.feature()))
+for i in range(10):
+  assert(Group_4.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBooleanSmash_SubSolid_Solid.py b/src/FeaturesPlugin/Test/TestBooleanSmash_SubSolid_Solid.py
new file mode 100644 (file)
index 0000000..e915145
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5, True)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")])
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], 3, 3, 3)
+Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Partition_1_1_2")], [model.selection("SOLID", "Translation_1_1")])
+model.do()
+
+model.testHaveNamingSubshapes(Smash_1, model, Part_1_doc)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Smash_1, 1)
+model.testNbSubResults(Smash_1, [3])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.FACE, [28])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.EDGE, [130])
+model.testNbSubShapes(Smash_1, GeomAPI_Shape.VERTEX, [260])
+model.testResultsVolumes(Smash_1, [1657])
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBoolean_ErrorMsg.py
new file mode 100644 (file)
index 0000000..f899d70
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/YOZ"), model.selection("SOLID", "Cylinder_1_1")])
+
+Cut_1 = model.addCut(Part_1_doc, [], [])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
+assert(Cut_1.feature().error() != "")
+Part_1_doc.removeFeature(Cut_1.feature())
+model.end()
index 47caabb1d0e461c8a09d5a53afdb49a66462d149..9a2f9fb740b869aedb2a02b36e7f16c8c5223f85 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -64,16 +63,8 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
index 5e44cac127913e038df1dc283cb72ffa9e22fb89..e9bec5b06c51182453d40bee1e134a8c41859090 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestExtrusion.py
@@ -85,24 +84,16 @@ aSession.finishOperation()
 #=========================================================================
 # Make extrusion on circle
 #=========================================================================
-# Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+# Build face from sketcher results
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -147,8 +138,7 @@ aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
-anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anExtrusionFt.real("to_size").setValue(0) #TODO: remove
 anExtrusionFt.real("from_size").setValue(0) #TODO: remove
@@ -213,20 +203,13 @@ aLineEEndPoint.setValue(0., -50.)
 aSession.finishOperation()
 
 # Extrude clamp
-aClampSketchResult = aClampSketchFeature.firstResult()
-aClampSketchEdges = modelAPI_ResultConstruction(aClampSketchResult).shape()
-origin = geomDataAPI_Point(aClampSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aClampSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aClampSketchFeature.attribute("Norm")).dir()
-aClampSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aClampSketchEdges, aClampSketchFaces)
+aClampSketchResult = modelAPI_ResultConstruction(aClampSketchFeature.firstResult())
 aSession.startOperation()
 aClampExtrusionFt = aPart.addFeature("Extrusion")
 assert (aClampExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 aClampExtrusionFt.selectionList("base").append(
-    aClampSketchResult, aClampSketchFaces[0])
+    aClampSketchResult, aClampSketchResult.face(0))
 aClampExtrusionFt.string("CreationMethod").setValue("BySizes")
 aClampExtrusionFt.real("to_size").setValue(70)
 aClampExtrusionFt.real("from_size").setValue(0)
@@ -245,14 +228,13 @@ aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
-anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anExtrusionFt.real("to_size").setValue(0) #TODO: remove
 anExtrusionFt.real("from_size").setValue(0) #TODO: remove
-anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_3")
+anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face&Sketch_2/SketchLine_3")
 anExtrusionFt.real("to_offset").setValue(0)
-anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_4")
+anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face&Sketch_2/SketchLine_4")
 anExtrusionFt.real("from_offset").setValue(0)
 anExtrusionFt.execute()
 aSession.finishOperation()
index af4c4917953c97baa9f766964d878b932b5692e8..f591a07148ea067b92f6624f15f007dd18068a51 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -62,23 +61,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -108,7 +99,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face")
 aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
diff --git a/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestExtrusionCut_ByPlanesAndOffsets.py
new file mode 100644 (file)
index 0000000..2cfa2d2
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Axis_4 = model.addAxis(Part_1_doc, 10, 10, 10)
+
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection("FACE", "Box_1_1/Right"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+ExtrusionCut_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = ExtrusionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5, 4.97049494)
+
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection("EDGE", "Axis_1"), model.selection(), 0, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Box_1_1/Left"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
+SketchCircle_2 = Sketch_2.addCircle(10, 10, 2.040695131136049)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Box_1_1/Right][Box_1_1/Front][(ExtrusionCut_1_1/Modified_Face&Box_1_1/Left)(ExtrusionCut_1_1/Modified_Face&Box_1_1/Right)(Box_1_1/Front)(Box_1_1/Back)2(Box_1_1/Bottom)2]"), False)
+SketchPoint_1 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+ExtrusionCut_2.setNestedSketch(Sketch_2)
+model.do()
+Shape = ExtrusionCut_2.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5.00107093476, 4.96064972557, 4.9770664027)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestExtrusionCut_BySize.py b/src/FeaturesPlugin/Test/TestExtrusionCut_BySize.py
new file mode 100644 (file)
index 0000000..9458b53
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Axis_1 = model.addAxis(Part_1_doc, 0, -10, 10)
+
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), -5, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+ExtrusionCut_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = ExtrusionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5.004704015828, 5.02793455788)
+
+ExtrusionCut_1.setDirection(model.selection("EDGE", "Axis_1"))
+model.do()
+Shape = ExtrusionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5.00027719467643, 4.861055360637628, 5.101882685002874)
+
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], -5, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
+SketchCircle_2 = Sketch_2.addCircle(2, 7, 1.5)
+ExtrusionCut_2.setNestedSketch(Sketch_2)
+model.do()
+
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [], 0, 7, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Box_1_1/Front"))
+SketchCircle_3 = Sketch_3.addCircle(7, 2, 1.5)
+ExtrusionCut_3.setNestedSketch(Sketch_3)
+model.do()
+Shape = ExtrusionCut_3.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5.15104587473, 4.96021, 4.86946)
+
+model.end()
+
+assert(model.checkPythonDump())
index a8c6cb8c398e61fb49590c41462175a4386fb53a..be7fb2dd3d6dc2e762dbbaa09d0a5ac177e36ff4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -62,23 +61,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -108,7 +99,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face")
 aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
diff --git a/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestExtrusionFuse_ByPlanesAndOffsets.py
new file mode 100644 (file)
index 0000000..837dac0
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Axis_4 = model.addAxis(Part_1_doc, 10, 10, 10)
+
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [], model.selection("FACE", "Box_1_1/Right"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+ExtrusionFuse_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = ExtrusionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5, 5.421244124)
+
+ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [], model.selection("EDGE", "Axis_1"), model.selection(), 0, model.selection("FACE", "ExtrusionFuse_1_1/Modified_Face&Box_1_1/Left&ExtrusionFuse_1_1/From_Face"), 0, [model.selection("SOLID", "ExtrusionFuse_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
+SketchCircle_2 = Sketch_2.addCircle(10, 10, 2.040695131136049)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[(Box_1_1/Back)(Box_1_1/Bottom)(Box_1_1/Front)(ExtrusionFuse_1_1/Modified_Face&Box_1_1/Right&ExtrusionFuse_1_1/To_Face)][Box_1_1/Bottom][Box_1_1/Front]"), False)
+SketchPoint_1 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+ExtrusionFuse_2.setNestedSketch(Sketch_2)
+model.do()
+Shape = ExtrusionFuse_2.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 4.88886637164, 4.89804988224, 2.94104936673)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestExtrusionFuse_BySize.py b/src/FeaturesPlugin/Test/TestExtrusionFuse_BySize.py
new file mode 100644 (file)
index 0000000..49cdfa0
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Axis_1 = model.addAxis(Part_1_doc, 0, 10, -10)
+
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [], model.selection(), -5, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+ExtrusionFuse_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = ExtrusionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 4.903914353, 5.273370165)
+
+ExtrusionFuse_1.setDirection(model.selection("EDGE", "Axis_1"))
+model.do()
+Shape = ExtrusionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 4.299736969, 5.70604613)
+
+ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [], 3, [model.selection("SOLID", "ExtrusionFuse_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
+SketchCircle_2 = Sketch_2.addCircle(4, 7, 2)
+ExtrusionFuse_2.setNestedSketch(Sketch_2)
+model.do()
+
+ExtrusionFuse_3 = model.addExtrusionFuse(Part_1_doc, [], 10, 0, [model.selection("SOLID", "ExtrusionFuse_2_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Right"))
+SketchCircle_3 = Sketch_3.addCircle(5, -6, 3)
+ExtrusionFuse_3.setNestedSketch(Sketch_3)
+model.do()
+Shape = ExtrusionFuse_3.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5.31705479, 6.86583379, 5.82287969)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestExtrusionOfCompound.py b/src/FeaturesPlugin/Test/TestExtrusionOfCompound.py
new file mode 100644 (file)
index 0000000..61e83e3
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(15, -20, 8)
+SketchCircle_2 = Sketch_1.addCircle(35, -5, 15)
+model.do()
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection(), model.selection(), 0, model.selection("FACE", "PartSet/XOY"), 10)
+model.do()
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Sketch_2 = model.addSketch(Part_2_doc, model.defaultPlane("XOY"))
+SketchCircle_3 = Sketch_2.addCircle(15, -20, 8)
+SketchCircle_4 = Sketch_2.addCircle(35, -5, 15)
+model.do()
+Compound_2 = model.addCompound(Part_2_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
+Extrusion_2 = model.addExtrusion(Part_2_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection(), 10, 0)
+model.do()
+
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+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, [6])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [12])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Extrusion_1, [9079.2027688745])
+
+model.testNbResults(Extrusion_2, 1)
+model.testNbSubResults(Extrusion_2, [2])
+model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.EDGE, [12])
+model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Extrusion_2, [9079.2027688745])
+
+assert(model.checkPythonDump())
\ No newline at end of file
diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py b/src/FeaturesPlugin/Test/TestExtrusion_ErrorMsg.py
new file mode 100644 (file)
index 0000000..7e1dc72
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 0, 0, 0)
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection(), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(20, 20, 10)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection("EDGE", "PartSet/OX"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OX"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchArc_1 = Sketch_2.addArc(25, 10, 40, 10, 25, 25, False)
+model.do()
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 10, 0)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 0, model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 10)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 0, model.selection("FACE", "PartSet/XOY"), 10)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 0, model.selection(), 10)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection(), 0, model.selection("EDGE", "Sketch_2/SketchArc_1_2"), 10)
+assert(Extrusion_1.feature().error() != "")
+Part_1_doc.removeFeature(Extrusion_1.feature())
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection(), 0, model.selection("FACE", "PartSet/XOY"), 10)
+assert(Extrusion_1.feature().error() == "")
+#Part_1_doc.removeFeature(Extrusion_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ZeroOffsetError.py b/src/FeaturesPlugin/Test/TestExtrusion_ZeroOffsetError.py
new file mode 100644 (file)
index 0000000..0973b05
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(9.631110499908317, -35.9437937189679, 36.19447160731126)
+model.do()
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, -10)
+assert(Extrusion_1.feature().error() != "")
+
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_2 = Sketch_2.addCircle(114.4867836253828, -21.50233830122853, 11.10986684682035)
+SketchCircle_3 = Sketch_2.addCircle(113.4180342136906, 1.426992627069481, 10.29495051811322)
+model.do()
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")])
+
+Plane_1 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 10, False)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchCircle_4 = Sketch_3.addCircle(91.42492988686666, -20.30106607931821, 6.749165188215104)
+SketchCircle_5 = Sketch_3.addCircle(88.32466240656791, 2.196618803039243, 8.273170230715275)
+model.do()
+Compound_2 = model.addCompound(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_4_2r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_5_2f")])
+
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), model.selection("COMPOUND", "Compound_1_1"), 0, model.selection("COMPOUND", "Compound_2_1"), 0)
+assert(Extrusion_2.feature().error() == "")
+
+model.end()
index 832475bb2a59621c3e704aaae1a977ce094139f7..54926d02562369797e2ac5a9f24c0385c898127a 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -50,13 +50,13 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Fill_1_1")], [model.selection("SOLID", "Box_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
+Fill_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Fill_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
-model.checkResult(Boolean_2, model, 1, [6], [0], [6], [22], [44])
-model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc)
+model.checkResult(Fill_2, model, 1, [6], [0], [6], [22], [44])
+model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc)
 
 model.end()
 
diff --git a/src/FeaturesPlugin/Test/TestFillCompsolidPlane.py b/src/FeaturesPlugin/Test/TestFillCompsolidPlane.py
new file mode 100644 (file)
index 0000000..a8abbd7
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(11.92861402549826, 0, 16.05621803603458)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+SketchCircle_2 = Sketch_1.addCircle(37.8779560884558, 0, 17.74637067763095)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_2.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")], [model.selection("FACE", "PartSet/XOZ")])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Fill_1, 1)
+model.testNbSubResults(Fill_1, [5])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.SOLID, [5])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.FACE, [25])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.EDGE, [90])
+model.testNbSubShapes(Fill_1, GeomAPI_Shape.VERTEX, [180])
+model.testResultsVolumes(Fill_1, [16831.622023411000554915517568588])
index 0c92a1422f1af360d886783fb88797f582027ee6..71d79a876d1efe81ca978dea16f91a4219269efe 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,18 +30,18 @@ SketchLine_1 = Sketch_1.addLine(-43.24383164005806, 13.92597968069667, 63.179970
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_2 = Sketch_2.addLine(-21.12944291883177, 24.09981691608177, 39.13933236574746, 51.82677414066782)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_3 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_3.result())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_3.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[3],[0],[0],[3],[6])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[3],[0],[0],[3],[6])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 5b5ee1cc4e9c9e4a43153aaee08e8b0d839fda0e..11dac36f0622b4e62fc4307289584164849943e9 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -31,13 +31,13 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_2 = Sketch_2.addLine(-42.46271611030479, 53.71965718432511, 14.83075791001449, -51.73354862119014)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_2")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("EDGE", "Edge_2_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[2],[0],[0],[2],[4])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[2],[0],[0],[2],[4])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 49a082413e58f87626cf1042dea8daff7a2f9969..b887f137f8ada14bcb9fa789e62a235066eddafa 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -35,16 +35,17 @@ SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"))
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchLine_5 = Sketch_2.addLine(-53.77011318694006, -47.84888937635935, 60.89888292381829, 36.13719175945)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("FACE", "Face_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index cd7be482d1baed8df930268df2bdfe1be4f89cf3..dc8557db13ff1f94096fc9db1d8d6b8868af06d0 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -40,19 +40,19 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint())
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1])
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")])
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, False)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_3 = Sketch_2.addLine(-64.49168769733997, 17.16789081864163, 146.7677170722727, 22.9901626941168)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SHELL", "Shell_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SHELL", "Shell_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 943d4e5a797599e3c818f200ead43ba6c059171b..11f88c2608af5bf5cb83a59d419103077fc0d50c 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,19 +28,19 @@ Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
 SketchLine_1 = Sketch_1.addLine(4, 10, 7, 0)
-SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), False)
 SketchLine_2 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result())
-SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), False)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), False)
 SketchLine_3 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Box_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [0], [1], [2])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [0], [1], [2])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 5756635e1669a9139546d6429922397518def96c..73bf806817aa2c1d82dde917912bfab3b0bfb406 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -36,12 +36,12 @@ SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_1.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Cone_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("SOLID", "Cone_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 33ba672dca3785d134b3295848202036ba596e2b..1ddc71865b96e4710f261f48b5d5b3988cef35d0 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -27,7 +27,7 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-Point_1 = model.addPoint(Part_1_doc, 10, 10, 0)
+Point_2 = model.addPoint(Part_1_doc, 10, 10, 0)
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-27.61369370623992, 41.69872643310781, 64.30052615729069, -35.76145957046036)
@@ -35,12 +35,11 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Point_1")
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchAPI_Point(SketchPoint_1).coordinates())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
 model.do()
-
-model.checkResult(Boolean_1,model,1,[2],[0],[0],[2],[4])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[2],[0],[0],[2],[4])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index ead4aeb8880ad2e4f42f5651e6f10cb7cd40462a..02520267aac5d8862c15336fb719aa229809063d 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,13 +38,14 @@ SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("WIRE", "Wire_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [3], [0], [0], [3], [6])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [3], [0], [0], [3], [6])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 5bcc0602a345edd7505954f4c2e5f48c2364cf68..555d6e869d171f17ad56bb6d75bcfd2647706f52 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -35,16 +35,17 @@ SketchLine_4 = Sketch_1.addLine(13.30716777939044, -81.12733381712628, -65.15998
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"))
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchLine_5 = Sketch_2.addLine(-53.77011318694006, -47.84888937635935, 60.89888292381829, 36.13719175945)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_5")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[2],[0],[2],[8],[16])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[2],[0],[2],[8],[16])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 44bd6384aef149cdd56713b5b6a0d0f0a4714d35..a069f88294df24612bfb7c47cc31cf92523de8d6 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -35,19 +35,20 @@ SketchLine_3 = Sketch_1.addLine(-34.74165457184325, -28.87808417997097, -49.4005
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.endPoint())
 model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_1r-SketchLine_2r-SketchLine_3r"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchLine_4 = Sketch_2.addLine(-17.59187701681758, -17.53169787967194, -23.97073271029336, 4.338664497959301)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_2"), False)
 SketchLine_5 = SketchProjection_1.createdFeature()
 SketchConstraintPerpendicular_1 = Sketch_2.setPerpendicular(SketchLine_4.result(), SketchLine_5.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_4")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[1],[5],[10])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[1],[5],[10])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 2d5182fd204a13322b131377ea119d999bf35bea..388522bfaf880cd8965f8dbf7135c83b1cf2c20f 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -42,13 +42,14 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_7 = Sketch_2.addLine(24.33758278426026, -52.48127186534471, 29.40566289183227, 59.45054433956496)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_7")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[1],[6],[13])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[1],[6],[13])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index d7ce14972ca30eae6ab0e599af24917134607212..07d47a4f9d4797190c0c8a3af513a18fd38fc62b 100644 (file)
@@ -1,26 +1,25 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
-from SketchAPI import *
 
 model.begin()
 partSet = model.moduleDocument()
@@ -42,26 +41,26 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_4 = Sketch_2.addLine(31.79164821526215, 49.99496405877289, 8.200436015051352, 0)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False)
 SketchPoint_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result())
 SketchLine_5 = Sketch_2.addLine(8.200436015051352, 0, 27.24680168984479, -49.85269382803262)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
-SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-021, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False)
+SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-21, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False)
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchArc_2.center())
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchArc_2.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_4.startPoint())
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_2.results()[1], "R")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchArc_2_2f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Face_2_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [2], [0], [2], [6], [12])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [2], [0], [2], [6], [12])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 068e4aebee22145353def0256914e2a868d6c4ec..548b3c4d24c60eb956ebcbfb7f1e96a0754a5e0d 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -97,15 +97,15 @@ SketchLine_15.result().setName("SketchLine_16")
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
 SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_3_1")], [model.selection("SHELL", "Shell_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [3], [0], [3], [14], [28])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [3], [0], [3], [14], [28])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index a99fa556f2ce0c71ca7e790abe6ec5218fd50e97..55ad8491cf2fd623125a472aca6895836b168302 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -49,12 +49,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5)
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [4], [0], [4], [15], [30])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [4], [0], [4], [15], [30])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 21b11a3d13adeb305ba61a639a055a110c303f74..6893a60b0272c30c00982ed6eac7ffe0ab7cb6a6 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -40,13 +40,14 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[1],[4],[9])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[1],[4],[9])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index b38a7a3dee3b41877efcc9c9745b43d644013aed..6245b2933d48052bfa45057d2f4767a0d995199b 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -45,19 +45,19 @@ SketchLine_5 = Sketch_2.addLine(-18.23994072168525, 7.835320880296757, 13.893416
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchLine_6 = Sketch_2.addLine(13.89341696052619, 27.33089138697832, 39.39985877388298, 9.747860956493145)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
-SketchLine_7 = Sketch_2.addLine(39.39985877388298, 9.747860956493145, 38.20105433548567, 71.93732104572752)
+SketchLine_7 = Sketch_2.addLine(39.39985877388298, 9.747860956493145, 38.20105433548567, 71.93732104572751)
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
-SketchLine_8 = Sketch_2.addLine(38.20105433548567, 71.93732104572752, -42.38833891077762, 73.71572760627062)
+SketchLine_8 = Sketch_2.addLine(38.20105433548567, 71.93732104572751, -42.38833891077762, 73.71572760627062)
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_8.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [5], [0], [5], [21], [42])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [5], [0], [5], [21], [42])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index a0bd627ba39a29984d4a83cbfddad0db769d1425..6600f67b2741d0a0b0f435a9daa18074fd0fcbed 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -40,14 +40,14 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint())
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1])
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "PartSet/XOZ")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[3],[12],[24])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[3],[12],[24])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 20f0ed60fbafcdbe245697ba83fea5a2942947df..8ee5cca390662fc702960c66953794fb5bf969bb 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -40,19 +40,19 @@ SketchArc_2 = Sketch_1.addArc(38.14157263904823, 16.22495851193372, 56.770542089
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint())
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1])
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 70, 0)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")])
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, False)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_3 = Sketch_2.addLine(-64.49168769733997, 17.16789081864163, 146.7677170722727, 22.9901626941168)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_3")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[2],[8],[18])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[2],[8],[18])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 0a7242dfc0b53b26d2c7fdf8db68c765a66818e9..8e2cf0d14042856178873c50281405c6d717a280 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -73,7 +73,9 @@ SketchLine_10 = Sketch_2.addLine(64.99999999999999, 12.18920647716607, 50, 12.18
 SketchLine_10.setName("SketchLine_12")
 SketchLine_10.result().setName("SketchLine_12")
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10")
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.result())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11")
 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_8.endPoint(), SketchLine_7.result(), "L", True)
 SketchConstraintDistance_5 = Sketch_2.setDistance(SketchLine_9.endPoint(), SketchLine_7.result(), "L/2", True)
 SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_10.result())
@@ -86,20 +88,22 @@ SketchLine_12.setName("SketchLine_14")
 SketchLine_12.result().setName("SketchLine_14")
 SketchLine_11.setName("SketchLine_13")
 SketchLine_11.result().setName("SketchLine_13")
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_9.result())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_12")
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_7.result())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_13")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("FACE", "Face_3_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [4], [13], [26])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [4], [13], [26])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 1363f2e95dd67a7db495bcf3a09b8012cec048f5..670a897480049e9cd0c816060dd7950dbaf674d7 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -33,10 +33,10 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-10, 32.04672553984553, 15.61552812808831, 47.66225366793383)
 SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_2 = SketchProjection_1.createdFeature()
-SketchLine_3 = Sketch_1.addLine(15.61552812808831, 47.66225366793383, -4.988916520257207e-021, 73.27778179602213)
+SketchLine_3 = Sketch_1.addLine(15.61552812808831, 47.66225366793383, -4.988916520257207e-21, 73.27778179602213)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result())
-SketchLine_4 = Sketch_1.addLine(-4.988916520257207e-021, 73.27778179602213, -25.61552812810082, 57.66225366792627)
+SketchLine_4 = Sketch_1.addLine(-4.988916520257207e-21, 73.27778179602213, -25.61552812810082, 57.66225366792627)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchLine_5 = Sketch_1.addLine(-25.61552812810082, 57.66225366792627, -10, 32.04672553984553)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
@@ -64,7 +64,7 @@ SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(),
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_10.endPoint())
 SketchLine_11 = Sketch_2.addLine(50, 15.56025031353752, 73.27778179602213, 0)
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_7.startPoint(), SketchLine_11.startPoint())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_3e"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_3_EndVertex"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result())
 SketchLine_12 = Sketch_2.addLine(73.27778179602213, 0, 50, -15.54016280334104)
@@ -73,17 +73,17 @@ SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_7.endPoint(),
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_9).startPoint(), SketchLine_7.result(), "D", True)
 SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_7.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7r-SketchLine_8r-SketchLine_10r")])
-Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_7f-SketchLine_11r-SketchLine_12r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_10r-SketchLine_8r-SketchLine_7r_wire")])
+Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_7r-SketchLine_12r-SketchLine_11r_wire")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
 Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_4_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SHELL", "Shell_2_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [4], [15], [30])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [4], [15], [30])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 1b78fe4c15b0d9a8f0d3cd94d6ad1a7609907cc4..08f10b53ff82c3850177a1d937a7b166f36aaa8f 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -50,14 +50,14 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")])
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
-model.checkResult(Boolean_2, model, 1, [0], [0], [6], [22], [44])
-model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc)
+model.checkResult(Fill_2, model, 1, [0], [0], [6], [22], [44])
+model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc)
 
 model.end()
 
index 2fb840f5c256e78aa076aba293e28461d9c210c6..a3062224c10eb7166ee5668be7e6be0845611c50 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -36,16 +36,16 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_2_2")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchArc_2_2")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 50, 0)
 Shell_1 = model.addShell(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")])
 Point_2 = model.addPoint(Part_1_doc, 0, 0, 10)
 Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[2],[9],[18])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[2],[9],[18])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 1dc51bd3de8b8951f3fce7b0df03f58f51bbf2c8..998cd655e6e20618b379e58fe81b79c83aeb4961 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -71,15 +71,16 @@ SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_2.createdFeature()
 SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.result(), "L", True)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchLine_10")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("WIRE", "Wire_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [8], [30], [60])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [8], [30], [60])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 981f18b9b1c43bb331b4b89f481d7007448f4462..86b3d0548eb5ad7eac93c6c549e3afe5e7f5bac7 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -26,11 +26,11 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[4],[4],[20],[72],[144])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[4],[4],[20],[72],[144])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index d486e1856193f198a81becb987c7a165d80a537b..5e137fdc7036c8e072ae7e417df92c3f896dd178 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -34,14 +34,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"),
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True)
+SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result())
-SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5)
+SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5)
+SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result())
@@ -50,13 +50,13 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Fill_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Fill_1_1")])
 model.do()
 
-model.checkResult(Boolean_2, model, 1, [2], [2], [14], [60], [120])
-model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc)
+model.checkResult(Fill_2, model, 1, [2], [2], [14], [60], [120])
+model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc)
 
 model.end()
 
index d6de9e4cf79ec6565d2d1c4668824f979e1b7f4f..bd641f1fdbde61c3fc3beb0bd1bd6d41d3662324 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -34,14 +34,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"),
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True)
+SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result())
-SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5)
+SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5)
+SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result())
@@ -50,15 +50,15 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
-MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3)
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")])
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3)
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")])
 model.do()
 
-model.checkResult(Boolean_2, model, 1, [4], [4], [30], [132], [264])
-model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc)
+model.checkResult(Fill_2, model, 1, [4], [4], [30], [132], [264])
+model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc)
 
 model.end()
 
index 25190b5fd62fe2b784659745fa101ad32296432a..2eb143b60899c4e25b0fde49c38b11a7e45e7a3b 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,19 +28,19 @@ Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
 SketchLine_1 = Sketch_1.addLine(4, 10, 7, 0)
-SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), False)
 SketchLine_2 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_2.result())
-SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Bottom"), False)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Bottom]"), False)
 SketchLine_3 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [1], [7], [30], [60])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [1], [7], [30], [60])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 54e07fa92f6bd637f638092a7b8d2b9601408cc5..5ad553c8b8bc7e39000efa6aa15308723de6825c 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -34,14 +34,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"),
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True)
+SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result())
-SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5)
+SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5)
+SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result())
@@ -49,12 +49,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), "Shift/3")
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("FACE", "Face_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [2], [2], [12], [48], [96])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [2], [2], [12], [48], [96])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 174e8db41fd3787b6a99c8a97968d8d05bf7bd6e..5264d051c6a5daea98b9eda3dd7763a4d15c50e0 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -34,14 +34,14 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"),
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchArc_1 = Sketch_1.addArc(0, 0, 11.4564392373896, -5, 0, -12.5, True)
+SketchArc_1 = Sketch_1.addArc(0, 0, 15.49193338482974, -4, 0, -16, True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
 SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.result())
-SketchLine_2 = Sketch_1.addLine(11.4564392373896, -5, 0, 5)
+SketchLine_2 = Sketch_1.addLine(15.49193338482974, -4, 0, 12)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.startPoint())
-SketchLine_3 = Sketch_1.addLine(0, 5, 0, -12.5)
+SketchLine_3 = Sketch_1.addLine(0, 12, 0, -16)
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_1.result())
@@ -50,14 +50,14 @@ SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")])
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")])
 model.do()
 
-model.checkResult(Boolean_2, model, 1, [2], [2], [14], [60], [120])
-model.testHaveNamingSubshapes(Boolean_2, model, Part_1_doc)
+model.checkResult(Fill_2, model, 1, [2], [2], [14], [60], [120])
+model.testHaveNamingSubshapes(Fill_2, model, Part_1_doc)
 
 model.end()
 
index eeda3945e1ad2ad934f1791a0a876520d9d6603d..c97e8930263d1aae77162f2f257a5573f8eb2d0a 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,13 +38,14 @@ SketchLine_5 = Sketch_2.addLine(55.26415094339622, -34.15529753265602, -40.60522
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_2.startPoint())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("EDGE", "Edge_1_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("EDGE", "Edge_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[0],[6],[12])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[0],[6],[12])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index e63cac9f591ae9750df04c90c19b24ebcdcef0d3..c6c4d288129f5a0860e4e26fdda0e23b5a53c81f 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,7 +41,7 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_4 = Sketch_2.addLine(29.74624907439609, 30.07487215963349, 31.08202242513997, 0)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False)
 SketchPoint_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result())
 SketchLine_5 = Sketch_2.addLine(31.08202242513997, 0, 45.45797599933665, 0)
@@ -57,13 +57,13 @@ SketchLine_9 = Sketch_2.addLine(70.40999925541598, 30.039147749218, 29.746249074
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_7f-SketchLine_8f-SketchLine_9f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("FACE", "Face_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [0], [6], [12])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [0], [6], [12])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index d5b99ecdc9fdb3de691803e32339fe4f9a505610..8b9006137b589de4ca392543a377cf7506bdbf63 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -97,15 +97,15 @@ SketchLine_15.result().setName("SketchLine_16")
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
 SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_8.startPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_5f-SketchLine_6r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_3f-SketchLine_4f-SketchLine_6f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_6r-SketchLine_5f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_6f_wire")])
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13r-SketchLine_14r-SketchLine_15r-SketchLine_16f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_15r-SketchLine_14r-SketchLine_13r-SketchLine_16f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SHELL", "Shell_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [0], [10], [20])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [0], [10], [20])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index d0fd12e4e69890edc0eda5bb63ed19c0fe265c55..590420a21cbd1f745c2ea61fefd98138b6785ee8 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -49,12 +49,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "L+Shift
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_2.startPoint(), 5)
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_1).startPoint(), SketchLine_3.startPoint(), "Shift", True)
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchLine_3f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [0], [9], [18])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [0], [9], [18])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index 01c3c349a917ea8dc05c560c00e346570698675e..f6d405d491f8cbeb517702906731483e289590b7 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -40,12 +40,13 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(),
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("VERTEX", "Vertex_1_1")])
 model.do()
 
-model.checkResult(Boolean_1,model,1,[0],[0],[0],[4],[8])
-model.testHaveNamingSubshapes(Boolean_1,model,Part_1_doc)
+model.checkResult(Fill_1,model,1,[0],[0],[0],[4],[8])
+model.testHaveNamingSubshapes(Fill_1,model,Part_1_doc)
 
 model.end()
 
index 9540742cff0f7b42a8f7eebe7a28093ee06f7488..8daed1bbe17cdb1c0cd95286f6a997caf8e89599 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,26 +41,26 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_4 = Sketch_2.addLine(31.79164821526215, 49.99496405877289, 8.200436015051352, 0)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_1e"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False)
 SketchPoint_1 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchPoint_1.result())
 SketchLine_5 = Sketch_2.addLine(8.200436015051352, 0, 27.24680168984479, -49.85269382803262)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
-SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-021, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False)
+SketchArc_2 = Sketch_2.addArc(31.08202242513997, 1.147024884467139e-21, 27.24680168984479, -49.85269382803262, 31.79164821526215, 49.99496405877289, False)
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchArc_2.center())
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchArc_2.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_4.startPoint())
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_2.results()[1], "R")
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchArc_1_2f")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_4f-SketchLine_5f-SketchArc_2_2f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchArc_1_2f_wire")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchArc_2_2f_wire")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], [model.selection("WIRE", "Wire_2_1")])
 model.do()
 
-model.checkResult(Boolean_1, model, 1, [0], [0], [0], [4], [8])
-model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
+model.checkResult(Fill_1, model, 1, [0], [0], [0], [4], [8])
+model.testHaveNamingSubshapes(Fill_1, model, Part_1_doc)
 
 model.end()
 
index a641328bf4764a8f7f8b937b673cd251c4e3702a..59f3d71221efbc4e22765e272cb9845cc53f79c9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestFillet.py
@@ -52,7 +51,7 @@ aSession.finishOperation()
 aSession.startOperation()
 aPoint = aPart.addFeature("Point")
 aPoint.string("creation_method").setValue("by_xyz")
-geomDataAPI_Point(aFeature.attribute("point3d")).setValue(20, 5, 0)
+geomDataAPI_Point(aPoint.attribute("point3d")).setValue(20, 5, 0)
 aSession.finishOperation()
 
 aSession.startOperation()
@@ -71,7 +70,7 @@ aSession.startOperation()
 aFillet1 = aPart.addFeature("Fillet")
 aFillet1.string("creation_method").setValue("fixed_radius")
 anObjects = aFillet1.selectionList("main_objects")
-anObjects.append("Box_1_1/Left&Box_1_1/Top", "edge")
+anObjects.append("[Box_1_1/Left][Box_1_1/Top]", "edge")
 aFillet1.real("radius1").setValue(3)
 aSession.finishOperation()
 assert(aFillet1.error() == ""), "FAILED: Fillet reports error \"{}\"".format(aFillet1.error())
@@ -94,7 +93,7 @@ aFillet2 = aPart.addFeature("Fillet")
 aFillet2.string("creation_method").setValue("fixed_radius")
 anObjects = aFillet2.selectionList("main_objects")
 anObjects.append("Cylinder_1_1/Face_2", "face")
-anObjects.append("_Box_1_1/Right", "face")
+anObjects.append("Box_1_1/Right", "face")
 aFillet2.real("radius1").setValue(2)
 aSession.finishOperation()
 assert(aFillet2.error() != ""), "FAILED: Fillet does not report error"
diff --git a/src/FeaturesPlugin/Test/TestFillet1.py b/src/FeaturesPlugin/Test/TestFillet1.py
new file mode 100644 (file)
index 0000000..01a7ff0
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "all-in-Box_1")], 2)
+assert(Fillet_1.feature().error() == "")
+
+model.testNbResults(Fillet_1, 1)
+model.testNbSubResults(Fillet_1, [0])
+model.testNbSubShapes(Fillet_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Fillet_1, GeomAPI_Shape.FACE, [26])
+model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [104])
+model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [208])
+model.testResultsVolumes(Fillet_1, [907.704992710141368661425076425])
+
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchCircle_1 = Sketch_1.addCircle(20, -15, 5)
+SketchCircle_2 = Sketch_1.addCircle(30, 10, 3)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Fillet_2 = model.addFillet(Part_1_doc, [model.selection("EDGE", "all-in-Extrusion_1")], 2)
+assert(Fillet_2.feature().error() != "")
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py b/src/FeaturesPlugin/Test/TestFillet_ErrorMsg.py
new file mode 100644 (file)
index 0000000..4527420
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-30, 5, 15)
+SketchLine_1 = Sketch_1.addLine(60, -30, 15, -30)
+SketchLine_2 = Sketch_1.addLine(15, -30, 15, 15)
+SketchLine_3 = Sketch_1.addLine(15, 15, 60, 15)
+SketchLine_4 = Sketch_1.addLine(60, 15, 60, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")], 2)
+assert(Fillet_1.feature().error() != "")
+Part_1_doc.removeFeature(Fillet_1.feature())
+
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_2/To_Face")], 2)
+assert(Fillet_1.feature().error() != "")
+Part_1_doc.removeFeature(Fillet_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestFillet_History.py b/src/FeaturesPlugin/Test/TestFillet_History.py
new file mode 100644 (file)
index 0000000..45f17b0
--- /dev/null
@@ -0,0 +1,83 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that the history of Fillet operation works correctly after movement of groups after this Fillet feature:
+# Faces are modified, edges that were used for fillet are removed
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(23.0955987576144, 26.85924638608351, -23.50862068965518, 26.85924638608351)
+SketchLine_2 = Sketch_1.addLine(-23.50862068965518, 26.85924638608351, -23.50862068965518, -11.11713209726581)
+SketchLine_3 = Sketch_1.addLine(-23.50862068965518, -11.11713209726581, 23.0955987576144, -11.11713209726581)
+SketchLine_4 = Sketch_1.addLine(23.0955987576144, -11.11713209726581, 23.0955987576144, 26.85924638608351)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_4")
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(2.024890803123894, -11.11713209726581, 23.0955987576144, 26.85924638608351)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_6")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_3.result())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_5")
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_7")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchLine_4f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5f")], model.selection(), 10, 0)
+Group_1_objects = [model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1_2/To_Face"), model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
+Group_2_objects = [model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1_2/To_Face]")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Fillet_1_objects = [model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/To_Face]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1_2/From_Face]")]
+Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2)
+model.do()
+# move groups after the Fillet
+Part_1_doc.moveFeature(Group_1.feature(), Fillet_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 3)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(3):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 2)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(2):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.EDGE)
+
+assert(model.checkPythonDump())
index 810d548dbd7149384efd1924c50c4bdaf06e582f..3fb85fd003103f8c23ffcf3f13e371f1537b2678 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -33,7 +34,7 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 10)
 
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Translation_1_1/Translated_Face_1")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Translation_1_1/MF:Translated&Box_2_1/Top")])
 model.do()
 
 model.checkResult(Shell_1, model, 1, [0], [0], [2], [8], [16])
diff --git a/src/FeaturesPlugin/Test/TestFusionFaces2697.py b/src/FeaturesPlugin/Test/TestFusionFaces2697.py
new file mode 100644 (file)
index 0000000..c84cd29
--- /dev/null
@@ -0,0 +1,264 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1.setName("Part_4")
+Part_1.result().setName("Part_4")
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(6.187999999999998, 10.256, 4.9175, 10.94235984621995)
+SketchLine_1.setName("SketchLine_11")
+SketchLine_1.result().setName("SketchLine_11")
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_2 = SketchProjection_1.createdFeature()
+SketchLine_2.setName("SketchLine_12")
+SketchLine_2.result().setName("SketchLine_12")
+SketchArc_1 = Sketch_1.addArc(0, 2.425, 0, 12.26, 4.9175, 10.94235984621995, True)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.center())
+SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_11")
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_12")
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchArc_1.endPoint())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_13")
+SketchLine_3 = Sketch_1.addLine(0, 12.26, 0, 12.096)
+SketchLine_3.setName("SketchLine_13")
+SketchLine_3.result().setName("SketchLine_13")
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_14")
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_4 = SketchProjection_2.createdFeature()
+SketchLine_4.setName("SketchLine_17")
+SketchLine_4.result().setName("SketchLine_17")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_2.result())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_20")
+SketchLine_5 = Sketch_1.addLine(5.404900443923878, 10.43809443685872, 5.12663857042824, 10.62933672216996)
+SketchLine_5.setName("SketchLine_23")
+SketchLine_5.result().setName("SketchLine_23")
+SketchLine_6 = Sketch_1.addLine(5.12663857042824, 10.62933672216996, 4.835500000000001, 10.80033167999931)
+SketchLine_6.setName("SketchLine_24")
+SketchLine_6.result().setName("SketchLine_24")
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_31")
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), "0.082*2")
+SketchConstraintLength_1.setName("SketchConstraintLength_3")
+SketchArc_2 = Sketch_1.addArc(0, 2.425, 0, 12.096, 4.835500000000001, 10.80033167999931, True)
+SketchArc_2.setName("SketchArc_3")
+SketchArc_2.result().setName("SketchArc_3")
+SketchArc_2.results()[1].setName("SketchArc_3_2")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.center(), SketchArc_2.center())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_32")
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchArc_2.startPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_33")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchArc_2.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_34")
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_4.result(), 2.425, True)
+SketchConstraintDistance_1.setName("SketchConstraintDistance_11")
+SketchLine_7 = Sketch_1.addLine(0, 2.425, 5.524022094217663, 10.61469954608912)
+SketchLine_7.setName("SketchLine_28")
+SketchLine_7.result().setName("SketchLine_28")
+SketchLine_7.setAuxiliary(True)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_43")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_1.result())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_44")
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_7.result(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_45")
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_7.result(), SketchLine_2.result(), 34)
+SketchConstraintAngle_1.setName("SketchConstraintAngle_5")
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_1.result(), "0.088*2", True)
+SketchConstraintDistance_2.setName("SketchConstraintDistance_12")
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 9.835000000000001)
+SketchConstraintRadius_1.setName("SketchConstraintRadius_2")
+SketchLine_8 = Sketch_1.addLine(5.404900443923878, 10.43809443685872, 6.187999999999998, 10.256)
+SketchLine_8.setName("SketchLine_19")
+SketchLine_8.result().setName("SketchLine_19")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_46")
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_47")
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_11r-SketchArc_1_2f-SketchLine_13f-SketchArc_3_2r-SketchLine_24r-SketchLine_23r-SketchLine_19f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_9 = Sketch_2.addLine(0, 2.425, 3.282538500974061, 11.74164236673401)
+SketchLine_9.setName("SketchLine_34")
+SketchLine_9.result().setName("SketchLine_34")
+SketchLine_9.setAuxiliary(True)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_28_StartVertex"), False)
+SketchPoint_1 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_55")
+SketchPoint_2 = Sketch_2.addPoint(3.241, 11.6237460014939)
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchLine_9.result())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_56")
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
+SketchLine_10 = SketchProjection_4.createdFeature()
+SketchLine_10.setName("SketchLine_36")
+SketchLine_10.result().setName("SketchLine_36")
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchPoint_2.coordinates(), SketchLine_10.result(), 3.241, True)
+SketchConstraintDistance_3.setName("SketchConstraintDistance_17")
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_13"), False)
+SketchLine_11 = SketchProjection_5.createdFeature()
+SketchLine_11.setName("SketchLine_37")
+SketchLine_11.result().setName("SketchLine_37")
+SketchProjection_6 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_28"), False)
+SketchLine_12 = SketchProjection_6.createdFeature()
+SketchLine_12.setName("SketchLine_38")
+SketchLine_12.result().setName("SketchLine_38")
+SketchArc_3 = Sketch_2.addArc(0, 2.425, 0, 12.178, 5.453808387550194, 10.51060344512932, True)
+SketchArc_3.setName("SketchArc_4")
+SketchArc_3.result().setName("SketchArc_4")
+SketchArc_3.results()[1].setName("SketchArc_4_2")
+SketchArc_3.setAuxiliary(True)
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchArc_3.center())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_58")
+SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_11.result(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_59")
+SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchLine_12.result(), SketchArc_3.endPoint())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_60")
+SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchLine_11.result(), SketchArc_3.startPoint())
+SketchConstraintMiddle_1.setName("SketchConstraintMiddle_3")
+SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchPoint_2.coordinates(), SketchArc_3.results()[1])
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_61")
+SketchArc_4 = Sketch_2.addArc(0, 2.425, 3.28253850097406, 11.74164236673401, 4.139817701932777, 11.39365616437401, True)
+SketchArc_4.setName("SketchArc_5")
+SketchArc_4.result().setName("SketchArc_5")
+SketchArc_4.results()[1].setName("SketchArc_5_2")
+SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchArc_4.center())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_62")
+SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_9.result(), SketchArc_4.startPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_63")
+SketchLine_13 = Sketch_2.addLine(4.139817701932777, 11.39365616437401, 4.459277785066624, 11.1909606795611)
+SketchLine_13.setName("SketchLine_39")
+SketchLine_13.result().setName("SketchLine_39")
+SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchArc_4.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_64")
+SketchProjection_7 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_1_2"), False)
+SketchArc_5 = SketchProjection_7.createdFeature()
+SketchArc_5.setName("SketchArc_6")
+SketchArc_5.result().setName("SketchArc_6")
+SketchArc_5.results()[1].setName("SketchArc_6_2")
+SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchArc_5.results()[1])
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_65")
+SketchLine_14 = Sketch_2.addLine(4.459277785066624, 11.1909606795611, 4.390495384356073, 11.041947909785)
+SketchLine_14.setName("SketchLine_40")
+SketchLine_14.result().setName("SketchLine_40")
+SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_66")
+SketchProjection_8 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchArc_3_2"), False)
+SketchArc_6 = SketchProjection_8.createdFeature()
+SketchArc_6.setName("SketchArc_7")
+SketchArc_6.result().setName("SketchArc_7")
+SketchArc_6.results()[1].setName("SketchArc_7_2")
+SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchArc_6.results()[1])
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_67")
+SketchLine_15 = Sketch_2.addLine(4.390495384356073, 11.041947909785, 4.035044020470619, 11.16667053559354)
+SketchLine_15.setName("SketchLine_41")
+SketchLine_15.result().setName("SketchLine_41")
+SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_68")
+SketchArc_7 = Sketch_2.addArc(0, 2.425, 3.199461499025941, 11.5058496362538, 4.035044020470619, 11.16667053559354, True)
+SketchArc_7.setName("SketchArc_8")
+SketchArc_7.result().setName("SketchArc_8")
+SketchArc_7.results()[1].setName("SketchArc_8_2")
+SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchArc_7.center())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_69")
+SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchLine_9.result(), SketchArc_7.startPoint())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_70")
+SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchArc_7.endPoint(), SketchLine_15.endPoint())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_71")
+SketchLine_16 = Sketch_2.addLine(0, 2.425, 4.139817701932777, 11.39365616437401)
+SketchLine_16.setName("SketchLine_42")
+SketchLine_16.result().setName("SketchLine_42")
+SketchLine_16.setAuxiliary(True)
+SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchLine_16.startPoint())
+SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_72")
+SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchArc_4.endPoint(), SketchLine_16.endPoint())
+SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_73")
+SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchArc_7.endPoint(), SketchLine_16.result())
+SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_74")
+SketchConstraintParallel_1 = Sketch_2.setParallel(SketchLine_14.result(), SketchLine_16.result())
+SketchLine_17 = Sketch_2.addLine(0, 2.425, 3.9115060144283, 11.49555702253678)
+SketchLine_17.setName("SketchLine_43")
+SketchLine_17.result().setName("SketchLine_43")
+SketchLine_17.setAuxiliary(True)
+SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchLine_17.startPoint())
+SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_75")
+SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchArc_4.results()[1])
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_76")
+SketchPoint_3 = Sketch_2.addPoint(3.812510620258724, 11.26599240868436)
+SketchConstraintCoincidence_36 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_17.result())
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_77")
+SketchConstraintCoincidence_37 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchArc_7.results()[1])
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_78")
+SketchLine_18 = Sketch_2.addLine(3.812510620258724, 11.26599240868436, 3.9115060144283, 11.49555702253678)
+SketchLine_18.setName("SketchLine_44")
+SketchLine_18.result().setName("SketchLine_44")
+SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchPoint_3.coordinates(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_79")
+SketchConstraintCoincidence_39 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchLine_18.endPoint())
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_80")
+SketchPoint_4 = Sketch_2.addPoint(3.862008317343517, 11.38077471561057)
+SketchConstraintCoincidence_40 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchLine_18.result())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_81")
+SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchPoint_4.coordinates(), SketchLine_18.result())
+SketchConstraintMiddle_2.setName("SketchConstraintMiddle_4")
+SketchConstraintCoincidence_41 = Sketch_2.setCoincident(SketchPoint_4.coordinates(), SketchArc_3.results()[1])
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_82")
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_18.endPoint(), SketchLine_16.result(), 0.25, True)
+SketchConstraintDistance_4.setName("SketchConstraintDistance_18")
+SketchConstraintDistance_5 = Sketch_2.setDistance(SketchArc_4.endPoint(), SketchLine_14.result(), 0.375, True)
+SketchConstraintDistance_5.setName("SketchConstraintDistance_19")
+SketchConstraintDistance_6 = Sketch_2.setDistance(SketchArc_4.startPoint(), SketchLine_18.result(), "1.35/2", True)
+SketchConstraintDistance_6.setName("SketchConstraintDistance_20")
+SketchConstraintDistance_7 = Sketch_2.setDistance(SketchArc_7.startPoint(), SketchArc_4.startPoint(), 0.25, True)
+SketchConstraintDistance_7.setName("SketchConstraintDistance_21")
+SketchConstraintCoincidence_42 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchArc_4.startPoint())
+SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_83")
+SketchLine_19 = Sketch_2.addLine(3.199461499025942, 11.5058496362538, 3.28253850097406, 11.74164236673401)
+SketchLine_19.setName("SketchLine_45")
+SketchLine_19.result().setName("SketchLine_45")
+SketchConstraintCoincidence_43 = Sketch_2.setCoincident(SketchArc_7.startPoint(), SketchLine_19.startPoint())
+SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_84")
+SketchConstraintCoincidence_44 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_19.endPoint())
+SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_85")
+model.do()
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_45r-SketchArc_8_2r-SketchLine_44f")], model.selection("EDGE", "Sketch_2/SketchLine_34"), 360, 0)
+Revolution_2.result().setName("Cut_tool")
+Revolution_3 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_44r-SketchArc_8_2r-SketchLine_41r-SketchLine_40r-SketchLine_39r")], model.selection("EDGE", "Sketch_2/SketchLine_34"), 360, 0)
+Revolution_3.result().setName("Fuse_tool")
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cut_tool"), model.selection("SOLID", "Fuse_tool")], model.selection("EDGE", "PartSet/OZ"), True)
+Symmetry_1.result().subResult(0).setName("Symmetry_1_1_1")
+Symmetry_1.result().subResult(1).setName("Symmetry_1_1_2")
+Symmetry_1.results()[1].subResult(0).setName("Symmetry_1_2_1")
+Symmetry_1.results()[1].subResult(1).setName("Symmetry_1_2_2")
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("COMPOUND", "Cut_tool")])
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("COMPOUND", "Fuse_tool")])
+FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Fuse_1_1"))
+model.end()
+
+# check the faces are fused
+model.checkResult(FusionFaces_1, model, 1, [0], [1], [16], [76], [152])
index ea47ba331366afb14fc08647e9e4c750ba191993..0d73a592e3364fdce2575e2a010476829d6fe731 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -62,23 +61,15 @@ aSession.finishOperation()
 # Make extrusion on circle 1
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -116,23 +107,15 @@ aSession.finishOperation()
 # Make extrusion on circle 2
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
diff --git a/src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py b/src/FeaturesPlugin/Test/TestIntersection_ErrorMsg.py
new file mode 100644 (file)
index 0000000..b96e2ec
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(10, -20, 15)
+model.do()
+
+Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+assert(Intersection_1.feature().error() != "")
+Part_1_doc.removeFeature(Intersection_1.feature())
+
+model.end()
index bec25e1c22ec4a1e544afc74a0a15edb51fb6a5c..87bc2a9a9aaa6e293da16b96e4be4e2382a3c121 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -28,9 +29,9 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-ParamR = model.addParameter(Part_1_doc, "R", "50")
-ParamL = model.addParameter(Part_1_doc, "L", "40")
-ParamH = model.addParameter(Part_1_doc, "H", "20")
+model.addParameter(Part_1_doc, "R", "50")
+model.addParameter(Part_1_doc, "L", "40")
+model.addParameter(Part_1_doc, "H", "20")
 Point_2 = model.addPoint(Part_1_doc, 0, 100, 100)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False)
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
@@ -59,8 +60,8 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchLine_7 = Sketch_2.addLine(119.1454520140253, 130.0744845530344, 10, 0)
 SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_8 = SketchProjection_3.createdFeature()
@@ -72,14 +73,14 @@ model.do()
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchLine_6", [90]),
-            ("Extrusion_1_1/Generated_Face_5", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [45]),
-            ("Sketch_1/Edge-SketchCircle_1_2", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [0]),
-            ("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchCircle_1_2", []),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", []),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_4", [130]),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_1", [40]),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [121.21205374, 84.80231126])
+REF_DATA = [("Sketch_1/SketchLine_3", "Sketch_1/SketchLine_6", [90]),
+            ("([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [45]),
+            ("Sketch_1/SketchCircle_1_2", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [0]),
+            ("Sketch_1/SketchLine_3", "Sketch_1/SketchCircle_1_2", []),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", []),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", [130]),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]", [40]),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [121.21205374, 84.80231126])
            ]
 
 for ref in REF_DATA:
@@ -89,7 +90,7 @@ for ref in REF_DATA:
         assert(math.fabs(a - r) < TOLERANCE), "Angle {} differs from expected value {}".format(a, r)
 
 # select incorrect data
-angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"))
+angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("EDGE", "Sketch_2/SketchLine_7"))
 assert(angle.size() == 0)
 
 model.end()
index c3f7fcc8e9aa553cf4a48b7985e03e3113ad4118..d610037c44bc61db31f98aeb7116245bccded129 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -55,43 +56,43 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), 100, 0)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
+REF_DATA = [("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
              60),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              104.9068234),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              90),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
              52.91916441),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
              0)
            ]
 
@@ -100,7 +101,7 @@ for ref in REF_DATA:
     assert(math.fabs(angle - ref[3]) < TOLERANCE), "Angle {} differs from expected value {}".format(angle, ref[3])
 
 # select incorrect data
-angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"))
+angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"))
 assert(angle == -1.0)
 
 angle = model.measureAngle(Part_1_doc, model.selection("VERTEX", ""), model.selection("VERTEX", ""), model.selection("VERTEX", ""))
index c2b7d0a6a6f28425edfc8914e2e35668af114318..33f942ee50aea156008ccfdddda70b1f1fe3ccd9 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -26,9 +27,9 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-ParamR = model.addParameter(Part_1_doc, "R", "50")
-ParamL = model.addParameter(Part_1_doc, "L", "40")
-ParamH = model.addParameter(Part_1_doc, "H", "20")
+model.addParameter(Part_1_doc, "R", "50")
+model.addParameter(Part_1_doc, "L", "40")
+model.addParameter(Part_1_doc, "H", "20")
 Point_2 = model.addPoint(Part_1_doc, 0, 100, 100)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False)
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
@@ -57,7 +58,7 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchArc_1 = Sketch_2.addArc(100, 48.41229182762603, 87.5, 0, 87.5, 96.82458365525073, False)
 SketchArc_2 = Sketch_2.addArc(0, 48.41229182762603, 87.5, 0, 87.5, 96.82458365525073, False)
@@ -87,34 +88,34 @@ TOLERANCE = 1.e-6
 
 # reference data
 REF_DATA = [(model.selection("VERTEX", "PartSet/Origin"),
-             model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"),
+             model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"),
              122.4744871),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"),
-             model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_1-SketchLine_7e"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"),
+             model.selection("VERTEX", "Sketch_2/SketchArc_1"),
              36.94403089),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("EDGE", "Extrusion_1_1/Generated_Face_5"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("EDGE", "([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])"),
              0),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("EDGE", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/To_Face_1"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2][Extrusion_2_1/To_Face]"),
              16.00781059),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2"),
              8.412291828),
-            (model.selection("VERTEX", "Sketch_1/Vertex-SketchCircle_1"),
+            (model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"),
              model.selection("FACE", "Plane_1"),
              35.35533906),
-            (model.selection("FACE", "Extrusion_2_2/From_Face_1"),
-             model.selection("FACE", "Extrusion_2_2/To_Face_1"),
+            (model.selection("FACE", "Extrusion_2_2/From_Face"),
+             model.selection("FACE", "Extrusion_2_2/To_Face"),
              100),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"),
-             model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"),
+             model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2"),
              0),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"),
-             model.selection("FACE", "Extrusion_1_1/Generated_Face_2"),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"),
+             model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"),
              27.63932023),
             (model.selection("SOLID", "Extrusion_1_1"),
-             model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+             model.selection("FACE", "Extrusion_2_1/To_Face"),
              12.5),
             (model.selection("SOLID", "Extrusion_1_1"),
              model.selection("SOLID", "Extrusion_2_1"),
index f557f8fde98eda4ba75723e1a709062c4b95a739..2b02575e1384aaa493854fb7f989432f841af34f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -57,20 +58,20 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_1", ParamH.value()),
-            ("Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_4", ParamL.value()),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1", ParamR.value() * 2.0 * math.pi),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", 381.981436664),
-            ("Extrusion_1_1/Generated_Face_5", 60),
-            ("Sketch_1/Edge-SketchLine_3", ParamL.value()),
-            ("Sketch_1/Edge-SketchLine_4", ParamH.value()),
-            ("Sketch_1/Edge-SketchCircle_1_2", ParamR.value() * 2.0 * math.pi)
+REF_DATA = [("[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]", ParamH.value()),
+            ("[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", ParamL.value()),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]", ParamR.value() * 2.0 * math.pi),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", 381.981436664),
+            ("([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])", 60),
+            ("Sketch_1/SketchLine_3", ParamL.value()),
+            ("Sketch_1/SketchLine_4", ParamH.value()),
+            ("Sketch_1/SketchCircle_1_2", ParamR.value() * 2.0 * math.pi)
            ]
 
 for ref in REF_DATA:
@@ -78,7 +79,7 @@ for ref in REF_DATA:
     assert(math.fabs(length - ref[1]) < TOLERANCE), "Length {} differs from expected value {}".format(length, ref[1])
 
 # select incorrect data
-length = model.measureLength(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_5"))
+length = model.measureLength(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"))
 assert(length == -1)
 
 model.end()
diff --git a/src/FeaturesPlugin/Test/TestMeasurementPresentation.py b/src/FeaturesPlugin/Test/TestMeasurementPresentation.py
new file mode 100644 (file)
index 0000000..1e3cd51
--- /dev/null
@@ -0,0 +1,97 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+from ConfigAPI import *
+Config_PropManager().registerProp("Visualization", "dimension_value_size", "Dimension value size", Config_Prop.IntSpin, "16")
+Config_PropManager().registerProp("Visualization", "dimension_arrow_size", "Dimension arrow size", Config_Prop.IntSpin, "16")
+Config_PropManager().registerProp("Visualization", "dimension_font", "Dimension font", Config_Prop.String, "Times-bold")
+Config_PropManager().registerProp("Visualization", "sketch_dimension_color", "Dimension color", Config_Prop.Color, "64,128,225")
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-15.79157881408318, 17.46869043106789, -28.20135254460625, -14.21916935022164)
+SketchLine_2 = Sketch_1.addLine(-28.20135254460625, -14.21916935022164, 5.332188506333114, -12.56026625936245)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchArc_1 = Sketch_1.addArc(-8.886980843888518, -0.1184930779185158, 5.332188506333114, -12.56026625936245, -15.79157881408318, 17.46869043106789, False)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_1.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchArc_1.endPoint())
+model.do()
+model.end()
+
+from ModelAPI import *
+
+aSession = ModelAPI_Session.get()
+aSession.startOperation()
+aMeasurement = Part_1_doc.addFeature("Measurement")
+aMeasurement.string("MeasureKind").setValue("Length")
+aMeasurement.selection("edge_for_length").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aMeasurement = Part_1_doc.addFeature("Measurement")
+aMeasurement.string("MeasureKind").setValue("Distance")
+aMeasurement.selection("distance_from").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_StartVertex")
+aMeasurement.selection("distance_to").selectSubShape("EDGE", "Sketch_1/SketchLine_2")
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aMeasurement = Part_1_doc.addFeature("Measurement")
+aMeasurement.string("MeasureKind").setValue("Radius")
+aMeasurement.selection("circular").selectSubShape("EDGE", "Sketch_1/SketchArc_1_2")
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aMeasurement = Part_1_doc.addFeature("Measurement")
+aMeasurement.string("MeasureKind").setValue("Angle")
+aMeasurement.selection("angle_from").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
+aMeasurement.selection("angle_to").selectSubShape("EDGE", "Sketch_1/SketchLine_2")
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
+aSession.finishOperation()
+
+aSession.startOperation()
+aMeasurement = Part_1_doc.addFeature("Measurement")
+aMeasurement.string("MeasureKind").setValue("AngleBy3Points")
+aMeasurement.selection("angle_point_1").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_StartVertex")
+aMeasurement.selection("angle_point_2").selectSubShape("VERTEX", "Sketch_1/SketchLine_1_EndVertex")
+aMeasurement.selection("angle_point_3").selectSubShape("VERTEX", "Sketch_1/SketchLine_2_EndVertex")
+anAIS = featureToPresentation(aMeasurement).getAISObject(None)
+assert(anAIS is not None)
+anAIS = featureToPresentation(aMeasurement).getAISObject(anAIS)
+assert(anAIS is not None)
+aSession.finishOperation()
index a39927d460e1282450693f3a93fb80355684e0ab..a2441307c21a89cbe4292f5206715748a765c255 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -57,15 +58,15 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [(model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"), ParamR.value()),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"), ParamR.value()),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"), ParamR.value())
+REF_DATA = [(model.selection("EDGE", "Sketch_1/SketchCircle_1_2"), ParamR.value()),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"), ParamR.value()),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"), ParamR.value())
            ]
 
 for ref in REF_DATA:
@@ -73,7 +74,7 @@ for ref in REF_DATA:
     assert(math.fabs(radius - ref[1]) < TOLERANCE), "Radius {} differs from expected value {}".format(radius, ref[1])
 
 # select incorrect data
-radius = model.measureRadius(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+radius = model.measureRadius(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 assert(radius == -1)
 
 model.end()
index c65d2c4bc550af394621c01be1fc587b0b4bfb47..fce6e9979cd626e96c5881a0eb6da04c39b3cd92 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestExtrusion.py
@@ -96,30 +95,17 @@ aSession.startOperation()
 
 anExtrusions = []
 for i in range(0, N * N):
-    aSketchResult = aSketchFeatures[i].firstResult()
-    aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-    origin = geomDataAPI_Point(aSketchFeatures[i].attribute("Origin")).pnt()
-    dirX = geomDataAPI_Dir(aSketchFeatures[i].attribute("DirX")).dir()
-    norm = geomDataAPI_Dir(aSketchFeatures[i].attribute("Norm")).dir()
-    aSketchFaces = ShapeList()
-    GeomAlgoAPI_SketchBuilder.createFaces(
-        origin, dirX, norm, aSketchEdges, aSketchFaces)
-
+    aSketchResult = modelAPI_ResultConstruction(aSketchFeatures[i].firstResult())
     anExtrusionFt = aPart.addFeature("Extrusion")
     assert (anExtrusionFt.getKind() == "Extrusion")
 
     anExtrusionFt.selectionList("base").append(
-        aSketchResult, aSketchFaces[0])
+        aSketchResult, aSketchResult.face(0))
     anExtrusionFt.string("CreationMethod").setValue("BySizes")
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(10)
     anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
     anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
-    # v1.0.2 from master
-    # anExtrusionFt.selection("extrusion_face").setValue(
-    #    aSketchResult, aSketchFaces[0])
-    # anExtrusionFt.real("extrusion_size").setValue(10)
-    # anExtrusionFt.boolean("extrusion_reverse").setValue(False)
     anExtrusions.append(anExtrusionFt)
 
 aSession.finishOperation()
@@ -162,28 +148,16 @@ aSession.startOperation()
 #=========================================================================
 # Build a big box extrusion
 #=========================================================================
-aSketchResult = aQuadrangleSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-origin = geomDataAPI_Point(aQuadrangleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("Norm")).dir()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aSketchEdges, aSketchFaces)
+aSketchResult = modelAPI_ResultConstruction(aQuadrangleSketchFeature.firstResult())
 # Create extrusion on them
 aBox = aPart.addFeature("Extrusion")
 aBox.selectionList("base").append(
-    aSketchResult, aSketchFaces[0])
+    aSketchResult, aSketchResult.face(0))
 aBox.string("CreationMethod").setValue("BySizes")
 aBox.real("from_size").setValue(0)
 aBox.real("to_size").setValue(10)
 aBox.real("to_offset").setValue(0) #TODO: remove
 aBox.real("from_offset").setValue(0) #TODO: remove
-# v 1.0.2 from master
-# aBox.selection("extrusion_face").setValue(
-#     aSketchResult, aSketchFaces[0])
-# aBox.real("extrusion_size").setValue(10)
-# aBox.boolean("extrusion_reverse").setValue(False)
 
 aSession.finishOperation()
 
diff --git a/src/FeaturesPlugin/Test/TestMultiRotation_ErrorMsg.py b/src/FeaturesPlugin/Test/TestMultiRotation_ErrorMsg.py
new file mode 100644 (file)
index 0000000..ef4106f
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompound.selectionList("base_objects").append("Box_1_1", "SOLID")
+aSession.finishOperation()
+
+
+aSession.startOperation()
+anAngularCopy1 = aPart.addFeature("AngularCopy")
+anAngularCopy1.execute()
+assert(anAngularCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+anAngularCopy1.selectionList("main_objects").append("Compound_1_1", "COMPOUND")
+anAngularCopy1.execute()
+assert(anAngularCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+anAngularCopy1.selection("axis_angular").selectSubShape("COMPOUND", "Compound_1_1")
+anAngularCopy1.execute()
+assert(anAngularCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+anAngularCopy1.selection("axis_angular").selectSubShape("EDGE", "PartSet/OX")
+anAngularCopy1.integer("nb_angular").setValue(0)
+anAngularCopy1.execute()
+assert(anAngularCopy1.error() != "")
+aSession.finishOperation()
diff --git a/src/FeaturesPlugin/Test/TestMultiRotation_Part.py b/src/FeaturesPlugin/Test/TestMultiRotation_Part.py
new file mode 100644 (file)
index 0000000..669c8c6
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+AngularCopy_1 = model.addMultiRotation(partSet, [model.selection("COMPOUND", "Part_1/")], model.selection("EDGE", "OZ"), 2)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(AngularCopy_1, 2)
+model.testNbSubResults(AngularCopy_1, [0, 0])
+model.testNbSubShapes(AngularCopy_1, GeomAPI_Shape.SOLID, [1, 1])
+model.testNbSubShapes(AngularCopy_1, GeomAPI_Shape.FACE, [6, 6])
+model.testNbSubShapes(AngularCopy_1, GeomAPI_Shape.EDGE, [24, 24])
+model.testNbSubShapes(AngularCopy_1, GeomAPI_Shape.VERTEX, [48, 48])
+model.testResultsVolumes(AngularCopy_1, [1000, 1000])
diff --git a/src/FeaturesPlugin/Test/TestMultiTranslation_ErrorMsg.py b/src/FeaturesPlugin/Test/TestMultiTranslation_ErrorMsg.py
new file mode 100644 (file)
index 0000000..e1011ee
--- /dev/null
@@ -0,0 +1,113 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create auxiliary box
+aSession.startOperation()
+aBox = aPart.addFeature("Box")
+aBox.string("CreationMethod").setValue("BoxByDimensions")
+aBox.real("dx").setValue(50)
+aBox.real("dy").setValue(50)
+aBox.real("dz").setValue(50)
+aSession.finishOperation()
+
+# Create auxiliary compound
+aSession.startOperation()
+aCompound = aPart.addFeature("Compound")
+aCompound.selectionList("base_objects").append("Box_1_1", "SOLID")
+aSession.finishOperation()
+
+
+aSession.startOperation()
+aLinearCopy1 = aPart.addFeature("LinearCopy")
+aLinearCopy1.execute()
+assert(aLinearCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy1.selectionList("main_objects").append("Compound_1_1", "COMPOUND")
+aLinearCopy1.execute()
+assert(aLinearCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy1.selection("axis_first_dir").selectSubShape("COMPOUND", "Compound_1_1")
+aLinearCopy1.execute()
+assert(aLinearCopy1.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy1.selection("axis_first_dir").selectSubShape("EDGE", "PartSet/OX")
+aLinearCopy1.integer("nb_first_dir").setValue(2)
+aLinearCopy1.execute()
+assert(aLinearCopy1.error() != "")
+aSession.finishOperation()
+
+
+aSession.startOperation()
+aLinearCopy2 = aPart.addFeature("LinearCopy")
+aLinearCopy2.string("use_second_dir").setValue("true")
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy2.selectionList("main_objects").append("Compound_1_1", "COMPOUND")
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy2.selection("axis_first_dir").selectSubShape("COMPOUND", "Compound_1_1")
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy2.selection("axis_first_dir").selectSubShape("EDGE", "PartSet/OX")
+aLinearCopy2.selection("axis_second_dir").selectSubShape("COMPOUND", "Compound_1_1")
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy2.selection("axis_second_dir").selectSubShape("EDGE", "PartSet/OY")
+aLinearCopy2.integer("nb_first_dir").setValue(0)
+aLinearCopy2.integer("nb_second_dir").setValue(0)
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aLinearCopy2.integer("nb_first_dir").setValue(2)
+aLinearCopy2.integer("nb_second_dir").setValue(2)
+aLinearCopy2.execute()
+assert(aLinearCopy2.error() != "")
+aSession.finishOperation()
diff --git a/src/FeaturesPlugin/Test/TestMultiTranslation_Part.py b/src/FeaturesPlugin/Test/TestMultiTranslation_Part.py
new file mode 100644 (file)
index 0000000..41cacb8
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+LinearCopy_1 = model.addMultiTranslation(partSet, [model.selection("COMPOUND", "Part_1/")], model.selection("EDGE", "OZ"), 20, 2)
+LinearCopy_2 = model.addMultiTranslation(partSet, [model.selection("COMPOUND", "LinearCopy_1/")], model.selection("EDGE", "OX"), 20, 2, model.selection("EDGE", "OY"), 20, 2)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(LinearCopy_1, 2)
+model.testNbSubResults(LinearCopy_1, [0, 0])
+model.testNbSubShapes(LinearCopy_1, GeomAPI_Shape.SOLID, [1, 1])
+model.testNbSubShapes(LinearCopy_1, GeomAPI_Shape.FACE, [6, 6])
+model.testNbSubShapes(LinearCopy_1, GeomAPI_Shape.EDGE, [24, 24])
+model.testNbSubShapes(LinearCopy_1, GeomAPI_Shape.VERTEX, [48, 48])
+model.testResultsVolumes(LinearCopy_1, [1000, 1000])
+
+model.testNbResults(LinearCopy_2, 4)
+model.testNbSubResults(LinearCopy_2, [0, 0, 0, 0])
+model.testNbSubShapes(LinearCopy_2, GeomAPI_Shape.SOLID, [1, 1, 1, 1])
+model.testNbSubShapes(LinearCopy_2, GeomAPI_Shape.FACE, [6, 6, 6, 6])
+model.testNbSubShapes(LinearCopy_2, GeomAPI_Shape.EDGE, [24, 24, 24, 24])
+model.testNbSubShapes(LinearCopy_2, GeomAPI_Shape.VERTEX, [48, 48, 48, 48])
+model.testResultsVolumes(LinearCopy_2, [1000, 1000, 1000, 1000])
index 6380b00947ee10d65d37165cd4772de5cac0dfb9..c91be933a387e2abda7a5772fe7a24ede35da70e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -64,23 +63,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
index dc64bef78f08cd4bda28470b5b29a13697fc2ba5..488a639bf82467db07da0a8a21f3d9fb0ded76a0 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -42,8 +42,9 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_2.addCircle(64.38749999999999, 45.44999999999999, 41.86298795836804)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_1_2")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1")])
 model.do()
 
index fac8630ee577a4c4e671002b35c903b578081f0c..c5a38d941331dfe11b119fdc056911769385c170 100644 (file)
@@ -1,33 +1,30 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
-from GeomAPI import GeomAPI_Shape
 
 model.begin()
-#Create part
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-#Create Sketch_1 - closed polyline from 5 segments
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_1 = Sketch_1.addLine(-43.90694444444443, 28.05555555555554, 19.21805555555554, 72.66388888888889)
 SketchLine_2 = Sketch_1.addLine(19.21805555555554, 72.66388888888889, 82.06249999999999, -36.19166666666666)
@@ -40,10 +37,8 @@ SketchLine_5 = Sketch_1.addLine(-45.87083333333333, -45.44999999999999, -43.9069
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_5.endPoint())
 model.do()
-#Create Extrusion_1 on Sketch_1
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r")], model.selection(), 100, 0)
-#Create Sketch_2 from 5 segments
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 100, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"))
 SketchLine_6 = Sketch_2.addLine(74.07000206783135, -18.10965884648514, 62.37497281453477, -31.70853007124862)
 SketchLine_7 = Sketch_2.addLine(62.37497281453477, -31.70853007124862, 37.35304976096997, -31.43655264675337)
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
@@ -55,9 +50,7 @@ SketchLine_10 = Sketch_2.addLine(69.44638585141178, 6.640286782584385, 74.070002
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchLine_10.endPoint())
 model.do()
-#Create Extrusion_2 on Sketch_2
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r")], model.selection(), 10, 160)
-#Create Partition on objects Extrusion_1 and Extrusion_2
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r")], model.selection(), 10, 160)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
 model.do()
 
index 01eb2c1e52b06080c84cc5acd86f6f41c679f6e1..cf198aaccdfe217f1673f6408544f56c153ebf02 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -49,8 +49,10 @@ SketchLine_9 = Sketch_2.addLine(30.30743587791019, -67.62202818906478, 1.8947624
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_9.endPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_1_2")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_6")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchArc_1_2")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Wire_2_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_6")]
+Wire_2 = model.addWire(Part_1_doc, Wire_2_objects)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("WIRE", "Wire_2_1"), model.selection("WIRE", "Wire_1_1")])
 model.do()
 
diff --git a/src/FeaturesPlugin/Test/TestPartitionArgsUpdate.py b/src/FeaturesPlugin/Test/TestPartitionArgsUpdate.py
new file mode 100644 (file)
index 0000000..fb133f2
--- /dev/null
@@ -0,0 +1,269 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that append a new element to the end of Partition attributes does not
+# change the previous partition results selection..
+# Based on the CEA report mail 04.12.2018, page 7
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "ep_base", "0.65")
+model.addParameter(Part_1_doc, "ep_voiles", "0.1")
+model.addParameter(Part_1_doc, "ep_poteau", "0.15")
+model.addParameter(Part_1_doc, "h_ouverture", "0.95")
+model.addParameter(Part_1_doc, "h_apres_ouverture", "0.6")
+model.addParameter(Part_1_doc, "ep_dalles", "0.12")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(0.275, 3.325, -0.375, 3.325)
+SketchLine_2 = Sketch_1.addLine(-0.375, 3.325, -0.375, -0.325)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-0.375, -0.325, 4.275, -0.325)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(4.275, -0.325, 4.275, 1.325)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(4.275, 1.325, 3.625, 1.325)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(3.625, 1.325, 3.625, 0.325)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(3.625, 0.325, 0.275, 0.3250000000000001)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(0.275, 0.3250000000000001, 0.275, 3.325)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_8.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_4.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "ep_base")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 3.65)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 4.65)
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_4.result(), 1.65)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_3.result(), "ep_base", False)
+SketchLine_9 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OX"))
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_9.result(), "0.275+ep_voiles/2", False)
+SketchLine_10 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OY"))
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_10.result(), "0.325+ep_voiles/2", False)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_1.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 0, 0.3)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
+SketchLine_11 = Sketch_2.addLine(2.26, -2.31, 1.64, -2.31)
+SketchLine_12 = Sketch_2.addLine(1.64, -2.31, 1.64, -1.69)
+SketchLine_13 = Sketch_2.addLine(1.64, -1.69, 2.26, -1.69)
+SketchLine_14 = Sketch_2.addLine(2.26, -1.69, 2.26, -2.31)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
+SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_12.result())
+SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result())
+SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result())
+SketchPoint_1 = Sketch_2.addPoint(1.925, -1.875)
+SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_11.result(), 0.62)
+SketchConstraintLength_5.setName("SketchConstraintLength_10")
+SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_11.result(), SketchLine_12.result())
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2", False)
+SketchConstraintDistance_4.setName("SketchConstraintDistance_6")
+SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.21+ep_poteau/2", False)
+SketchConstraintDistance_5.setName("SketchConstraintDistance_7")
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_15 = SketchProjection_1.createdFeature()
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_16 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2", False)
+SketchConstraintDistance_6.setName("SketchConstraintDistance_8")
+SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2", False)
+SketchConstraintDistance_7.setName("SketchConstraintDistance_9")
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r")], model.selection(), 0, 0.02)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f"))
+SketchLine_17 = Sketch_3.addLine(0, 2.950000000000001, 0, 1.700000000000001)
+SketchLine_17.setName("SketchLine_15")
+SketchLine_17.result().setName("SketchLine_15")
+SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OY"))
+SketchLine_18.setName("SketchLine_16")
+SketchLine_18.result().setName("SketchLine_16")
+SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_17.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.result())
+SketchLine_19 = Sketch_3.addLine(0, 1.2, 0, 0)
+SketchLine_19.setName("SketchLine_17")
+SketchLine_19.result().setName("SketchLine_17")
+SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_19.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.result())
+SketchLine_20 = Sketch_3.addLine(0, 0, 0.95, 0)
+SketchLine_20.setName("SketchLine_18")
+SketchLine_20.result().setName("SketchLine_18")
+SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OX"))
+SketchLine_21.setName("SketchLine_19")
+SketchLine_21.result().setName("SketchLine_19")
+SketchLine_22 = Sketch_3.addLine(2.525000000000001, 0, 3.975000000000001, 0)
+SketchLine_22.setName("SketchLine_20")
+SketchLine_22.result().setName("SketchLine_20")
+SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
+SketchLine_23 = Sketch_3.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_23.setName("SketchLine_21")
+SketchLine_23.result().setName("SketchLine_21")
+SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"))
+SketchLine_24.setName("SketchLine_22")
+SketchLine_24.result().setName("SketchLine_22")
+SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_17.result(), 1.25)
+SketchConstraintLength_6.setName("SketchConstraintLength_5")
+SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_19.endPoint())
+SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_19.result(), "1.25-ep_voiles/2")
+SketchConstraintLength_7.setName("SketchConstraintLength_6")
+SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_20.result(), "1-ep_voiles/2")
+SketchConstraintLength_8.setName("SketchConstraintLength_7")
+SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_22.result(), "1.5-ep_voiles/2")
+SketchConstraintLength_9.setName("SketchConstraintLength_8")
+SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_23.result())
+SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
+SketchLine_25.setName("SketchLine_23")
+SketchLine_25.result().setName("SketchLine_23")
+SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2", False)
+SketchConstraintDistance_8.setName("SketchConstraintDistance_5")
+SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_23.result(), "1-ep_voiles/2")
+SketchConstraintLength_10.setName("SketchConstraintLength_9")
+SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
+SketchLine_26.setName("SketchLine_35")
+SketchLine_26.result().setName("SketchLine_35")
+SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 0.375, False)
+SketchConstraintDistance_9.setName("SketchConstraintDistance_12")
+model.do()
+Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_15"), model.selection("EDGE", "Sketch_3/SketchLine_17"), model.selection("EDGE", "Sketch_3/SketchLine_18"), model.selection("EDGE", "Sketch_3/SketchLine_20"), model.selection("EDGE", "Sketch_3/SketchLine_21")]
+Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Extrusion_3_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5")]
+Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchLine_27 = Sketch_4.addLine(0, 2.950000000000001, 0, 0)
+SketchLine_27.setName("SketchLine_26")
+SketchLine_27.result().setName("SketchLine_26")
+SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"))
+SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_27.startPoint(), SketchPoint_2.result())
+SketchPoint_3 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"))
+SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_3.result())
+SketchLine_28 = Sketch_4.addLine(0, 0, 3.975000000000001, 0)
+SketchLine_28.setName("SketchLine_27")
+SketchLine_28.result().setName("SketchLine_27")
+SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
+SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
+SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_4.result())
+SketchLine_29 = Sketch_4.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_29.setName("SketchLine_28")
+SketchLine_29.result().setName("SketchLine_28")
+SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchPoint_5 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_5/Generated_Edge&Sketch_3/SketchLine_21_EndVertex]e[Extrusion_3_5/To_Edge]e"))
+SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchPoint_5.result())
+model.do()
+Edge_2_objects = [model.selection("EDGE", "Sketch_4/SketchLine_26"), model.selection("EDGE", "Sketch_4/SketchLine_27"), model.selection("EDGE", "Sketch_4/SketchLine_28")]
+Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
+Extrusion_4_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3")]
+Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
+SketchLine_30 = Sketch_5.addLine(0, 2.950000000000001, 0, 0)
+SketchLine_30.setName("SketchLine_29")
+SketchLine_30.result().setName("SketchLine_29")
+SketchPoint_6 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchPoint_6.result())
+SketchPoint_7 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_7.result())
+SketchLine_31 = Sketch_5.addLine(0, 0, 3.975000000000001, 0)
+SketchLine_31.setName("SketchLine_30")
+SketchLine_31.result().setName("SketchLine_30")
+SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
+SketchPoint_8 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
+SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_8.result())
+SketchLine_32 = Sketch_5.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_32.setName("SketchLine_31")
+SketchLine_32.result().setName("SketchLine_31")
+SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
+SketchPoint_9 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_3/Generated_Edge&Sketch_4/SketchLine_28_EndVertex]e[Extrusion_4_3/To_Edge]e"))
+SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchPoint_9.result())
+SketchLine_33 = Sketch_5.addLine(3.975000000000001, 0.95, 0, 2.950000000000001)
+SketchLine_33.setName("SketchLine_32")
+SketchLine_33.result().setName("SketchLine_32")
+SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchLine_33.endPoint())
+SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchPoint_6.coordinates(), SketchLine_33.endPoint())
+SketchLine_34 = Sketch_5.addLine(1.85, 2.019182389937107, 1.85, 0)
+SketchLine_34.setName("SketchLine_33")
+SketchLine_34.result().setName("SketchLine_33")
+SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_33.result())
+SketchLine_35 = Sketch_5.addLine(2.075000000000001, 1.905974842767296, 2.075000000000001, 0)
+SketchLine_35.setName("SketchLine_34")
+SketchLine_35.result().setName("SketchLine_34")
+SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchLine_35.startPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_35.endPoint(), SketchLine_31.result())
+SketchConstraintCoincidence_40 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_31.result())
+SketchConstraintVertical_8 = Sketch_5.setVertical(SketchLine_34.result())
+SketchConstraintVertical_9 = Sketch_5.setVertical(SketchLine_35.result())
+SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_30.result(), "1.8+ep_voiles/2", False)
+SketchConstraintDistance_10.setName("SketchConstraintDistance_10")
+SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_35.startPoint(), SketchLine_32.result(), "1.85+ep_voiles/2", False)
+SketchConstraintDistance_11.setName("SketchConstraintDistance_11")
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_29r-SketchLine_30f-SketchLine_33r-SketchLine_32f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_34r-SketchLine_32f-SketchLine_33f_wire")])
+Translation_1_objects = [model.selection("FACE", "Extrusion_4_3"), model.selection("FACE", "Extrusion_3_3"), model.selection("FACE", "Extrusion_4_2"), model.selection("FACE", "Extrusion_3_5"), model.selection("FACE", "Extrusion_3_4"), model.selection("FACE", "Extrusion_3_2"), model.selection("FACE", "Extrusion_4_1"), model.selection("FACE", "Extrusion_3_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_2_1")]
+Translation_1 = model.addTranslation(Part_1_doc, Translation_1_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2")
+Recover_1_objects = [Face_2.result(), Face_3.result(), Face_1.result(), Extrusion_3.result(), Extrusion_4.result(), Extrusion_3.results()[1], Extrusion_3.results()[3], Extrusion_3.results()[4], Extrusion_4.results()[1], Extrusion_3.results()[2], Extrusion_4.results()[2]]
+Recover_1 = model.addRecover(Part_1_doc, Translation_1, Recover_1_objects)
+Translation_2_objects = [model.selection("FACE", "Recover_1_2"), model.selection("FACE", "Recover_1_5"), model.selection("FACE", "Recover_1_3"), model.selection("FACE", "Recover_1_4"), model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_1_6"), model.selection("FACE", "Recover_1_8"), model.selection("FACE", "Recover_1_7"), model.selection("FACE", "Recover_1_11"), model.selection("FACE", "Recover_1_10"), model.selection("FACE", "Recover_1_9")]
+Translation_2 = model.addTranslation(Part_1_doc, Translation_2_objects, model.selection("EDGE", "PartSet/OZ"), "2*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
+Recover_2_objects = [Recover_1.results()[8], Recover_1.results()[9], Recover_1.results()[10], Recover_1.results()[6], Recover_1.results()[7], Recover_1.results()[5], Recover_1.result(), Recover_1.results()[3], Recover_1.results()[2], Recover_1.results()[4], Recover_1.results()[1]]
+Recover_2 = model.addRecover(Part_1_doc, Translation_2, Recover_2_objects)
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_1")])
+Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection("FACE", "Translation_2_11"), 0, model.selection(), 0)
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Translation_1_3"), model.selection("FACE", "Translation_1_4"), model.selection("FACE", "Translation_1_5"), model.selection("FACE", "Translation_1_6"), model.selection("FACE", "Translation_1_7"), model.selection("FACE", "Translation_1_8"), model.selection("FACE", "Translation_1_9"), model.selection("FACE", "Translation_1_10"), model.selection("FACE", "Translation_1_11"), model.selection("FACE", "Translation_2_1"), model.selection("FACE", "Translation_2_2"), model.selection("FACE", "Translation_2_3"), model.selection("FACE", "Translation_2_4"), model.selection("FACE", "Translation_2_5"), model.selection("FACE", "Translation_2_6"), model.selection("FACE", "Translation_2_7"), model.selection("FACE", "Translation_2_8"), model.selection("FACE", "Translation_2_9"), model.selection("FACE", "Translation_2_10"), model.selection("FACE", "Translation_2_11"), model.selection("FACE", "Recover_2_1"), model.selection("FACE", "Recover_2_2"), model.selection("FACE", "Recover_2_3"), model.selection("FACE", "Recover_2_4"), model.selection("FACE", "Recover_2_5"), model.selection("FACE", "Recover_2_6"), model.selection("FACE", "Recover_2_7"), model.selection("FACE", "Recover_2_8"), model.selection("FACE", "Recover_2_9"), model.selection("FACE", "Recover_2_10"), model.selection("FACE", "Recover_2_11"), model.selection("EDGE", "Extrusion_5_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc)
+model.do()
+# insert points and polyline before partition to add it as a Partition argument
+Part_1_doc.setCurrentFeature(Extrusion_5.feature(), True)
+Point_2 = model.addPoint(Part_1_doc, "0", "0", "3*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
+Point_3 = model.addPoint(Part_1_doc, 0, 0, 5)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+model.do()
+Part_1_doc.setCurrentFeature(Partition_1.feature(), True)
+# append the polyline argument to the end of selection partition list
+Partition_1_objects.append(model.selection("WIRE", "Polyline_1_1"))
+Partition_1.setBase(Partition_1_objects)
+model.end()
+
+# check all groups are valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(Part_1_doc.size("Groups") == 3)
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
index 7e2313a7fcc92bdaf6ca145ecaed4b9107d80f1e..f9f94a2f1ce4508297e39d6c9db0695794ecaae4 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +30,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 100
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), 100, False)
 Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_2"), 100, False)
 Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 50, False)
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("FACE", "Plane_3"), model.selection("FACE", "Plane_4"), model.selection("SOLID", "Box_1_1")])
+Partition_1_objects = [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("FACE", "Plane_3"), model.selection("FACE", "Plane_4"), model.selection("SOLID", "Box_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 model.checkResult(Partition_1,model,1,[8],[8],[48],[192],[384])
index c12eec4b3a9acb2347925ad1c3da06c9481ae741..a134b99f155449690777c803fb3a8f866ca3f9ef 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -26,12 +26,12 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Point_1 = model.addPoint(Part_1_doc, 4, 5, 11)
+Point_2 = model.addPoint(Part_1_doc, 4, 5, 11)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_1 = Sketch_1.addLine(1.156555510724249, 12.03812858614785, 0.5812800089239156, -4.87167684997945)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cone_1_1"), model.selection("EDGE", "Edge_1_1")])
 model.do()
 
index 7750c01486c80b1f33beb715d402972ad48e9ded..9de79ea8c52c0d19f2abd99be5e666f7ddc81d14 100644 (file)
@@ -1,27 +1,28 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
-from salome.shaper import model
 from SketchAPI import *
 
+from salome.shaper import model
+
 model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
@@ -48,8 +49,7 @@ SketchConstraintMirror_2 = Sketch_1.addMirror(SketchLine_1.result(), SketchConst
 [SketchArc_5, SketchArc_6, SketchArc_7, SketchArc_8] = SketchConstraintMirror_2.mirrored()
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 12, 12)
-
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchLine_3 = Sketch_2.addLine(7.498934040825037, 4.111344571723496, -7.530337532973568, 4.111344571723496)
 SketchLine_4 = Sketch_2.addLine(-7.530337532973568, 4.111344571723496, -7.530337532973568, -4.489390918751097)
 SketchLine_5 = Sketch_2.addLine(-7.530337532973568, -4.489390918751097, 7.498934040825037, -4.489390918751097)
@@ -64,8 +64,7 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
 SketchCircle_1 = Sketch_2.addCircle(-0.133117930244568, 0.08984026389066591, 1.099112071963378)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchCircle_1_2r")], model.selection(), model.selection(), 5, model.selection(), 10)
-
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_3r-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchCircle_1_2r")], model.selection(), model.selection(), 5, model.selection(), 10)
 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_7 = Sketch_3.addLine(21.55890075100801, 30.21822825485694, -17.43219636481839, 31.63011070278906)
 SketchLine_8 = Sketch_3.addLine(-17.43219636481839, 31.63011070278906, -12.33809712604348, -45.93749869468675)
@@ -76,9 +75,10 @@ SketchLine_10 = Sketch_3.addLine(30.10255255530162, -25.9120009302625, 21.558900
 SketchConstraintCoincidence_12 = Sketch_3.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_7.startPoint(), SketchLine_10.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_10")])
-
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")])
+Face_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_7"), model.selection("EDGE", "Sketch_3/SketchLine_8"), model.selection("EDGE", "Sketch_3/SketchLine_9"), model.selection("EDGE", "Sketch_3/SketchLine_10")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 model.checkResult(Partition_1,model,1,[2],[4],[42],[198],[396])
index 22c616923b8414743f24fde604b95cf95dcac6de..9d7af166ec7e016a5a020e615b3ac3edc6f9fdf8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 
 from salome.shaper import model
@@ -47,8 +46,8 @@ SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_6.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_1.result())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 180, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/To_Face_1"))
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OZ"), 180, 0)
+Sketch_2 = model.addSketch(Part_1_doc,  model.standardPlane("YOZ"))
 SketchLine_8 = Sketch_2.addLine(61.72045613220821, 51.92790864086226, -64.56856594464165, 51.92790864086226)
 SketchLine_9 = Sketch_2.addLine(-64.56856594464165, 51.92790864086226, -64.56856594464165, -5.323114700643004)
 SketchLine_10 = Sketch_2.addLine(-64.56856594464165, -5.323114700643004, 61.72045613220821, -5.323114700643004)
@@ -62,7 +61,7 @@ SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_9.result())
 SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_10.result())
 SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_11.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_11"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_10"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f-SketchLine_11f")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Revolution_1_1"), model.selection("FACE", "Face_1_1")])
 model.do()
 
index 3a6a56b86d244047c92c372e8f3651bed65af667..f18a066fde501c2079cdffaac3296298d97da5dd 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -52,8 +52,10 @@ SketchLine_9 = Sketch_2.addLine(-36.0335881148175, -7.328477046301525, -31.39978
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchArc_2.startPoint(), SketchLine_9.endPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Face_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchArc_2_2"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("WIRE", "Wire_1_1")])
 model.do()
 
index c7113bbc2ad8bc7eef66f606dde033620156650d..82535565921625b8ed51b9efc63f1128f26bcee9 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +30,7 @@ SketchCircle_1 = Sketch_1.addCircle(-18.11540697674418, -21.53002906976744, 69.9
 SketchCircle_2 = Sketch_1.addCircle(-18.11540697674418, -21.53002906976744, 31.60961705559024)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchCircle_2.center())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2r")], model.selection(), 100, 0)
 Point_2 = model.addPoint(Part_1_doc, 100, 40, 80)
 Point_3 = model.addPoint(Part_1_doc, 100, -40, 80)
 Point_4 = model.addPoint(Part_1_doc, 20, 40, -80)
@@ -45,7 +45,8 @@ SketchLine_4 = Sketch_2.addLine(-102.5665996005733, 115.6113578178721, 98.506500
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3")])
+Face_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_4"), model.selection("EDGE", "Sketch_2/SketchLine_1"), model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("FACE", "Face_1_1")])
 model.do()
 
index 689fdb07eb284e49420f4f1f463d62b019824c05..dd16213fa11a02e6292a0a89272b9beccce39197 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
index 48e09d554587d348fb38f36f912ec3ca427b6e70..721a462046e57e39de534c3c69fdfc7224d15d53 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,7 +41,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), mo
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Front"))
 Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
-Partition_2 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_3")])
+Partition_2_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_3")]
+Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects)
 model.do()
 
 # check partition
index c6673117d30384dfc7b02def66722b2bddbeabca..51320cc18faa4b8c211d78f6037bce360babf711 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,7 +41,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), mo
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), model.selection("FACE", "Box_1_1/Front"))
 Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
-Partition_2 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Partition_1_1_3")])
+Partition_2_objects = [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Partition_1_1_3")]
+Partition_2 = model.addPartition(Part_1_doc, Partition_2_objects)
 model.do()
 
 # check partition
index 086680d49109aeb9ab2588e6ecee30295657932b..38ebc343a0916b65131a0b67d66d519335c481e1 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,8 +41,8 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1")])
 model.do()
 
index 3ed42aa9c47802fa663db5cc0490e407c954ab0a..0ce7fa755cd136899eaf8c28d2fee7f9ba24d981 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,8 +41,8 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "Face_1_1")])
 model.do()
 
index 93b708ca6805ea76c1692afff6a5aa065abf5b16..167257e6b480719e607b974be1f116e89850af65 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,8 +41,8 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "Face_1_1")])
 model.do()
 
index c2e0b80452a910e182cc0727ac9b23741d563ede..a30479ae86ca5bbc3439387c912509994babbb43 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,9 +41,10 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "Face_1_1")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "Face_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index d1bc8fa050fa72be7445f80f8211062c26d167ed..b723beb077b4934da5cf2699159076a3a66c6d41 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -40,9 +41,10 @@ SketchLine_1 = Sketch_2.addLine(58.22303949051827, 32.8176179844255, 7.898114670
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), 90, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_2")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_1_1_3")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "Sketch_2/SketchLine_1"), 90, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_2/SketchArc_1_2")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Extrusion_1_1_3")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index 3e12bd028ac2e5be0fb050c6cb7fa7566ea6c97b..5437ecf7637bd345c32b1dbd447024e52aa881a3 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
index f64b01b7e6f17c1da62604361dcc730b03f84e0f..4abfe5ed48e1dd1cbe45720b19d9feedc3d83aa7 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
index befdd88030929d931139432c19d4d508e6b05601..41ac6660af8c1a6fcc076f026792a16ff4c762b5 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
index a4e738ff397d58897299b83d71aa8fd9ece366b8..71a62a8edca8b43c1026f95f9783781917463908 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -34,7 +35,8 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40)
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius")
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("FACE", "PartSet/XOZ")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index 11f2e34c6b47871c19e6701d9815d5ffc2d761af..9330b46ddfe655b811e6845d63288203710b3dfd 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -34,7 +35,8 @@ SketchCircle_2 = Sketch_1.addCircle(55, 30, 40)
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radius")
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "PartSet/XOZ")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("FACE", "PartSet/XOZ")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index 02f6690539dc44f1daf9cd020df410052c9d0c08..215c9e4df2cdd3b691ff8d07a594aebad8d7c037 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
index d132dd3683804642fef544f1a75c200a2c0c8732..c6ff3bd622f299a760eb7d99b6a37872210a6148 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -36,7 +37,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
 Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index 736e688e0e0303b6d6a2937b5065a2fcdd603ce0..36b75fc6cf784ed9fb248c95bc4d8be5af727aa7 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -36,7 +37,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
 Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Box_1_1")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Extrusion_1_1_3"), model.selection("SOLID", "Box_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index fef86e870c0ac607802c76f70552b5fe0398b762..dddf7e4611862b4fd23cdadc5fee5180dc0981f0 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -36,7 +37,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
 Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index df68837afabd3e7b0e450a0e8a4bdc776a2f6e06..92bfed329cf26f5a42893a8da501370f2556948f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from GeomAPI import *
@@ -36,7 +37,8 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_2.results()[1], "Radi
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "ExtrusionMax", "ExtrusionMin")
 Box_1 = model.addBox(Part_1_doc, 50, 100, "BoxHeight")
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")])
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 # check partition
index 9573c9cc764b04af144ee17d4f76da2bde46ad5d..132651d26d98b580ce250f36951a4d8db13931cc 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -37,7 +37,8 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(),
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 SketchCircle_1 = Sketch_1.addCircle(14.49765103937751, 9.678507230150521, 3.831444106492329)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchCircle_1_2")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_5 = Sketch_2.addLine(-15.11211565655763, 11.99814589971457, -14.79635576556081, -11.77064279967296)
 SketchLine_6 = Sketch_2.addLine(-14.79635576556081, -11.77064279967296, -3.043616368139293, -11.46189011940212)
@@ -48,8 +49,10 @@ SketchLine_8 = Sketch_2.addLine(-3.922197168000547, 15.83568871823551, -15.11211
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_8.endPoint())
 model.do()
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Torus_1_1"), model.selection("WIRE", "Wire_1_1")])
+Wire_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("SOLID", "Torus_1_1"), model.selection("WIRE", "Wire_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 
 model.checkResult(Partition_1,model,1,[3],[1],[4],[22],[46])
diff --git a/src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py b/src/FeaturesPlugin/Test/TestPartition_ErrorMsg.py
new file mode 100644 (file)
index 0000000..41f038a
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(60, -30, 15, -30)
+SketchLine_2 = Sketch_1.addLine(15, -30, 15, 15)
+SketchLine_3 = Sketch_1.addLine(15, 15, 60, 15)
+SketchLine_4 = Sketch_1.addLine(60, 15, 60, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+assert(Partition_1.feature().error() != "")
+Part_1_doc.removeFeature(Partition_1.feature())
+
+model.end()
+
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+Partition_1 = Part_1_doc.addFeature("Partition")
+Partition_1.execute()
+assert(Partition_1.error() != "")
+aSession.finishOperation()
diff --git a/src/FeaturesPlugin/Test/TestPartition_SolidsHistory.py b/src/FeaturesPlugin/Test/TestPartition_SolidsHistory.py
new file mode 100644 (file)
index 0000000..ea7a2da
--- /dev/null
@@ -0,0 +1,91 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## 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<mailto:webmaster.salome@opencascade.com>
+##
+
+# Test that partition of solid works correctly after movement of groups after this partition
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-16.04556650246306, 45.15147783251232, -31.59359605911331, 45.15147783251232)
+SketchLine_2 = Sketch_1.addLine(-31.59359605911331, 45.15147783251232, -31.59359605911331, 29.10591133004927)
+SketchLine_3 = Sketch_1.addLine(-31.59359605911331, 29.10591133004927, -16.04556650246306, 29.10591133004927)
+SketchLine_4 = Sketch_1.addLine(-16.04556650246306, 29.10591133004927, -16.04556650246306, 45.15147783251232)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(12.4384236453202, 13.06034482758621, -5.846059113300496, 13.06034482758621)
+SketchLine_6 = Sketch_1.addLine(-5.846059113300496, 13.06034482758621, -5.846059113300496, -6.965517241379309)
+SketchLine_7 = Sketch_1.addLine(-5.846059113300496, -6.965517241379309, 12.4384236453202, -6.965517241379309)
+SketchLine_8 = Sketch_1.addLine(12.4384236453202, -6.965517241379309, 12.4384236453202, 13.06034482758621)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
+model.do()
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_2.addCircle(-10.81448298196523, 20.3003568426161, 15.58088381891068)
+SketchLine_9 = Sketch_2.addLine(-19.86849367207068, 32.98061042849822, 0.2083042015703297, 9.288449501673265)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_9.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchCircle_1.results()[1])
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1"), model.selection("COMPOUND", "Sketch_2")], model.selection(), 10, 0)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_3_2")])
+Group_2_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_3_2/Generated_Face&Sketch_2/SketchCircle_1_2"), model.selection("FACE", "Extrusion_1_3_1/Generated_Face&Sketch_2/SketchCircle_1_2&weak_name_1"), model.selection("FACE", "Extrusion_1_2/To_Face")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2"), model.selection("COMPSOLID", "Extrusion_1_3")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+model.do()
+# move groups after the partitiion
+Part_1_doc.moveFeature(Group_1.feature(), Partition_1.feature())
+Part_1_doc.moveFeature(Group_2.feature(), Group_1.feature())
+model.end()
+
+# check groups are correct
+aFactory = ModelAPI_Session.get().validators()
+selectionList = Group_1.feature().selectionList("group_list")
+assert(selectionList.size() == 5)
+assert(aFactory.validate(Group_1.feature()))
+for i in range(5):
+  assert(Group_1.groupList().value(i).value().shapeType() == GeomAPI_Shape.SOLID)
+
+selectionList = Group_2.feature().selectionList("group_list")
+assert(selectionList.size() == 10)
+assert(aFactory.validate(Group_2.feature()))
+for i in range(10):
+  assert(Group_2.groupList().value(i).value().shapeType() == GeomAPI_Shape.FACE)
+
+assert(model.checkPythonDump())
index f805375d5fbb98c6f7f407f199d466943f90f5f4..e0718b88893a348c31adf9b6f2faf1bf5a3c7eeb 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
diff --git a/src/FeaturesPlugin/Test/TestPipe_Compound.py b/src/FeaturesPlugin/Test/TestPipe_Compound.py
new file mode 100644 (file)
index 0000000..667236c
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(50, 15, 100, 20)
+SketchLine_2 = Sketch_1.addLine(30, 10, 50, 0)
+SketchArc_1 = Sketch_1.addArc(30, 40, 60, 40, 30, 70, False)
+model.do()
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2")])
+model.do()
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection("EDGE", "Sketch_1/SketchArc_1_2"))
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Pipe_1, 1)
+model.testNbSubResults(Pipe_1, [2])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [2])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [8])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [16])
diff --git a/src/FeaturesPlugin/Test/TestPipe_Edge.py b/src/FeaturesPlugin/Test/TestPipe_Edge.py
new file mode 100644 (file)
index 0000000..9c431a7
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchArc_1 = Sketch_1.addArc(23.47558064206828, 28.1849874113521, 68.07028657666974, 20.97621888383109, 20.24058919303746, 73.24260576165612, False)
+SketchLine_1 = Sketch_1.addLine(67.41776169413798, 4.173199186912264, 102.8479480835664, 10.72004206910377)
+model.do()
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_1/SketchArc_1_2"))
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Pipe_2 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_2_1")], model.selection("EDGE", "PartSet/OY"), model.selection("EDGE", "PartSet/OZ"))
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Pipe_1, 1)
+model.testNbSubResults(Pipe_1, [0])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [1])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [8])
+model.testResultsVolumes(Pipe_1, [3693.366575752712378744035959244])
+
+model.testNbResults(Pipe_2, 1)
+model.testNbSubResults(Pipe_2, [0])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [1])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [8])
+model.testResultsVolumes(Pipe_2, [3543.018638942841789685189723969])
diff --git a/src/FeaturesPlugin/Test/TestPipe_ErrorMsg.py b/src/FeaturesPlugin/Test/TestPipe_ErrorMsg.py
new file mode 100644 (file)
index 0000000..ac5e048
--- /dev/null
@@ -0,0 +1,88 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from ModelAPI import *
+from GeomDataAPI import *
+
+# Get document
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+# Create a part
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+# Create a sketch with circle for pipe profile
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+
+# Create circle
+aSketchCircleFeature = aSketchFeature.addFeature("SketchCircle")
+anCircleCentr = geomDataAPI_Point2D(aSketchCircleFeature.attribute("circle_center"))
+aCircleRadius = aSketchCircleFeature.real("circle_radius")
+anCircleCentr.setValue(0, 0)
+aCircleRadius.setValue(10)
+aSession.finishOperation()
+
+aSketchResult = aSketchFeature.firstResult()
+aSketchShape = aSketchResult.shape()
+
+aSession.startOperation()
+aPipeFeature = aPart.addFeature("Pipe")
+aPipeFeature.string("creation_method").setValue("WrongCreationMethod")
+aPipeFeature.execute()
+assert(aPipeFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aBaseObjectsList = aPipeFeature.selectionList("base_objects")
+aBaseObjectsList.append(aSketchResult, None)
+aPipeFeature.execute()
+assert(aPipeFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aPathObjectSelection = aPipeFeature.selection("path_object")
+aPathObjectSelection.selectSubShape("EDGE", "PartSet/OZ")
+aPipeFeature.execute()
+assert(aPipeFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aPipeFeature.string("creation_method").setValue("binormal")
+aPipeFeature.execute()
+assert(aPipeFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
+aPipeFeature.string("creation_method").setValue("locations")
+aBaseObjectsList = aPipeFeature.selectionList("locations_objects")
+aBaseObjectsList.append(None, None)
+aPipeFeature.execute()
+assert(aPipeFeature.error() != "")
+aSession.finishOperation()
diff --git a/src/FeaturesPlugin/Test/TestPipe_Wire.py b/src/FeaturesPlugin/Test/TestPipe_Wire.py
new file mode 100644 (file)
index 0000000..a5ed6f4
--- /dev/null
@@ -0,0 +1,68 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(25, -20, -20, -20)
+SketchLine_2 = Sketch_1.addLine(-20, -20, -20, 15)
+SketchLine_3 = Sketch_1.addLine(-20, 15, 25, 15)
+SketchLine_4 = Sketch_1.addLine(25, 15, 25, -20)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(75, 25, 95, 25)
+SketchLine_6 = Sketch_1.addLine(95, 25, 95, 45)
+SketchLine_7 = Sketch_1.addLine(95, 45, 75, 45)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+model.do()
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")], model.selection("EDGE", "PartSet/OZ"))
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_6"), model.selection("EDGE", "Sketch_1/SketchLine_7")]
+Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
+Pipe_2 = model.addPipe(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OZ"), [])
+model.do()
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Pipe_1, 1)
+model.testNbSubResults(Pipe_1, [0])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [24])
+model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [48])
+model.testResultsVolumes(Pipe_1, [157500])
+
+model.testNbResults(Pipe_2, 1)
+model.testNbSubResults(Pipe_2, [0])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [12])
+model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Pipe_2, [6000])
diff --git a/src/FeaturesPlugin/Test/TestPlacement.py b/src/FeaturesPlugin/Test/TestPlacement.py
deleted file mode 100644 (file)
index 0ad0b90..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-#=========================================================================
-# Initialization of the test
-#=========================================================================
-from ModelAPI import *
-from GeomDataAPI import *
-from GeomAlgoAPI import *
-from GeomAPI import *
-import math
-
-__updated__ = "2014-12-16"
-
-aSession = ModelAPI_Session.get()
-aDocument = aSession.moduleDocument()
-
-aSession.startOperation()
-aPartFeature = aDocument.addFeature("Part")
-aSession.finishOperation()
-assert (len(aPartFeature.results()) == 1)
-aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
-aPart = aPartResult.partDoc()
-
-#=========================================================================
-# Create a sketch to extrude
-#=========================================================================
-aSession.startOperation()
-aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
-origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
-origin.setValue(0, 0, 0)
-dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
-dirx.setValue(1, 0, 0)
-norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
-norm.setValue(0, 0, 1)
-aLineA1 = aSketchFeature.addFeature("SketchLine")
-aLineB1 = aSketchFeature.addFeature("SketchLine")
-aLineC1 = aSketchFeature.addFeature("SketchLine")
-aLineD1 = aSketchFeature.addFeature("SketchLine")
-aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
-aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
-aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
-aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
-aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
-aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
-aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
-aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
-aLineA1StartPoint.setValue(-100, 0)
-aLineA1EndPoint.setValue(-50, 0)
-aLineB1StartPoint.setValue(-50, 0)
-aLineB1EndPoint.setValue(-50, 50)
-aLineC1StartPoint.setValue(-50, 50)
-aLineC1EndPoint.setValue(-100, 50)
-aLineD1StartPoint.setValue(-100, 50)
-aLineD1EndPoint.setValue(-100, 0)
-aLineA2 = aSketchFeature.addFeature("SketchLine")
-aLineB2 = aSketchFeature.addFeature("SketchLine")
-aLineC2 = aSketchFeature.addFeature("SketchLine")
-aLineD2 = aSketchFeature.addFeature("SketchLine")
-aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
-aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
-aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
-aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
-aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
-aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
-aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
-aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
-aLineA2StartPoint.setValue(100, 0)
-aLineA2EndPoint.setValue(50, 0)
-aLineB2StartPoint.setValue(50, 0)
-aLineB2EndPoint.setValue(50, 50)
-aLineC2StartPoint.setValue(50, 50)
-aLineC2EndPoint.setValue(100, 50)
-aLineD2StartPoint.setValue(100, 50)
-aLineD2EndPoint.setValue(100, 0)
-aSession.finishOperation()
-
-#=========================================================================
-# Make extrusion
-#=========================================================================
-aSketchResult = aSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-origin = geomDataAPI_Point(aSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm")).dir()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(origin, dirX, norm, aSketchEdges, aSketchFaces)
-assert (len(aSketchFaces) > 0)
-assert (aSketchFaces[0] is not None)
-assert (aSketchFaces[1] is not None)
-
-aSession.startOperation()
-anExtrusionFt = aPart.addFeature("Extrusion")
-assert (anExtrusionFt.getKind() == "Extrusion")
-anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0])
-anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[1])
-anExtrusionFt.string("CreationMethod").setValue("BySizes")
-anExtrusionFt.real("to_size").setValue(50)
-anExtrusionFt.real("from_size").setValue(0)
-anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
-anExtrusionFt.execute()
-aSession.finishOperation()
-assert (anExtrusionFt.real("to_size").value() == 50.0)
-
-# Check extrusion results
-assert (len(anExtrusionFt.results()) > 0)
-anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
-assert (anExtrusionResult is not None)
-
-#=========================================================================
-# Test placement by face - face
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("face", "Extrusion_1_2/Generated_Face_3")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-aSession.undo()
-
-#=========================================================================
-# Test placement by face - edge
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-aSession.undo()
-
-#=========================================================================
-# Test placement by face - vertex
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-aSession.undo()
-
-#=========================================================================
-# Test placement by edge - edge
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/To_Face_1_1&Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-aSession.undo()
-
-#=========================================================================
-# Test placement by edge - vertex
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/To_Face_1_1&Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-aSession.undo()
-
-#=========================================================================
-# Test placement by vertex - vertex
-#=========================================================================
-aSession.startOperation()
-aPlacementFt = aPart.addFeature("Placement")
-aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("vertex", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1_1&Extrusion_1_1/Generated_Face_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
-aPlacementFt.boolean("placement_reverse_direction").setValue(False)
-aPlacementFt.boolean("placement_centering").setValue(True)
-aPlacementFt.execute()
-aSession.finishOperation()
-
-# Check placement results
-assert (len(aPlacementFt.results()) > 0)
-aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
-assert (aPlacementResult is not None)
-
-from salome.shaper import model
-assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_BodyShapesValidator.py b/src/FeaturesPlugin/Test/TestPlacement_BodyShapesValidator.py
new file mode 100644 (file)
index 0000000..85b3cfa
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.do()
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Box_1 = model.addBox(Part_2_doc, 10, 10, 10)
+model.do()
+
+Placement_1 = model.addPlacement(partSet, [model.selection("COMPOUND", "Part_2/")], model.selection("COMPOUND", "all-in-Part_1"), model.selection("FACE", "Part_2/Box_1_1/Top"), False, False)
+assert(Placement_1.feature().error() != "")
+Part_1_doc.removeFeature(Placement_1.feature())
+
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Complex.py b/src/FeaturesPlugin/Test/TestPlacement_Complex.py
new file mode 100644 (file)
index 0000000..e8fe584
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(2, -40, -30, -40)
+SketchLine_2 = Sketch_1.addLine(-30, -40, -30, -5)
+SketchLine_3 = Sketch_1.addLine(-30, -5, 2, -5)
+SketchLine_4 = Sketch_1.addLine(2, -5, 2, -40)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(40, -25, 2, -25)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_4.result())
+SketchLine_6 = Sketch_1.addLine(2, -25, 2, 20)
+SketchLine_7 = Sketch_1.addLine(2, 20, 40, 20)
+SketchLine_8 = Sketch_1.addLine(40, 20, 40, -25)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_8.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4f-SketchLine_5r-SketchLine_8r-SketchLine_7r-SketchLine_6r")], model.selection(), 10, 0)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4&weak_name_1][Extrusion_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_2_1/To_Face]"), False, False)
+Placement_2 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Placement_1_1")], model.selection("VERTEX", "[Placement_1_1/MF:Placed&Sketch_1/SketchLine_4&weak_name_1][Placement_1_1/MF:Placed&Sketch_1/SketchLine_1][Placement_1_1/MF:Placed&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_2_1/To_Face]"), False, True)
+model.do()
+model.end()
+
+from GeomAPI import *
+
+# check middle point of the placed solid
+shape = Placement_2.results()[0].resultSubShapePair()[0].shape()
+assert(shape.middlePoint().distance(GeomAPI_Pnt(-14, 25, 5)) < 1e-7)
+
+# check properties of the result
+model.testNbResults(Placement_2, 1)
+model.testNbSubResults(Placement_2, [0])
+model.testNbSubShapes(Placement_2, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Placement_2, GeomAPI_Shape.FACE, [7])
+model.testNbSubShapes(Placement_2, GeomAPI_Shape.EDGE, [30])
+model.testNbSubShapes(Placement_2, GeomAPI_Shape.VERTEX, [60])
+model.testResultsVolumes(Placement_2, [11200])
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Edge_Edge.py b/src/FeaturesPlugin/Test/TestPlacement_Edge_Edge.py
new file mode 100644 (file)
index 0000000..e0c262d
--- /dev/null
@@ -0,0 +1,139 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+import math
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+assert (len(aPartFeature.results()) == 1)
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+#=========================================================================
+# Create a sketch to extrude
+#=========================================================================
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aLineA1 = aSketchFeature.addFeature("SketchLine")
+aLineB1 = aSketchFeature.addFeature("SketchLine")
+aLineC1 = aSketchFeature.addFeature("SketchLine")
+aLineD1 = aSketchFeature.addFeature("SketchLine")
+aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
+aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
+aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
+aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
+aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
+aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
+aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
+aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
+aLineA1StartPoint.setValue(-100, 0)
+aLineA1EndPoint.setValue(-50, 0)
+aLineB1StartPoint.setValue(-50, 0)
+aLineB1EndPoint.setValue(-50, 50)
+aLineC1StartPoint.setValue(-50, 50)
+aLineC1EndPoint.setValue(-100, 50)
+aLineD1StartPoint.setValue(-100, 50)
+aLineD1EndPoint.setValue(-100, 0)
+aLineA2 = aSketchFeature.addFeature("SketchLine")
+aLineB2 = aSketchFeature.addFeature("SketchLine")
+aLineC2 = aSketchFeature.addFeature("SketchLine")
+aLineD2 = aSketchFeature.addFeature("SketchLine")
+aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
+aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
+aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
+aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
+aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
+aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
+aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
+aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
+aLineA2StartPoint.setValue(100, 0)
+aLineA2EndPoint.setValue(50, 0)
+aLineB2StartPoint.setValue(50, 0)
+aLineB2EndPoint.setValue(50, 50)
+aLineC2StartPoint.setValue(50, 50)
+aLineC2EndPoint.setValue(100, 50)
+aLineD2StartPoint.setValue(100, 50)
+aLineD2EndPoint.setValue(100, 0)
+aSession.finishOperation()
+
+#=========================================================================
+# Make extrusion
+#=========================================================================
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
+assert (aSketchResult.facesNum() > 1)
+
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(1))
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+assert (anExtrusionFt.real("to_size").value() == 50.0)
+
+# Check extrusion results
+assert (len(anExtrusionFt.results()) > 0)
+anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
+assert (anExtrusionResult is not None)
+
+#=========================================================================
+# Test placement by edge - edge
+#=========================================================================
+aSession.startOperation()
+aPlacementFt = aPart.addFeature("Placement")
+aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
+aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")
+aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+
+# Check placement results
+assert (len(aPlacementFt.results()) > 0)
+aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
+assert (aPlacementResult is not None)
+aSession.finishOperation()
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Edge_Vertex.py b/src/FeaturesPlugin/Test/TestPlacement_Edge_Vertex.py
new file mode 100644 (file)
index 0000000..d5315e6
--- /dev/null
@@ -0,0 +1,139 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+import math
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+assert (len(aPartFeature.results()) == 1)
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+#=========================================================================
+# Create a sketch to extrude
+#=========================================================================
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aLineA1 = aSketchFeature.addFeature("SketchLine")
+aLineB1 = aSketchFeature.addFeature("SketchLine")
+aLineC1 = aSketchFeature.addFeature("SketchLine")
+aLineD1 = aSketchFeature.addFeature("SketchLine")
+aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
+aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
+aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
+aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
+aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
+aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
+aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
+aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
+aLineA1StartPoint.setValue(-100, 0)
+aLineA1EndPoint.setValue(-50, 0)
+aLineB1StartPoint.setValue(-50, 0)
+aLineB1EndPoint.setValue(-50, 50)
+aLineC1StartPoint.setValue(-50, 50)
+aLineC1EndPoint.setValue(-100, 50)
+aLineD1StartPoint.setValue(-100, 50)
+aLineD1EndPoint.setValue(-100, 0)
+aLineA2 = aSketchFeature.addFeature("SketchLine")
+aLineB2 = aSketchFeature.addFeature("SketchLine")
+aLineC2 = aSketchFeature.addFeature("SketchLine")
+aLineD2 = aSketchFeature.addFeature("SketchLine")
+aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
+aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
+aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
+aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
+aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
+aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
+aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
+aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
+aLineA2StartPoint.setValue(100, 0)
+aLineA2EndPoint.setValue(50, 0)
+aLineB2StartPoint.setValue(50, 0)
+aLineB2EndPoint.setValue(50, 50)
+aLineC2StartPoint.setValue(50, 50)
+aLineC2EndPoint.setValue(100, 50)
+aLineD2StartPoint.setValue(100, 50)
+aLineD2EndPoint.setValue(100, 0)
+aSession.finishOperation()
+
+#=========================================================================
+# Make extrusion
+#=========================================================================
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
+assert (aSketchResult.facesNum() > 1)
+
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(1))
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+assert (anExtrusionFt.real("to_size").value() == 50.0)
+
+# Check extrusion results
+assert (len(anExtrusionFt.results()) > 0)
+anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
+assert (anExtrusionResult is not None)
+
+#=========================================================================
+# Test placement by edge - vertex
+#=========================================================================
+aSession.startOperation()
+aPlacementFt = aPart.addFeature("Placement")
+aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
+aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")
+aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_2/To_Face]")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+
+# Check placement results
+assert (len(aPlacementFt.results()) > 0)
+aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
+assert (aPlacementResult is not None)
+aSession.finishOperation()
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_ErrorMsg.py b/src/FeaturesPlugin/Test/TestPlacement_ErrorMsg.py
new file mode 100644 (file)
index 0000000..cfffc61
--- /dev/null
@@ -0,0 +1,87 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(-16.57843122838298, -30.87163595652513, 16.88033171559421)
+SketchCircle_2 = Sketch_1.addCircle(29.74848722752363, 33.32178840955915, 9.026354269133289)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+model.do()
+model.end()
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+
+aShapeToMove = Extrusion_1.feature().results()[1]
+
+# Verify Placement errors on low-level
+aSession.startOperation()
+aPlacementFt = featureToCompositeFeature(Part_1.feature()).addFeature("Placement")
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() != "")
+
+aSession.startOperation()
+aPlacementFt.selectionList("placement_objects_list").append(aShapeToMove, aShapeToMove.shape())
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() != "")
+
+aSession.startOperation()
+aPlacementFt.selection("placement_start_shape").selectSubShape("FACE", "Extrusion_1_2/To_Face")
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() != "")
+
+aSession.startOperation()
+aPlacementFt.selection("placement_start_shape").selectSubShape("FACE", "Extrusion_1_2/Generated_Face&Sketch_1/SketchCircle_2_2")
+aPlacementFt.selection("placement_end_shape").selectSubShape("FACE", "Extrusion_1_1/To_Face")
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() != "")
+
+aSession.startOperation()
+aPlacementFt.selection("placement_start_shape").selectSubShape("EDGE", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_2/To_Face]")
+aPlacementFt.selection("placement_end_shape").selectSubShape("FACE", "Extrusion_1_1/To_Face")
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() != "")
+
+# Create correct Placement
+aSession.startOperation()
+aPlacementFt.selection("placement_start_shape").selectSubShape("FACE", "Extrusion_1_2/To_Face")
+aPlacementFt.selection("placement_end_shape").selectSubShape("FACE", "Extrusion_1_1/To_Face")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+assert(aPlacementFt.error() == "")
+
+
+model.begin()
+Placement_2 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Placement_1_1")], model.selection("COMPOUND", "Sketch_1"), model.selection("FACE", "Extrusion_1_1/To_Face"), False, False)
+assert(Placement_2.feature().error() != "")
+Part_1_doc.removeFeature(Placement_2.feature())
+model.end()
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Face_Edge.py b/src/FeaturesPlugin/Test/TestPlacement_Face_Edge.py
new file mode 100644 (file)
index 0000000..5cdaeff
--- /dev/null
@@ -0,0 +1,139 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+import math
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+assert (len(aPartFeature.results()) == 1)
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+#=========================================================================
+# Create a sketch to extrude
+#=========================================================================
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aLineA1 = aSketchFeature.addFeature("SketchLine")
+aLineB1 = aSketchFeature.addFeature("SketchLine")
+aLineC1 = aSketchFeature.addFeature("SketchLine")
+aLineD1 = aSketchFeature.addFeature("SketchLine")
+aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
+aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
+aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
+aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
+aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
+aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
+aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
+aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
+aLineA1StartPoint.setValue(-100, 0)
+aLineA1EndPoint.setValue(-50, 0)
+aLineB1StartPoint.setValue(-50, 0)
+aLineB1EndPoint.setValue(-50, 50)
+aLineC1StartPoint.setValue(-50, 50)
+aLineC1EndPoint.setValue(-100, 50)
+aLineD1StartPoint.setValue(-100, 50)
+aLineD1EndPoint.setValue(-100, 0)
+aLineA2 = aSketchFeature.addFeature("SketchLine")
+aLineB2 = aSketchFeature.addFeature("SketchLine")
+aLineC2 = aSketchFeature.addFeature("SketchLine")
+aLineD2 = aSketchFeature.addFeature("SketchLine")
+aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
+aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
+aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
+aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
+aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
+aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
+aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
+aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
+aLineA2StartPoint.setValue(100, 0)
+aLineA2EndPoint.setValue(50, 0)
+aLineB2StartPoint.setValue(50, 0)
+aLineB2EndPoint.setValue(50, 50)
+aLineC2StartPoint.setValue(50, 50)
+aLineC2EndPoint.setValue(100, 50)
+aLineD2StartPoint.setValue(100, 50)
+aLineD2EndPoint.setValue(100, 0)
+aSession.finishOperation()
+
+#=========================================================================
+# Make extrusion
+#=========================================================================
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
+assert (aSketchResult.facesNum() > 1)
+
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(1))
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+assert (anExtrusionFt.real("to_size").value() == 50.0)
+
+# Check extrusion results
+assert (len(anExtrusionFt.results()) > 0)
+anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
+assert (anExtrusionResult is not None)
+
+#=========================================================================
+# Test placement by face - edge
+#=========================================================================
+aSession.startOperation()
+aPlacementFt = aPart.addFeature("Placement")
+aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4")
+aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/To_Face]")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+
+# Check placement results
+assert (len(aPlacementFt.results()) > 0)
+aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
+assert (aPlacementResult is not None)
+aSession.finishOperation()
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Face_Face.py b/src/FeaturesPlugin/Test/TestPlacement_Face_Face.py
new file mode 100644 (file)
index 0000000..edcfc7b
--- /dev/null
@@ -0,0 +1,139 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+import math
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+assert (len(aPartFeature.results()) == 1)
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+#=========================================================================
+# Create a sketch to extrude
+#=========================================================================
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aLineA1 = aSketchFeature.addFeature("SketchLine")
+aLineB1 = aSketchFeature.addFeature("SketchLine")
+aLineC1 = aSketchFeature.addFeature("SketchLine")
+aLineD1 = aSketchFeature.addFeature("SketchLine")
+aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
+aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
+aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
+aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
+aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
+aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
+aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
+aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
+aLineA1StartPoint.setValue(-100, 0)
+aLineA1EndPoint.setValue(-50, 0)
+aLineB1StartPoint.setValue(-50, 0)
+aLineB1EndPoint.setValue(-50, 50)
+aLineC1StartPoint.setValue(-50, 50)
+aLineC1EndPoint.setValue(-100, 50)
+aLineD1StartPoint.setValue(-100, 50)
+aLineD1EndPoint.setValue(-100, 0)
+aLineA2 = aSketchFeature.addFeature("SketchLine")
+aLineB2 = aSketchFeature.addFeature("SketchLine")
+aLineC2 = aSketchFeature.addFeature("SketchLine")
+aLineD2 = aSketchFeature.addFeature("SketchLine")
+aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
+aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
+aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
+aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
+aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
+aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
+aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
+aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
+aLineA2StartPoint.setValue(100, 0)
+aLineA2EndPoint.setValue(50, 0)
+aLineB2StartPoint.setValue(50, 0)
+aLineB2EndPoint.setValue(50, 50)
+aLineC2StartPoint.setValue(50, 50)
+aLineC2EndPoint.setValue(100, 50)
+aLineD2StartPoint.setValue(100, 50)
+aLineD2EndPoint.setValue(100, 0)
+aSession.finishOperation()
+
+#=========================================================================
+# Make extrusion
+#=========================================================================
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
+assert (aSketchResult.facesNum() > 1)
+
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(1))
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+assert (anExtrusionFt.real("to_size").value() == 50.0)
+
+# Check extrusion results
+assert (len(anExtrusionFt.results()) > 0)
+anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
+assert (anExtrusionResult is not None)
+
+#=========================================================================
+# Test placement by face - face
+#=========================================================================
+aSession.startOperation()
+aPlacementFt = aPart.addFeature("Placement")
+aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4")
+aPlacementFt.selection("placement_end_shape").selectSubShape("face", "Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+
+# Check placement results
+assert (len(aPlacementFt.results()) > 0)
+aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
+assert (aPlacementResult is not None)
+aSession.finishOperation()
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Face_Vertex.py b/src/FeaturesPlugin/Test/TestPlacement_Face_Vertex.py
new file mode 100644 (file)
index 0000000..e7ee2f8
--- /dev/null
@@ -0,0 +1,139 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+from GeomDataAPI import *
+from GeomAlgoAPI import *
+from GeomAPI import *
+import math
+
+__updated__ = "2014-12-16"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aPartFeature = aDocument.addFeature("Part")
+aSession.finishOperation()
+assert (len(aPartFeature.results()) == 1)
+aPartResult = modelAPI_ResultPart(aPartFeature.firstResult())
+aPart = aPartResult.partDoc()
+
+#=========================================================================
+# Create a sketch to extrude
+#=========================================================================
+aSession.startOperation()
+aSketchFeature = featureToCompositeFeature(aPart.addFeature("Sketch"))
+origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
+origin.setValue(0, 0, 0)
+dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
+dirx.setValue(1, 0, 0)
+norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
+norm.setValue(0, 0, 1)
+aLineA1 = aSketchFeature.addFeature("SketchLine")
+aLineB1 = aSketchFeature.addFeature("SketchLine")
+aLineC1 = aSketchFeature.addFeature("SketchLine")
+aLineD1 = aSketchFeature.addFeature("SketchLine")
+aLineA1StartPoint = geomDataAPI_Point2D(aLineA1.attribute("StartPoint"))
+aLineA1EndPoint = geomDataAPI_Point2D(aLineA1.attribute("EndPoint"))
+aLineB1StartPoint = geomDataAPI_Point2D(aLineB1.attribute("StartPoint"))
+aLineB1EndPoint = geomDataAPI_Point2D(aLineB1.attribute("EndPoint"))
+aLineC1StartPoint = geomDataAPI_Point2D(aLineC1.attribute("StartPoint"))
+aLineC1EndPoint = geomDataAPI_Point2D(aLineC1.attribute("EndPoint"))
+aLineD1StartPoint = geomDataAPI_Point2D(aLineD1.attribute("StartPoint"))
+aLineD1EndPoint = geomDataAPI_Point2D(aLineD1.attribute("EndPoint"))
+aLineA1StartPoint.setValue(-100, 0)
+aLineA1EndPoint.setValue(-50, 0)
+aLineB1StartPoint.setValue(-50, 0)
+aLineB1EndPoint.setValue(-50, 50)
+aLineC1StartPoint.setValue(-50, 50)
+aLineC1EndPoint.setValue(-100, 50)
+aLineD1StartPoint.setValue(-100, 50)
+aLineD1EndPoint.setValue(-100, 0)
+aLineA2 = aSketchFeature.addFeature("SketchLine")
+aLineB2 = aSketchFeature.addFeature("SketchLine")
+aLineC2 = aSketchFeature.addFeature("SketchLine")
+aLineD2 = aSketchFeature.addFeature("SketchLine")
+aLineA2StartPoint = geomDataAPI_Point2D(aLineA2.attribute("StartPoint"))
+aLineA2EndPoint = geomDataAPI_Point2D(aLineA2.attribute("EndPoint"))
+aLineB2StartPoint = geomDataAPI_Point2D(aLineB2.attribute("StartPoint"))
+aLineB2EndPoint = geomDataAPI_Point2D(aLineB2.attribute("EndPoint"))
+aLineC2StartPoint = geomDataAPI_Point2D(aLineC2.attribute("StartPoint"))
+aLineC2EndPoint = geomDataAPI_Point2D(aLineC2.attribute("EndPoint"))
+aLineD2StartPoint = geomDataAPI_Point2D(aLineD2.attribute("StartPoint"))
+aLineD2EndPoint = geomDataAPI_Point2D(aLineD2.attribute("EndPoint"))
+aLineA2StartPoint.setValue(100, 0)
+aLineA2EndPoint.setValue(50, 0)
+aLineB2StartPoint.setValue(50, 0)
+aLineB2EndPoint.setValue(50, 50)
+aLineC2StartPoint.setValue(50, 50)
+aLineC2EndPoint.setValue(100, 50)
+aLineD2StartPoint.setValue(100, 50)
+aLineD2EndPoint.setValue(100, 0)
+aSession.finishOperation()
+
+#=========================================================================
+# Make extrusion
+#=========================================================================
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
+assert (aSketchResult.facesNum() > 1)
+
+aSession.startOperation()
+anExtrusionFt = aPart.addFeature("Extrusion")
+assert (anExtrusionFt.getKind() == "Extrusion")
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(1))
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
+anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
+anExtrusionFt.execute()
+aSession.finishOperation()
+assert (anExtrusionFt.real("to_size").value() == 50.0)
+
+# Check extrusion results
+assert (len(anExtrusionFt.results()) > 0)
+anExtrusionResult = modelAPI_ResultBody(anExtrusionFt.firstResult())
+assert (anExtrusionResult is not None)
+
+#=========================================================================
+# Test placement by face - vertex
+#=========================================================================
+aSession.startOperation()
+aPlacementFt = aPart.addFeature("Placement")
+aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4")
+aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_2/To_Face]")
+aPlacementFt.boolean("placement_reverse_direction").setValue(False)
+aPlacementFt.boolean("placement_centering").setValue(True)
+aPlacementFt.execute()
+aSession.finishOperation()
+
+# Check placement results
+assert (len(aPlacementFt.results()) > 0)
+aPlacementResult = modelAPI_ResultBody(aPlacementFt.firstResult())
+assert (aPlacementResult is not None)
+aSession.finishOperation()
+
+from salome.shaper import model
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Part_Part.py b/src/FeaturesPlugin/Test/TestPlacement_Part_Part.py
new file mode 100644 (file)
index 0000000..142d193
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Cylinder_1 = model.addCylinder(Part_2_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+model.do()
+Placement_1 = model.addPlacement(partSet, [model.selection("COMPOUND", "Part_2/")], model.selection("FACE", "Part_2/Cylinder_1_1/Face_2"), model.selection("FACE", "Part_1/Box_1_1/Front"), False, True)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Placement_1, 1)
+model.testNbSubResults(Placement_1, [0])
+model.testNbSubShapes(Placement_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Placement_1, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Placement_1, GeomAPI_Shape.EDGE, [6])
+model.testNbSubShapes(Placement_1, GeomAPI_Shape.VERTEX, [12])
+model.testResultsVolumes(Placement_1, [785.398163397448342948337085545])
diff --git a/src/FeaturesPlugin/Test/TestPlacement_Vertex_Vertex.py b/src/FeaturesPlugin/Test/TestPlacement_Vertex_Vertex.py
new file mode 100644 (file)
index 0000000..bb5b353
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-100, 0, -50, 0)
+SketchLine_2 = Sketch_1.addLine(-50, 0, -50, 50)
+SketchLine_3 = Sketch_1.addLine(-50, 50, -100, 50)
+SketchLine_4 = Sketch_1.addLine(-100, 50, -100, 0)
+SketchLine_5 = Sketch_1.addLine(100, 0, 50, 0)
+SketchLine_6 = Sketch_1.addLine(50, 0, 50, 50)
+SketchLine_7 = Sketch_1.addLine(50, 50, 100, 50)
+SketchLine_8 = Sketch_1.addLine(100, 50, 100, 0)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 50, 0)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"), model.selection("VERTEX", "[Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_2/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_2/To_Face]"), False, True)
+model.do()
+model.end()
index a5827e0fb8892b02b4710d56d5c05044ed74314c..392d85ae7ec489d1f71fd269d98c51619bd460c1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Test made with high level API
 # -----------------------------
index 1adcbd13e30df69ed0f45b9d1042d05d31598811..3515ff19294b1fa3e48f5fa1c1b8c9a1cb512278 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -54,7 +55,7 @@ SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_9.endPoint(),
 SketchLine_11 = Sketch_1.addLine(-70, 0, -90, 0)
 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_9.result())
-SketchConstraintDistance_1 = Sketch_1.setDistance(SketchPoint_1.coordinates(), SketchLine_10.result(), 70)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchPoint_1.coordinates(), SketchLine_10.result(), 70, False)
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_10.result())
 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_4.result())
@@ -66,10 +67,10 @@ SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintHorizontal_3.setName("SketchConstraintHorizontal_4")
 SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
 SketchConstraintHorizontal_4.setName("SketchConstraintHorizontal_5")
-SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_9.startPoint(), SketchLine_1.result(), 80)
-SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_1.result(), 90)
-SketchConstraintDistance_4 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_1.result(), 85)
-SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_2.endPoint(), SketchLine_1.result(), 90)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_9.startPoint(), SketchLine_1.result(), 80, False)
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_5.endPoint(), SketchLine_1.result(), 90, False)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_1.result(), 85, False)
+SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_2.endPoint(), SketchLine_1.result(), 90, False)
 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_11.endPoint(), SketchLine_2.startPoint())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_10.result(), 190)
 SketchConstraintLength_1.setName("SketchConstraintLength_3")
@@ -92,40 +93,44 @@ SketchConstraintHorizontal_5.setName("SketchConstraintHorizontal_8")
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_13.result(), SketchLine_4.endPoint())
 SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_17")
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r-SketchLine_11r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 180, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Revolution_1_1/From_Face_1"), 120, True)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r")], model.selection("EDGE", "Sketch_1/SketchLine_1"), 180, 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Revolution_1_1/From_Face"), 120, True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_14 = SketchProjection_1.createdFeature()
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"))
+SketchLine_14.setName("SketchLine_14")
+SketchLine_14.result().setName("SketchLine_14")
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_15 = SketchProjection_2.createdFeature()
-SketchLine_16 = Sketch_2.addLine(-15.00002401644285, 44.20204102886705, 14.99999932366307, 44.20204102886705)
+SketchLine_15.setName("SketchLine_15")
+SketchLine_15.result().setName("SketchLine_15")
+SketchLine_16 = Sketch_2.addLine(-15, 44.202041028867, 15, 44.20204102886701)
 SketchLine_16.setName("SketchLine_24")
 SketchLine_16.result().setName("SketchLine_24")
-SketchLine_17 = Sketch_2.addLine(-25, 88.20203643108667, -25, 54.20202402898175)
+SketchLine_17 = Sketch_2.addLine(-25, 88.20204102886699, -25, 54.202041028867)
 SketchLine_17.setName("SketchLine_28")
 SketchLine_17.result().setName("SketchLine_28")
-SketchLine_18 = Sketch_2.addLine(25, 54.2020551101737, 25, 88.20204066628929)
+SketchLine_18 = Sketch_2.addLine(25, 54.20204102886701, 25, 88.202041028867)
 SketchLine_18.setName("SketchLine_26")
 SketchLine_18.result().setName("SketchLine_26")
-SketchLine_19 = Sketch_2.addLine(14.99999814471567, 98.20204102886706, -15.00002220451297, 98.20204102886706)
+SketchLine_19 = Sketch_2.addLine(15, 98.202041028867, -15.00000000000001, 98.20204102886699)
 SketchLine_19.setName("SketchLine_27")
 SketchLine_19.result().setName("SketchLine_27")
-SketchLine_21 = Sketch_2.addLine(25, 98.20204102886706, -25, 98.20204102886706)
-SketchLine_21.setName("SketchLine_15")
-SketchLine_21.result().setName("SketchLine_15")
-SketchLine_21.setAuxiliary(True)
-SketchLine_20 = Sketch_2.addLine(25, 44.20204102886705, 25, 98.20204102886706)
-SketchLine_20.setName("SketchLine_18")
-SketchLine_20.result().setName("SketchLine_18")
+SketchLine_20 = Sketch_2.addLine(25, 98.20204102886706, -25, 98.20204102886706)
+SketchLine_20.setName("SketchLine_15")
+SketchLine_20.result().setName("SketchLine_15")
 SketchLine_20.setAuxiliary(True)
-SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_21.startPoint())
+SketchLine_21 = Sketch_2.addLine(25, 44.20204102886705, 25, 98.20204102886706)
+SketchLine_21.setName("SketchLine_18")
+SketchLine_21.result().setName("SketchLine_18")
+SketchLine_21.setAuxiliary(True)
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_21.endPoint(), SketchLine_20.startPoint())
 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_13")
 SketchLine_22 = Sketch_2.addLine(-25, 98.20204102886706, -25, 44.20204102886705)
 SketchLine_22.setName("SketchLine_16")
 SketchLine_22.result().setName("SketchLine_16")
 SketchLine_22.setAuxiliary(True)
-SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_22.startPoint())
 SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_14")
 SketchLine_23 = Sketch_2.addLine(-25, 44.20204102886705, 25, 44.20204102886705)
 SketchLine_23.setName("SketchLine_17")
@@ -133,27 +138,31 @@ SketchLine_23.result().setName("SketchLine_17")
 SketchLine_23.setAuxiliary(True)
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_15")
-SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_23.endPoint(), SketchLine_20.startPoint())
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_23.endPoint(), SketchLine_21.startPoint())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_16")
-SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_21.result())
+SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_20.result())
+SketchConstraintHorizontal_6.setName("SketchConstraintHorizontal_6")
 SketchConstraintVertical_7 = Sketch_2.setVertical(SketchLine_22.result())
 SketchConstraintHorizontal_7 = Sketch_2.setHorizontal(SketchLine_23.result())
-SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_20.result())
-SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_21.result(), "l_percage")
+SketchConstraintHorizontal_7.setName("SketchConstraintHorizontal_7")
+SketchConstraintVertical_8 = Sketch_2.setVertical(SketchLine_21.result())
+SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_20.result(), "l_percage")
 SketchConstraintLength_6.setName("SketchConstraintLength_8")
-SketchConstraintLength_7 = Sketch_2.setLength(SketchLine_20.result(), 54)
+SketchConstraintLength_7 = Sketch_2.setLength(SketchLine_21.result(), 54)
 SketchConstraintLength_7.setName("SketchConstraintLength_9")
-SketchConstraintDistance_6 = Sketch_2.setDistance(SketchLine_14.result(), SketchLine_22.startPoint(), "l_percage/2")
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_19"))
+SketchConstraintDistance_6 = Sketch_2.setDistance(SketchLine_14.result(), SketchLine_22.startPoint(), "l_percage/2", False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_19"), False)
 SketchLine_24 = SketchProjection_3.createdFeature()
-SketchConstraintDistance_7 = Sketch_2.setDistance(SketchLine_24.result(), SketchLine_21.startPoint(), 20)
-SketchArc_1 = Sketch_2.addArc(-15, 54.20204102886705, -25, 54.20202402898175, -15.00002401644285, 44.20204102886705, False)
-SketchLine_25 = Sketch_2.addLine(-25, 98.20204102886706, -25, 54.20202402898175)
+SketchLine_24.setName("SketchLine_25")
+SketchLine_24.result().setName("SketchLine_25")
+SketchConstraintDistance_7 = Sketch_2.setDistance(SketchLine_24.result(), SketchLine_20.startPoint(), 20, False)
+SketchArc_1 = Sketch_2.addArc(-15, 54.202041028867, -25, 54.202041028867, -15, 44.202041028867, False)
+SketchLine_25 = Sketch_2.addLine(-25, 98.20204102886706, -25, 54.202041028867)
 SketchLine_25.setName("SketchLine_22")
 SketchLine_25.result().setName("SketchLine_22")
 SketchLine_25.setAuxiliary(True)
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchLine_25.endPoint())
-SketchLine_26 = Sketch_2.addLine(-15.00002401644285, 44.20204102886705, 25, 44.20204102886705)
+SketchLine_26 = Sketch_2.addLine(-15, 44.202041028867, 25, 44.20204102886705)
 SketchLine_26.setName("SketchLine_21")
 SketchLine_26.result().setName("SketchLine_21")
 SketchLine_26.setAuxiliary(True)
@@ -164,33 +173,33 @@ SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_23.endPoint()
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_22.startPoint(), SketchLine_25.startPoint())
 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_26.startPoint(), SketchLine_23.result())
 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_25.endPoint(), SketchLine_22.result())
-SketchArc_2 = Sketch_2.addArc(15, 54.20204102886705, 14.99999932366307, 44.20204102886705, 25, 54.2020551101737, False)
+SketchArc_2 = Sketch_2.addArc(15, 54.20204102886701, 15, 44.20204102886701, 25, 54.20204102886701, False)
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchArc_2.startPoint(), SketchLine_16.endPoint())
-SketchLine_27 = Sketch_2.addLine(25, 54.2020551101737, 25, 98.20204102886706)
+SketchLine_27 = Sketch_2.addLine(25, 54.20204102886701, 25, 98.20204102886706)
 SketchLine_27.setName("SketchLine_23")
 SketchLine_27.result().setName("SketchLine_23")
 SketchLine_27.setAuxiliary(True)
 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_27.startPoint())
 SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_27.result())
 SketchConstraintTangent_4 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_16.result())
-SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_27.endPoint())
+SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_21.endPoint(), SketchLine_27.endPoint())
 SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchLine_26.startPoint(), SketchLine_16.startPoint())
-SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_27.startPoint(), SketchLine_20.result())
+SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_27.startPoint(), SketchLine_21.result())
 SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchLine_16.endPoint(), SketchLine_26.result())
-SketchArc_3 = Sketch_2.addArc(15, 88.20204102886704, 25, 88.20204066628929, 14.99999814471567, 98.20204102886706, False)
+SketchArc_3 = Sketch_2.addArc(15, 88.202041028867, 25, 88.202041028867, 15, 98.202041028867, False)
 SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchArc_3.startPoint(), SketchLine_18.endPoint())
-SketchLine_28 = Sketch_2.addLine(14.99999814471567, 98.20204102886706, -25, 98.20204102886706)
+SketchLine_28 = Sketch_2.addLine(15, 98.202041028867, -25, 98.20204102886706)
 SketchLine_28.setName("SketchLine_25")
 SketchLine_28.result().setName("SketchLine_25")
 SketchLine_28.setAuxiliary(True)
 SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_28.startPoint())
 SketchConstraintTangent_5 = Sketch_2.setTangent(SketchArc_3.results()[1], SketchLine_28.result())
 SketchConstraintTangent_6 = Sketch_2.setTangent(SketchArc_3.results()[1], SketchLine_18.result())
-SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_21.endPoint(), SketchLine_28.endPoint())
+SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchLine_20.endPoint(), SketchLine_28.endPoint())
 SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchLine_27.startPoint(), SketchLine_18.startPoint())
-SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_28.startPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_28.startPoint(), SketchLine_20.result())
 SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchLine_18.endPoint(), SketchLine_27.result())
-SketchArc_4 = Sketch_2.addArc(-15, 88.20204102886706, -15.00002220451297, 98.20204102886706, -25, 88.20203643108667, False)
+SketchArc_4 = Sketch_2.addArc(-15, 88.20204102886699, -15.00000000000001, 98.20204102886699, -25, 88.20204102886699, False)
 SketchConstraintCoincidence_36 = Sketch_2.setCoincident(SketchArc_4.startPoint(), SketchLine_19.endPoint())
 SketchConstraintCoincidence_37 = Sketch_2.setCoincident(SketchArc_4.endPoint(), SketchLine_17.startPoint())
 SketchConstraintTangent_7 = Sketch_2.setTangent(SketchArc_4.results()[1], SketchLine_19.result())
@@ -204,9 +213,9 @@ SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_4.results()[1], 10)
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchArc_2.results()[1], 10)
 SketchConstraintRadius_4 = Sketch_2.setRadius(SketchArc_1.results()[1], 10)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_24f-SketchLine_28f-SketchLine_26f-SketchLine_27f-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2f-SketchArc_4_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/To_Face_1"), -30, model.selection(), 0)
-Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_8"), "inclinaison")
-Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "PartSet/OZ"), "angle1")
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_24f-SketchArc_2_2f-SketchLine_26f-SketchArc_3_2f-SketchLine_27f-SketchArc_4_2f-SketchLine_28f-SketchArc_1_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/To_Face"), -30, model.selection(), 0)
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_24][Extrusion_1_1/From_Face]"), "inclinaison")
+Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Rotation_1_1")], model.selection("EDGE", "PartSet/OZ"), "angle1")
 Recover_1 = model.addRecover(Part_1_doc, Rotation_2, [Rotation_1.result()])
 Rotation_3 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_1_1")], model.selection("EDGE", "PartSet/OZ"), "angle2")
 Rotation_3.setName("Rotation_4")
@@ -219,8 +228,10 @@ Recover_3 = model.addRecover(Part_1_doc, Rotation_2, [Rotation_1.result()])
 Rotation_5 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_3_1")], model.selection("EDGE", "PartSet/OZ"), "-angle1")
 Rotation_5.setName("Rotation_6")
 Rotation_5.result().setName("Rotation_6_1")
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Rotation_4_1"), model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Rotation_6_1"), model.selection("SOLID", "Rotation_5_1")])
+Cut_1_objects_2 = [model.selection("SOLID", "Rotation_4_1"), model.selection("SOLID", "Rotation_2_1"), model.selection("SOLID", "Rotation_6_1"), model.selection("SOLID", "Rotation_5_1")]
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], Cut_1_objects_2)
+model.do()
 model.end()
 
-assert(Boolean_1.result().shapeType() == 'SOLID')
+assert(Cut_1.result().shapeType() == 'SOLID')
 assert(Part_1_doc.size("Bodies") == 1)
index 7926781a667b9032710db3da016238bb6820eb3f..f8021ed067db933fede6d34581559789d94bc5b8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index f630056604a7d23817326bfce2ba0c0d6f5762c4..aa624f6d66badf7d55d8d0160b47a93d36642c08 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index c7f7d638404c19c2e5e0f4202a73871ae65a3b40..540de580b90e13a3624633737081d7f2c621e111 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -36,7 +37,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Face_1_1")])
 
 Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("SHELL", "Shell_1_1"))
-Remove_SubShapes_1.setSubShapesToRemove([model.selection("FACE", "Shell_1_1/Modified_Face_2")])
+Remove_SubShapes_1.setSubShapesToRemove([model.selection("FACE", "Shell_1_1/Modified_Face&Face_2_1/Face_2_1")])
 model.do()
 
 model.checkResult(Remove_SubShapes_1, model, 1, [0], [0], [1], [4], [8])
index e594d3371ca98eb5ad1de18a4aa98d0e7e3f1c8d..cd612898c1e14b181f9800abe6f5e1ba5832a66c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,7 +48,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2)
 Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
index ff3c8d8047b4ec10dfdc4f4ee7ec0158256c50f5..665fffe395715ec2a5f1965b7d4458d347cdf003 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,7 +48,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2)
 Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
index ff61445e55733a9f75c1c0fbe84ecf3b3f6f0b96..3890afaabdfa05296c7b1f51f1adb9c33214f1f4 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,7 +48,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_1.result(), SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 20)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OZ"), 2, 2)
 Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
index bfe1a37bb07dfcc23af7ae242f113e8e1658497d..8ec3abe5a9059013600068c16c8a29515eb59ed9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestRevolution.py
@@ -86,16 +85,8 @@ aCircleRadius.setValue(30.)
 aSession.finishOperation()
 
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 
 #=========================================================================
 # Create a sketch line to revol
@@ -130,7 +121,7 @@ aRevolFt = aPart.addFeature("Revolution")
 assert (aRevolFt.getKind() == "Revolution")
 # selection type FACE=4
 aRevolFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 aRevolFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 aRevolFt.string("CreationMethod").setValue("ByAngles")
 aRevolFt.real("from_angle").setValue(10)
@@ -184,7 +175,7 @@ aRevolFt = aPart.addFeature("Revolution")
 assert (aRevolFt.getKind() == "Revolution")
 # selection type FACE=4
 aRevolFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 aRevolFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 aRevolFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 aRevolFt.real("from_angle").setValue(0) #TODO: remove
@@ -210,7 +201,7 @@ aRevolFt = aPart.addFeature("Revolution")
 assert (aRevolFt.getKind() == "Revolution")
 # selection type FACE=4
 aRevolFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 aRevolFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 aRevolFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 aRevolFt.real("from_angle").setValue(0) #TODO: remove
index 21bb4644b29395f2db8cd11c5c240d1e29f44cc6..62da2cef1250dc8ff9f4b96a19cb86859c874179 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
@@ -62,23 +61,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -104,7 +95,7 @@ dirx = geomDataAPI_Dir(aLineSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aLineSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace")
 
 aSketchLine = aLineSketchFeature.addFeature("SketchLine")
 aLineStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint"))
@@ -134,7 +125,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face")
 aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
diff --git a/src/FeaturesPlugin/Test/TestRevolutionCut_ByAngle.py b/src/FeaturesPlugin/Test/TestRevolutionCut_ByAngle.py
new file mode 100644 (file)
index 0000000..ba79b8f
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 45, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+RevolutionCut_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = RevolutionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 4.985950242219446, 4.993794269643578, 5.022028013265849)
+
+RevolutionCut_1.setAxis(model.selection("EDGE", "PartSet/OX"))
+model.do()
+Shape = RevolutionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5, 5)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolutionCut_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestRevolutionCut_ByPlanesAndOffsets.py
new file mode 100644 (file)
index 0000000..0c14b10
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "Box_1_1/Right"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+RevolutionCut_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = RevolutionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5.15948561, 5.15948561)
+
+RevolutionCut_1.setPlanesAndOffsets(model.selection(), 0, model.selection("FACE", "Box_1_1/Bottom"), 3)
+model.do()
+Shape = RevolutionCut_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 5.23264, 5.07457446)
+
+model.end()
+
+assert(model.checkPythonDump())
index 659cde9b85c87ece2acb93bbbee586e4c734c230..046e6ae4a095ac8b8e7b42a27167633d648dd86c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestRevolutionFuse.py
@@ -90,23 +89,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -132,7 +123,7 @@ dirx = geomDataAPI_Dir(aLineSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aLineSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aLineSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace")
 
 aSketchLine = aLineSketchFeature.addFeature("SketchLine")
 aLineStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint"))
@@ -162,7 +153,7 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face")
 aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("circle_center"))
diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse_ByAngle.py b/src/FeaturesPlugin/Test/TestRevolutionFuse_ByAngle.py
new file mode 100644 (file)
index 0000000..dbf1a51
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 45, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+RevolutionFuse_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 4.98623430526137, 4.892827903704557, 5.240928197091025)
+
+RevolutionFuse_1.setAxis(model.selection("EDGE", "PartSet/OX"))
+model.do()
+Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 3.5650977446, 5.63206191645)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py b/src/FeaturesPlugin/Test/TestRevolutionFuse_ByPlanesAndOffsets.py
new file mode 100644 (file)
index 0000000..8eaee31
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "Box_1_1/Right"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Left"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(5, 10, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.result(), SketchCircle_1.center())
+RevolutionFuse_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 1.31869538592, 1.538946730649)
+
+RevolutionFuse_1.setPlanesAndOffsets(model.selection(), 0, model.selection("FACE", "Box_1_1/Bottom"), 0)
+model.do()
+Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 1.98775395252, 5.352665608174)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolutionOfCompound.py b/src/FeaturesPlugin/Test/TestRevolutionOfCompound.py
new file mode 100644 (file)
index 0000000..1bce19a
--- /dev/null
@@ -0,0 +1,83 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(15, -20, 8)
+SketchCircle_2 = Sketch_1.addCircle(35, -35, 15)
+model.do()
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection("EDGE", "PartSet/OX"), model.selection(), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+model.do()
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Sketch_2 = model.addSketch(Part_2_doc, model.defaultPlane("XOY"))
+SketchCircle_3 = Sketch_2.addCircle(15, -20, 8)
+SketchCircle_4 = Sketch_2.addCircle(35, -35, 15)
+model.do()
+Compound_2 = model.addCompound(Part_2_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
+Revolution_2 = model.addRevolution(Part_2_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection("EDGE", "PartSet/OX"), 90, 0)
+model.do()
+
+Part_3 = model.addPart(partSet)
+Part_3_doc = Part_3.document()
+Sketch_3 = model.addSketch(Part_3_doc, model.defaultPlane("XOY"))
+SketchCircle_5 = Sketch_3.addCircle(15, -20, 8)
+SketchCircle_6 = Sketch_3.addCircle(35, -35, 15)
+model.do()
+Compound_3 = model.addCompound(Part_3_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")])
+Revolution_3 = model.addRevolution(Part_3_doc, [model.selection("COMPOUND", "Compound_1_1")], model.selection("EDGE", "PartSet/OX"), model.selection("FACE", "PartSet/XOY"), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+model.do()
+
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Revolution_1, 1)
+model.testNbSubResults(Revolution_1, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [8])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [16])
+model.testResultsVolumes(Revolution_1, [38861.56734363])
+
+model.testNbResults(Revolution_2, 1)
+model.testNbSubResults(Revolution_2, [2])
+model.testNbSubShapes(Revolution_2, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Revolution_2, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Revolution_2, GeomAPI_Shape.EDGE, [12])
+model.testNbSubShapes(Revolution_2, GeomAPI_Shape.VERTEX, [24])
+model.testResultsVolumes(Revolution_2, [45178.11414513])
+
+model.testNbResults(Revolution_3, 1)
+model.testNbSubResults(Revolution_3, [0])
+model.testNbSubShapes(Revolution_3, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Revolution_3, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Revolution_3, GeomAPI_Shape.EDGE, [6])
+model.testNbSubShapes(Revolution_3, GeomAPI_Shape.VERTEX, [12])
+model.testResultsVolumes(Revolution_3, [38861.56733864])
+
+assert(model.checkPythonDump())
\ No newline at end of file
diff --git a/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py b/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py
new file mode 100644 (file)
index 0000000..e727c6b
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Point_3 = model.addPoint(Part_1_doc, 20, 0, 10)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")], False)
+
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Polyline_1_1/Generated_Edge&Point_1/Point_1")], model.selection("EDGE", "PartSet/OZ"), model.selection(), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+
+model.testNbResults(Revolution_1, 1)
+model.testNbSubResults(Revolution_1, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [1])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [8])
+model.testResultsVolumes(Revolution_1, [666.43244])
+
+Revolution_1.setPlanesAndOffsets(model.selection("FACE", "PartSet/YOZ"), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+
+model.testNbResults(Revolution_1, 1)
+model.testNbSubResults(Revolution_1, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [1])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [8])
+model.testResultsVolumes(Revolution_1, [333.21622])
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolutionOfPoint.py b/src/FeaturesPlugin/Test/TestRevolutionOfPoint.py
new file mode 100644 (file)
index 0000000..30d1330
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    assert(shape.isEdge())
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Point_1")])
+
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection(), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+Shape = Revolution_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 0, -10, 0)
+
+Revolution_1.setPlanesAndOffsets(model.selection("FACE", "PartSet/YOZ"), 0, model.selection("FACE", "PartSet/XOZ"), 0)
+Shape = Revolution_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 7.071067811865474, -7.071067811865474, 0)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRevolution_ByAngle.py b/src/FeaturesPlugin/Test/TestRevolution_ByAngle.py
new file mode 100644 (file)
index 0000000..a493f41
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+
+Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 90)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
+SketchCircle_1 = Sketch_1.addCircle(30, 20, 15)
+Revolution_1.setNestedSketch(Sketch_1)
+model.do()
+Shape = Revolution_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, -19.9197187127138, 19.9197187127138, 20)
+
+Revolution_1.setAxis(model.selection("EDGE", "PartSet/OY"))
+model.do()
+Shape = Revolution_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 14.2731178230633, 30, 14.2731178230633)
+
+model.end()
+
+assert(model.checkPythonDump())
index 5e192e24ab5d0daf5d469626f9c8f6834b932842..29f52d4a0bfd76d569c687aaee09143b01cd4cf1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestRotation.py
@@ -75,23 +74,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
diff --git a/src/FeaturesPlugin/Test/TestRotation_ByAxis.py b/src/FeaturesPlugin/Test/TestRotation_ByAxis.py
new file mode 100644 (file)
index 0000000..05f5363
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 5)
+
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Left]"), 45)
+Shape = Rotation_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 0, 7.071067811865, 5)
+
+Rotation_1.setAxisObject(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]"))
+Shape = Rotation_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 2.928932188135, 0, 5)
+
+Rotation_1.setMainObjects([model.selection("SOLID", "Sphere_1_1")])
+Shape = Rotation_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 2.928932188135, -7.071067811865, 0)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRotation_ByPoints.py b/src/FeaturesPlugin/Test/TestRotation_ByPoints.py
new file mode 100644 (file)
index 0000000..4494e5b
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 5)
+
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"))
+Shape = Rotation_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 0, 7.071067811865, 5)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestRotation_ErrorMsg.py b/src/FeaturesPlugin/Test/TestRotation_ErrorMsg.py
new file mode 100644 (file)
index 0000000..7b9405e
--- /dev/null
@@ -0,0 +1,79 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 =model.addBox(Part_1_doc, 10, 10, 10)
+model.end()
+
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+
+aShapeToMove = Box_1.feature().lastResult()
+
+# Verify Rotation errors on low-level
+aSession.startOperation()
+aRotation = featureToCompositeFeature(Part_1.feature()).addFeature("Rotation")
+aRotation.string("CreationMethod").setValue("ByAxisAndAngle")
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.selectionList("main_objects").append(aShapeToMove, aShapeToMove.shape())
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.selectionList("main_objects").append(None, None)
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.string("CreationMethod").setValue("ByThreePoints")
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.selectionList("main_objects").removeLast()
+aRotation.selectionList("main_objects").removeLast()
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.selectionList("main_objects").append(aShapeToMove, aShapeToMove.shape())
+aRotation.string("CreationMethod").setValue("ByAxisAndAngle")
+aRotation.selection("axis_object").selectSubShape("FACE", "Box_1_1/Back")
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
+
+aSession.startOperation()
+aRotation.selection("axis_object").selectSubShape("COMPOUND", "Box_1_1/Back")
+aRotation.execute()
+aSession.finishOperation()
+assert(aRotation.error() != "")
diff --git a/src/FeaturesPlugin/Test/TestScale1.py b/src/FeaturesPlugin/Test/TestScale1.py
new file mode 100644 (file)
index 0000000..f94eba2
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 5)
+
+Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_1_1")] , model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), 2)
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 10, 10, 10)
+
+Scale_1.setCenterPoint(model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"))
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 0, 10, 10)
+
+Scale_1.setMainObjects([model.selection("SOLID", "Sphere_1_1")])
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, -10, 0, 0)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/FeaturesPlugin/Test/TestScale2.py b/src/FeaturesPlugin/Test/TestScale2.py
new file mode 100644 (file)
index 0000000..9dedd36
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+import math
+
+def checkMiddlePoint(shape, x, y, z, tolerance = 1.e-7):
+    assert(shape is not None)
+    middlePoint = shape.middlePoint()
+    assert(math.fabs(middlePoint.x() - x) < tolerance), "{} != {}".format(middlePoint.x(), x)
+    assert(math.fabs(middlePoint.y() - y) < tolerance), "{} != {}".format(middlePoint.y(), y)
+    assert(math.fabs(middlePoint.z() - z) < tolerance), "{} != {}".format(middlePoint.z(), z)
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), 5)
+
+Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_1_1")] , model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), 1 , 2, 4)
+model.do()
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 10, 20)
+
+Scale_1.setCenterPoint(model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"))
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 5, 10, 20)
+
+Scale_1.setMainObjects([model.selection("SOLID", "Sphere_1_1")])
+Shape = Scale_1.results()[0].resultSubShapePair()[0].shape()
+checkMiddlePoint(Shape, 0.0058892, 0, 0)
+
+model.end()
+
+assert(model.checkPythonDump())
index ddbde47932709ce72866ee278c80d81c4653e610..f0d788fea2c6ec973a22bf05edfa98b4ce8d734f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestExtrusion.py
@@ -96,30 +95,17 @@ aSession.startOperation()
 
 anExtrusions = []
 for i in range(0, N * N):
-    aSketchResult = aSketchFeatures[i].firstResult()
-    aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-    origin = geomDataAPI_Point(aSketchFeatures[i].attribute("Origin")).pnt()
-    dirX = geomDataAPI_Dir(aSketchFeatures[i].attribute("DirX")).dir()
-    norm = geomDataAPI_Dir(aSketchFeatures[i].attribute("Norm")).dir()
-    aSketchFaces = ShapeList()
-    GeomAlgoAPI_SketchBuilder.createFaces(
-        origin, dirX, norm, aSketchEdges, aSketchFaces)
-
+    aSketchResult = modelAPI_ResultConstruction(aSketchFeatures[i].firstResult())
     anExtrusionFt = aPart.addFeature("Extrusion")
     assert (anExtrusionFt.getKind() == "Extrusion")
 
     anExtrusionFt.selectionList("base").append(
-        aSketchResult, aSketchFaces[0])
+        aSketchResult, aSketchResult.face(0))
     anExtrusionFt.string("CreationMethod").setValue("BySizes")
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(10)
     anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
     anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
-    # v1.0.2 from master
-    # anExtrusionFt.selection("extrusion_face").setValue(
-    #    aSketchResult, aSketchFaces[0])
-    # anExtrusionFt.real("extrusion_size").setValue(10)
-    # anExtrusionFt.boolean("extrusion_reverse").setValue(False)
     anExtrusions.append(anExtrusionFt)
 
 aSession.finishOperation()
@@ -162,28 +148,16 @@ aSession.startOperation()
 #=========================================================================
 # Build a big box extrusion
 #=========================================================================
-aSketchResult = aQuadrangleSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-origin = geomDataAPI_Point(aQuadrangleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aQuadrangleSketchFeature.attribute("Norm")).dir()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aSketchEdges, aSketchFaces)
+aSketchResult = modelAPI_ResultConstruction(aQuadrangleSketchFeature.firstResult())
 # Create extrusion on them
 aBox = aPart.addFeature("Extrusion")
 aBox.selectionList("base").append(
-    aSketchResult, aSketchFaces[0])
+    aSketchResult, aSketchResult.face(0))
 aBox.string("CreationMethod").setValue("BySizes")
 aBox.real("from_size").setValue(0)
 aBox.real("to_size").setValue(10)
 aBox.real("to_offset").setValue(0) #TODO: remove
 aBox.real("from_offset").setValue(0) #TODO: remove
-# v 1.0.2 from master
-# aBox.selection("extrusion_face").setValue(
-#     aSketchResult, aSketchFaces[0])
-# aBox.real("extrusion_size").setValue(10)
-# aBox.boolean("extrusion_reverse").setValue(False)
 
 aSession.finishOperation()
 
diff --git a/src/FeaturesPlugin/Test/TestSymmetry_Part.py b/src/FeaturesPlugin/Test/TestSymmetry_Part.py
new file mode 100644 (file)
index 0000000..b370ccb
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+Symmetry_1 = model.addSymmetry(partSet, [model.selection("COMPOUND", "Part_1/")], model.selection("VERTEX", "Part_1/[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), False)
+Symmetry_2 = model.addSymmetry(partSet, [model.selection("COMPOUND", "Symmetry_1/")], model.selection("EDGE", "Symmetry_1/[Box_1_1/Back][Box_1_1/Left]"), False)
+Symmetry_3 = model.addSymmetry(partSet, [model.selection("COMPOUND", "Symmetry_2/")], model.selection("FACE", "Symmetry_2/Box_1_1/Bottom"), True)
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Symmetry_3, 2)
+model.testNbSubResults(Symmetry_3, [0, 0])
+model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.SOLID, [1, 1])
+model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [6, 6])
+model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.EDGE, [24, 24])
+model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.VERTEX, [48, 48])
+model.testResultsVolumes(Symmetry_3, [-1000, 1000])
index 0ebe4e3009740fc8ccb04b5c54a977cdeae2c09e..ca3a7aaeea200e65570c0f55eaa7feb8b9029df5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestMovement.py
@@ -75,23 +74,15 @@ aSession.finishOperation()
 # Make extrusion on circle
 #=========================================================================
 # Build shape from sketcher results
-aCircleSketchResult = aCircleSketchFeature.firstResult()
-aCircleSketchEdges = modelAPI_ResultConstruction(aCircleSketchResult).shape()
-origin = geomDataAPI_Point(aCircleSketchFeature.attribute("Origin")).pnt()
-dirX = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX")).dir()
-norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm")).dir()
-aCircleSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin, dirX, norm, aCircleSketchEdges, aCircleSketchFaces)
-assert (len(aCircleSketchFaces) > 0)
-assert (aCircleSketchFaces[0] is not None)
+aCircleSketchResult = modelAPI_ResultConstruction(aCircleSketchFeature.firstResult())
+assert (aCircleSketchResult.facesNum() > 0)
 # Create extrusion
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
 assert (anExtrusionFt.getKind() == "Extrusion")
 # selection type FACE=4
 anExtrusionFt.selectionList("base").append(
-    aCircleSketchResult, aCircleSketchFaces[0])
+    aCircleSketchResult, aCircleSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
diff --git a/src/FeaturesPlugin/Test/TestTranslation_Part.py b/src/FeaturesPlugin/Test/TestTranslation_Part.py
new file mode 100644 (file)
index 0000000..b7207b5
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+Translation_1 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_1/")], model.selection("EDGE", "OX"), 10)
+Translation_2 = model.addTranslation(partSet, [model.selection("COMPOUND", "Translation_1/")], 0, 10, 0)
+Translation_3 = model.addTranslation(partSet, [model.selection("COMPOUND", "Translation_2/")], model.selection("VERTEX", "Translation_2/[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "Translation_2/[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"))
+model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Translation_1, 1)
+model.testNbSubResults(Translation_1, [0])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.EDGE, [24])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.VERTEX, [48])
+model.testResultsVolumes(Translation_1, [1000])
index 541ad7344a0088c86295effa6699463e94e7246a..ccb6e644b85c7df2cad239ee2bb2cdced28beb74 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index 80665ef414248d64f15038498781890870d42905..971fcd7384aa8e88de718df1c008e1a9536cdba0 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -36,7 +36,7 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(),
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")])
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OY"), 200, 0)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "Revolution_1_1")])
 Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2")])
index 2519dd469b9f186b555d37c29965d70c653753b8..8f596f817ec827a8ca7ad9e56c22a140e8a53850 100644 (file)
@@ -1,17 +1,23 @@
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,10 +36,12 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.startPoint(),
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchArc_1_2")])
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OY"), 360, 0)
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY"), model.selection("FACE", "Revolution_1_1")])
-Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")])
+Partition_1_objects = [model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY"), model.selection("FACE", "Revolution_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Union_1_objects = [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")]
+Union_1 = model.addUnion(Part_1_doc, Union_1_objects)
 model.testHaveNamingSubshapes(Union_1,model,Part_1_doc)
 model.do()
 model.end()
index f5adc70c80fe862d1e9e69c817d200661187e833..3f18effcecc6c4fc160f0eb6bb94a9bd207fb566 100644 (file)
@@ -1,23 +1,23 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -37,9 +37,9 @@ SketchLine_5 = Sketch_1.addLine(31.85610465116278, -38.16860465116279, -44.48110
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.startPoint())
 model.do()
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchLine_6 = Sketch_2.addLine(31.85610465116278, -38.16860465116279, -40.43276493886778, -56.03425756438362)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.startPoint(), SketchPoint_1.result())
 SketchLine_7 = Sketch_2.addLine(-40.43276493886778, -56.03425756438362, -115.5003601973775, -26.06900348999911)
@@ -48,14 +48,18 @@ SketchLine_8 = Sketch_2.addLine(-115.5003601973775, -26.06900348999911, -106.232
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchLine_9 = Sketch_2.addLine(-106.2327558444751, 34.47934494896344, -44.48110465116279, 12.33139534883721)
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_5e"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchPoint_2.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_6"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_8")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ")])
-Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_5")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Face_2_objects = [model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_2/SketchLine_6"), model.selection("EDGE", "Sketch_2/SketchLine_7"), model.selection("EDGE", "Sketch_2/SketchLine_8")]
+Face_2 = model.addFace(Part_1_doc, Face_2_objects)
+Partition_1_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Union_1_objects = [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_3"), model.selection("FACE", "Partition_1_1_4")]
+Union_1 = model.addUnion(Part_1_doc, Union_1_objects)
 model.do()
 
 model.checkResult(Union_1,model,1,[2],[0],[2],[13],[26])
index ae80df8af0baa083a10f08ee3b63e8e9f71684c7..bc2319399d8801ab3e50f388cb22032a35d739b7 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,8 +28,9 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(-5.197255574614073, 0.1732418524871273, 67.586529314451)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+Partition_1_objects = [model.selection("FACE", "Face_1_1"), model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 Union_1 = model.addUnion(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("FACE", "Partition_1_1_2")])
 model.do()
 model.end()
index a681118ea7c813fb7d0e98a8e769680a7979cc2d..e27e7e7d01223db03ac7f73d091315864ca98344 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -30,7 +31,8 @@ Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), 5
 Partition_1_objects = [model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("SOLID", "Box_1_1")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Partition_1_1_3"), model.selection("SOLID", "Partition_1_1_1")])
-Union_2 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Partition_1_1_4/Partition_1_1_4"), model.selection("SOLID", "Partition_1_1_2/Partition_1_1_2")])
+Union_2 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Union_1_1_2"), model.selection("SOLID", "Union_1_1_1")])
+model.do()
 model.end()
 
 from GeomAPI import GeomAPI_Shape
diff --git a/src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py b/src/FeaturesPlugin/Test/TestUnion_ErrorMsg.py
new file mode 100644 (file)
index 0000000..ed752a9
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, -30, 15)
+SketchCircle_2 = Sketch_1.addCircle(10, -25, 10)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0)
+
+Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("COMPOUND", "Sketch_1")])
+assert(Union_1.feature().error() != "")
+Part_1_doc.removeFeature(Union_1.feature())
+
+model.end()
index 9065d1e2d6eb824262d39efa1b77dfa3981e9bae..987dadc3a7b5b85850edfd23d795a17500f9e853 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="creation_method">
     <box id="simple"
index e584a531facc839e3e9739c7fc6cf2e6a8f757fe..0b0281098a7c2f4e9999ed5772dad72c3ead9424 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="main_objects"
     label="Main objects"
index 952ff6eb097208933ae1e4cd765ca0f9d5218465..cf622baf62ce668b36b2bed244554ebb8cbda7e2 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="creation_method">
     <box id="simple"
index cb755c187078b9d2421ec11d739bd9ce7dc5cd4a..227fd02d87c4c95b1cf0ed6afd7cb34d2ef38ced 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="main_objects"
     label="Main objects"
@@ -40,4 +19,5 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_ValidatorBooleanSmashSelection"/>
   </multi_selector>
+  <validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
 </source>
index 4e82542b9477e726b1fe50803358c7600737a95d..9ea5db5d13a5081b944b3fde8d73f46bbc25b2e8 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="main_objects"
     label="Main objects"
index 67299d876884edde815d29669c2c0af033bc15c1..80cce185bc3087e5ac187b47363ebbf0490f38b1 100644 (file)
@@ -7,6 +7,7 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("FACE", "Box_1_1/Front"), model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 2)
+Fillet_1_objects = [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Left]")]
+Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2)
 model.do()
 model.end()
index a72a7ec7833739b29b6e1a1713e77502bfc81e73..465fbcd9d48e28888c74f70bfb49b8be93db86c0 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Box_1_1/Left&Box_1_1/Top")], 1, 3)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")], 1, 3)
 model.do()
 model.end()
index 888480992648a7a976f3d74976fdabbec9c00e2a..ed41166ea18d0c10f16c4fdf1d1b8f7c21d42907 100644 (file)
@@ -33,10 +33,9 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
 SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 0)
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection(), 0, 50)
-Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r_wire")], model.selection(), 50, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 0, 50)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")model.selection("SOLID", "Extrusion_2_1")])
 FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Fuse_1_1"))
-Export_1 = model.exportToXAO(Part_1_doc, '/tmp/shaper_gjzkis0q.xao', 'automatic_shaper_export_to_XAO')
 model.do()
 model.end()
index 68fc2bca4e51db5b96959ddff7c58c1a4e5f95f4..93bb0ce86548719bd3407586a3aa73cd61050974 100644 (file)
@@ -8,13 +8,9 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_1 = Sketch_1.addLine(72.2418524871355, 29.96679215537161, -69.82505995666611, 29.96679215537161)
-SketchLine_1.result().setColor(225, 0, 0)
 SketchLine_2 = Sketch_1.addLine(-69.82505995666611, 29.96679215537161, -69.82505995666611, -40.02291624943114)
-SketchLine_2.result().setColor(225, 0, 0)
 SketchLine_3 = Sketch_1.addLine(-69.82505995666611, -40.02291624943114, 72.2418524871355, -40.02291624943114)
-SketchLine_3.result().setColor(225, 0, 0)
 SketchLine_4 = Sketch_1.addLine(72.2418524871355, -40.02291624943114, 72.2418524871355, 29.96679215537161)
-SketchLine_4.result().setColor(225, 0, 0)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
@@ -28,7 +24,6 @@ Point_2 = model.addPoint(Part_1_doc, 0, 100, 40)
 Point_3 = model.addPoint(Part_1_doc, 0, 260, 60)
 Interpolation_1_objects = [model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2")]
 Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, False, False)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")])
-Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Interpolation_1_1"), model.selection("EDGE", "PartSet/OX"))
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection("EDGE", "Interpolation_1_1"), model.selection("EDGE", "PartSet/OX"))
 model.do()
 model.end()
index 52386bd1b10bb46e1cb3909ed9949b6dbfce599b..88490b163a382e5468fb9764d4339844bd35d8c8 100644 (file)
@@ -20,13 +20,12 @@ model.do()
 Sketch_3 = model.addSketch(Part_2_doc, model.selection("FACE", "Plane_2"))
 SketchCircle_3 = Sketch_3.addCircle(121.2811188302094, -19.85285601110755, 120.5601403551194)
 model.do()
-Interpolation_1_objects = [model.selection("VERTEX", "Sketch_1/Vertex-SketchCircle_1"), model.selection("VERTEX", "Sketch_2/Vertex-SketchCircle_2"), model.selection("VERTEX", "Sketch_3/Vertex-SketchCircle_3")]
+Interpolation_1_objects = [model.selection("VERTEX", "Sketch_1/SketchCircle_1"), model.selection("VERTEX", "Sketch_2/SketchCircle_2"), model.selection("VERTEX", "Sketch_3/SketchCircle_3")]
 Interpolation_1 = model.addInterpolation(Part_2_doc, Interpolation_1_objects, False, False)
-Vertex_1 = model.addVertex(Part_2_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchCircle_2")])
+Vertex_1 = model.addVertex(Part_2_doc, [model.selection("VERTEX", "Sketch_2/SketchCircle_2")])
 Partition_1 = model.addPartition(Part_2_doc, [model.selection("EDGE", "Interpolation_1_1"), model.selection("VERTEX", "Vertex_1_1")])
 Wire_1 = model.addWire(Part_2_doc, [model.selection("EDGE", "Partition_1_1_1"), model.selection("EDGE", "Partition_1_1_2")])
-Pipe_1_objects_2 = [model.selection("VERTEX", "Interpolation_1_1/Vertex_1"), model.selection("VERTEX", "Vertex_1_1/Vertex_1_1_1"), model.selection("VERTEX", "Interpolation_1_1/Vertex_2")]
-Pipe_1_objects_1 = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f")]
+Pipe_1_objects_2 = [model.selection("VERTEX", "Interpolation_1_1/Vertex_1_1"), model.selection("VERTEX", "Vertex_1_1/Vertex_1_1&Sketch_2/SketchCircle_2"), model.selection("VERTEX", "Interpolation_1_1/Vertex_1_2")]
+Pipe_1_objects_1 = [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r"), model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2r")]
 Pipe_1 = model.addPipe(Part_2_doc, Pipe_1_objects_1, model.selection("WIRE", "Wire_1_1"), Pipe_1_objects_2)
-model.do()
 model.end()
index 5deb47e2cd879189af9339e7cb48b5a042b4e496..05be8a2834eade992188aff402526e63dbe51f62 100644 (file)
@@ -11,25 +11,19 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchPoint_1.result().setColor(170, 0, 225)
 SketchCircle_1 = Sketch_1.addCircle(0, 0, 40)
-SketchCircle_1.result().setColor(225, 0, 0)
-SketchCircle_1.results()[1].setColor(225, 0, 0)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 40)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_1 = SketchProjection_2.createdFeature()
-SketchLine_1.result().setColor(170, 0, 225)
 SketchArc_1 = Sketch_2.addArc(30, 0, 0, 0, 40.50885209855912, 28.09918197333542, True)
-SketchArc_1.result().setColor(225, 0, 0)
-SketchArc_1.results()[1].setColor(225, 0, 0)
 SketchConstraintCoincidence_2 = Sketch_2.setCoincident(SketchLine_1.result(), SketchArc_1.center())
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_1).startPoint(), SketchArc_1.startPoint())
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_1.results()[1], 30)
 model.do()
-Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_2/Edge-SketchArc_1_2"))
+Pipe_1 = model.addPipe(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "Sketch_2/SketchArc_1_2"))
 model.do()
 model.end()
index d74ab4d23ccb71baa780f31f8459be2c905c3c66..433d523dada81f0ae319274a365923fb71c67928 100644 (file)
@@ -10,12 +10,7 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Front"))
 SketchCircle_1 = Sketch_1.addCircle(20, 6, 3)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc,
-                                 [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")],
-                                 model.selection(), -10, 0)
-Placement_1 = model.addPlacement(Part_1_doc,
-                                 [model.selection("SOLID", "Extrusion_1_1")],
-                                 model.selection("FACE", "Extrusion_1_1/From_Face_1"),
-                                 model.selection("FACE", "Box_1_1/Front"), False, True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), -10, 0)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Box_1_1/Front"), False, True)
 model.do()
 model.end()
index 295a9493c85fcd793b28fe6bfdbabc312e32add1..213b5501d94ec6c1e933194724ed79b76f81d9c4 100644 (file)
@@ -10,11 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc,
-                                         [model.selection("COMPOUND", "Sketch_1")],
-                                         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                         0,
-                                         90,
-                                         [model.selection("SOLID", "Box_1_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 0, 90, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index fba7ef0810f4f63c1ed903091d37ef2b8a923f8e..bf0c00f2a1ce992bec2a83b44c899cf38b5a4ed7 100644 (file)
@@ -10,13 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc,
-                                         [model.selection("COMPOUND", "Sketch_1")],
-                                         model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                         model.selection(),
-                                         0,
-                                         model.selection("FACE", "Box_1_1/Front"),
-                                         0,
-                                         [model.selection("SOLID", "Box_1_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection(), 0, model.selection("FACE", "Box_1_1/Front"), 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 145a9a0fb52167094bc8feeb9b774293167f4ada..5aafe07fbb06d5bae15e0158c26c6ea0e7143645 100644 (file)
@@ -10,11 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionFuse(Part_1_doc,
-                                          [model.selection("COMPOUND", "Sketch_1")],
-                                          model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                          90,
-                                          0,
-                                          [model.selection("SOLID", "Box_1_1")])
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), 90, 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 3e2c2e0ecbd96167171a1153e79bc6eee317398e..65ee5cd7a3b956d5e74971f43f78bceefc678cfa 100644 (file)
@@ -10,13 +10,6 @@ Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
 SketchCircle_1 = Sketch_1.addCircle(5, 5, 2.5)
 model.do()
-RevolutionCut_1 = model.addRevolutionFuse(Part_1_doc,
-                                          [model.selection("COMPOUND", "Sketch_1")],
-                                          model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"),
-                                          model.selection("FACE", "Box_1_1/Front"),
-                                          0,
-                                          model.selection(),
-                                          0,
-                                          [model.selection("SOLID", "Box_1_1")])
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), model.selection("FACE", "Box_1_1/Front"), 0, model.selection(), 0, [model.selection("SOLID", "Box_1_1")])
 model.do()
 model.end()
index 489541f93856e7f7531a38e446ef35b444707ac8..68f242c6a0fa9259f428a9e1bf5d89171bbf723e 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_3"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_3]"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"))
 model.do()
 model.end()
index 3ceb146fef66200d4b8ce9fef5b42ad9969fd3b7..ac042b77021442839a5ea8e4a53a3b489e3253c6 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "Cylinder_1_1/Face_1"), False)
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "([Cylinder_1_1/Face_1][Cylinder_1_1/Face_2])([Cylinder_1_1/Face_1][Cylinder_1_1/Face_3])"), False)
 model.do()
 model.end()
index d06a7ecad63e5d597a0b31042afcd1abfe4dddc5..955e212de5383c1118097d7601d1d195fc1aa6fc 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "Cone_1_1/Face_1&Cone_1_1/Face_2"))
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("VERTEX", "PartSet/Origin"), model.selection("VERTEX", "[Cone_1_1/Face_1][Cone_1_1/Face_2]"))
 model.do()
 model.end()
index 5ebee45fad3983e85c78f7ed13de9878ff04685e..19a4887723fdd4b55617083b995cf7751471c005 100644 (file)
@@ -7,6 +7,6 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "Cone_1_1/Face_1"), 40)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "([Cone_1_1/Face_1][Cone_1_1/Face_2])([Cone_1_1/Face_1][Cone_1_1/Face_3])"), 40)
 model.do()
 model.end()
index f5ce125b4120318b538e3e3521e5605d93f3dcd2..d4336f5abb44d845e41fc6ba2cc0232834d77c84 100644 (file)
@@ -23,12 +23,7 @@ SketchLine_5 = Sketch_1.addLine(3, -15, 36, -56)
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc,
-                                 [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_5r"),
-                                  model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f")],
-                                 model.selection(), 10, 0)
-Union_1 = model.addUnion(Part_1_doc,
-                         [model.selection("SOLID", "Extrusion_1_1_1"),
-                          model.selection("SOLID", "Extrusion_1_1_2")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_5r"), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_5f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
+Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_1"), model.selection("SOLID", "Extrusion_1_1_2")])
 model.do()
 model.end()
index 910a623e3bd48907dbbc846d0641782fc820b6d6..de815a28a64143fa181cc822f4103e8982a74d2a 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <sketch_launcher id="sketch"
                    attribute_list_id="base"
@@ -41,6 +20,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                   label="Direction"
                   tooltip="Select an edge for direction"
                   shape_types="edge"
+                  geometrical_selection="true"
                   default="&lt;base normal&gt;">
     <validator id="GeomValidators_ShapeType" parameters="empty,line"/>
   </shape_selector>
@@ -74,6 +54,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                         label="Plane face"
                         tooltip="Bounding plane (select a planar face)"
                         shape_types="face"
+                        geometrical_selection="true"
                         default="&lt;base sketch&gt;">
           <validator id="GeomValidators_Face" parameters="plane"/>
         </shape_selector>
@@ -90,6 +71,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                         label="Plane face"
                         tooltip="Bounding plane (select a planar face)"
                         shape_types="face"
+                        geometrical_selection="true"
                         default="&lt;base sketch&gt;">
           <validator id="GeomValidators_Face" parameters="plane"/>
         </shape_selector>
old mode 100755 (executable)
new mode 100644 (file)
index b176ddc..e0c30ab
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Extrusion">
     <sketch_launcher id="sketch"
@@ -43,6 +22,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Direction"
                     tooltip="Select an edge for direction"
                     shape_types="edge"
+                    geometrical_selection="true"
                     default="&lt;base normal&gt;">
       <validator id="GeomValidators_ShapeType" parameters="empty,line"/>
     </shape_selector>
@@ -76,6 +56,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;base sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
@@ -91,6 +72,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;base sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
index e65b6b4af990bcdcb52914206dae5522a2fd9ade..932f7d8a1a3077d20947ea2dac580f9997acfb00 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Extrusion">
     <sketch_launcher id="sketch"
@@ -43,6 +22,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Direction"
                     tooltip="Select an edge for direction"
                     shape_types="edge"
+                    geometrical_selection="true"
                     default="&lt;base normal&gt;">
       <validator id="GeomValidators_ShapeType" parameters="empty,line"/>
     </shape_selector>
@@ -76,6 +56,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;base sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
@@ -91,6 +72,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;base sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
index 1ccb5bc55430dbe77ee42f7361483e5ec0f74be2..898173efb0e273c43c1de1c60c895b8ca5d4c6e0 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="creation_method">
     <box id="fixed_radius"
index eb123bf15ad0df1fafbd5b06fd4d523ec89c5777..3869b147ad6e39c2c87735830187465e5eee4516 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <shape_selector id="base_shape"
                   label="Shape:"
index a0a4a5099c7e8f4d7903b214933fa1dfe26be987..167080c6efe9d481d23a18e8b095054e1402e24d 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="main_objects"
     label="Objects"
index cd3012cbe1f44261a561f1efcea5c9dd3648f2d8..3f5ca15e748fdbcbd49f64fd0ea604f8404033d5 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="MeasureKind">
     <box id="Length" title="Edge length" icon="icons/Features/meas_length_32x32.png">
index e0357b1f45e78746e70eac77c094442febf8bc73..a14b35035d8a4ae6c74e5b159c772c4fa67ff43d 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
-
 <source>
   <multi_selector id="main_objects"
                   label="Main objects"
@@ -15,7 +13,8 @@
                     label="Axis"
                     tooltip="Select an edge for the axis of rotation"
                     shape_types="edge"
-                    default="">
+                    default=""
+                    geometrical_selection="true">
       <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
     <optionalbox id="use_step_angular" title="Angular step">
index b6137c34ec3a8c3522ea408efb45ddf957312259..b7cf37cb0059e40a91d4aed1d07e1951d53f41ed 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="main_objects"
                   label="Main objects"
@@ -34,7 +13,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Axis"
                     tooltip="Select an edge for the first direction"
                     shape_types="edge"
-                    default="">
+                    default=""
+                    geometrical_selection="true">
       <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
     <doublevalue id="step_first_dir"
@@ -58,7 +38,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Axis"
                     tooltip="Select an edge for the second direction"
                     shape_types="edge"
-                    default="">
+                    default=""
+                    geometrical_selection="true">
       <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
     <doublevalue id="step_second_dir"
old mode 100755 (executable)
new mode 100644 (file)
index 05dec48..a0d358b
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
     label="Base objects:"
index f472fb00e308691e92fdd10c2c7db15ef9c9894b..11a967d03fc33b59e4ae85c5dd602cc3e704e15b 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
                   label="Base objects:"
index 42a493390a912e2c7ce45ee764252c21bfc0e315..b62c06dba3bc48c0098fd721aab5f937e96b3403 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="placement_objects_list"
     label="Select objects to move"
@@ -32,14 +11,16 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     label="Select an object"
     icon="icons/Features/placement_from.png"
     tooltip="Select a start face, edge or vertex"
-    shape_types="face edge vertex">
+    shape_types="face edge vertex"
+    geometrical_selection="true">
     <validator id="GeomValidators_BodyShapes"/>
   </shape_selector>
   <shape_selector id="placement_end_shape"
     label="Select an object"
     icon="icons/Features/placement_to.png"
     tooltip="Select an end face, edge or vertex"
-    shape_types="face edge vertex">
+    shape_types="face edge vertex"
+    geometrical_selection="true">
     <validator id="PartSet_DifferentObjects"/>
     <validator id="GeomValidators_BodyShapes"/>
   </shape_selector>
index 090e9e5d60de317a08835efbd78f2caf3a2c09e9..e5c1574856de1c8c7214f9c0db6d9ee94350e8b1 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Features" document="Part">
     <group id="Transformation">
index 25044b4cd9c40b568a3348f9816e4fb9bc89100f..0e2f865f6e7c32f507448a8748e8e966a5e4ed53 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <feature_selector id="base_feature"
                   label="Feature:"
index 92cb0aab07e22f78261d5b8a9d6da33ec3ca9a2a..c880f816d233c32e553460f0d863a26e4ac723dd 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <shape_selector id="base_shape"
                   label="Shape:"
index 3d71c3d844b90a41682dbd5bfe7227b35f8abf25..e5a28b89f50745a5f8d0da40d9c0d8ee45be6e4c 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <sketch_launcher id="sketch"
                    attribute_list_id="base"
@@ -41,6 +20,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                   label="Axis"
                   tooltip="Select an edge for axis"
                   shape_types="edge"
+                  geometrical_selection="true"
                   default="">
     <validator id="GeomValidators_ShapeType" parameters="line"/>
   </shape_selector>
@@ -74,6 +54,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                         label="Plane face"
                         tooltip="Bounding plane (select a planar face)"
                         shape_types="face"
+                        geometrical_selection="true"
                         default="&lt;base sketch&gt;">
           <validator id="GeomValidators_Face" parameters="plane"/>
         </shape_selector>
@@ -90,6 +71,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                         label="Plane face"
                         tooltip="Bounding plane (select a planar face)"
                         shape_types="face"
+                        geometrical_selection="true"
                         default="&lt;base sketch&gt;">
           <validator id="GeomValidators_Face" parameters="plane"/>
         </shape_selector>
index 12f2f247f45e509048e9dd951573275a38668bfa..fc2b822436ece70a48478d90f01e68bd68659a89 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Revolution">
     <sketch_launcher id="sketch"
@@ -43,6 +22,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Axis"
                     tooltip="Select an edge for axis"
                     shape_types="edge"
+                    geometrical_selection="true"
                     default="">
       <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
@@ -76,6 +56,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
@@ -91,6 +72,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
index 6d1bb83945ef55b9e1a08688f8ea6173cb2ae147..575c6c4bf37718d97e5db09cd64328184b3505d8 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Revolution">
     <sketch_launcher id="sketch"
@@ -43,6 +22,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                     label="Axis"
                     tooltip="Select an edge for axis"
                     shape_types="edge"
+                    geometrical_selection="true"
                     default="">
       <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
@@ -76,6 +56,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
@@ -91,6 +72,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                           label="Plane face"
                           tooltip="Bounding plane (select a planar face)"
                           shape_types="face"
+                          geometrical_selection="true"
                           default="&lt;sketch&gt;">
             <validator id="GeomValidators_Face" parameters="plane"/>
           </shape_selector>
old mode 100755 (executable)
new mode 100644 (file)
index c07bd8b..def2c3f
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="ByAxisAndAngle"
@@ -37,7 +16,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                   label="Axis"
                   tooltip="Select an edge for axis"
                   shape_types="edge"
-                  default="">
+                  default=""
+                  geometrical_selection="true">
         <validator id="GeomValidators_ShapeType" parameters="line"/>
       </shape_selector>
       <doublevalue id="angle"
index f0da16c198d86561ea844562b836a484a5681d3d..6dc4303c15b479f99015454eda0010ec39603c8d 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="ByFactor"
index 9923217faaed1415bab958bc097afdd7ceed7a27..bda3367eaf34269f9c92bed42afd06d365afbe8c 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="ByPoint" title="Point reflection" icon="icons/Features/symmetry_point_32x32.png">
@@ -53,7 +32,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Axis"
                       tooltip="Select an axis"
                       shape_types="edge"
-                      default="">
+                      default=""
+                      geometrical_selection="true">
         <validator id="GeomValidators_ShapeType" parameters="line"/>
       </shape_selector>
     </box>
index 28bb25115ef0ba4363f26de0757ae7442001644f..ca02649513c9debeafe44ae95b7921ff7ce22edb 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="ByAxisAndDistance"
@@ -37,7 +16,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                       label="Axis"
                       tooltip="Select an edge for axis"
                       shape_types="edge"
-                      default="">
+                      default=""
+                      geometrical_selection="true">
         <validator id="GeomValidators_ShapeType" parameters="line"/>
       </shape_selector>
       <doublevalue id="distance"
index 2d14a54bd2515186a1ed85813ce7a01d0f8b7bdd..966068352604118bbc8cab10fe4edf772a2bcb86 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <multi_selector id="base_objects"
     label="Base objects:"
index 20c2a121c3be29d9092c9d9d97a7b1f76f0d1b07..19d9ed3de068c88abe1200fefe292952e8b25626 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 2a37325afd5f439b3a3a7f45f8cc0a6b11b8efd4..c23f8e9bc034ad945fddc10b6ebc6be0204ef2d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLAPI_H
index 25516108d34d1ddb4ce0bfb962d969306884fca2..9d9707f3fa27c6927d61d70ce404806ae58120bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* GDMLAPI.i */
index a68dab5b016da4210e9322f5b756ed2ad2a6e6d4..3492f7449025de96c57ca861503b3b1929bb31a6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GDMLAPI_ConeSegment.h"
@@ -87,7 +86,7 @@ void GDMLAPI_ConeSegment::dump(ModelHighAPI_Dumper& theDumper) const
   AttributeDoublePtr anAttrDeltaPhi = aBase->real(GDMLPlugin_ConeSegment::DELTAPHI_ID());
   theDumper << ", " << anAttrRMin1 << ", " << anAttrRMax1;
   theDumper << ", " << anAttrRMin2 << ", " << anAttrRMax2;
-  theDumper << ", " << anAttrZ << ", " << anAttrStartPhi << " , " << anAttrDeltaPhi;
+  theDumper << ", " << anAttrZ << ", " << anAttrStartPhi << ", " << anAttrDeltaPhi;
 
   theDumper << ")" << std::endl;
 }
index c7a40d1cf66b2b31491f7e4e56549165c97e2e6d..2560ff2b58c975836995759c312cac97fb51380f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLAPI_ConeSegment_H_
index 167d6aa64fd8995c64939ad3268bc4aad9ccf0a0..5b606f1d6abd61361fa791c191259d600c22cd49 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GDMLAPI_Ellipsoid.h"
index dcc93ff9295523dbae991a7507a8a6f49aaa4784..6b519bad402d7e3725f70222228354cd87858d7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLAPI_Ellipsoid_H_
index 91571affdf5a9c3391dc62dc16d5b35581cd4aa2..65178ea8aaa8f566b3a4e4a3706709e94bfacf96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLAPI_swig_H_
index f2d4c1b6f0c2609c5514769e0254d86f0e3759b3..bd8e77a4448f7eaa17701024df6667a0d461455a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -70,5 +69,7 @@ INSTALL(TARGETS GDMLPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
 INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/GDML)
 
-ADD_UNIT_TESTS()
-
+#ADD_UNIT_TESTS(
+#  TestCone.py
+#  TestEllipsoid.py
+#)
index 6ac748bd354b79f7a6832005c044f2f3adb5507e..96b3642cb8dfe8d518d91a1fd0f33d4bfd6e443c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLPLUGIN_H
index 2429edd78744ceb42dfd34179252e312340cc992..cd7874f9caa05661115d5ab54e1b81709e9c13be 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GDMLPlugin_ConeSegment.h>
@@ -94,13 +93,13 @@ void GDMLPlugin_ConeSegment::loadNamingDS(
   theConeSegmentAlgo->prepareNamingFaces();
 
   // Insert to faces
-  int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
     theConeSegmentAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultConeSegment->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it != listOfFaces.end();
+       ++it)
+  {
+    theResultConeSegment->generated((*it).second, (*it).first);
   }
 }
 
index 921b51e7eb728b8145b477748345097722ca5645..68a27f8b9e14de25c8ac494ff07cef1c929d6067 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLPLUGIN_CONESEGMENT_H_
index 55e2d14454f6f688a69b55f5634bd632b2dbdddd..4f92544391afae0d83f07ccbae8c70c6f8f0a3c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GDMLPlugin_Ellipsoid.h>
@@ -113,23 +112,26 @@ void GDMLPlugin_Ellipsoid::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Ellipsoid> t
 
   // Insert to faces
   // Naming for faces and edges
-  int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
       theEllipsoidAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultEllipsoid->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it!=listOfFaces.end();
+       ++it)
+  {
+    theResultEllipsoid->generated((*it).second, (*it).first);
   }
 
   // Naming vertices
   GeomAPI_DataMapOfShapeShape aVertices;
-  GeomAPI_ShapeExplorer aVertExp(theEllipsoidAlgo->shape(), GeomAPI_Shape::VERTEX);
-  for(int anIndex = 1; aVertExp.more(); aVertExp.next()) {
+  int anIndex = 1;
+  for (GeomAPI_ShapeExplorer aVertExp(theEllipsoidAlgo->shape(), GeomAPI_Shape::VERTEX);
+       aVertExp.more();
+       aVertExp.next())
+  {
     if (!aVertices.isBound(aVertExp.current())) {
       std::ostringstream aStream;
       aStream<<"Vertex_"<<anIndex++;
-      theResultEllipsoid->generated(aVertExp.current(), aStream.str(), num++);
+      theResultEllipsoid->generated(aVertExp.current(), aStream.str());
       aVertices.bind(aVertExp.current(), aVertExp.current());
     }
   }
index 649afcf3a7dd7396b29051871d7b27d887d04312..b62595d4d9fbf77fc8b4c271dbd03d1ab70fb680 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLPLUGIN_ELLIPSOID_H_
index 168ae380e05c44db301fc8b368feb11831593518..ba58aac346670b75c91b8497e0cc270be73eeb5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Session.h>
index cd06d277e6a38fe135706ea6eb4257c78fa0e396..4fe12c53527d365751af0c4d785119ac773e8a84 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GDMLPLUGIN_PLUGIN_H_
diff --git a/src/GDMLPlugin/Test/TestCone.py b/src/GDMLPlugin/Test/TestCone.py
new file mode 100644 (file)
index 0000000..5351f27
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+ConeSegment_1 = model.addConeSegment(Part_1_doc, 7, 11, 5, 8, 12, 0, 270)
+model.end()
+
+model.testNbResults(ConeSegment_1, 1)
+model.testNbSubResults(ConeSegment_1, [0])
+model.testNbSubShapes(ConeSegment_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(ConeSegment_1, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(ConeSegment_1, GeomAPI_Shape.EDGE, [24])
+model.testNbSubShapes(ConeSegment_1, GeomAPI_Shape.VERTEX, [48])
+model.testResultsVolumes(ConeSegment_1, [1545.663585663386584201361984015])
+
+assert(model.checkPythonDump())
diff --git a/src/GDMLPlugin/Test/TestEllipsoid.py b/src/GDMLPlugin/Test/TestEllipsoid.py
new file mode 100644 (file)
index 0000000..5dbe33b
--- /dev/null
@@ -0,0 +1,113 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
+
+model.begin()
+partSet = model.moduleDocument()
+
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Ellipsoid_1 = model.addEllipsoid(Part_1_doc, 10, 20, 40)
+
+model.testNbResults(Ellipsoid_1, 1)
+model.testNbSubResults(Ellipsoid_1, [0])
+model.testNbSubShapes(Ellipsoid_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Ellipsoid_1, GeomAPI_Shape.FACE, [1])
+model.testNbSubShapes(Ellipsoid_1, GeomAPI_Shape.EDGE, [4])
+model.testNbSubShapes(Ellipsoid_1, GeomAPI_Shape.VERTEX, [8])
+model.testResultsVolumes(Ellipsoid_1, [4188.80255909031])
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Ellipsoid_2 = model.addEllipsoid(Part_2_doc, 20, 10, 30, 5, 5)
+
+model.testNbResults(Ellipsoid_2, 1)
+model.testNbSubResults(Ellipsoid_2, [0])
+model.testNbSubShapes(Ellipsoid_2, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Ellipsoid_2, GeomAPI_Shape.FACE, [3])
+model.testNbSubShapes(Ellipsoid_2, GeomAPI_Shape.EDGE, [6])
+model.testNbSubShapes(Ellipsoid_2, GeomAPI_Shape.VERTEX, [12])
+model.testResultsVolumes(Ellipsoid_2, [1512.62177363772])
+
+Part_3 = model.addPart(partSet)
+Part_3_doc = Part_3.document()
+Ellipsoid_3 = model.addEllipsoid(Part_3_doc, 20, 20, 40)
+Ellipsoid_3.setZCut1(5)
+
+model.testNbResults(Ellipsoid_3, 1)
+model.testNbSubResults(Ellipsoid_3, [0])
+model.testNbSubShapes(Ellipsoid_3, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Ellipsoid_3, GeomAPI_Shape.FACE, [2])
+model.testNbSubShapes(Ellipsoid_3, GeomAPI_Shape.EDGE, [7])
+model.testNbSubShapes(Ellipsoid_3, GeomAPI_Shape.VERTEX, [14])
+model.testResultsVolumes(Ellipsoid_3, [5726.87643051263])
+
+Part_4 = model.addPart(partSet)
+Part_4_doc = Part_4.document()
+Ellipsoid_4 = model.addEllipsoid(Part_4_doc, 20, 20, 40)
+Ellipsoid_4.setZCut2(5)
+
+model.testNbResults(Ellipsoid_4, 1)
+model.testNbSubResults(Ellipsoid_4, [0])
+model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.FACE, [2])
+model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.EDGE, [7])
+model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.VERTEX, [14])
+model.testResultsVolumes(Ellipsoid_4, [5726.87643051263])
+
+# Check ellipsoid errors
+Part_5 = model.addPart(partSet)
+Part_5_doc = Part_5.document()
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 0, 20, 30)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 0, 30)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 0)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, -5, 5)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, 5, -5)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, 0, 0)
+model.do()
+assert(Ellipsoid_5.feature().error() != "")
+Part_5_doc.removeFeature(Ellipsoid_5.feature())
+
+partSet.removeFeature(Part_5.feature())
+
+model.end()
+
+assert(model.checkPythonDump())
index 7d10aa14688e4681b0015a06d89e1e7d7d55c19a..8dbc3f73765ffa1d59551d2606e66b3f4d31ee06 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Base face">
     <doublevalue
index 62da54f8e5d94ddcf76a4d1e77b84b48871c3b44..cef5822758e838f045b2bdb5be4a581ed0e0c398 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <groupbox title="Dimensions">
     <doublevalue id="ax"
index 47e3075ccf1b0ff3bb54ca2dccf0384e764c0e75..5030f6bb94f9b64e1fe9327d2e9f650b144b1c91 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="GDML" document="Part">
     <group id="GDML">
index 0c1b55f631789742e3e3fbda3368b4d723324efe..a95efe2ce332b7f0c56742e846826ac46d38a12a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 
@@ -160,11 +159,17 @@ INSTALL(TARGETS GeomAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
 
 ADD_UNIT_TESTS(
+  TestAx123.py
   TestBox.py
+  TestBuilders.py
   TestCone.py
   TestCylinder.py
+  TestEllipse2d.py
+  TestLine.py
+  TestPlanarEdge.py
   TestPolygon.py
   TestSphere.py
   TestTorus.py
   Test2675.py
+  Test2879.py
 )
index 2bf2ed3917c4a5cbed57ccc7ca1c703ad52fd0f4..01c885a6874ec825feadfb39da16a7807cce506c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMAPI_H
index aa26482458d7cac892cda2ac8a9a319fe1a1ba03..061eedfed7d877577bcfbcac4485d4724d4b2ca3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* GeomAPI.i */
index c323a7835704631979c04f3dd8fefb1755444a3a..7a86b1e8c410e3e88eb24f06bc2c76febad1d672 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_AISObject.h>
index 54c6840b2197707f2e1883c2b920ab93486c7c38..57bfa3922804244541a58a5d1249272f700fd1de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_AISObject_H_
index ca1c06275c8d94d8281dcde566b2302787cbe6dc..02e16ef892f84ca629299ab46c8edf1945477d5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Angle.h>
index 678c7510f801486b51eebe027f3dd381399a85eb..97ae590ae40b49853ff14451ea257c6949028755 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Angle_H_
index 7aa1df7c5267bc2d12e74ad6e951ab1d3c08041f..bb093cb0caa3ef22c9bda6e267a71cff6f3cf772 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Angle2d.h>
index 78846df72ad53277d4962d1bb5f01e982201cd17..c58b54856d1849e6f8d13172315fb972501408b7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Angle2d_H_
index b48a6f396668e6c091de01d895f137126159d0e0..6bd97ca59010471c2a0ac1e734bbb58b7774f19d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Ax1.h>
index 3126c13e0f1b9ea564f8f0995c241a9216c8ddeb..91b9e9611d15b83edb5f35889a8e25ab463cc9c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMAPI_AX1_H_
index fb961197541b9243332d826eaf1cd31ea53b74d2..6565553d98b7fd2a1e9170265cb75295f9bdbef2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Ax2.h>
index 39cd19c3f42e94cd0796d1b3558ff64844f47c86..1e6a20c65c7bc5c66f130b118759f2ce5a590c59 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Ax2_H_
index 5dd911edf7e10f1d508a43d38ecfbb4223da46bb..d45c4f75416376ec26e9eab5753967067c1c9fcc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Ax3.h"
@@ -107,12 +106,12 @@ std::shared_ptr<GeomAPI_Pnt> GeomAPI_Ax3::to3D(double theX, double theY) const
 std::shared_ptr<GeomAPI_Pnt2d> GeomAPI_Ax3::to2D(double theX, double theY, double theZ) const
 {
   gp_Pnt anOriginPnt = MY_AX3->Axis().Location();
-  gp_Vec aVec(anOriginPnt, gp_Pnt(0, 0, 0));
+  gp_Vec aVec(anOriginPnt, gp_Pnt(theX, theY, theZ));
 
   gp_Dir aXDir = MY_AX3->XDirection();
   gp_Dir aYDir = MY_AX3->YDirection();
 
   double aX = aVec.X() * aXDir.X() + aVec.Y() * aXDir.Y() + aVec.Z() * aXDir.Z();
-  double aY = aVec.X() * aYDir.X() + aVec.Y() * aYDir.Y() + aVec.Z() * aYDir.Y();
+  double aY = aVec.X() * aYDir.X() + aVec.Y() * aYDir.Y() + aVec.Z() * aYDir.Z();
   return std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aX, aY));
 }
index 3da31148a9aeeee0be0122fb20e52478d2ac705b..68115e4281ca584ceed2cc60f3c89becd5521f54 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMAPI_AX3_H_
index 68fe4db81db366692b81b4699adcb2833056161c..f319789dc438ac00a3284a4f94c013b7a907a9b0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Box.h>
@@ -43,12 +42,6 @@ struct Box
 
 #define MY_BOX implPtr<Box>()
 
-//=================================================================================================
-GeomAPI_Box::GeomAPI_Box()
-  : GeomAPI_Interface(new Box(std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3), 0., 0., 0.))
-{
-}
-
 //=================================================================================================
 GeomAPI_Box::GeomAPI_Box(const std::shared_ptr<GeomAPI_Ax3>& theCorner,
                          const double theWidth,
index c3c9673cc1ed9d624af2864ffefeeba26bd28467..2ef03db0bf9e78312bde3f6c7f978139a6744294 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Box_H_
@@ -34,9 +33,6 @@ class GeomAPI_Pnt;
 class GeomAPI_Box : public GeomAPI_Interface
 {
 public:
-  /// Default constructor
-  GEOMAPI_EXPORT GeomAPI_Box();
-
   /// Creation of torus defined by center point, direction, major and minor radii
   GEOMAPI_EXPORT GeomAPI_Box(const std::shared_ptr<GeomAPI_Ax3>& theCorner,
                              const double theWidth,
index 87662f275a42cdc2e18a4510c50b4bb8ed2621d9..facc1ec2a970ac4315c08bbc01f8fa8465e292f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Circ.h>
index 4fe0c82407f4a8d2e4dcd52e005dff5551a1238f..098c9ccaa4f615c5dfe98f639d2f1b3c89e4a055 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Circ_H_
index 5df372df7d1762ae09d2ec65984abcd522dc2b2d..5204f25e5ca5def7ac0d599552ca98c73737a5fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Circ2d.h>
index f78efac2263d94d8429a4aa6e65d5ad3d75ddf67..479f6edf63feb4963033899e02f46caa74d0774c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Circ2d_H_
index c8344c3acf960bc4a0465d57bb69f87863d8fb0a..a08a07535e93dc1f9d1cd73961c1ef227e0b03e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Cone.h>
index bfc901debf51075fbe807357c33a455ce722a90f..5cc77b2bf12ca93a6d5ae6a51ad2c237e326861b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Cone_H_
index f0c5e6782d10a78cf06ee1203999887c8ba0b013..07fb93d65c858bfc5b3be00cf2bdc4f9ab91ad77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Curve.h>
index 70bafd8299240d441fea44ac9f4d8de6a0a73b2c..d002d4250189c63bb5015d681424bfc7ecf38784 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Curve_H_
index 0e043bbc7126e294a5238fc70483434518de174d..35b23e73bf922061f6f45107cd16cec9bb337242 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Cylinder.h>
index 025a8e0de6b0d33a1ea74075b72586a8152d2c63..da78aeb36a87e889be33b5e10a84d2b4baec434a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Cylinder_H_
index a7497c0dc511501d449e667aa10c8c486263b47e..ad4d1c324383affc8fe868ae493f58953120fa39 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_DataMapOfShapeMapOfShapes.h>
@@ -115,6 +114,7 @@ int GeomAPI_DataMapOfShapeMapOfShapes::size() const
   return MY_MAP->Size();
 }
 
+// LCOV_EXCL_START
 
 //=================================================================================================
 //   iterator implementation
@@ -269,3 +269,4 @@ GeomAPI_DataMapOfShapeMapOfShapes::const_iterator GeomAPI_DataMapOfShapeMapOfSha
 {
   return IteratorImpl(std::shared_ptr<IteratorImpl>());
 }
+// LCOV_EXCL_STOP
index 395abae3444c6cba1c40305d8be7a2d38a3d6da8..b5c9ae05a1733490248e01544c144331b6165573 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_DataMapOfShapeMapOfShapes_H_
index 3ee6778eedf2fded996ceed1d0d207c5fd8634b2..a311cafbc6901e894b52da3aa8c6a201d3297799 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Shape.h>
index 1d09aff6b1cc102a9df79dadaa6cfd95b0130ec1..42d811bb08bb3d41b4aa7944fda4ec72745c9bfa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_DataMapOfShapeShape_H_
index 6ed07714e96ed643e6328fe6c67c11b14490be84..e6261c0d75a5a28fc549c979dadd095a7d277715 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Dir.h>
index 7e2a0bda7f0580b04afb36d4f7be963839fdabc0..8fd6a1328f8e6003cc87663f7c34cb7eb6b91ce8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Dir_H_
index 747b84e35459295b69564dbbd726c460958f548f..38a0ec56f609608ff480edfce11a3514ff3b0f98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Dir2d.h>
index 810ec4c3dbd759d6d54d2a500172e705dbf95d06..c525e8c3fc2a86e691d352b38d155c553db87e8b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Dir2d_H_
index 01c98124c438de5cc5fd096a8412f0a68d49526d..ede977f30df08670d940ebbf007986f89286d43f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Edge.h>
@@ -39,6 +38,7 @@
 #include <Geom_Curve.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_Circle.hxx>
+#include <Geom_TrimmedCurve.hxx>
 #include <Geom_Ellipse.hxx>
 #include <Geom_Plane.hxx>
 #include <GeomAPI_IntCS.hxx>
@@ -79,15 +79,29 @@ bool GeomAPI_Edge::isLine() const
   return false;
 }
 
+/// extracts a circle curve from the arbitrary curve, returns null is it is different type
+static Handle(Geom_Circle) circ(const Handle(Geom_Curve) theCurve)
+{
+  Handle(Geom_Circle) aResult = Handle(Geom_Circle)::DownCast(theCurve);
+  if (!aResult.IsNull())
+    return aResult;
+  // check this may be a trimmed curve that contains circle inside
+  Handle(Geom_TrimmedCurve) aTrimmed = Handle(Geom_TrimmedCurve)::DownCast(theCurve);
+  while(!aTrimmed.IsNull()) {
+    aResult = Handle(Geom_Circle)::DownCast(aTrimmed->BasisCurve());
+    if (!aResult.IsNull())
+      return aResult;
+    aTrimmed = Handle(Geom_TrimmedCurve)::DownCast(aTrimmed->BasisCurve());
+  }
+  return aResult; // null, not circle
+}
+
 bool GeomAPI_Edge::isCircle() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   double aFirst, aLast;
   Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
-  if (aCurve.IsNull()) // degenerative edge
-    return false;
-  if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)))
-  {
+  if (!circ(aCurve).IsNull()) {
     // Check the difference of first and last parameters to be equal to the curve period
     if (Abs(aLast - aFirst - aCurve->Period()) < Precision::PConfusion())
       return true;
@@ -100,10 +114,7 @@ bool GeomAPI_Edge::isArc() const
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   double aFirst, aLast;
   Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
-  if (aCurve.IsNull()) // degenerative edge
-    return false;
-  if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)))
-  {
+  if (!circ(aCurve).IsNull()) {
     // Check the difference of first and last parameters is not equal the curve period
     if (Abs(aLast - aFirst - aCurve->Period()) >= Precision::PConfusion())
       return true;
@@ -148,15 +159,13 @@ std::shared_ptr<GeomAPI_Circ> GeomAPI_Edge::circle() const
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   double aFirst, aLast;
   Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
-  if (!aCurve.IsNull()) {
-    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(aCurve);
-    if (!aCirc.IsNull()) {
-      gp_Pnt aLoc = aCirc->Location();
-      std::shared_ptr<GeomAPI_Pnt> aCenter(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
-      gp_Dir anAxis = aCirc->Axis().Direction();
-      std::shared_ptr<GeomAPI_Dir> aDir(new GeomAPI_Dir(anAxis.X(), anAxis.Y(), anAxis.Z()));
-      return std::shared_ptr<GeomAPI_Circ>(new GeomAPI_Circ(aCenter, aDir, aCirc->Radius()));
-    }
+  Handle(Geom_Circle) aCirc = circ(aCurve);
+  if (!aCirc.IsNull()) {
+    gp_Pnt aLoc = aCirc->Location();
+    std::shared_ptr<GeomAPI_Pnt> aCenter(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
+    gp_Dir anAxis = aCirc->Axis().Direction();
+    std::shared_ptr<GeomAPI_Dir> aDir(new GeomAPI_Dir(anAxis.X(), anAxis.Y(), anAxis.Z()));
+    return std::shared_ptr<GeomAPI_Circ>(new GeomAPI_Circ(aCenter, aDir, aCirc->Radius()));
   }
   return std::shared_ptr<GeomAPI_Circ>(); // not circle
 }
@@ -175,7 +184,7 @@ std::shared_ptr<GeomAPI_Ellipse> GeomAPI_Edge::ellipse() const
       return aEllipse;
     }
   }
-  return std::shared_ptr<GeomAPI_Ellipse>(); // not elipse
+  return std::shared_ptr<GeomAPI_Ellipse>(); // not ellipse
 }
 
 std::shared_ptr<GeomAPI_Lin> GeomAPI_Edge::line() const
@@ -240,6 +249,7 @@ bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
   return true;
 }
 
+// LCOV_EXCL_START
 void GeomAPI_Edge::getRange(double& theFirst, double& theLast) const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
@@ -265,24 +275,26 @@ bool GeomAPI_Edge::isInPlane(std::shared_ptr<GeomAPI_Pln> thePlane) const
     gp_Pnt aLastPnt = aCurve->Value(aLast);
     inPlane = aPlane.SquareDistance(aFirstPnt) < Precision::SquareConfusion() &&
               aPlane.SquareDistance(aLastPnt) < Precision::SquareConfusion();
-  } else if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle))) {
-    // check the center on the plane and normals are collinear
-    Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(aCurve);
-    gp_Pnt aCenter = aCirc->Location();
-    Standard_Real aDot = aPlane.Axis().Direction().Dot(aCirc->Axis().Direction());
-    inPlane = aPlane.SquareDistance(aCenter) < Precision::SquareConfusion() &&
-              Abs(Abs(aDot) - 1.0) < Precision::Confusion();
   } else {
-    // three points checking
-    gp_Pnt aFirstPnt = aCurve->Value(aFirst);
-    gp_Pnt aMidPnt = aCurve->Value((aFirst + aLast) / 2.);
-    gp_Pnt aLastPnt = aCurve->Value(aLast);
-    inPlane = aPlane.SquareDistance(aFirstPnt) < Precision::SquareConfusion() &&
-              aPlane.SquareDistance(aMidPnt) < Precision::SquareConfusion() &&
-              aPlane.SquareDistance(aLastPnt) < Precision::SquareConfusion();
+    Handle(Geom_Circle) aCirc = circ(aCurve);
+    if (!aCirc.IsNull()) {
+      gp_Pnt aCenter = aCirc->Location();
+      Standard_Real aDot = aPlane.Axis().Direction().Dot(aCirc->Axis().Direction());
+      inPlane = aPlane.SquareDistance(aCenter) < Precision::SquareConfusion() &&
+                Abs(Abs(aDot) - 1.0) < Precision::Confusion();
+    } else {
+      // three points checking
+      gp_Pnt aFirstPnt = aCurve->Value(aFirst);
+      gp_Pnt aMidPnt = aCurve->Value((aFirst + aLast) / 2.);
+      gp_Pnt aLastPnt = aCurve->Value(aLast);
+      inPlane = aPlane.SquareDistance(aFirstPnt) < Precision::SquareConfusion() &&
+                aPlane.SquareDistance(aMidPnt) < Precision::SquareConfusion() &&
+                aPlane.SquareDistance(aLastPnt) < Precision::SquareConfusion();
+    }
   }
   return inPlane;
 }
+// LCOV_EXCL_STOP
 
 void GeomAPI_Edge::intersectWithPlane(const std::shared_ptr<GeomAPI_Pln> thePlane,
                                       std::list<std::shared_ptr<GeomAPI_Pnt>>& theResult) const
index a375b100ee5586f887442cad012059c43c5a3c93..eb3b668a8c5f02d5f175134c31a3d6f2647a1d62 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Edge_H_
@@ -123,7 +122,7 @@ public:
   virtual std::shared_ptr<GeomAPI_Pnt> middlePoint() const;
 };
 
-//! Pointer on attribute object
+//! Pointer on object
 typedef std::shared_ptr<GeomAPI_Edge> GeomEdgePtr;
 
 #endif
index 23247f8435186e8050a71134b4c1464d8250edfd..c9384724ac380a8ea90abedfbdb278e172b37652 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        GeomAPI_Ellipse.cpp
index fa79bd0226917c1127507518e3bbf523b29e1bb7..ac63dd97ec3bfb80d8f60cef0af4512d0a53898a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        GeomAPI_Ellipse.h
index d789f717fe3c9c78f45393d9168964c6ac754e60..20338230448d0cc057133aa0b7b643e9a6658cc9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        GeomAPI_Ellipse2d.cpp
index ef8840d4a59bf894d4302cb346a1382814bce9cd..11c11f93492a49c0e8827d3b0dbb6c0542f43c7b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        GeomAPI_Ellipse2d.h
index bf2dbddf17bd7984038420423b2d94ffd5b6b255..c17fe87d3ec243f47aa5fd42269f5047be7c1514 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Face.h"
index c50e980d03e55e67be44bdd12626504e53b6d3e2..271667107557da13f0aeb486bf2fdf02ac41e50c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Face_H_
index 353a42bce6e38cbb7a5b4df62ad86fc2e5eda12f..fcbb54fc70252d48ff6574270ca895688e238cb5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_ICustomPrs.h>
index 176c86f58c552d2084aa5295fad187ef4a63afe5..8a595d1028e2cdd8a5c9691962d1154be122d65b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_ICustomPrs_H
index 13153bf8df32d86144cdd2b6eed84931659dd4a8..c4ccf0070fe6b2701f12afaa30b9aa3ffc99d835 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // This file is added in order to avoid a problem with
index b04b2e97627f5f49f3b218a8dcab43d23726eaaf..a7b83a1856f428fda714b7a23dc0e8688fcc5465 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_IPresentable_H_
index 8a6c09283f91c604e0abc470d7906d4be33bec9c..812349c4829fd2789a7bc75a59cc4658f23b406a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_IScreenParams_H_
index 025a4d4f9eb0859b8fbf0978f6fe01416d1db54a..70a2b0f43111eaca668038174c9ebf859a2055e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Interface.h>
index ee2a0837986cc022f7dd68f31a7e982fdfe9bbe8..2d94780a42079983fc185fc1984802121efb5b74 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Interface_H_
index d3f44a404aedef61c6d26e1c8625bf2a247f79d6..9b90edf5c090c3e9f60954493b6b84eb4eae824d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Lin.h>
index 71048019cdd90890436c36c5cebbd10aa6b47027..8bed9c31b24b99e9e8c56521fbcf59dc64358417 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Lin_H_
index 18351340a36e219c4591272dce20faf167276f81..8194a18d391cbc36bd3927fdeac4ec3672b53689 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Lin2d.h>
index 5249fe66f439f5f951ab5a14fd0e43fed27ea7bf..3fdda3048163340b611f9800183732be0c186845 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Lin2d_H_
index fa4686de7e8797971b1d0ffc20520d9fdad9c978..459ce060e3b2ca1bc05ee68fa4b1f552f35f35d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Interface.h>
@@ -122,6 +121,8 @@ bool GeomAPI_PlanarEdges::isEqual(const std::shared_ptr<GeomAPI_Shape> theShape)
     return false;
   TopoDS_Shape& aMyShape = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
   TopoDS_Shape aTheShape = theShape->impl<TopoDS_Shape>();
+  if (aMyShape.ShapeType() != aTheShape.ShapeType()) // to don't confuse by the face of same edges
+    return false;
   TopExp_Explorer aMyExp(aMyShape, TopAbs_EDGE);
   TopExp_Explorer aTheExp(aTheShape, TopAbs_EDGE);
   for (; aMyExp.More() && aTheExp.More(); aMyExp.Next(), aTheExp.Next()) {
index ef1cea8beeef1be375c07277592466338e6d956a..4520c4dfabaa8ef9d5a02e1560be97303afb59f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMAPI_WIRE_H_
@@ -35,7 +34,7 @@
  * \ingroup DataModel
  * \brief Interface to the set of edges located in one plane
  *
- * Normally this interface corresponds to theedges of the sketch
+ * Normally this interface corresponds to the edges of the sketch
  */
 class GeomAPI_PlanarEdges : public GeomAPI_Shape
 {
index 60e417c7c5df4d79f6c29ab2f9ecb2c8533f2c86..c52dda9d659e869e48c55bc1c6e19a1aeebe1977 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Pln.h>
@@ -120,6 +119,13 @@ double GeomAPI_Pln::distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const
   return aMyPln.Distance(anOtherPln);
 }
 
+double GeomAPI_Pln::distance(const std::shared_ptr<GeomAPI_Pnt> thePoint) const
+{
+  const gp_Pln& aMyPln = impl<gp_Pln>();
+  const gp_Pnt& aPnt = thePoint->impl<gp_Pnt>();
+  return aMyPln.Distance(aPnt);
+}
+
 void GeomAPI_Pln::translate(const std::shared_ptr<GeomAPI_Dir> theDir, double theDist)
 {
   gp_Vec aVec(theDir->impl<gp_Dir>());
index 863a72f617edfe1329eacf23220c0222a08bb000..9df0c882d1bbaf4b1283dc9e33d575e2088df816 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Pln_H_
@@ -82,6 +81,10 @@ class GeomAPI_Pln : public GeomAPI_Interface
   GEOMAPI_EXPORT
   double distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
 
+  /// \return distance from a point to this plane.
+  GEOMAPI_EXPORT
+  double distance(const std::shared_ptr<GeomAPI_Pnt> thePoint) const;
+
   /// Translates the plane along direction theDir on distance theDist
   GEOMAPI_EXPORT
   void translate(const std::shared_ptr<GeomAPI_Dir> theDir, const double theDist);
index 97d66fc6e28ccefb821e4df20a37adb7048e015e..4f7607c8fe5d7524df48e78b4abee954912eae09 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Pnt.h>
index d06d5d9fb1be8a0a210c697c611be2d8be89ce1a..693934412b107193e6af3a992d85bc8d7f291f23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Pnt_H_
index 78e7b2521cea18deb3647a3d20c615bc2b1cd898..a3205843456b9ac40f3553daab10963841250a74 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Pnt2d.h>
index ac6365a717d3fcdba76937ef82c96c8fc9e21976..ad8248576dcdcae9e3defcaa580735921aecc0e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Pnt2d_H_
index c4f30b6d321fb8aceee45910f7ce2f4cb0da47ee..7036f55378ede29acbbcf26dc3c9ae31e06c9320 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Shape.h"
@@ -152,6 +151,7 @@ bool GeomAPI_Shape::isCompoundOfSolids() const
   return isAtLeastOne;
 }
 
+// LCOV_EXCL_START
 GeomAPI_Shape::ShapeType GeomAPI_Shape::typeOfCompoundShapes() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
@@ -168,6 +168,7 @@ GeomAPI_Shape::ShapeType GeomAPI_Shape::typeOfCompoundShapes() const
   }
   return (GeomAPI_Shape::ShapeType) aType;
 }
+// LCOV_EXCL_STOP
 
 // adds the nopt-compound elements recursively to the list
 static void addSimpleToList(const TopoDS_Shape& theShape, NCollection_List<TopoDS_Shape>& theList)
@@ -609,6 +610,7 @@ GeomPointPtr GeomAPI_Shape::middlePoint() const
   return aMiddlePoint;
 }
 
+// LCOV_EXCL_START
 std::string GeomAPI_Shape::getShapeStream() const
 {
   std::ostringstream aStream;
@@ -616,6 +618,7 @@ std::string GeomAPI_Shape::getShapeStream() const
   BRepTools::Write(aShape, aStream);
   return aStream.str();
 }
+// LCOV_EXCL_STOP
 
 GeomShapePtr GeomAPI_Shape::intersect(const GeomShapePtr theShape) const
 {
@@ -685,3 +688,9 @@ bool GeomAPI_Shape::isSelfIntersected(const int theLevelOfCheck) const
 
   return false;
 }
+
+bool GeomAPI_Shape::Comparator::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape1,
+                                           const std::shared_ptr<GeomAPI_Shape>& theShape2) const
+{
+  return theShape1->impl<TopoDS_Shape>().TShape() < theShape2->impl<TopoDS_Shape>().TShape();
+}
index a70574aa4e44fb3fc54429c0e28fe4dbbec835f5..cf3222bca246fc178d895d381812016bebdc9121 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Shape_H_
@@ -219,6 +218,16 @@ public:
   /// 8 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S and F/S;<br>
   /// 9 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S, F/S and S/S - all interferences (Default value)
   GEOMAPI_EXPORT bool isSelfIntersected(const int theLevelOfCheck = 9) const;
+
+public:
+  class Comparator
+  {
+  public:
+    /// Return \c true if the address of the first shape is less than the address of the second
+    GEOMAPI_EXPORT
+    bool operator ()(const std::shared_ptr<GeomAPI_Shape>& theShape1,
+                     const std::shared_ptr<GeomAPI_Shape>& theShape2) const;
+  };
 };
 
 //! Pointer on list of shapes
index a604f7663ad11fd4da45fe6d3ab305dde6e58c40..85c8d9de9f2bca3ccdf84f95964645430bc52035 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_ShapeExplorer.h>
index a1835b0536c8564bdaf6c07028c66cd9d950b0c8..50cb4395980861aaa54ac05b39223d9213486024 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_ShapeExplorer_H_
index bda28ebe68f6253af2b43179682ec56aa358dca5..8b95e841b5b99963eee70c59f746da494c836f89 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_ShapeIterator.h"
index 65234b2e7bf8498cbe0470126de1f5a13e08f8dc..049da9484dbaf31103f662e8b91bd043bb630b8a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_ShapeIterator_H_
index ae5e12ae972a347398aa852ad71fefd8414fd931..c6a1e24f437d1f303d315206e7595df22fc00e66 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Shell.h"
index d92f6900033760e8ff5db08aab5a0e44226ac60d..ae6c6460667000f8e889051de8a628bcf0b71996 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Shell_H_
index 8ac3a38624f339617430b649a155d4dfc220d174..cc8dc6d04ca9068ff9e8f8171b6b418c8e737668 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Solid.h"
index 12519db242eddba875fdb454aa904f9ccc91a685..01b6b24500621871c33265b8107b3eace514b0de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Solid_H_
index 72e9eb5340cb0ef0e89da2b7114a199cfdc45819..2e36c0dda83f41d7e7167d1ca937b5758592f985 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Sphere.h>
index 4217733ac41aea7ca2a49865e525cf618d346229..f472c8c241a974dc7e264a00eccaf4a426c1d309 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Sphere_H_
index 0825957681036ae6d31270139c4cd882d46b6512..66756005c91b67a22a90910a1d8631f268444f6a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Tools.h"
@@ -28,6 +27,9 @@
 //==================================================================================================
 GeomShapePtr GeomAPI_Tools::getTypedShape(const GeomShapePtr& theShape)
 {
+  if (!theShape.get())
+    return GeomShapePtr();
+
   GeomShapePtr aTypedShape = theShape;
 
   GeomAPI_Shape::ShapeType aType = theShape->shapeType();
index 3ee2027c32098b28781201708f33b990693d4378..ab46380ec42ac48925418cdec27ec982f229ad96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Tools_H_
index b6da884e9f4c27fa7760aa5675326975139efe77..0c822aa1505139ff372e26070fec60c67c9714c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Torus.h>
index c8db45bf8c28fb4c10cbfb7811265b95907f20fc..536e031a78f82b53376033ea8a1aa48f504011fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Torus_H_
index 1262d4717b34c21bb1156c2c23903017e874a236..b2df2368d23654278ca988a470f47d7dec6286a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Trsf.h>
index 13ff325314c0b8f2bb92ac37884b9060fa407e29..80b492f09de163abb3b8fdf9a921981d51ab4090 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Trsf_H_
index b22c4a7bb49532360f465f8a9a267e612165e54f..683413c63e9a2aa92cdc35af97daa64a06464f29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_Vertex.h>
index cbde7b5382627ea84386ffd57c60e3b7068939fc..13668b6af2c4c1034c719c06d6ba5b1b99ad28d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Vertex_H_
index 05062a145cc25abc95b00133c5c7e91a7f52c145..c1124a353d5fc2b9f30e2ee6c4402a7882ebc665 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Wire.h"
@@ -24,6 +23,7 @@
 #include <BRep_Builder.hxx>
 #include <BRepTools_WireExplorer.hxx>
 #include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
 #include <Precision.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS.hxx>
@@ -85,6 +85,7 @@ bool GeomAPI_Wire::isRectangle(std::list<GeomPointPtr>& thePoints) const
 
   const TopoDS_Wire& aWire = TopoDS::Wire(impl<TopoDS_Shape>());
   const Handle(Standard_Type)& aLineType = STANDARD_TYPE(Geom_Line);
+  const Handle(Standard_Type)& aTrimmedCurveType = STANDARD_TYPE(Geom_TrimmedCurve);
 
   gp_XYZ aPrevDir(0, 0, 0);
 
@@ -92,6 +93,8 @@ bool GeomAPI_Wire::isRectangle(std::list<GeomPointPtr>& thePoints) const
     const TopoDS_Edge& anEdge = anExp.Current();
     double aT1, aT2;
     Handle(Geom_Curve) aC3D = BRep_Tool::Curve(anEdge, aT1, aT2);
+    while (aC3D->IsKind(aTrimmedCurveType))
+      aC3D = Handle(Geom_TrimmedCurve)::DownCast(aC3D)->BasisCurve();
     if (!aC3D.IsNull() && aC3D->IsKind(aLineType)) {
       gp_Pnt aCorner = BRep_Tool::Pnt(anExp.CurrentVertex());
       thePoints.push_back(GeomPointPtr(new GeomAPI_Pnt(aCorner.X(), aCorner.Y(), aCorner.Z())));
index 4b244296dee3a2c79c62024c070f1203f3175796..a5e4342fb232150c146ad0f40bb82af2dd5bbf53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_Wire_H_
index 3f49c09438771ff42ef4a456b76c6f9317bfeff7..4448b3e9050d53038a56f364efaa52da1aa4b336 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_XY.h>
index e2b51eda7ec3b53b46cc0fe266fa0065cb9f110a..f2924cc91cd8912770eef6e09b30f5bdfa5bc03c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_XY_H_
index 435990a6524c68f23c15fe6e608072452b2cb07c..d13c91977f958306606381776db1a1edce57bb1b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include<GeomAPI_XYZ.h>
index 020d819c158bec3cda7c594d700b1817865add05..5b5c19bff4dc7d0d042181975b5638285c246eb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAPI_XYZ_H_
@@ -81,5 +80,8 @@ class GeomAPI_XYZ : public GeomAPI_Interface
   GEOMAPI_EXPORT double squareModulus() const;
 };
 
+//! Pointer on object
+typedef std::shared_ptr<GeomAPI_XYZ> GeomXYZPtr;
+
 #endif
 
index e92af5fba156fa400f1086bf9a820a9fffdfd0bf..8c5472e93649d10d94fffd67657c34a13ba88cc3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_GEOMAPI_GEOMAPI_SWIG_H_
index d1c6fae9c48911a24c6e558d5d09f7aa05f8e011..8ae91d8a87e379eeba337a856a1e3517d5f1b81d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
    Test2675.py
@@ -77,8 +76,8 @@ SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_2.center(), Sketc
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchCircle_1.results()[1])
 SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.endPoint(), 325)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_1")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_2_2f-SketchLine_7r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7")])
 
 from GeomAPI import *
 
diff --git a/src/GeomAPI/Test/Test2879.py b/src/GeomAPI/Test/Test2879.py
new file mode 100644 (file)
index 0000000..cb7c500
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2019-20xx  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+import math
+
+TOLERANCE = 1.e-7
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Box_2 = model.addBox(Part_1_doc, 10, 10, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 10)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Translation_1_1")], True)
+model.do()
+model.end()
+
+aShape = Fuse_1.result().resultSubShapePair()[0].shape()
+assert(aShape.isSolid())
+aBox = aShape.solid().getParallelepiped()
+assert(aBox is not None)
+assert(aBox.isAxesAligned())
+
+CORNER = GeomAPI_Pnt(0, 0, 0)
+WIDTH = 20
+HEIGHT = 10
+DEPTH = 10
+
+aCorner = aBox.corner()
+assert(aCorner.distance(CORNER) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(aCorner.x(), aCorner.y(), aCorner.z(), CORNER.x(), CORNER.y(), CORNER.z())
+assert(math.fabs(aBox.width() - WIDTH) < TOLERANCE), "Width {} != {}".format(aBox.width(), WIDTH)
+assert(math.fabs(aBox.depth() - DEPTH) < TOLERANCE), "Depth {} != {}".format(aBox.depth(), DEPTH)
+assert(math.fabs(aBox.height() - HEIGHT) < TOLERANCE), "Height {} != {}".format(aBox.height(), HEIGHT)
diff --git a/src/GeomAPI/Test/TestAx123.py b/src/GeomAPI/Test/TestAx123.py
new file mode 100644 (file)
index 0000000..b6ba20d
--- /dev/null
@@ -0,0 +1,81 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+import math
+
+from GeomAPI import *
+
+TOLERANCE = 1.e-7
+
+origin = GeomAPI_Pnt(10, 0, 0)
+dir = GeomAPI_Dir(1, 0, 0)
+
+# Test GeomAPI_Ax1
+ax1 = GeomAPI_Ax1()
+ax1.setOrigin(origin)
+ax1.setDir(dir)
+assert(ax1.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax1.dir().dot(dir) - 1.) < TOLERANCE)
+
+ax1.reverse()
+ax1 = ax1.reversed()
+assert(ax1.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax1.dir().dot(dir) - 1.) < TOLERANCE)
+
+
+# Test GeomAPI_Ax2
+ax2 = GeomAPI_Ax2()
+ax2.setOrigin(origin)
+ax2.setDir(dir)
+assert(ax2.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax2.dir().dot(dir) - 1.) < TOLERANCE)
+
+ax2 = GeomAPI_Ax2(origin, dir)
+assert(ax2.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax2.dir().dot(dir) - 1.) < TOLERANCE)
+
+dx = GeomAPI_Dir(0, 1, 0)
+ax2 = GeomAPI_Ax2(origin, dir, dx)
+assert(ax2.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax2.dir().dot(dir) - 1.) < TOLERANCE)
+
+
+# Test GeomAPI_Ax3
+dy = GeomAPI_Dir(0, 0, 1)
+ax3 = GeomAPI_Ax3()
+ax3.setOrigin(origin)
+ax3.setNormal(dy)
+ax3.setDirX(dir)
+ax3.setDirY(dx)
+assert(ax3.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax3.normal().dot(dy) - 1.) < TOLERANCE)
+assert(math.fabs(ax3.dirX().dot(dir) - 1.) < TOLERANCE)
+assert(math.fabs(ax3.dirY().dot(dx) - 1.) < TOLERANCE)
+
+ax3 = GeomAPI_Ax3(origin, dx, dir)
+assert(ax3.origin().distance(origin) < TOLERANCE)
+assert(math.fabs(ax3.normal().dot(dir) - 1.) < TOLERANCE)
+assert(math.fabs(ax3.dirX().dot(dx) - 1.) < TOLERANCE)
+assert(math.fabs(ax3.dirY().dot(dy) - 1.) < TOLERANCE)
+
+p2d = GeomAPI_Pnt2d(1, 2)
+a2d = ax3.to2D(origin.x() + dx.x() * p2d.x() + dy.x() * p2d.y(),
+               origin.y() + dx.y() * p2d.x() + dy.y() * p2d.y(),
+               origin.z() + dx.z() * p2d.x() + dy.z() * p2d.y())
+assert(a2d.distance(p2d) < TOLERANCE)
index a8412a4cdcc5c830339e7d035372d3599e84378a..1e6086a001827db229b890aed8abc5e27e126dcd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -91,7 +90,7 @@ ParamHeight = model.addParameter(Part_1_doc, "Height", "25")
 ParamAngle = model.addParameter(Part_1_doc, "Angle", "30")
 Box_1 = model.addBox(Part_1_doc, "BoxSize", "BoxSize", "BoxSize")
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchLine_1 = Sketch_1.addLine(30, 10, 10, 10)
 SketchLine_2 = Sketch_1.addLine(10, 10, 10, 20)
@@ -109,7 +108,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "Width")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), "Depth")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), "Height", 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), "Height", 0)
 model.do()
 
 # Test 1. Check boxes
@@ -119,13 +118,13 @@ aCornerPara = GeomAPI.GeomAPI_Pnt(ParamSize.value(), ParamSize.value(), ParamSiz
 checkBox(Extrusion_1, aCornerPara, ParamWidth.value(), ParamDepth.value(), ParamHeight.value())
 
 # Test 2. Rotate box to keep it still axes-aligned
-Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1"), 90)
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), 90)
 aCornerPara.setX(aCornerPara.x() + ParamWidth.value() - ParamDepth.value())
 aCornerPara.setY(aCornerPara.y() - ParamWidth.value())
 checkBox(Rotation_1, aCornerPara, ParamDepth.value(), ParamWidth.value(), ParamHeight.value())
 
 # Test 3. Rotate boxes
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom"), model.selection("VERTEX", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]"))
 Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "Axis_1"), "Angle")
 Rotation_3 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Rotation_1_1")], model.selection("EDGE", "Axis_1"), "Angle")
 
@@ -155,11 +154,16 @@ aCornerPara1 = GeomAPI.GeomAPI_Pnt(aCornerPara1.x() * (aCosAngle + (1 - aCosAngl
 checkRotatedBox(Rotation_3, aCornerPara, aCornerPara1)
 
 # Test 4. Compose a non-closed shell of the box faces and check it is not a box
-Shell_objects = ["Rotation_3_1/Rotated_Face_1", "Rotation_3_1/Rotated_Face_2", "Rotation_3_1/Rotated_Face_3", "Rotation_3_1/Rotated_Face_4"]
+Shell_objects = ["Rotation_3_1/MF:Rotated&Extrusion_1_1/To_Face", "Rotation_3_1/MF:Rotated&Extrusion_1_1/From_Face", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_1", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_2"]
 checkShellNotBox(Part_1_doc, Shell_objects)
 
 # Test 5. Compose a shell of all box faces
-Shell_objects = ["Rotation_3_1/Rotated_Face_1", "Rotation_3_1/Rotated_Face_2", "Rotation_3_1/Rotated_Face_3", "Rotation_3_1/Rotated_Face_4", "Rotation_3_1/Rotated_Face_5", "Rotation_3_1/Rotated_Face_6"]
+Shell_objects = ["Rotation_3_1/MF:Rotated&Extrusion_1_1/To_Face", "Rotation_3_1/MF:Rotated&Extrusion_1_1/From_Face", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_1", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_2", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_3", "Rotation_3_1/MF:Rotated&Sketch_1/SketchLine_4"]
 checkShellRotatedBox(Part_1_doc, Shell_objects, aCornerPara, aCornerPara1)
 
+# Test 6. One more check the shell is not a box
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10, 45)
+Shell_objects = ["Cylinder_1_1/Face_2", "Cylinder_1_1/Face_4"]
+checkShellNotBox(Part_1_doc, Shell_objects)
+
 model.end()
diff --git a/src/GeomAPI/Test/TestBuilders.py b/src/GeomAPI/Test/TestBuilders.py
new file mode 100644 (file)
index 0000000..8f9e612
--- /dev/null
@@ -0,0 +1,96 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+import math
+
+from GeomAlgoAPI import GeomAlgoAPI_Circ2dBuilder as circBuilder
+from GeomAlgoAPI import GeomAlgoAPI_CurveBuilder as curveBuilder
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAlgoAPI import GeomAlgoAPI_FaceBuilder as faceBuilder
+from GeomAlgoAPI import GeomAlgoAPI_ShapeTools as tools
+from GeomAPI import GeomAPI_Ax3 as ax3
+from GeomAPI import GeomAPI_Dir as dir
+from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Pnt2d as pnt2d
+from GeomAPI import GeomAPI_Circ2d
+from GeomAPI import GeomAPI_Shape
+
+TOLERANCE = 1.e-7
+
+center = pnt(10, 0, 0)
+normal = dir(0, 0, 1)
+xAxis = dir(1, 0, 0)
+majorRadius = 10
+minorRadius = 5
+
+# Test 1. Elliptical edge
+ellipseEdge = edgeBuilder.ellipse(center, normal, xAxis, majorRadius, minorRadius)
+ellipse = ellipseEdge.ellipse()
+assert(ellipse is not None)
+assert(ellipse.center().distance(center) < TOLERANCE)
+assert(ellipse.firstFocus().distance(pnt(18.66025404, 0., 0.)) < TOLERANCE)
+assert(ellipse.secondFocus().distance(pnt(1.339745962, 0., 0.)) < TOLERANCE)
+assert(ellipse.majorRadius() == majorRadius)
+assert(ellipse.minorRadius() == minorRadius)
+
+# Test 2. Square face
+size = 100.
+squareFace = faceBuilder.squareFace(center, normal, size)
+assert(squareFace.middlePoint().distance(center) < TOLERANCE)
+
+# Test 3. Check are of the face
+assert(tools.area(squareFace) == size**2)
+
+# Test 4. Check properties of wrong shapes
+assert(tools.volume(None) == 0)
+assert(tools.volume(GeomAPI_Shape()) == 0)
+assert(tools.area(None) == 0)
+assert(tools.area(GeomAPI_Shape()) == 0)
+assert(tools.centreOfMass(None) is None)
+assert(tools.centreOfMass(GeomAPI_Shape()) is None)
+
+# Test 5. Curve with duplicated points
+points = [pnt(10, 0, 0),
+          pnt(20, 10, 0),
+          pnt(20, 10, 0),
+          pnt(10, 10, 0),
+          pnt(10, 0, 0)]
+curve = curveBuilder.edge(points, True, True, None, None)
+assert(curve is not None)
+
+# Test 6. Circle by center and radius
+center = pnt2d(5, 0)
+radius = 5
+plane = ax3(pnt(0, 0, 0), dir(0, 0, 1), dir(1, 0, 0))
+circleBuilder = circBuilder(plane)
+circleBuilder.setCenter(center)
+circleBuilder.setRadius(radius)
+circle = circBuilder.circle(circleBuilder)
+assert(circle is not None)
+assert(circle.center().distance(center) < TOLERANCE)
+assert(circle.radius() == radius)
+
+# Test 7. Circle by 3 points
+p1 = pnt2d(center.x() + radius, center.y())
+p2 = pnt2d(center.x() - radius, center.y())
+p3 = pnt2d(center.x(), center.y() + radius)
+circle = circBuilder.circle(p1, p2, p3)
+assert(circle is not None)
+assert(circle.center().distance(center) < TOLERANCE)
+assert(circle.radius() == radius)
index 2c74a1955475694876e75442314f8093f87a5b5b..a7c2d72edd2f1635dac440a7e6ed2859e1770b9f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -37,6 +36,7 @@ def checkCircleEdge(theDocument, theEdgeName, theCenter, theRadius):
     anEdge = model.addEdge(theDocument, [model.selection("EDGE", theEdgeName)])
     aShape = anEdge.result().resultSubShapePair()[0].shape()
     assert(aShape.isEdge())
+    assert(aShape.edge().isClosed())
     assertCircle(aShape.edge(), theCenter, theRadius)
     theDocument.removeFeature(anEdge.feature())
 
@@ -50,7 +50,7 @@ def checkCircleFace(theDocument, theFaceName, theCenter, theRadius):
     assertCircle(aSubs[0].edge(), theCenter, theRadius)
     theDocument.removeFeature(aFaceFeature.feature())
 
-def assertEllipse(theEdge, theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius):
+def assertEllipse(theEdge, theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius, theNormal = None):
     assert(theEdge.isEllipse())
     anEllipse = theEdge.ellipse()
     assert(anEllipse.firstFocus().distance(theFirstFocus) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(anEllipse.firstFocus().x(), anEllipse.firstFocus().y(), anEllipse.firstFocus().z(), theFirstFocus.x(), theFirstFocus.y(), theFirstFocus.z())
@@ -58,11 +58,17 @@ def assertEllipse(theEdge, theFirstFocus, theSecondFocus, theMajorRadius, theMin
     assert(math.fabs(anEllipse.majorRadius() - theMajorRadius) < TOLERANCE), "Major radius {} != {}".format(anEllipse.majorRadius(), theMajorRadius)
     assert(math.fabs(anEllipse.minorRadius() - theMinorRadius) < TOLERANCE), "Minor radius {} != {}".format(anEllipse.minorRadius(), theMinorRadius)
 
-def checkEllipseEdge(theDocument, theEdgeName, theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius):
+    center = GeomAPI.GeomAPI_Pnt((theFirstFocus.x() + theSecondFocus.x()) * 0.5, (theFirstFocus.y() + theSecondFocus.y()) * 0.5, (theFirstFocus.z() + theSecondFocus.z()) * 0.5)
+    assert(anEllipse.center().distance(center) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(anEllipse.center().x(), anEllipse.center().y(), anEllipse.center().z(), center.x(), center.y(), center.z())
+
+    if theNormal is not None:
+        assert(math.fabs(anEllipse.normal().dot(theNormal) - 1.) < TOLERANCE), "Normal ({}, {}, {}) != ({}, {}, {})".format(anEllipse.normal().x(), anEllipse.normal().y(), anEllipse.normal().z(), theNormal.x(), theNormal.y(), theNormal.z())
+
+def checkEllipseEdge(theDocument, theEdgeName, theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius, theNormal):
     anEdge = model.addEdge(theDocument, [model.selection("EDGE", theEdgeName)])
     aShape = anEdge.result().resultSubShapePair()[0].shape()
     assert(aShape.isEdge())
-    assertEllipse(aShape.edge(), theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius)
+    assertEllipse(aShape.edge(), theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius, theNormal)
     theDocument.removeFeature(anEdge.feature())
 
 def checkEllipseFace(theDocument, theFaceName, theFirstFocus, theSecondFocus, theMajorRadius, theMinorRadius):
@@ -77,6 +83,8 @@ def checkEllipseFace(theDocument, theFaceName, theFirstFocus, theSecondFocus, th
 
 def assertCone(theCone, theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight):
     assert(theCone is not None)
+    assert(theCone.isSemiInfinite() == False)
+    assert(theCone.isInfinite() == False)
     anApex = theCone.apex()
     anAxis = theCone.axis()
     assert(anApex.distance(theApex) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(anApex.x(), anApex.y(), anApex.z(), theApex.x(), theApex.y(), theApex.z())
@@ -105,6 +113,17 @@ def checkConeShell(theDocument, theFaceNames, theApex, theAxis, theSemiAngle, th
     assertCone(aShape.shell().getCone(), theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight)
     theDocument.removeFeature(aShell.feature())
 
+def checkConeSolid(theDocument, theFaceNames, theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight):
+    # check cone
+    aSelection = []
+    for name in theFaceNames:
+        aSelection.append(model.selection("FACE", name))
+    aSolid = model.addSolid(theDocument, aSelection)
+    aShape = aSolid.result().resultSubShapePair()[0].shape()
+    assert(aShape.isSolid())
+    assertCone(aShape.solid().getCone(), theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight)
+    theDocument.removeFeature(aSolid.feature())
+
 def checkConeAll(theDocument, theFeature, theFaceName, theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight):
     # check solid
     aShape = theFeature.result().resultSubShapePair()[0].shape()
@@ -114,6 +133,16 @@ def checkConeAll(theDocument, theFeature, theFaceName, theApex, theAxis, theSemi
     checkConeShell(theDocument, [theFaceName], theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight)
     checkConeFace(theDocument, theFaceName, theApex, theAxis, theSemiAngle, theRadius1, theRadius2, theHeight)
 
+def checkNonCone(theFeature):
+    aShape = theFeature.result().resultSubShapePair()[0].shape()
+    assert(aShape.isSolid())
+    assert(aShape.solid().getCone() is None)
+
+def checkNonConeShell(theFeature):
+    aShape = theFeature.result().resultSubShapePair()[0].shape()
+    assert(aShape.isShell())
+    assert(aShape.shell().getCone() is None)
+
 def checkSegment(theDocument, theEdgeName, theStartPoint, theEndPoint):
     anEdgeFeature = model.addEdge(theDocument, [model.selection("EDGE", theEdgeName)])
     aShape = anEdgeFeature.result().resultSubShapePair()[0].shape()
@@ -153,10 +182,10 @@ anApex = GeomAPI.GeomAPI_Pnt(0, 0, ParamR1.value() / math.tan(aSemiAngle))
 anAxis = GeomAPI.GeomAPI_Dir(0, 0, 1)
 checkConeAll(Part_1_doc, Cone_1, "Cone_1_1/Face_1", anApex, anAxis, aSemiAngle, ParamR2.value(), ParamR1.value(), ParamH.value())
 checkCircleFace(Part_1_doc, "Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
-checkCircleEdge(Part_1_doc, "Cone_1_1/Face_1&Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
+checkCircleEdge(Part_1_doc, "[Cone_1_1/Face_1][Cone_1_1/Face_2]", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
 checkCircleFace(Part_1_doc, "Cone_1_1/Face_3", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
-checkCircleEdge(Part_1_doc, "Cone_1_1/Face_1&Cone_1_1/Face_3", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
-checkSegment(Part_1_doc, "Cone_1_1/Face_1", GeomAPI.GeomAPI_Pnt(ParamR1.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
+checkCircleEdge(Part_1_doc, "[Cone_1_1/Face_1][Cone_1_1/Face_3]", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
+checkSegment(Part_1_doc, "[Cone_1_1/Face_1][weak_name_3]", GeomAPI.GeomAPI_Pnt(ParamR1.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
 
 # Test 2. Update cone radii
 ParamR1.setValue(0)
@@ -165,8 +194,8 @@ aSemiAngle = semiAngle(ParamR1.value(), ParamR2.value(), ParamH.value())
 anApex.setZ(0)
 checkConeAll(Part_1_doc, Cone_1, "Cone_1_1/Face_1", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
 checkCircleFace(Part_1_doc, "Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
-checkCircleEdge(Part_1_doc, "Cone_1_1/Face_1&Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
-checkSegment(Part_1_doc, "Cone_1_1/Face_1", GeomAPI.GeomAPI_Pnt(0, 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
+checkCircleEdge(Part_1_doc, "[Cone_1_1/Face_1][Cone_1_1/Face_2]", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
+checkSegment(Part_1_doc, "[Cone_1_1/Face_1][weak_name_3]", GeomAPI.GeomAPI_Pnt(0, 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
 checkVertex(Part_1_doc, "Cone_1_1/Vertex_2", GeomAPI.GeomAPI_Pnt(0, 0, 0))
 
 ParamR2.setValue(50)
@@ -176,20 +205,20 @@ aSemiAngle = semiAngle(ParamR1.value(), ParamR2.value(), ParamH.value())
 anApex.setZ(-ParamR1.value() / math.tan(aSemiAngle))
 checkConeAll(Part_1_doc, Cone_1, "Cone_1_1/Face_1", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
 checkCircleFace(Part_1_doc, "Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
-checkCircleEdge(Part_1_doc, "Cone_1_1/Face_1&Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
+checkCircleEdge(Part_1_doc, "[Cone_1_1/Face_1][Cone_1_1/Face_2]", GeomAPI.GeomAPI_Pnt(0, 0, ParamH.value()), ParamR2.value())
 checkCircleFace(Part_1_doc, "Cone_1_1/Face_3", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
-checkCircleEdge(Part_1_doc, "Cone_1_1/Face_1&Cone_1_1/Face_3", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
-checkSegment(Part_1_doc, "Cone_1_1/Face_1", GeomAPI.GeomAPI_Pnt(ParamR1.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
+checkCircleEdge(Part_1_doc, "[Cone_1_1/Face_1][Cone_1_1/Face_3]", GeomAPI.GeomAPI_Pnt(0, 0, 0), ParamR1.value())
+checkSegment(Part_1_doc, "[Cone_1_1/Face_1][weak_name_3]", GeomAPI.GeomAPI_Pnt(ParamR1.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value(), 0, ParamH.value()))
 
 # Test 3. Translate cone
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "PartSet/OX"), "Shift")
 anApex.setX(anApex.x() + ParamShift.value())
-checkConeAll(Part_1_doc, Translation_1, "Translation_1_1/Translated_Face_3", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
-checkCircleFace(Part_1_doc, "Translation_1_1/Translated_Face_2", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, ParamH.value()), ParamR2.value())
-checkCircleEdge(Part_1_doc, "Translation_1_1/Translated_Face_3&Translation_1_1/Translated_Face_2", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, ParamH.value()), ParamR2.value())
-checkCircleFace(Part_1_doc, "Translation_1_1/Translated_Face_1", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, 0), ParamR1.value())
-checkCircleEdge(Part_1_doc, "Translation_1_1/Translated_Face_3&Translation_1_1/Translated_Face_1", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, 0), ParamR1.value())
-checkSegment(Part_1_doc, "Translation_1_1/Translated_Face_3", GeomAPI.GeomAPI_Pnt(ParamR1.value() + ParamShift.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value() + ParamShift.value(), 0, ParamH.value()))
+checkConeAll(Part_1_doc, Translation_1, "Translation_1_1/MF:Translated&Cone_1_1/Face_1", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
+checkCircleFace(Part_1_doc, "Translation_1_1/MF:Translated&Cone_1_1/Face_2", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, ParamH.value()), ParamR2.value())
+checkCircleEdge(Part_1_doc, "[Translation_1_1/MF:Translated&Cone_1_1/Face_1][Translation_1_1/MF:Translated&Cone_1_1/Face_2]", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, ParamH.value()), ParamR2.value())
+checkCircleFace(Part_1_doc, "Translation_1_1/MF:Translated&Cone_1_1/Face_3", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, 0), ParamR1.value())
+checkCircleEdge(Part_1_doc, "[Translation_1_1/MF:Translated&Cone_1_1/Face_1][Translation_1_1/MF:Translated&Cone_1_1/Face_3]", GeomAPI.GeomAPI_Pnt(ParamShift.value(), 0, 0), ParamR1.value())
+checkSegment(Part_1_doc, "[Translation_1_1/MF:Translated&Cone_1_1/Face_1][weak_name_3]", GeomAPI.GeomAPI_Pnt(ParamR1.value() + ParamShift.value(), 0, 0), GeomAPI.GeomAPI_Pnt(ParamR2.value() + ParamShift.value(), 0, ParamH.value()))
 
 # Test 4. Rotate cone
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OY"), "Angle")
@@ -198,24 +227,80 @@ anAxis = GeomAPI.GeomAPI_Dir(math.sin(anAngle), 0, math.cos(anAngle))
 x, z = anApex.x(), anApex.z()
 anApex.setX(x * math.cos(anAngle) + z * math.sin(anAngle))
 anApex.setZ(-x * math.sin(anAngle) + z * math.cos(anAngle))
-checkConeAll(Part_1_doc, Rotation_1, "Rotation_1_1/Rotated_Face_3", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
+checkConeAll(Part_1_doc, Rotation_1, "Rotation_1_1/MF:Rotated&Cone_1_1/Face_1", anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
 aCenter = GeomAPI.GeomAPI_Pnt(ParamShift.value() * math.cos(anAngle) + ParamH.value() * math.sin(anAngle), 0, -ParamShift.value() * math.sin(anAngle) + ParamH.value() * math.cos(anAngle))
-checkCircleFace(Part_1_doc, "Rotation_1_1/Rotated_Face_2", aCenter, ParamR2.value())
-checkCircleEdge(Part_1_doc, "Rotation_1_1/Rotated_Face_3&Rotation_1_1/Rotated_Face_2", aCenter, ParamR2.value())
+checkCircleFace(Part_1_doc, "Rotation_1_1/MF:Rotated&Cone_1_1/Face_2", aCenter, ParamR2.value())
+checkCircleEdge(Part_1_doc, "[Rotation_1_1/MF:Rotated&Cone_1_1/Face_1][Rotation_1_1/MF:Rotated&Cone_1_1/Face_2]", aCenter, ParamR2.value())
 aCenter = GeomAPI.GeomAPI_Pnt(ParamShift.value() * math.cos(anAngle), 0, -ParamShift.value() * math.sin(anAngle))
-checkCircleFace(Part_1_doc, "Rotation_1_1/Rotated_Face_1", aCenter, ParamR1.value())
-checkCircleEdge(Part_1_doc, "Rotation_1_1/Rotated_Face_3&Rotation_1_1/Rotated_Face_1", aCenter, ParamR1.value())
+checkCircleFace(Part_1_doc, "Rotation_1_1/MF:Rotated&Cone_1_1/Face_3", aCenter, ParamR1.value())
+checkCircleEdge(Part_1_doc, "[Rotation_1_1/MF:Rotated&Cone_1_1/Face_1][Rotation_1_1/MF:Rotated&Cone_1_1/Face_3]", aCenter, ParamR1.value())
 
 # Test 5. Split cone by plane and check conical shell and elliptic face
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 20, False)
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Rotation_1_1"), model.selection("FACE", "Plane_1")])
-checkConeShell(Part_1_doc, ["Partition_1_1_1/Modified_Face_2_2", "Partition_1_1_2/Modified_Face_2_2"], anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
+checkConeShell(Part_1_doc, ["Partition_1_1_1/Modified_Face&Cone_1_1/Face_1", "Partition_1_1_2/Modified_Face&Cone_1_1/Face_1"], anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
 
 aFirstFocus = GeomAPI.GeomAPI_Pnt(20, 0, 31.062397266842858)
 aSecondFocus = GeomAPI.GeomAPI_Pnt(20, 0, -1.0935246846933797)
 aMajorRadius = 27.91915871311068
 aMinorRadius = 22.824955511666207
-checkEllipseFace(Part_1_doc, "Partition_1_1_2/Modified_Face_2_1", aFirstFocus, aSecondFocus, aMajorRadius, aMinorRadius)
-checkEllipseEdge(Part_1_doc, "Partition_1_1_1/Modified_Face_1_divided_1_e_1", aFirstFocus, aSecondFocus, aMajorRadius, aMinorRadius)
+aNormal = GeomAPI.GeomAPI_Dir(1, 0, 0)
+checkEllipseFace(Part_1_doc, "_weak_name_1_Partition_1_1_2", aFirstFocus, aSecondFocus, aMajorRadius, aMinorRadius)
+checkEllipseEdge(Part_1_doc, "Partition_1_1_1/Generated_Edge&Cone_1_1/Face_1", aFirstFocus, aSecondFocus, aMajorRadius, aMinorRadius, aNormal)
+
+# Test 6. Compose a conical solid
+Solid_1_objects = ["Rotation_1_1/MF:Rotated&Cone_1_1/Face_3",
+                   "Partition_1_1_1/Modified_Face&Cone_1_1/Face_1",
+                   "Partition_1_1_2/Modified_Face&Cone_1_1/Face_1",
+                   "Rotation_1_1/MF:Rotated&Cone_1_1/Face_2"]
+checkConeSolid(Part_1_doc, Solid_1_objects, anApex, anAxis, aSemiAngle, ParamR1.value(), ParamR2.value(), ParamH.value())
+
+# Test 7. Check non-cone
+Cone_2 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
+Cone_3 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10, 20)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cone_2_1"), model.selection("SOLID", "Cone_3_1")], True)
+Solid_2_objects = [model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_2_1/Face_3&Cone_3_1/Face_3"),
+                   model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_2_1/Face_1"),
+                   model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_3_1/Face_1"),
+                   model.selection("FACE", "Cone_3_1/Face_2")]
+Solid_2 = model.addSolid(Part_1_doc, Solid_2_objects)
+checkNonCone(Solid_2)
+
+# Test 8. Check non-conical shell
+Shell_1_objects = [model.selection("FACE", "Rotation_1_1/MF:Rotated&Cone_1_1/Face_3"),
+                   model.selection("FACE", "Partition_1_1_1/Modified_Face&Cone_1_1/Face_1"),
+                   model.selection("FACE", "Partition_1_1_2/Modified_Face&Cone_1_1/Face_1"),
+                   model.selection("FACE", "Rotation_1_1/MF:Rotated&Cone_1_1/Face_2")]
+Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
+checkNonConeShell(Shell_1)
+
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_2_1/Face_1"), model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_3_1/Face_1")])
+checkNonConeShell(Shell_2)
+
+# Test 9. Check error on conversion to wrong type of curve
+anEdge = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Cone_1_1/Face_1][Rotation_1_1/MF:Rotated&Cone_1_1/Face_2]")])
+aShape = anEdge.result().resultSubShapePair()[0].shape()
+assert(aShape.isEdge())
+assert(aShape.edge().ellipse() is None)
+assert(aShape.edge().line() is None)
+
+anEdge = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Cone_1_1/Face_1][weak_name_2]")])
+aShape = anEdge.result().resultSubShapePair()[0].shape()
+assert(aShape.isEdge())
+assert(aShape.edge().circle() is None)
+assert(aShape.isSelfIntersected() == False)
+
+# Test 10. Test cone constructors
+apex = GeomAPI_Pnt(10, 0, 0)
+dir = GeomAPI_Dir(1, 0, 0)
+semiAngle = math.pi / 4
+cone = GeomAPI_Cone(apex, dir, semiAngle)
+assert(cone.location().distance(apex) < TOLERANCE)
+
+radius = 5
+cone = GeomAPI_Cone(apex, dir, semiAngle, radius)
+assert(cone.location().distance(apex) < TOLERANCE)
+
+
 
 model.end()
index 726b837fa0a9f47b0569dab4cf55fbfd44e8c39d..fcd40909015a6f10fe0f4522d8f7ccd56610506b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -29,6 +28,7 @@ TOLERANCE = 1.e-7
 
 def assertCylinder(theCylinder, theLocation, theAxis, theRadius, theHeight):
     assert(theCylinder is not None)
+    assert(theCylinder.isInfinite() == False)
     aLoc = theCylinder.location()
     aDir = theCylinder.axis()
     assert(aLoc.distance(theLocation) < TOLERANCE), "({}, {}, {}) != expected ({}, {}, {})".format(aLoc.x(), aLoc.y(), aLoc.z(), theLocation.x(), theLocation.y(), theLocation.z())
@@ -53,6 +53,16 @@ def checkCylinderShell(theDocument, theFaceNames, theLocation, theAxis, theRadiu
     assertCylinder(aShape.shell().getCylinder(), theLocation, theAxis, theRadius, theHeight)
     theDocument.removeFeature(aShell.feature())
 
+def checkCylinderSolid(theDocument, theFaceNames, theLocation, theAxis, theRadius, theHeight):
+    aSelection = []
+    for name in theFaceNames:
+        aSelection.append(model.selection("FACE", name))
+    aSolid = model.addSolid(theDocument, aSelection)
+    aShape = aSolid.result().resultSubShapePair()[0].shape()
+    assert(aShape.isSolid())
+    assertCylinder(aShape.solid().getCylinder(), theLocation, theAxis, theRadius, theHeight)
+    theDocument.removeFeature(aSolid.feature())
+
 def checkCylinderAll(theDocument, theFeature, theFaceName, theLocation, theAxis, theRadius, theHeight):
     aShape = theFeature.result().resultSubShapePair()[0].shape()
     assert(aShape.isSolid())
@@ -66,6 +76,11 @@ def checkNonCylinder(theFeature):
     assert(aShape.isSolid())
     assert(aShape.solid().getCylinder() is None)
 
+def checkNonCylindricalShell(theFeature):
+    aShape = theFeature.result().resultSubShapePair()[0].shape()
+    assert(aShape.isShell())
+    assert(aShape.shell().getCylinder() is None)
+
 
 model.begin()
 partSet = model.moduleDocument()
@@ -76,7 +91,7 @@ ParamR = model.addParameter(Part_1_doc, "R", "10")
 ParamAngle = model.addParameter(Part_1_doc, "Angle", "30")
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), "2*R", "H")
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Cylinder_1_1/Face_2"))
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Cylinder_1_1/Face_1&Cylinder_1_1/Face_2__cc"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]__cc"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchCircle_1 = Sketch_1.addCircle(0, 0, 10)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
@@ -98,14 +113,14 @@ SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_2.setLength(SketchLine_1.result(), "R/2")
 SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_2.result(), "H")
-SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"), False)
 [SketchPoint_2, SketchPoint_3] = SketchIntersectionPoint_1.intersectionPoints()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_1.result())
 SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OZ"), False)
 SketchLine_5 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchLine_5.result())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection("EDGE", "PartSet/OZ"), 270, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 270, 0)
 model.do()
 
 # Test 1. Check cylinders
@@ -114,10 +129,10 @@ aLoc2 = GeomAPI.GeomAPI_Pnt(0, 0, 2 * ParamH.value())
 aLoc3 = GeomAPI.GeomAPI_Pnt(0, 0, 3 * ParamH.value())
 anAxis = GeomAPI.GeomAPI_Dir(0, 0, 1)
 checkCylinderAll(Part_1_doc, Cylinder_1, "Cylinder_1_1/Face_1", aLoc1, anAxis, 2 * ParamR.value(), ParamH.value())
-checkCylinderAll(Part_1_doc, Extrusion_1, "Extrusion_1_1/Generated_Face_1", aLoc2, anAxis, ParamR.value(), ParamH.value())
+checkCylinderAll(Part_1_doc, Extrusion_1, "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2", aLoc2, anAxis, ParamR.value(), ParamH.value())
 checkNonCylinder(Revolution_1)
-checkCylinderShell(Part_1_doc, ["Revolution_1_1/Generated_Face_4"], aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
-checkCylinderFace(Part_1_doc, "Revolution_1_1/Generated_Face_4", aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
+checkCylinderShell(Part_1_doc, ["Revolution_1_1/Generated_Face&Sketch_2/SketchLine_4"], aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
+checkCylinderFace(Part_1_doc, "Revolution_1_1/Generated_Face&Sketch_2/SketchLine_4", aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
 
 # Test 2. Rotate cylinders
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), "Angle")
@@ -131,11 +146,11 @@ anAxis = GeomAPI.GeomAPI_Dir(0, anAxis.y() * aCosAngle - anAxis.z() * aSinAngle,
 aLoc1 = GeomAPI.GeomAPI_Pnt(0, aLoc1.y() * aCosAngle - aLoc1.z() * aSinAngle, aLoc1.y() * aSinAngle + aLoc1.z() * aCosAngle)
 aLoc2 = GeomAPI.GeomAPI_Pnt(0, aLoc2.y() * aCosAngle - aLoc2.z() * aSinAngle, aLoc2.y() * aSinAngle + aLoc2.z() * aCosAngle)
 aLoc3 = GeomAPI.GeomAPI_Pnt(0, aLoc3.y() * aCosAngle - aLoc3.z() * aSinAngle, aLoc3.y() * aSinAngle + aLoc3.z() * aCosAngle)
-checkCylinderAll(Part_1_doc, Rotation_1, "Rotation_1_1/Rotated_Face_3", aLoc1, anAxis, 2 * ParamR.value(), ParamH.value())
-checkCylinderAll(Part_1_doc, Rotation_2, "Rotation_2_1/Rotated_Face_3", aLoc2, anAxis, ParamR.value(), ParamH.value())
+checkCylinderAll(Part_1_doc, Rotation_1, "Rotation_1_1/MF:Rotated&Cylinder_1_1/Face_1", aLoc1, anAxis, 2 * ParamR.value(), ParamH.value())
+checkCylinderAll(Part_1_doc, Rotation_2, "Rotation_2_1/MF:Rotated&Sketch_1/SketchCircle_1_2", aLoc2, anAxis, ParamR.value(), ParamH.value())
 checkNonCylinder(Rotation_3)
-checkCylinderShell(Part_1_doc, ["Rotation_3_1/Rotated_Face_5"], aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
-checkCylinderFace(Part_1_doc, "Rotation_3_1/Rotated_Face_5", aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
+checkCylinderShell(Part_1_doc, ["Rotation_3_1/MF:Rotated&Sketch_2/SketchLine_4"], aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
+checkCylinderFace(Part_1_doc, "Rotation_3_1/MF:Rotated&Sketch_2/SketchLine_4", aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
 
 # Test 3. Split cylinder and compose a shell
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), "2.2*H", False)
@@ -143,7 +158,47 @@ Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOZ"), "H"
 Partition_1_objects = [model.selection("SOLID", "Rotation_3_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 
-Shell_1_objects = ["Partition_1_1_1/Modified_Face_3_5", "Partition_1_1_4/Modified_Face_3_3", "Partition_1_1_2/Modified_Face_1_divided_2_1"]
+Shell_1_objects = ["Partition_1_1_1/Modified_Face&Sketch_2/SketchLine_4",
+                   "Partition_1_1_4/Modified_Face&Sketch_2/SketchLine_4",
+                   "(Partition_1_1_2/Modified_Face&Revolution_1_1/To_Face)(Partition_1_1_2/Modified_Face&Sketch_2/SketchLine_1)"]
 checkCylinderShell(Part_1_doc, Shell_1_objects, aLoc3, anAxis, 0.5 * ParamR.value(), ParamH.value())
 
+# Test 4. Split cylinder and compose a solid
+Partition_2 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Rotation_1_1"), model.selection("FACE", "PartSet/XOZ")])
+Solid_1_objects = ["(Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_3)(Partition_2_1_1/Modified_Face&PartSet/XOZ/XOZ)(Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_2)",
+                   "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_1&weak_name_2",
+                   "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_2",
+                   "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_3",
+                   "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_1",
+                   "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_2",
+                   "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_3"]
+checkCylinderSolid(Part_1_doc, Solid_1_objects, aLoc1, anAxis, 2 * ParamR.value(), ParamH.value())
+
+# Test 5. Check non-cylinder
+Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_2 = Sketch_3.addCircle(12.62721775445329, 9.188425784259302, 5)
+SketchCircle_3 = Sketch_3.addCircle(16.49821418064359, 12.35313535520289, 5)
+SketchConstraintRadius_2 = Sketch_3.setRadius(SketchCircle_2.results()[1], 5)
+SketchConstraintEqual_1 = Sketch_3.setEqual(SketchCircle_2.results()[1], SketchCircle_3.results()[1])
+SketchConstraintDistance_1 = Sketch_3.setDistance(SketchCircle_2.center(), SketchCircle_3.center(), 5, True)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection(), 10, 0)
+Solid_1_objects = [model.selection("FACE", "Extrusion_2_1_1/From_Face"), model.selection("FACE", "Extrusion_2_1_1/To_Face"), model.selection("FACE", "Extrusion_2_1_2/From_Face"), model.selection("FACE", "Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_3_2&weak_name_2"), model.selection("FACE", "Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_3_2&weak_name_1"), model.selection("FACE", "Extrusion_2_1_2/To_Face"), model.selection("FACE", "Extrusion_2_1_3/From_Face"), model.selection("FACE", "Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_2_2"), model.selection("FACE", "Extrusion_2_1_3/To_Face")]
+Solid_1 = model.addSolid(Part_1_doc, Solid_1_objects)
+checkNonCylinder(Solid_1)
+
+# Test 6. Check non-cylindrical shell
+Shell_1_objects = [model.selection("FACE", "(Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_3)(Partition_2_1_1/Modified_Face&PartSet/XOZ/XOZ)(Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_2)"),
+                   model.selection("FACE", "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_1&weak_name_2"),
+                   model.selection("FACE", "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_2"),
+                   model.selection("FACE", "Partition_2_1_1/Modified_Face&Cylinder_1_1/Face_3"),
+                   model.selection("FACE", "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_1"),
+                   model.selection("FACE", "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_2"),
+                   model.selection("FACE", "Partition_2_1_2/Modified_Face&Cylinder_1_1/Face_3")]
+Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
+checkNonCylindricalShell(Shell_1)
+
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Extrusion_2_1_3/Generated_Face&Sketch_3/SketchCircle_2_2"), model.selection("FACE", "Extrusion_2_1_2/Generated_Face&Sketch_3/SketchCircle_3_2&weak_name_1")])
+checkNonCylindricalShell(Shell_2)
+
 model.end()
diff --git a/src/GeomAPI/Test/TestEllipse2d.py b/src/GeomAPI/Test/TestEllipse2d.py
new file mode 100644 (file)
index 0000000..d11d00d
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+import math
+
+from GeomAPI import *
+
+TOLERANCE = 1.e-7
+
+center = GeomAPI_Pnt2d(10, 0)
+xAxis = GeomAPI_Dir2d(1, 0)
+majorRadius = 10
+minorRadius = 5
+
+# Test 1. Default ellipse
+ellipse = GeomAPI_Ellipse2d(center, xAxis, majorRadius, minorRadius)
+assert(ellipse.center().distance(center) < TOLERANCE)
+assert(ellipse.firstFocus().distance(GeomAPI_Pnt2d(18.66025404, 0.)) < TOLERANCE)
+assert(ellipse.secondFocus().distance(GeomAPI_Pnt2d(1.339745962, 0.)) < TOLERANCE)
+assert(ellipse.majorRadius() == majorRadius)
+assert(ellipse.minorRadius() == minorRadius)
+
+# Test 2. Ellipse with swapped radii
+ellipse = GeomAPI_Ellipse2d(center, xAxis, minorRadius, majorRadius)
+assert(ellipse.center().distance(center) < TOLERANCE)
+assert(ellipse.firstFocus().distance(GeomAPI_Pnt2d(10., 8.66025404)) < TOLERANCE)
+assert(ellipse.secondFocus().distance(GeomAPI_Pnt2d(10., -8.66025404)) < TOLERANCE)
+assert(ellipse.majorRadius() == majorRadius)
+assert(ellipse.minorRadius() == minorRadius)
+
+# Test 3. Ellipse by 3 points
+axisPnt = GeomAPI_Pnt2d(center.x() + majorRadius, center.y())
+passedPnt = GeomAPI_Pnt2d(center.x(), center.y() + minorRadius)
+ellipse = GeomAPI_Ellipse2d(center, axisPnt, passedPnt)
+assert(ellipse.center().distance(center) < TOLERANCE)
+assert(ellipse.firstFocus().distance(GeomAPI_Pnt2d(18.66025404, 0.)) < TOLERANCE)
+assert(ellipse.secondFocus().distance(GeomAPI_Pnt2d(1.339745962, 0.)) < TOLERANCE)
+assert(ellipse.majorRadius() == majorRadius)
+assert(ellipse.minorRadius() == minorRadius)
diff --git a/src/GeomAPI/Test/TestLine.py b/src/GeomAPI/Test/TestLine.py
new file mode 100644 (file)
index 0000000..5a3dd75
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+import math
+
+from GeomAPI import *
+
+TOLERANCE = 1.e-7
+
+loc = GeomAPI_Pnt2d(10, 0)
+axis = GeomAPI_Dir2d(1, 0)
+
+# Test 1. GeomAPI_Lin2d
+line2d = GeomAPI_Lin2d(loc, axis)
+assert(line2d.location().distance(loc) < TOLERANCE)
+assert(line2d.isRight(GeomAPI_Pnt2d(15, 5)))
+
+# Test 2. GeomAPI_Lin
+ln1 = GeomAPI_Lin(10, 0, 0, 20, 0, 0)
+ln2 = GeomAPI_Lin(15, -1, 1, 15, 1, 1)
+assert(ln1.isCoplanar(ln2) == False)
+assert(ln1.contains(None, TOLERANCE) == False)
diff --git a/src/GeomAPI/Test/TestPlanarEdge.py b/src/GeomAPI/Test/TestPlanarEdge.py
new file mode 100644 (file)
index 0000000..8c9d26b
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Interpolation_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")]
+Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, False, False)
+
+aShape = Interpolation_1.result().resultSubShapePair()[0].shape()
+assert(aShape.isEdge())
+assert(aShape.isPlanar() == False)
+
+model.end()
index c05c3886451d4c6dcf39d24825730fa4e8c5fe5a..03a3106beef3a70a07fb5bb29e670c6f6080ae1b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -48,6 +47,7 @@ def checkRectangleWire(theDocument, theEdgeNames):
     aWire = model.addWire(theDocument, aSelection)
     aShape = aWire.result().resultSubShapePair()[0].shape()
     assert(aShape.isWire())
+    assert(aShape.wire().isClosed())
     assertRectangle(aShape.wire())
     theDocument.removeFeature(aWire.feature())
 
@@ -88,15 +88,15 @@ model.do()
 
 # Test 1. Check face/wire of box is a rectangle
 checkRectangleFace(Part_1_doc, "Box_1_1/Top")
-Wire_edges = ["Box_1_1/Left&Box_1_1/Top", "Box_1_1/Front&Box_1_1/Top", "Box_1_1/Right&Box_1_1/Top", "Box_1_1/Back&Box_1_1/Top"]
+Wire_edges = ["[Box_1_1/Left][Box_1_1/Top]", "[Box_1_1/Front][Box_1_1/Top]", "[Box_1_1/Right][Box_1_1/Top]", "[Box_1_1/Back][Box_1_1/Top]"]
 checkRectangleWire(Part_1_doc, Wire_edges)
 
 # Test 2. Build a polygon from edges
-Wire_edges = ["Box_1_1/Left&Box_1_1/Bottom", "Box_1_1/Front&Box_1_1/Left", "Box_1_1/Left&Box_1_1/Top", "Box_1_1/Back&Box_1_1/Top", "Box_1_1/Right&Box_1_1/Top"]
+Wire_edges = ["[Box_1_1/Left][Box_1_1/Bottom]", "[Box_1_1/Front][Box_1_1/Left]", "[Box_1_1/Left][Box_1_1/Top]", "[Box_1_1/Back][Box_1_1/Top]", "[Box_1_1/Right][Box_1_1/Top]"]
 checkPolygonWire(Part_1_doc, Wire_edges)
 
 # Test 3. Build a polygon from vertices
-Poly_vertices = ["Box_1_1/Back&Box_1_1/Left&Box_1_1/Bottom", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Bottom", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Bottom", "Box_1_1/Front&Box_1_1/Right&Box_1_1/Top", "Box_1_1/Front&Box_1_1/Left&Box_1_1/Top", "Box_1_1/Back&Box_1_1/Right&Box_1_1/Top"]
+Poly_vertices = ["[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"]
 checkPolyline(Part_1_doc, Poly_vertices)
 
 model.end()
index 961ed55e14b4e9d5bd151f61a55ba126828223ee..70c18f087735fca4e5d8bc38783b7df15b766d56 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -68,7 +67,14 @@ def checkSphereAll(theDocument, theFeature, theFaceName, theCenter, theRadius):
 
     checkSphereShell(theDocument, theFaceName, theCenter, theRadius)
     checkSphereFace(theDocument, theFaceName, theCenter, theRadius)
-    checkArc(theDocument, theFaceName, theCenter, theRadius)
+
+    anArcName = "[" + theFaceName + "][weak_name_3]"
+    checkArc(theDocument, anArcName, theCenter, theRadius)
+
+def checkNonSphereShell(theFeature):
+    aShape = theFeature.result().resultSubShapePair()[0].shape()
+    assert(aShape.isShell())
+    assert(aShape.shell().getSphere() is None)
 
 
 model.begin()
@@ -93,32 +99,51 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "R")
 model.do()
 
 # Test 1. Compose sphere
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_1f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), "Aperture", 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_1f")], model.selection("EDGE", "Sketch_1/SketchLine_1"), "Aperture", 0)
 aCenter = GeomAPI.GeomAPI_Pnt(0, 0, 0)
-checkSphereAll(Part_1_doc, Revolution_1, "Revolution_1_1/Generated_Face_2", aCenter, ParamR.value())
+checkSphereAll(Part_1_doc, Revolution_1, "Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
 
 # Test 2. Translate sphere
 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], model.selection("EDGE", "PartSet/OX"), "Shift")
 aCenter.setX(aCenter.x() + ParamShift.value())
-checkSphereAll(Part_1_doc, Translation_1, "Translation_1_1/Translated_Face_1", aCenter, ParamR.value())
+checkSphereAll(Part_1_doc, Translation_1, "Translation_1_1/MF:Translated&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
 
 # Test 3. Rotate sphere
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OY"), "Angle")
 anAngle = ParamAngle.value() * math.pi / 180.0
 aCenter.setX(ParamShift.value() * math.cos(anAngle))
 aCenter.setZ(-ParamShift.value() * math.sin(anAngle))
-checkSphereAll(Part_1_doc, Rotation_1, "Rotation_1_1/Rotated_Face_1", aCenter, ParamR.value())
+checkSphereAll(Part_1_doc, Rotation_1, "Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
 
 # Test 4. Check result by changing parameters
 ParamR.setValue(100)
 model.do()
-checkSphereAll(Part_1_doc, Rotation_1, "Rotation_1_1/Rotated_Face_1", aCenter, ParamR.value())
+checkSphereAll(Part_1_doc, Rotation_1, "Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
 
 ParamAperture.setValue(270)
 model.do()
-checkSphereFace(Part_1_doc, "Rotation_1_1/Rotated_Face_3", aCenter, ParamR.value())
-checkSphereShell(Part_1_doc, "Rotation_1_1/Rotated_Face_3", aCenter, ParamR.value())
-checkArc(Part_1_doc, "Rotation_1_1/Rotated_Face_3&Rotation_1_1/Rotated_Face_1", aCenter, ParamR.value())
-checkArc(Part_1_doc, "Rotation_1_1/Rotated_Face_3&Rotation_1_1/Rotated_Face_2", aCenter, ParamR.value())
+checkSphereFace(Part_1_doc, "Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
+checkSphereShell(Part_1_doc, "Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2", aCenter, ParamR.value())
+checkArc(Part_1_doc, "[Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2][Rotation_1_1/MF:Rotated&Revolution_1_1/From_Face]", aCenter, ParamR.value())
+checkArc(Part_1_doc, "[Rotation_1_1/MF:Rotated&Sketch_1/SketchArc_1_2][Rotation_1_1/MF:Rotated&Revolution_1_1/To_Face]", aCenter, ParamR.value())
+
+# Test 5. Sheck non-spherical shell
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Rotation_1_1/MF:Rotated&Revolution_1_1/To_Face"), model.selection("FACE", "Rotation_1_1/MF:Rotated&Revolution_1_1/From_Face")])
+checkNonSphereShell(Shell_1)
+
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_2 = Sketch_2.addLine(18.12152721893265, 20.53645178481853, 73.15172297255518, 20.53645178481853)
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_2.result())
+SketchArc_2 = Sketch_2.addArc(60.28852631862447, 20.53645178481853, 73.15172297255518, 20.53645178481853, 58.16589238004093, 33.22330534748203, False)
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_2.result(), SketchArc_2.center())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_2.endPoint(), SketchArc_2.startPoint())
+SketchArc_3 = Sketch_2.addArc(40.15343392262997, 20.53645178481853, 18.12152721893265, 20.53645178481853, 58.16589238004093, 33.22330534748203, True)
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_2.result(), SketchArc_3.center())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchArc_3.endPoint())
+model.do()
+Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_2r-SketchArc_2_2f-SketchArc_3_2f")], model.selection("EDGE", "Sketch_2/SketchLine_2"), 360, 0)
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Revolution_2_1/Generated_Face&Sketch_2/SketchArc_3_2"), model.selection("FACE", "Revolution_2_1/Generated_Face&Sketch_2/SketchArc_2_2")])
+checkNonSphereShell(Shell_2)
 
 model.end()
index 25c7f3edc6d059a2855b56c30f32317cffe33133..df88a0dad72bf41139c1f4517ee7ca90f69582ce 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -61,6 +60,11 @@ def checkTorusAll(theDocument, theFeature, theFaceName, theCenter, theAxis, theM
     checkTorusShell(theDocument, [theFaceName], theCenter, theAxis, theMajorRadius, theMinorRadius)
     checkTorusFace(theDocument, theFaceName, theCenter, theAxis, theMajorRadius, theMinorRadius)
 
+def checkNonTorusShell(theFeature):
+    aShape = theFeature.result().resultSubShapePair()[0].shape()
+    assert(aShape.isShell())
+    assert(aShape.shell().getTorus() is None)
+
 
 model.begin()
 partSet = model.moduleDocument()
@@ -84,12 +88,23 @@ aCosAngle = math.cos(anAngle)
 aSinAngle = math.sin(anAngle)
 aCenter = GeomAPI.GeomAPI_Pnt(0, aCenter.y() * aCosAngle - aCenter.z() * aSinAngle, aCenter.y() * aSinAngle + aCenter.z() * aCosAngle)
 anAxis = GeomAPI.GeomAPI_Dir(0, anAxis.y() * aCosAngle - anAxis.z() * aSinAngle, anAxis.y() * aSinAngle + anAxis.z() * aCosAngle)
-checkTorusAll(Part_1_doc, Rotation_1, "Rotation_1_1/Rotated_Face_1", aCenter, anAxis, ParamRMax.value(), ParamRMin.value())
+checkTorusAll(Part_1_doc, Rotation_1, "Rotation_1_1/MF:Rotated&Torus_1_1/Face_1", aCenter, anAxis, ParamRMax.value(), ParamRMin.value())
 
 # Test 3. Split torus and compose a shell
 Partition_1_objects = [model.selection("SOLID", "Rotation_1_1"), model.selection("FACE", "PartSet/YOZ"), model.selection("FACE", "PartSet/XOZ"), model.selection("FACE", "PartSet/XOY")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
-Shell_1_objects = ["Partition_1_1_6/Modified_Face_4_4", "Partition_1_1_7/Modified_Face_4_3", "Partition_1_1_7/Modified_Face_1_divided_2_1", "Partition_1_1_5/Modified_Face_4_4"]
+Shell_1_objects = ["Partition_1_1_6/Modified_Face&Torus_1_1/Face_1",
+                   "Partition_1_1_7/Modified_Face&Torus_1_1/Face_1&weak_name_2",
+                   "Partition_1_1_7/Modified_Face&Torus_1_1/Face_1&weak_name_1",
+                   "Partition_1_1_5/Modified_Face&Torus_1_1/Face_1"]
 checkTorusShell(Part_1_doc, Shell_1_objects, aCenter, anAxis, ParamRMax.value(), ParamRMin.value())
 
+# Test 4. Check non-torus shell
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Partition_1_1_1/Modified_Face&Torus_1_1/Face_1"), model.selection("FACE", "Partition_1_1_1/Modified_Face&PartSet/YOZ/YOZ")])
+checkNonTorusShell(Shell_1)
+
+Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("FACE", "PartSet/XOY"), True)
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "_weak_name_1_Symmetry_1_1_1"), model.selection("FACE", "_weak_name_1_Symmetry_1_1_2")])
+checkNonTorusShell(Shell_2)
+
 model.end()
index 77e7d3b1ac24045d6b4f6ecad4b81eaf4324b65c..a886d6d0507e5a5674b0acc452e31f968c5d4a0c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 
index cf12b391840fa753e303f7076df24ede3de9e3ce..89ef33075607fbe562475fec49b765490334afb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_H
index 71c5a05db255f81b91df106cb17bac1aff6e8704..d1c014e1b6d0783a541d7fc46f32425296787b87 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* GeomAPI.i */
@@ -50,6 +49,7 @@
 %shared_ptr(GeomAlgoAPI_Revolution)
 %shared_ptr(GeomAlgoAPI_Rotation)
 %shared_ptr(GeomAlgoAPI_Sewing)
+%shared_ptr(GeomAlgoAPI_SketchBuilder)
 %shared_ptr(GeomAlgoAPI_ShapeBuilder)
 %shared_ptr(GeomAlgoAPI_Translation)
 %shared_ptr(GeomAlgoAPI_Transform)
@@ -61,7 +61,9 @@
 // all supported interfaces
 %include "GeomAlgoAPI_MakeShape.h"
 %include "GeomAlgoAPI_Boolean.h"
+%include "GeomAlgoAPI_Circ2dBuilder.h"
 %include "GeomAlgoAPI_CompoundBuilder.h"
+%include "GeomAlgoAPI_CurveBuilder.h"
 %include "GeomAlgoAPI_DFLoader.h"
 %include "GeomAlgoAPI_EdgeBuilder.h"
 %include "GeomAlgoAPI_FaceBuilder.h"
index 48bdb152c532f4a79911aca09926d8061f1dccc3..d067fe8bf8e13c3cbd3b3bafe556f1d95f643e31 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_BREPExport.h>
index 4cc219f60f7754a5439fa484313c6f64d7b179b3..2a3433c1b5569fc1d7fc843bd37a51e7213ec63d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_BREPEXPORT_H_
index c71bafa40f2953a294e86584e7d7f18599dca67e..a9b71669c199d06a4793fed839acd2065758aa2d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_BREPImport.h>
index 33976750f54a4a3746c96c4a153676156971f952..38890ffd5d3c9da707390df47941a1199c7d11f5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_BREPIMPORT_H_
index c9d9524c41610898521dcb5c621638e44d23b201..bb2d2815d4d99efcc0cd3d73402aabe9809ed8bd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Boolean.h"
@@ -25,6 +24,8 @@
 
 #include <BOPAlgo_BOP.hxx>
 #include <TopTools_ListOfShape.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopExp_Explorer.hxx>
 
 //=================================================================================================
 GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(const GeomShapePtr theObject,
@@ -117,11 +118,10 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
   if(aResult.ShapeType() == TopAbs_COMPOUND) {
     std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
     aGeomShape->setImpl(new TopoDS_Shape(aResult));
-    ListOfShape aCompSolids, aFreeSolids;
+    ListOfShape aResults;
     aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                        GeomAPI_Shape::COMPSOLID,
-                                                       aCompSolids,
-                                                       aFreeSolids);
+                                                       aResults);
     aResult = aGeomShape->impl<TopoDS_Shape>();
   }
 
@@ -130,3 +130,87 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
   this->setShape(aShape);
   this->setDone(true);
 }
+
+static bool isHistoryType(TopAbs_ShapeEnum theType) {
+  return theType == TopAbs_VERTEX || theType == TopAbs_EDGE ||
+         theType == TopAbs_FACE || theType == TopAbs_SOLID;
+}
+
+/// searches the corresponding result for theOld
+static void searchResult(const TopoDS_Shape& theOld, const TopoDS_Shape& theResult,
+  BOPAlgo_BOP* theBuilder, TopTools_MapOfShape& theNews)
+{
+  if (theResult.ShapeType() == theOld.ShapeType()) { // check some sub-shape produces a sub-result
+    if (theOld.IsSame(theResult)) {
+      theNews.Add(theResult);
+      return;
+    }
+    // searching for new result by sub-shapes of aSubType type
+    TopAbs_ShapeEnum aSubType = TopAbs_ShapeEnum(int(theOld.ShapeType()) + 1);
+    while(aSubType < TopAbs_VERTEX && !isHistoryType(aSubType))
+      aSubType = TopAbs_ShapeEnum(int(aSubType) + 1);
+    if (aSubType == TopAbs_SHAPE)
+      return;
+    TopTools_MapOfShape aResSubs;
+    for(TopExp_Explorer aResExp(theResult, aSubType); aResExp.More(); aResExp.Next())
+      aResSubs.Add(aResExp.Current());
+    for(TopExp_Explorer anExp(theOld, aSubType); anExp.More(); anExp.Next()) {
+      const TopTools_ListOfShape& aNewSubs = theBuilder->Modified(anExp.Current());
+      // searching for this new sub in theResult
+      for(TopTools_ListIteratorOfListOfShape aNewSub(aNewSubs); aNewSub.More(); aNewSub.Next()) {
+        if (aResSubs.Contains(aNewSub.Value())) {
+          theNews.Add(theResult);
+          return;
+        }
+      }
+    }
+  } else if (theResult.ShapeType() < theOld.ShapeType()) { // recursive search among sub-shapes
+    for(TopoDS_Iterator aSubResults(theResult); aSubResults.More(); aSubResults.Next()) {
+      searchResult(theOld, aSubResults.Value(), theBuilder, theNews);
+    }
+  }
+}
+
+// check the shape is on the higher level of compound or compsolid
+bool isInComp(const TopoDS_Shape& theComp, const TopoDS_Shape& theShape) {
+  if (theComp.ShapeType() == TopAbs_COMPOUND || theComp.ShapeType() == TopAbs_COMPSOLID) {
+    for(TopoDS_Iterator anIter(theComp); anIter.More(); anIter.Next()) {
+      if (isInComp(anIter.Value(), theShape))
+        return true;
+    }
+  } else return theShape.IsSame(theComp);
+  return false;
+}
+
+//=================================================================================================
+/// make arguments of Fuse produce result shapes with "modified" evolution
+void GeomAlgoAPI_Boolean::modified(const GeomShapePtr theOldShape, ListOfShape& theNewShapes)
+{
+  BOPAlgo_BOP* aBuilder = this->implPtr<BOPAlgo_BOP>();
+  if (aBuilder->Operation() == BOPAlgo_FUSE) { // only for fuse and when old is and argument
+    TopoDS_Shape anOld = theOldShape->impl<TopoDS_Shape>();
+    bool isOldComp = anOld.ShapeType() == TopAbs_COMPOUND || anOld.ShapeType() == TopAbs_COMPSOLID;
+    bool aFound = false;
+    TopTools_ListIteratorOfListOfShape anIter(aBuilder->Arguments());
+    for(; !aFound && anIter.More(); anIter.Next())
+      aFound = anOld.IsSame(anIter.Value()) || (!isOldComp && isInComp(anIter.Value(), anOld));
+    for(anIter.Initialize(aBuilder->Tools()); !aFound && anIter.More(); anIter.Next())
+      aFound = anOld.IsSame(anIter.Value()) || (!isOldComp && isInComp(anIter.Value(), anOld));
+    if (aFound) {
+      TopoDS_Shape aResult = aBuilder->Shape();
+      TopTools_MapOfShape aNewsMap;
+      searchResult(anOld, aResult, aBuilder, aNewsMap);
+      if (!aNewsMap.IsEmpty()) {
+        for(TopTools_MapIteratorOfMapOfShape aNewsIter(aNewsMap);
+            aNewsIter.More(); aNewsIter.Next())
+        {
+          GeomShapePtr aShape(new GeomAPI_Shape);
+          aShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewsIter.Value()));
+          theNewShapes.push_back(aShape);
+        }
+        return;
+      }
+    }
+  }
+  GeomAlgoAPI_MakeShape::modified(theOldShape, theNewShapes); // default behavior
+}
index 54a5d9428a870195917546d05739b6c065bb14af..d5a08376c3d3163fec204e9ca730396703e9788a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Boolean_H_
@@ -57,6 +56,10 @@ public:
                                          const ListOfShape& theTools,
                                          const OperationType theOperationType);
 
+  /// Redefinition of the generic method for the Fuse problem: OCCT 30481
+  GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
+    ListOfShape& theNewShapes);
+
 private:
   /// Builds resulting shape.
   void build(const ListOfShape& theObjects,
index cbdb91239eadc27eb95c1e162a674e202c031396..8105c7bf2f0a2ed8f355052a51820471e7d84d70 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_Box.h>
index 5d61686b2b4113d7f32d06cc09d18d3a423b7d50..69236954fde73a646293be3cb69de413dda78228 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_BOX_H_
index f0d92c7f75d22d6c043c9c57913bd564f281cdfe..232a0d690d894f03d646a36bc8212a881b5b2931 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_Circ2dBuilder.h>
@@ -211,29 +210,28 @@ private:
     VectorOfGccLine aTgLine;
     convertTangentCurvesToGccEnt(aTgCirc, aTgLine);
 
-    if (aTgCirc.size() + aTgLine.size() != 3)
-      return Circ2dPtr();
-
     std::shared_ptr<GccAna_Circ2d3Tan> aCircleBuilder;
-    switch (aTgLine.size()) {
-    case 0:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-          *aTgCirc[0], *aTgCirc[1], *aTgCirc[2], Precision::Confusion()));
-      break;
-    case 1:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-          *aTgCirc[0], *aTgCirc[1], *aTgLine[0], Precision::Confusion()));
-      break;
-    case 2:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-          *aTgCirc[0], *aTgLine[0], *aTgLine[1], Precision::Confusion()));
-      break;
-    case 3:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-          *aTgLine[0], *aTgLine[1], *aTgLine[0], Precision::Confusion()));
-      break;
-    default:
-      break;
+    if (aTgCirc.size() + aTgLine.size() == 3) {
+      switch (aTgLine.size()) {
+      case 0:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgCirc[0], *aTgCirc[1], *aTgCirc[2], Precision::Confusion()));
+        break;
+      case 1:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgCirc[0], *aTgCirc[1], *aTgLine[0], Precision::Confusion()));
+        break;
+      case 2:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgCirc[0], *aTgLine[0], *aTgLine[1], Precision::Confusion()));
+        break;
+      case 3:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgLine[0], *aTgLine[1], *aTgLine[2], Precision::Confusion()));
+        break;
+      default:
+        break;
+      }
     }
 
     return getProperCircle(aCircleBuilder);
@@ -242,35 +240,28 @@ private:
   Circ2dPtr circleByPointAndTwoTangentCurves()
   {
     const gp_Pnt2d& aPoint = myPassingPoints[0];
-    CurveAdaptorPtr aCurve1 = myTangentShapes[0];
-    CurveAdaptorPtr aCurve2 = myTangentShapes[1];
-    if (!aCurve1 || !aCurve2)
-      return Circ2dPtr();
+
+    VectorOfGccCirc aTgCirc;
+    VectorOfGccLine aTgLine;
+    convertTangentCurvesToGccEnt(aTgCirc, aTgLine);
 
     std::shared_ptr<GccAna_Circ2d3Tan> aCircleBuilder;
-    if (aCurve1->GetType() == GeomAbs_Line) {
-      if (aCurve2->GetType() == GeomAbs_Line) {
-        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(
-            new GccAna_Circ2d3Tan(GccEnt::Unqualified(aCurve1->Line()),
-                                  GccEnt::Unqualified(aCurve2->Line()),
-                                  aPoint, Precision::Confusion()));
-      } else if (aCurve2->GetType() == GeomAbs_Circle) {
-        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(
-            new GccAna_Circ2d3Tan(GccEnt::Unqualified(aCurve2->Circle()),
-                                  GccEnt::Unqualified(aCurve1->Line()),
-                                  aPoint, Precision::Confusion()));
-      }
-    } else if (aCurve1->GetType() == GeomAbs_Circle) {
-      if (aCurve2->GetType() == GeomAbs_Line) {
-        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(
-            new GccAna_Circ2d3Tan(GccEnt::Unqualified(aCurve1->Circle()),
-                                  GccEnt::Unqualified(aCurve2->Line()),
-                                  aPoint, Precision::Confusion()));
-      } else if (aCurve2->GetType() == GeomAbs_Circle) {
-        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(
-            new GccAna_Circ2d3Tan(GccEnt::Unqualified(aCurve2->Circle()),
-                                  GccEnt::Unqualified(aCurve1->Circle()),
-                                  aPoint, Precision::Confusion()));
+    if (aTgCirc.size() + aTgLine.size() == 2) {
+      switch (aTgLine.size()) {
+      case 0:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgCirc[0], *aTgCirc[1], aPoint, Precision::Confusion()));
+        break;
+      case 1:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgCirc[0], *aTgLine[0], aPoint, Precision::Confusion()));
+        break;
+      case 2:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            *aTgLine[0], *aTgLine[1], aPoint, Precision::Confusion()));
+        break;
+      default:
+        break;
       }
     }
 
@@ -282,16 +273,17 @@ private:
     const gp_Pnt2d& aPoint1 = myPassingPoints[0];
     const gp_Pnt2d& aPoint2 = myPassingPoints[1];
     CurveAdaptorPtr aCurve = myTangentShapes[0];
-    if (!aCurve)
-      return Circ2dPtr();
 
     std::shared_ptr<GccAna_Circ2d3Tan> aCircleBuilder;
-    if (aCurve->GetType() == GeomAbs_Line) {
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-        GccEnt::Unqualified(aCurve->Line()), aPoint1, aPoint2, Precision::Confusion()));
-    } else if (aCurve->GetType() == GeomAbs_Circle) {
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
-          GccEnt::Unqualified(aCurve->Circle()), aPoint1, aPoint2, Precision::Confusion()));
+    if (aCurve) {
+      if (aCurve->GetType() == GeomAbs_Line) {
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            GccEnt::Unqualified(aCurve->Line()), aPoint1, aPoint2, Precision::Confusion()));
+      }
+      else if (aCurve->GetType() == GeomAbs_Circle) {
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d3Tan>(new GccAna_Circ2d3Tan(
+            GccEnt::Unqualified(aCurve->Circle()), aPoint1, aPoint2, Precision::Confusion()));
+      }
     }
 
     return getProperCircle(aCircleBuilder);
@@ -356,25 +348,24 @@ private:
     VectorOfGccLine aTgLine;
     convertTangentCurvesToGccEnt(aTgCirc, aTgLine);
 
-    if (aTgCirc.size() + aTgLine.size() != 2)
-      return Circ2dPtr();
-
     std::shared_ptr<GccAna_Circ2d2TanRad> aCircleBuilder;
-    switch (aTgLine.size()) {
-    case 0:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
-          *aTgCirc[0], *aTgCirc[1], myRadius, Precision::Confusion()));
-      break;
-    case 1:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
-          *aTgCirc[0], *aTgLine[0], myRadius, Precision::Confusion()));
-      break;
-    case 2:
-      aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
-          *aTgLine[0], *aTgLine[1], myRadius, Precision::Confusion()));
-      break;
-    default:
-      break;
+    if (aTgCirc.size() + aTgLine.size() == 2) {
+      switch (aTgLine.size()) {
+      case 0:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
+            *aTgCirc[0], *aTgCirc[1], myRadius, Precision::Confusion()));
+        break;
+      case 1:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
+            *aTgCirc[0], *aTgLine[0], myRadius, Precision::Confusion()));
+        break;
+      case 2:
+        aCircleBuilder = std::shared_ptr<GccAna_Circ2d2TanRad>(new GccAna_Circ2d2TanRad(
+            *aTgLine[0], *aTgLine[1], myRadius, Precision::Confusion()));
+        break;
+      default:
+        break;
+      }
     }
 
     return getProperCircle(aCircleBuilder);
index f643c966385d17f3787dcef6fb8029dfc6f87394..c193e877dc8314128d221bfc8d15b219bb021ca6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Circ2dBuilder_H_
index 6e8516840baa1822e6a9d7b9e7b342ad034b8762..6df743c509174546d72c566a057cdf6fde150391 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
index 97dcf42b7b11363a8c5b21e3f36d9c5bd731c5e5..7c449a29b6863be27c7794939114fa6cf4b268a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_CompoundBuilder_H_
index 5d9be8c863afa09739876ee98d4a6b3c373610fa..c8a8234140367040f995c80b0ed61abd7cd0a157 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Cone.cpp
 // Created:     20 Mar 2017
 
 #include <BRepPrimAPI_MakeCone.hxx>
 
-//=================================================================================================
-GeomAlgoAPI_Cone::GeomAlgoAPI_Cone()
-{
-}
-
 //=================================================================================================
 GeomAlgoAPI_Cone::GeomAlgoAPI_Cone(std::shared_ptr<GeomAPI_Ax2> theAxis,
                                    const double theBaseRadius,
@@ -83,4 +95,4 @@ void GeomAlgoAPI_Cone::build()
   setImpl(aConeMaker);
 
   setDone(true);
-}
\ No newline at end of file
+}
index 327ef6bbce4c0f0abedf4c1b730c88b7e6a8a75c..a44a0e4d531efe078518981cfeec3ba3e8c3c21b 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Cone.h
 // Created:     20 Mar 2017
@@ -18,8 +35,6 @@
 class GeomAlgoAPI_Cone : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Cone();
-
   /// Creates a cone.
   /// \param theAxis The axis of the cone
   /// \param theBaseRadius The base radius of the cone
index db5e544bb94f15b486ac29cf44153b3350616cd7..3f1e577ba6c941f024dd44c9029df3a1ef47da9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_ConeSegment.h>
 
 #include <math.h>
 
-//=================================================================================================
-GeomAlgoAPI_ConeSegment::GeomAlgoAPI_ConeSegment()
-{
-}
-
 //=================================================================================================
 
 GeomAlgoAPI_ConeSegment::GeomAlgoAPI_ConeSegment(const double theRMin1,
@@ -147,8 +141,8 @@ void GeomAlgoAPI_ConeSegment::build()
   BRepPrimAPI_MakeRevol* aRevolBuilder =
     new BRepPrimAPI_MakeRevol(aFaceBuilder.Face(), aZAxis, myDeltaPhi * M_PI/180., Standard_True);
   if(!aRevolBuilder) {
-    return;
     myError = "Cone Segment builder :: section revolution did not succeed";
+    return;
   }
   if(!aRevolBuilder->IsDone()) {
     myError = "Cone Segment builder :: section revolution did not succeed";
index f28cf597a733bbf0dfa673c46dec4f1086ad7fe2..5517e1703766f3a032ed0be6d2d07c20c2da3c4f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_CONESEGMENT_H_
@@ -30,8 +29,6 @@
 class GeomAlgoAPI_ConeSegment : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_ConeSegment();
-
   /// Creates a cone segment using standard GDML parameters.
   /// \param theRMin1 Cone base inner radius.
   /// \param theRMax1 Cone base outer radius.
index 34bd7db045ee2b355298ac24a0e06957cd1f3b5d..a189db128f7b80bb513cac53a093b5e019be3056 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Copy.h"
index 04e3df387226f477b546fd0e2432e53357e73efe..d195b8f23c8edd295f83f05766b4f3e2811a8885 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Copy_H_
index 04966cbd655d14b0e8215592c79127d25687e408..ffec79e30a7aeed5a2549ded6b41cb449e35daa4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_CurveBuilder.h"
@@ -35,7 +34,7 @@
 #include <Precision.hxx>
 
 
-static void reorder(Handle(TColgp_HArray1OfPnt) thePoints);
+static void reorder(Handle(TColgp_HArray1OfPnt)& thePoints);
 
 //=================================================================================================
 GeomEdgePtr GeomAlgoAPI_CurveBuilder::edge(const std::list<GeomPointPtr>& thePoints,
@@ -52,17 +51,17 @@ GeomEdgePtr GeomAlgoAPI_CurveBuilder::edge(const std::list<GeomPointPtr>& thePoi
     aPoints->SetValue(i, aPoint->impl<gp_Pnt>());
   }
 
-  // Reorder points if required
-  if (theIsToReorder) {
-    reorder(aPoints);
-  }
-
   // If the curve to be closed - remove last point if it is too close to the first one
   bool isClose = aPoints->First().Distance(aPoints->Last()) <= gp::Resolution();
   if (isClose && theIsClosed) {
     aPoints->Resize(aPoints->Lower(), aPoints->Upper() - 1, Standard_True);
   }
 
+  // Reorder points if required
+  if (theIsToReorder) {
+    reorder(aPoints);
+  }
+
   // Initialize interpolator
   GeomAPI_Interpolate anInterp(aPoints, theIsClosed, gp::Resolution());
 
@@ -94,7 +93,7 @@ GeomEdgePtr GeomAlgoAPI_CurveBuilder::edge(const std::list<GeomPointPtr>& thePoi
 }
 
 //================   Auxiliary functions   ========================================================
-void reorder(Handle(TColgp_HArray1OfPnt) thePoints)
+void reorder(Handle(TColgp_HArray1OfPnt)& thePoints)
 {
   if (thePoints->Length() < 3) {
     return;
@@ -103,7 +102,7 @@ void reorder(Handle(TColgp_HArray1OfPnt) thePoints)
   int aNbPoints = thePoints->Length();
   int aNbDup = 0;
   gp_Pnt aPrevPnt = thePoints->Value(1);
-  for (int i = 1; i < aNbPoints - 1; i++) {
+  for (int i = 1; i < aNbPoints; i++) {
     gp_Pnt aPnt = thePoints->Value(i);
     int aNearest = 0;
     double aMinDist = RealLast();
@@ -118,7 +117,7 @@ void reorder(Handle(TColgp_HArray1OfPnt) thePoints)
       // Keep given order of points to use it in case of equidistant candidates
       //               .-<---<-.
       //              /         \
-                      // o  o  o  c  o->o->o->o->n  o  o
+      // o  o  o  c  o->o->o->o->n  o  o
       //          |  |           |
       //          i i+1       nearest
       gp_Pnt aNearestPnt = thePoints->Value(aNearest);
index 89c4255bb0fdb2f0159e5c9cff24ebc7eccaa2f7..e35073b8d890c379d379fccfb0a584b4922ab915 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_CurveBuilder_H_
index bfdc203b96b1f1ab15c06caa7069f9c954ac9213..cf980671f9260643391e1e3703d606cf2b1a2c89 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_Cylinder.h>
 
 #include <BRepPrimAPI_MakeCylinder.hxx>
 
-//=================================================================================================
-GeomAlgoAPI_Cylinder::GeomAlgoAPI_Cylinder()
-{
-}
-
 //=================================================================================================
 GeomAlgoAPI_Cylinder::GeomAlgoAPI_Cylinder(std::shared_ptr<GeomAPI_Ax2> theAxis,
                                            const double theRadius,
index fcbca3448dc4147fdeb76cc880c534c2c5fb47e5..3eaa0067869e22fe85f04ddd556a13a65d8d9918 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_CYLINDER_H_
@@ -33,8 +32,6 @@
 class GeomAlgoAPI_Cylinder : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Cylinder();
-
   /// Creates a cylinder.
   /// \param theAxis The axis of the cylinder
   /// \param theRadius The radius of the cylinder
index 751e755c3eb22892835fedf9068f0e272f30a4fe..20c710b97390c4477f0ca41593b920aa1c74ecbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_DFLoader.h>
index 0ace57d5a20935f652bb097102a8f23577d8d04e..e419c03aa712cc308b6145077b328b89b2211175 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_DFLoader_H_
index d6ba70d19919110cfe07087731d15cd75995457f..85828425c2aaee9eb5e56004d8c001554101eb30 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_EdgeBuilder.h>
 #include <Bnd_Box.hxx>
 #include <BRepBndLib.hxx>
 
+static GeomEdgePtr createLine(const gp_Pnt& theStart, const gp_Pnt& theEnd)
+{
+  GeomEdgePtr aRes;
+  if (!theStart.IsEqual(theEnd, Precision::Confusion()) &&
+    Abs(theStart.SquareDistance(theEnd)) < 1.e+100) {
+    BRepBuilderAPI_MakeEdge anEdgeBuilder(theStart, theEnd);
+    TopoDS_Edge anEdge = anEdgeBuilder.Edge();
+    aRes = GeomEdgePtr(new GeomAPI_Edge);
+    aRes->setImpl(new TopoDS_Shape(anEdge));
+  }
+  return aRes;
+}
+
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
     std::shared_ptr<GeomAPI_Pnt> theStart, std::shared_ptr<GeomAPI_Pnt> theEnd)
 {
   const gp_Pnt& aStart = theStart->impl<gp_Pnt>();
   const gp_Pnt& anEnd = theEnd->impl<gp_Pnt>();
-
-  if (aStart.IsEqual(anEnd, Precision::Confusion()))
-    return std::shared_ptr<GeomAPI_Edge>();
-  if (Abs(aStart.SquareDistance(anEnd)) > 1.e+100)
-    return std::shared_ptr<GeomAPI_Edge>();
-  BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd);
-  std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge);
-  TopoDS_Edge anEdge = anEdgeBuilder.Edge();
-  aRes->setImpl(new TopoDS_Shape(anEdge));
-  return aRes;
+  return createLine(aStart, anEnd);
 }
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
     double theDX, double theDY, double theDZ)
 {
-
   const gp_Pnt& aStart = gp_Pnt(0, 0, 0);
   const gp_Pnt& anEnd = gp_Pnt(theDX, theDY, theDZ);
-
-  if (aStart.IsEqual(anEnd, Precision::Confusion()))
-    return std::shared_ptr<GeomAPI_Edge>();
-  if (Abs(aStart.SquareDistance(anEnd)) > 1.e+100)
-    return std::shared_ptr<GeomAPI_Edge>();
-  BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd);
-  std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge);
-  TopoDS_Edge anEdge = anEdgeBuilder.Edge();
-  aRes->setImpl(new TopoDS_Shape(anEdge));
-  return aRes;
+  return createLine(aStart, anEnd);
 }
 
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
     const std::shared_ptr<GeomAPI_Lin> theLin)
 {
-  if(!theLin.get()) {
-    return std::shared_ptr<GeomAPI_Edge>();
+  GeomEdgePtr aRes;
+  if (theLin.get()) {
+    const gp_Lin& aLin = theLin->impl<gp_Lin>();
+    BRepBuilderAPI_MakeEdge anEdgeBuilder(aLin);
+    TopoDS_Edge anEdge = anEdgeBuilder.Edge();
+    aRes = GeomEdgePtr(new GeomAPI_Edge);
+    aRes->setImpl(new TopoDS_Shape(anEdge));
   }
-
-  const gp_Lin& aLin = theLin->impl<gp_Lin>();
-  BRepBuilderAPI_MakeEdge anEdgeBuilder(aLin);
-  std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge());
-  TopoDS_Edge anEdge = anEdgeBuilder.Edge();
-  aRes->setImpl(new TopoDS_Shape(anEdge));
   return aRes;
 }
 
@@ -140,7 +132,9 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::cylinderAxis(
   aParamMax += aDelta * 0.1;
 
   gp_Pnt aStart(aParamMin * anAxis.Direction().XYZ() + anAxis.Location().XYZ());
+  aStart.Transform(aLoc.Transformation());
   gp_Pnt anEnd(aParamMax * anAxis.Direction().XYZ() + anAxis.Location().XYZ());
+  anEnd.Transform(aLoc.Transformation());
   /*
   gp_Pnt aStart(anAxis.Location().Transformed(aLoc.Transformation()));
   // edge length is 100, "-" because cylinder of extrusion has negative direction with the cylinder
@@ -176,15 +170,14 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::lineCircle(
 std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::lineCircle(
     std::shared_ptr<GeomAPI_Circ> theCircle)
 {
-  if(!theCircle.get()) {
-    return std::shared_ptr<GeomAPI_Edge>();
+  GeomEdgePtr aRes;
+  if (theCircle.get()) {
+    const gp_Circ& aCirc = theCircle->impl<gp_Circ>();
+    BRepBuilderAPI_MakeEdge anEdgeBuilder(aCirc);
+    TopoDS_Edge anEdge = anEdgeBuilder.Edge();
+    aRes = GeomEdgePtr(new GeomAPI_Edge);
+    aRes->setImpl(new TopoDS_Shape(anEdge));
   }
-
-  const gp_Circ& aCirc = theCircle->impl<gp_Circ>();
-  BRepBuilderAPI_MakeEdge anEdgeBuilder(aCirc);
-  std::shared_ptr<GeomAPI_Edge> aRes(new GeomAPI_Edge());
-  TopoDS_Edge anEdge = anEdgeBuilder.Edge();
-  aRes->setImpl(new TopoDS_Shape(anEdge));
   return aRes;
 }
 
index 22c248d97bfd412b237fe6ee8416c7a55ca7fad4..259800972bc6c6de42395a7c5d40a69ae1e0d67f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_EdgeBuilder_H_
index afa430db18b3fef3fbb827304a72ce4cddd8c5cd..aa6f5ae2c3eb26d1052d4b51250b151890bf81ef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_Ellipsoid.h>
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 
-//=================================================================================================
-GeomAlgoAPI_Ellipsoid::GeomAlgoAPI_Ellipsoid()
-{
-}
-
 //=================================================================================================
 
 GeomAlgoAPI_Ellipsoid::GeomAlgoAPI_Ellipsoid(const double theAx,
index 96a37ea70f9a25dd997e552443b228893adc6ec9..9cf1a32c9ac8da6c378cc0d4da561e138add6d03 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_ELLIPSOID_H_
@@ -30,8 +29,6 @@
 class GeomAlgoAPI_Ellipsoid : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Ellipsoid();
-
   /// Creates a ellipsoid using standard GDML parameters.
   /// \param theAx X dimension of the ellipsoid.
   /// \param theBy Y dimension of the ellipsoid.
old mode 100755 (executable)
new mode 100644 (file)
index e5d9bd0..17e30e2
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_Exception.h>
index 74003721a19b7b3f1a9018dfb044cd1ffae4ad94..50883089be9a89f5dda11fda3e6b9d742cf433ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Exception_H_
index 728e9f56449da0e93a9756056526c8f28f16e5ac..0df30cddc3e8b455e9475d59d12fb5d719eb06bd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_FaceBuilder.h"
@@ -120,23 +119,3 @@ std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFaceByThreeVertices
   aFace->setImpl(new TopoDS_Face(aMakeFace.Face()));
   return aFace;
 }
-
-//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFaceByFaceAndVertex(
-    const std::shared_ptr<GeomAPI_Face> theFace,
-    const std::shared_ptr<GeomAPI_Vertex> theVertex)
-{
-  gp_Pln aPln = theFace->getPlane()->impl<gp_Pln>();
-  gp_Pnt aPnt = theVertex->point()->impl<gp_Pnt>();
-
-  std::shared_ptr<GeomAPI_Face> aFace;
-  GC_MakePlane aMakePlane(aPln, aPnt);
-  if(!aMakePlane.IsDone()) {
-    return aFace;
-  }
-
-  BRepBuilderAPI_MakeFace aMakeFace(aMakePlane.Value()->Pln());
-  aFace.reset(new GeomAPI_Face());
-  aFace->setImpl(new TopoDS_Face(aMakeFace.Face()));
-  return aFace;
-}
index 1d7e8e8523e15fcfb27789d226b03be20b3c1367..11672a4cc8adb4dfb12204e152ab7b814e0c9375 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_FaceBuilder_H_
@@ -61,11 +60,6 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_FaceBuilder
                         const std::shared_ptr<GeomAPI_Vertex> theVertex1,
                         const std::shared_ptr<GeomAPI_Vertex> theVertex2,
                         const std::shared_ptr<GeomAPI_Vertex> theVertex3);
-
-  /// Creates a planar face parallel to theFace and passing through theVertex.
-  static std::shared_ptr<GeomAPI_Face> planarFaceByFaceAndVertex(
-                        const std::shared_ptr<GeomAPI_Face> theFace,
-                        const std::shared_ptr<GeomAPI_Vertex> theVertex);
 };
 
 #endif
index b3d510cfb169f5aab56672bfc8c260dc3fa2891e..19e6cdf0c155d93602adff7afe6fe4aae05b218e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Fillet.h"
index 56648cdec15b0677543c413436db801e99351a5b..f5060fd61f5083854fbea8819506710095afb556 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Fillet_H_
index 3609b06ff66406806f0eb8d8678fd1cbc129c277..fe4d5234a5dbd2a200cfe463eac054a490f13b5d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Filling.h"
index 99275bf670e3cb15fabd85fae16cdddd85baf3ec..b86376d03ec433f4ce04a142f2c3726bc69bc921 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Filling_H_
index 0fca6a9d348c9a7bdb37cc68f0d78c1226ac615f..80bb1a00e1aab7f415603e22065d6d8414fb69cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_IGESExport.h>
index 723e00c04d03ee1ac2f2c114224aba6d14f278f8..aa0a12addf34cf9b3065ccd58d487cc3ad360b68 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_IGESEXPORT_H_
index 1b9637feb80cddbef1b2e2fed476063f07774266..5a18c1910dac415717a099cdfe5682d85c6f3f72 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_IGESImport.h>
index 73e85fab1ed2fafd849edacc1db0aabd4275cbac..8f1072ae6ab99cded22fe95593135b00062b4a9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_IGESIMPORT_H_
index 5793dbf0bd49a6e4bbd8330cf0276551403e7f40..ea80a97b4f50de6f4d3aa8dabbba2238a14ab305 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Intersection.h"
 
 //==================================================================================================
 GeomAlgoAPI_Intersection::GeomAlgoAPI_Intersection(const ListOfShape& theObjects)
+  : myFiller(0)
 {
   build(theObjects);
 }
 
+GeomAlgoAPI_Intersection::~GeomAlgoAPI_Intersection() {
+  if (myFiller)
+    delete (BOPAlgo_PaveFiller*)myFiller;
+}
 //==================================================================================================
 void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects)
 {
@@ -53,21 +57,22 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects)
     }
   }
 
-  BOPAlgo_PaveFiller aDSFiller;
-  aDSFiller.SetArguments(anObjects);
+  BOPAlgo_PaveFiller* aDSFiller = new BOPAlgo_PaveFiller;
+  myFiller = aDSFiller;
+  aDSFiller->SetArguments(anObjects);
 
-  aDSFiller.SetRunParallel(false);
-  aDSFiller.SetNonDestructive(false);
-  aDSFiller.SetGlue(BOPAlgo_GlueOff);
+  aDSFiller->SetRunParallel(false);
+  aDSFiller->SetNonDestructive(false);
+  aDSFiller->SetGlue(BOPAlgo_GlueOff);
 
   // optimization for the issue #2399
   BOPAlgo_SectionAttribute theSecAttr(Standard_True,
                                       Standard_True,
                                       Standard_True);
-  aDSFiller.SetSectionAttribute(theSecAttr);
+  aDSFiller->SetSectionAttribute(theSecAttr);
 
-  aDSFiller.Perform();
-  if (aDSFiller.HasErrors()) {
+  aDSFiller->Perform();
+  if (aDSFiller->HasErrors()) {
     return;
   }
 
@@ -75,7 +80,7 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects)
   anOperation->SetRunParallel(false);
   anOperation->SetCheckInverted(true);
 
-  anOperation->PerformWithFiller(aDSFiller);
+  anOperation->PerformWithFiller(*aDSFiller); // it references a filler fields, so keep the filler
   if(anOperation->HasErrors()) {
     return;
   }
index 2ea3e0c14d2bce03b2f614d1eac6ac0640730cb3..9aea7504145481fa3baff5a498ae2e76d89b4058 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Intersection_H_
 /// \brief Performs the intersection operations.
 class GeomAlgoAPI_Intersection : public GeomAlgoAPI_MakeShape
 {
+  void* myFiller; ///< store filler to avoid memory leaks
 public:
   /// \brief Constructor.
   /// \param[in] theObjects list of objects.
   /// \param[in] theTools list of tools.
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Intersection(const ListOfShape& theObjects);
 
+  /// Destructor to erase the filler
+  GEOMALGOAPI_EXPORT virtual ~GeomAlgoAPI_Intersection();
+
 private:
   /// Builds resulting shape.
   void build(const ListOfShape& theObjects);
+
 };
 
 #endif
index 6ed3adf8e21d25821bbb702c697d84204216a1f6..5195d75c9a5804e7144cf5b4d1565c95f336b797 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_MakeShape.h"
 
 #include <BOPAlgo_Builder.hxx>
+#include <BRep_Tool.hxx>
 #include <BRepBuilderAPI_MakeShape.hxx>
 #include <BRepCheck_Analyzer.hxx>
 #include <BRepGProp.hxx>
@@ -31,7 +31,9 @@
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <GeomAPI_ShapeExplorer.h>
 #include <GeomAPI_ShapeIterator.h>
+#include <TopoDS.hxx>
 #include <TopoDS_Builder.hxx>
+#include <TopoDS_Edge.hxx>
 
 // new shape -> old shapes -> index in the old shape
 typedef NCollection_DataMap<TopoDS_Shape,
@@ -41,7 +43,7 @@ typedef
   NCollection_DataMap<int, NCollection_DataMap<TopoDS_Shape, MapNewToOld, TopTools_ShapeMapHasher> >
   HistoryMap;
 
-//=================================================================================================
+//==================================================================================================
 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
 : myBuilderType(Unknown),
   myDone(false)
@@ -49,127 +51,113 @@ GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
   myHist = 0;
 }
 
-GeomAlgoAPI_MakeShape::~GeomAlgoAPI_MakeShape() {
+//==================================================================================================
+GeomAlgoAPI_MakeShape::~GeomAlgoAPI_MakeShape()
+{
   if (myHist) {
     delete (HistoryMap*)myHist;
   }
 }
 
-//=================================================================================================
+//==================================================================================================
 bool GeomAlgoAPI_MakeShape::isDone() const
 {
   return myDone;
 }
 
-//=================================================================================================
-const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
+//==================================================================================================
+const GeomShapePtr GeomAlgoAPI_MakeShape::shape() const
 {
   return myShape;
 }
 
-//=================================================================================================
+//==================================================================================================
 bool GeomAlgoAPI_MakeShape::isValid() const
 {
   BRepCheck_Analyzer aChecker(myShape->impl<TopoDS_Shape>());
   return (aChecker.IsValid() == Standard_True);
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShape::hasVolume() const
-{
-  bool hasVolume = false;
-  if(isValid()) {
-    const TopoDS_Shape& aRShape = myShape->impl<TopoDS_Shape>();
-    GProp_GProps aGProp;
-    BRepGProp::VolumeProperties(aRShape, aGProp);
-    if(aGProp.Mass() > Precision::Confusion())
-      hasVolume = true;
-  }
-  return hasVolume;
-}
-
-//=================================================================================================
+//==================================================================================================
 std::shared_ptr<GeomAPI_DataMapOfShapeShape> GeomAlgoAPI_MakeShape::mapOfSubShapes() const
 {
   return myMap;
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShape::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                      ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShape::generated(const GeomShapePtr theOldShape,
+                                      ListOfShape& theNewShapes)
 {
   TopTools_ListOfShape aList;
   if(myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
     BRepBuilderAPI_MakeShape* aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
-    aList = aMakeShape->Generated(theShape->impl<TopoDS_Shape>());
+    aList = aMakeShape->Generated(theOldShape->impl<TopoDS_Shape>());
   } else if(myBuilderType == OCCT_BOPAlgo_Builder) {
     BOPAlgo_Builder* aBOPBuilder = implPtr<BOPAlgo_Builder>();
-    aList = aBOPBuilder->Generated(theShape->impl<TopoDS_Shape>());
+    aList = aBOPBuilder->Generated(theOldShape->impl<TopoDS_Shape>());
   }
   for(TopTools_ListIteratorOfListOfShape anIt(aList); anIt.More(); anIt.Next()) {
-    if(anIt.Value().IsNull()) {
-      continue;
-    }
-    std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+    GeomShapePtr aShape(new GeomAPI_Shape());
     aShape->setImpl(new TopoDS_Shape(anIt.Value()));
-    theHistory.push_back(aShape);
+    if (!isValidForHistory(aShape)) continue;
+    fixOrientation(aShape);
+    theNewShapes.push_back(aShape);
   }
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShape::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                     ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShape::modified(const GeomShapePtr theOldShape,
+                                     ListOfShape& theNewShapes)
 {
   TopTools_ListOfShape aList;
   if(myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
     BRepBuilderAPI_MakeShape* aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
     try {
-      aList = aMakeShape->Modified(theShape->impl<TopoDS_Shape>());
+      aList = aMakeShape->Modified(theOldShape->impl<TopoDS_Shape>());
     } catch(Standard_NoSuchObject) {
     }
   } else if(myBuilderType == OCCT_BOPAlgo_Builder) {
     BOPAlgo_Builder* aBOPBuilder = implPtr<BOPAlgo_Builder>();
-    aList = aBOPBuilder->Modified(theShape->impl<TopoDS_Shape>());
+    aList = aBOPBuilder->Modified(theOldShape->impl<TopoDS_Shape>());
   }
   for(TopTools_ListIteratorOfListOfShape anIt(aList); anIt.More(); anIt.Next()) {
-    if(anIt.Value().IsNull()) {
-      continue;
-    }
-    std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+    GeomShapePtr aShape(new GeomAPI_Shape());
     aShape->setImpl(new TopoDS_Shape(anIt.Value()));
-    theHistory.push_back(aShape);
+    if (!isValidForHistory(aShape)) continue;
+    fixOrientation(aShape);
+    theNewShapes.push_back(aShape);
   }
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShape::isDeleted(const GeomShapePtr theOldShape)
 {
   bool isDeleted = false;
   if(myBuilderType == OCCT_BRepBuilderAPI_MakeShape) {
     BRepBuilderAPI_MakeShape* aMakeShape = implPtr<BRepBuilderAPI_MakeShape>();
-    isDeleted = aMakeShape->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;
+    isDeleted = aMakeShape->IsDeleted(theOldShape->impl<TopoDS_Shape>()) == Standard_True;
   } else if(myBuilderType == OCCT_BOPAlgo_Builder) {
     BOPAlgo_Builder* aBOPBuilder = implPtr<BOPAlgo_Builder>();
-    isDeleted = aBOPBuilder->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;
+    isDeleted = aBOPBuilder->IsDeleted(theOldShape->impl<TopoDS_Shape>()) == Standard_True;
   }
 
   return isDeleted;
 }
 
-//=================================================================================================
+//==================================================================================================
 void GeomAlgoAPI_MakeShape::setBuilderType(const BuilderType theBuilderType)
 {
   myBuilderType = theBuilderType;
 }
 
-//=================================================================================================
+//==================================================================================================
 void GeomAlgoAPI_MakeShape::setDone(const bool theFlag)
 {
   myDone = theFlag;
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShape::setShape(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+void GeomAlgoAPI_MakeShape::setShape(const GeomShapePtr theShape)
 {
   if(myShape.get() && myShape->isEqual(theShape)) {
     return;
@@ -187,17 +175,17 @@ void GeomAlgoAPI_MakeShape::setShape(const std::shared_ptr<GeomAPI_Shape> theSha
 
     const TopoDS_Shape& aTopoDSShape = myShape->impl<TopoDS_Shape>();
     for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_VERTEX); anExp.More(); anExp.Next()) {
-      std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+      GeomShapePtr aCurrentShape(new GeomAPI_Shape());
       aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
       myMap->bind(aCurrentShape, aCurrentShape);
     }
     for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_EDGE); anExp.More(); anExp.Next()) {
-      std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+      GeomShapePtr aCurrentShape(new GeomAPI_Shape());
       aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
       myMap->bind(aCurrentShape, aCurrentShape);
     }
     for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_FACE); anExp.More(); anExp.Next()) {
-      std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+      GeomShapePtr aCurrentShape(new GeomAPI_Shape());
       aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
       myMap->bind(aCurrentShape, aCurrentShape);
     }
@@ -208,8 +196,30 @@ void GeomAlgoAPI_MakeShape::setShape(const std::shared_ptr<GeomAPI_Shape> theSha
   }
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShape::initialize() {
+//==================================================================================================
+bool GeomAlgoAPI_MakeShape::isValidForHistory(const GeomShapePtr theShape)
+{
+  if (!theShape.get()) return false;
+
+  const TopoDS_Shape& aShape_ = theShape->impl<TopoDS_Shape>();
+  if (aShape_.IsNull()) return false;
+
+  if (aShape_.ShapeType() == TopAbs_EDGE) {
+    TopoDS_Edge anEdge_ = TopoDS::Edge(aShape_);
+    if (BRep_Tool::Degenerated(anEdge_)) return false;
+  }
+
+  return true;
+}
+
+//==================================================================================================
+void GeomAlgoAPI_MakeShape::fixOrientation(GeomShapePtr& theShape) {
+  if (myMap->isBound(theShape)) theShape = myMap->find(theShape);
+}
+
+//==================================================================================================
+void GeomAlgoAPI_MakeShape::initialize()
+{
   switch (myBuilderType) {
     case OCCT_BRepBuilderAPI_MakeShape: {
       myDone = implPtr<BRepBuilderAPI_MakeShape>()->IsDone() == Standard_True;
@@ -233,7 +243,7 @@ void GeomAlgoAPI_MakeShape::initialize() {
 
   const TopoDS_Shape& aTopoDSShape = myShape->impl<TopoDS_Shape>();
   for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_FACE); anExp.More(); anExp.Next()) {
-    std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+    GeomShapePtr aCurrentShape(new GeomAPI_Shape());
     aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
     myMap->bind(aCurrentShape, aCurrentShape);
   }
@@ -241,21 +251,21 @@ void GeomAlgoAPI_MakeShape::initialize() {
 }
 
 
-//=================================================================================================
+//==================================================================================================
 void GeomAlgoAPI_MakeShape::prepareNamingFaces()
 {
   long long index = 1;
   GeomAPI_ShapeExplorer anExp(shape(), GeomAPI_Shape::FACE);
   for(GeomAPI_ShapeExplorer anExp(shape(), GeomAPI_Shape::FACE); anExp.more(); anExp.next()) {
-    std::shared_ptr<GeomAPI_Shape> aFace = anExp.current();
+    GeomShapePtr aFace = anExp.current();
     myCreatedFaces["Face_" + std::to_string(index++)] = aFace;
   }
 }
 
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShape::checkValid(std::string theMessage){
-
+//==================================================================================================
+bool GeomAlgoAPI_MakeShape::checkValid(std::string theMessage)
+{
   // isValid() is called from this method
   if (!isValid()) {
     myError = theMessage + " :: resulting shape is not valid.";
@@ -278,8 +288,9 @@ bool GeomAlgoAPI_MakeShape::checkValid(std::string theMessage){
   return true ;
 }
 
-bool GeomAlgoAPI_MakeShape::newShapesCollected(
-  std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShape::isNewShapesCollected(GeomShapePtr theWholeOld,
+                                                 const int theShapeType)
 {
   if (!myHist)
     return false;
@@ -290,7 +301,7 @@ bool GeomAlgoAPI_MakeShape::newShapesCollected(
 }
 
 void GeomAlgoAPI_MakeShape::collectNewShapes(
-  std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType)
+  GeomShapePtr theWholeOld, const int theShapeType)
 {
   if (!myHist)
     myHist = new HistoryMap;
@@ -339,9 +350,10 @@ static void addAllSubs(const TopoDS_Shape& theNewShape,
   }
 }
 
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::oldShapesForNew(
-  std::shared_ptr<GeomAPI_Shape> theWholeOld,
-  std::shared_ptr<GeomAPI_Shape> theNewShape, const int theShapeType)
+//==================================================================================================
+GeomShapePtr GeomAlgoAPI_MakeShape::oldShapesForNew(GeomShapePtr theWholeOld,
+                                                    GeomShapePtr theNewShape,
+                                                    const int theShapeType)
 {
   GeomShapePtr aResult(new GeomAPI_Shape);
   TopoDS_Compound aResComp;
index eb2396c96736daaa37e0b95fa6fa5f49085228b2..a840233ecfad96805a04abd34befa47e7f55e12e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_MakeShape_H_
@@ -52,7 +51,8 @@ public:
   /// \brief Constructor by builder and builder type.
   /// \param[in] theBuilder pointer to the builder.
   /// \param[in] theBuilderType builder type.
-  template<class T> explicit GeomAlgoAPI_MakeShape(T* theBuilder,
+  template<class T> explicit GeomAlgoAPI_MakeShape(
+    T* theBuilder,
     const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
   : GeomAPI_Interface(theBuilder),
     myBuilderType(theBuilderType)
@@ -63,7 +63,8 @@ public:
   /// \brief Initializes internals.
   /// \param[in] theBuilder pointer to the builder.
   /// \param[in] theBuilderType builder type.
-  template<class T> void initialize(T* theBuilder,
+  template<class T> void initialize(
+    T* theBuilder,
     const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
   {
     setImpl(theBuilder);
@@ -71,50 +72,51 @@ public:
     initialize();
   }
 
+  /// Execute the algorithm.
+  GEOMALGOAPI_EXPORT virtual void build() {}
+
   /// \return status of builder.
   GEOMALGOAPI_EXPORT bool isDone() const;
 
   /// \return a shape built by the shape construction algorithm.
-  GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
+  GEOMALGOAPI_EXPORT virtual const GeomShapePtr shape() const;
 
   /// \return true if resulting shape is valid.
   GEOMALGOAPI_EXPORT bool isValid() const;
 
-  /// \return true if resulting shape has volume.
-  GEOMALGOAPI_EXPORT bool hasVolume() const;
-
   /// \return map of sub-shapes of the result. To be used for History keeping.
   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfSubShapes() const;
 
   /// \return the list of shapes generated from the shape \a theShape.
-  /// \param[in] theShape base shape.
-  /// \param[out] theHistory generated shapes.
-  GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                            ListOfShape& theHistory);
+  /// \param[in] theOldShape base shape.
+  /// \param[out] theNewShapes shapes generated from \a theShape. Does not cleared!
+  GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape,
+                                            ListOfShape& theNewShapes);
 
   /// \return the list of shapes modified from the shape \a theShape.
-  /// \param[in] theShape base shape.
-  /// \param[out] theHistory modified shapes. Does not cleared!
-  GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                           ListOfShape& theHistory);
+  /// \param[in] theOldShape base shape.
+  /// \param[out] theNewShapes shapes modified from \a theShape. Does not cleared!
+  GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
+                                           ListOfShape& theNewShapes);
 
   /// \return true if theShape was deleted.
-  /// \param[in] theShape base shape.
-  GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+  /// \param[in] theOldShape base shape.
+  GEOMALGOAPI_EXPORT virtual bool isDeleted(const GeomShapePtr theOldShape);
 
   /// \return true if the data were correct.
   GEOMALGOAPI_EXPORT virtual bool check() { return true; };
 
+  /// \brief Prepare the naming of faces.
+  GEOMALGOAPI_EXPORT virtual void prepareNamingFaces();
+
   ///  \return the list of created faces.
-  GEOMALGOAPI_EXPORT std::map< std::string, std::shared_ptr<GeomAPI_Shape> > getCreatedFaces()
-  {return myCreatedFaces;}
+  GEOMALGOAPI_EXPORT std::map< std::string, GeomShapePtr > getCreatedFaces() {
+    return myCreatedFaces;
+  }
 
   /// \return the error.
   GEOMALGOAPI_EXPORT std::string getError() { return myError; }
 
-  /// \brief Prepare the naming of faces.
-  GEOMALGOAPI_EXPORT virtual void prepareNamingFaces();
-
   /// \brief Check the validity of the produced shape.
   GEOMALGOAPI_EXPORT bool checkValid(std::string theMessage);
 
@@ -122,24 +124,27 @@ public:
   /// \param theWholeOld the whole old shape
   /// \param theShapeType type of the sub-shapes that is used for optimization
   /// \returns true if optimization containers are already filled
-  GEOMALGOAPI_EXPORT bool newShapesCollected(
-    std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType);
+  GEOMALGOAPI_EXPORT bool isNewShapesCollected(GeomShapePtr theWholeOld,
+                                               const int theShapeType);
 
   /// Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
   /// \param theWholeOld the whole old shape
   /// \param theShapeType type of the sub-shapes that is used for optimization
   /// \returns true if optimization containers are already filled
-  GEOMALGOAPI_EXPORT void collectNewShapes(
-    std::shared_ptr<GeomAPI_Shape> theWholeOld, const int theShapeType);
+  GEOMALGOAPI_EXPORT void collectNewShapes(GeomShapePtr theWholeOld,
+                                           const int theShapeType);
 
   /// Optimization of access the new shapes by old shapes for the limited set of needed new shapes.
   /// \param theWholeOld the whole old shape
   /// \param theNewShape the whole new shape
   /// \param theShapeType type of the old sub-shapes
   /// \returns compound of all old shapes that were used for creation of the given new
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> oldShapesForNew(
-    std::shared_ptr<GeomAPI_Shape> theWholeOld,
-    std::shared_ptr<GeomAPI_Shape> theNewShape, const int theShapeType);
+  GEOMALGOAPI_EXPORT GeomShapePtr oldShapesForNew(GeomShapePtr theWholeOld,
+                                                  GeomShapePtr theNewShape,
+                                                  const int theShapeType);
+
+  /// Replaces \a theShape with shape from \a myMap.
+  GEOMALGOAPI_EXPORT void fixOrientation(GeomShapePtr& theShape);
 
 protected:
   /// \brief Sets builder type.
@@ -152,7 +157,10 @@ protected:
 
   /// \brief Sets result shape.
   /// \param[in] theShape new shape.
-  void setShape(const std::shared_ptr<GeomAPI_Shape> theShape);
+  void setShape(const GeomShapePtr theShape);
+
+  /// \return true if passed shape is valid for history.
+  bool isValidForHistory(const GeomShapePtr theShape);
 
 protected:
    /// Data map to keep correct orientation of sub-shapes.
@@ -160,7 +168,7 @@ protected:
   /// Error occurred during the execution of an algorithm.
   std::string myError;
   /// Map of created faces with their name for naming.
-  std::map< std::string, std::shared_ptr<GeomAPI_Shape> > myCreatedFaces;
+  std::map< std::string, GeomShapePtr > myCreatedFaces;
 
 private:
   /// \brief Initializes internals.
@@ -169,13 +177,14 @@ private:
 private:
   GeomAlgoAPI_MakeShape::BuilderType myBuilderType; ///< Type of make shape builder.
   bool myDone; ///< Builder status.
-  std::shared_ptr<GeomAPI_Shape> myShape; ///< Resulting shape.
+  GeomShapePtr myShape; ///< Resulting shape.
 
   /// map that is used to keep the optimization structure for access to the history
   /// kind of sub-shapes -> whole old shape -> new shape -> list of old shapes that create this new
   void* myHist;
 };
 
-typedef std::list<std::shared_ptr<GeomAlgoAPI_MakeShape> > ListOfMakeShape;
+typedef std::shared_ptr<GeomAlgoAPI_MakeShape> GeomMakeShapePtr;
+typedef std::list<GeomMakeShapePtr> ListOfMakeShape;
 
 #endif
index 01bf7a88a8af2c82ca0b94f1f90dabe9cfe212d4..ae6be4163e5f6db17f47064a629904282e7c1879 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_MakeShapeCustom.h>
 
-//=================================================================================================
+//==================================================================================================
 GeomAlgoAPI_MakeShapeCustom::GeomAlgoAPI_MakeShapeCustom()
-{}
+{
+}
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShapeCustom::setResult(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::setResult(const GeomShapePtr theShape)
 {
   setShape(theShape);
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShapeCustom::addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
-                                              const std::shared_ptr<GeomAPI_Shape> theResult)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addModified(const GeomShapePtr theOldShape,
+                                              const GeomShapePtr theNewShape)
 {
-  return myModified.add(theBase, theResult);
+  if (!isValidForHistory(theNewShape)) return false;
+  GeomShapePtr aNewShape = theNewShape;
+  return myModified.add(theOldShape, aNewShape);
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShapeCustom::addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
-                                               const std::shared_ptr<GeomAPI_Shape> theResult)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addGenerated(const GeomShapePtr theOldShape,
+                                               const GeomShapePtr theNewShape)
 {
-  return myGenerated.add(theBase, theResult);
+  if (!isValidForHistory(theNewShape)) return false;
+  GeomShapePtr aNewShape = theNewShape;
+  return myGenerated.add(theOldShape, aNewShape);
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShapeCustom::addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addDeleted(const GeomShapePtr theOldShape)
 {
-  return myDeleted.bind(theShape, theShape);
+  return myDeleted.bind(theOldShape, theOldShape);
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShapeCustom::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                            ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::generated(const GeomShapePtr theOldShape,
+                                            ListOfShape& theNewShapes)
 {
   ListOfShape aGenerated;
-  if(myGenerated.find(theShape, aGenerated)) {
-    theHistory.insert(theHistory.end(), aGenerated.begin(), aGenerated.end());
+  if(myGenerated.find(theOldShape, aGenerated)) {
+    theNewShapes.insert(theNewShapes.end(), aGenerated.begin(), aGenerated.end());
   }
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShapeCustom::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                           ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::modified(const GeomShapePtr theOldShape,
+                                           ListOfShape& theNewShapes)
 {
   ListOfShape aModified;
-  if(myModified.find(theShape, aModified)) {
-    theHistory.insert(theHistory.end(), aModified.begin(), aModified.end());
+  if(myModified.find(theOldShape, aModified)) {
+    theNewShapes.insert(theNewShapes.end(), aModified.begin(), aModified.end());
   }
 }
 
-//=================================================================================================
-bool GeomAlgoAPI_MakeShapeCustom::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::isDeleted(const GeomShapePtr theOldShape)
 {
-  return myDeleted.isBound(theShape);
-}
\ No newline at end of file
+  return myDeleted.isBound(theOldShape);
+}
index 77bfac0e231e924f22a962e86c53b4da807bb304..b40be782475b00acf5e9b0983d54184c96da32a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_MakeShapeCustom_H_
@@ -37,29 +36,29 @@ public:
   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeCustom();
 
   /// Sets result shape.
-  GEOMALGOAPI_EXPORT void setResult(const std::shared_ptr<GeomAPI_Shape> theShape);
+  GEOMALGOAPI_EXPORT void setResult(const GeomShapePtr theShape);
 
   /// Adds modified shape.
-  GEOMALGOAPI_EXPORT bool addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
-                                      const std::shared_ptr<GeomAPI_Shape> theResult);
+  GEOMALGOAPI_EXPORT bool addModified(const GeomShapePtr theOldShape,
+                                      const GeomShapePtr theNewShape);
 
   /// Adds generated shape.
-  GEOMALGOAPI_EXPORT bool addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
-                                       const std::shared_ptr<GeomAPI_Shape> theResult);
+  GEOMALGOAPI_EXPORT bool addGenerated(const GeomShapePtr theOldShape,
+                                       const GeomShapePtr theNewShape);
 
   /// Adds deleted shape.
-  GEOMALGOAPI_EXPORT bool addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+  GEOMALGOAPI_EXPORT bool addDeleted(const GeomShapePtr theOldShape);
 
   /// \return the list of shapes generated from the shape theShape
-  GEOMALGOAPI_EXPORT void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                            ListOfShape& theHistory);
+  GEOMALGOAPI_EXPORT void generated(const GeomShapePtr theOldShape,
+                                    ListOfShape& theNewShapes);
 
   /// \return the list of shapes modified from the shape theShape
-  GEOMALGOAPI_EXPORT void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                           ListOfShape& theHistory);
+  GEOMALGOAPI_EXPORT void modified(const GeomShapePtr theShape,
+                                   ListOfShape& theNewShapes);
 
   /// \return whether the shape is deleted
-  GEOMALGOAPI_EXPORT bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+  GEOMALGOAPI_EXPORT bool isDeleted(const GeomShapePtr theOldShape);
 
 private:
   GeomAPI_DataMapOfShapeMapOfShapes myGenerated;
index 1c615ced3505a04201f1ab6bfe933ba95f5e71c9..f0d239c04c7097c57a232849ff854f706f39f7ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_MakeShapeList.h"
 #include <NCollection_Map.hxx>
 #include <TopoDS_Shape.hxx>
 
-//=================================================================================================
+//==================================================================================================
 GeomAlgoAPI_MakeShapeList::GeomAlgoAPI_MakeShapeList()
 : GeomAlgoAPI_MakeShape()
 {}
 
-//=================================================================================================
+//==================================================================================================
 GeomAlgoAPI_MakeShapeList::GeomAlgoAPI_MakeShapeList(const ListOfMakeShape& theMakeShapeList)
 : GeomAlgoAPI_MakeShape()
 {
   init(theMakeShapeList);
 }
 
-//=================================================================================================
+//==================================================================================================
 void GeomAlgoAPI_MakeShapeList::init(const ListOfMakeShape& theMakeShapeList)
 {
   if(myMap.get()) {
@@ -54,9 +53,15 @@ void GeomAlgoAPI_MakeShapeList::init(const ListOfMakeShape& theMakeShapeList)
   }
 }
 
-//=================================================================================================
+const ListOfMakeShape& GeomAlgoAPI_MakeShapeList::list() const
+{
+  return myListOfMakeShape;
+}
+
+
+//==================================================================================================
 void GeomAlgoAPI_MakeShapeList::appendAlgo(
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+  const GeomMakeShapePtr theMakeShape)
 {
   myListOfMakeShape.push_back(theMakeShape);
   if(!myMap.get()) {
@@ -65,38 +70,41 @@ void GeomAlgoAPI_MakeShapeList::appendAlgo(
   myMap->merge(theMakeShape->mapOfSubShapes());
 }
 
-//=================================================================================================
-const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShapeList::shape() const
+//==================================================================================================
+const GeomShapePtr GeomAlgoAPI_MakeShapeList::shape() const
 {
-  std::shared_ptr<GeomAPI_Shape> aShape = GeomAlgoAPI_MakeShape::shape();
+  GeomShapePtr aShape = GeomAlgoAPI_MakeShape::shape();
   if(aShape.get() && !aShape->impl<TopoDS_Shape>().IsNull()) {
     return aShape;
   } else if(!myListOfMakeShape.empty()) {
     return myListOfMakeShape.back()->shape();
   }
-  return std::shared_ptr<GeomAPI_Shape>();
+  return GeomShapePtr();
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShapeList::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                          ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeList::generated(const GeomShapePtr theOldShape,
+                                          ListOfShape& theNewShapes)
 {
-  result(theShape,  GeomAlgoAPI_MakeShapeList::Generated, theHistory);
+  result(theOldShape,  GeomAlgoAPI_MakeShapeList::Generated, theNewShapes);
 }
 
-//=================================================================================================
-void GeomAlgoAPI_MakeShapeList::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
-                                         ListOfShape& theHistory)
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeList::modified(const GeomShapePtr theOldShape,
+                                         ListOfShape& theNewShapes)
 {
-  result(theShape, GeomAlgoAPI_MakeShapeList::Modified, theHistory);
+  result(theOldShape, GeomAlgoAPI_MakeShapeList::Modified, theNewShapes);
 }
 
-bool GeomAlgoAPI_MakeShapeList::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+//==================================================================================================
+bool GeomAlgoAPI_MakeShapeList::isDeleted(const GeomShapePtr theOldShape)
 {
-  for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
-      aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
-    std::shared_ptr<GeomAlgoAPI_MakeShape> aMakeShape = *aBuilderIt;
-    if(aMakeShape->isDeleted(theShape)) {
+  for (ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
+       aBuilderIt != myListOfMakeShape.end();
+       ++aBuilderIt)
+  {
+    GeomMakeShapePtr aMakeShape = *aBuilderIt;
+    if(aMakeShape->isDeleted(theOldShape)) {
       return true;
     }
   }
@@ -104,9 +112,10 @@ bool GeomAlgoAPI_MakeShapeList::isDeleted(const std::shared_ptr<GeomAPI_Shape> t
   return false;
 }
 
-void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr<GeomAPI_Shape> theShape,
+//==================================================================================================
+void GeomAlgoAPI_MakeShapeList::result(const GeomShapePtr theOldShape,
                                        OperationType theOperationType,
-                                       ListOfShape& theHistory)
+                                       ListOfShape& theNewShapes)
 {
   if(myListOfMakeShape.empty()) {
     return;
@@ -115,24 +124,30 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr<GeomAPI_Shape> theS
   NCollection_Map<TopoDS_Shape> anAlgoShapes;
   NCollection_Map<TopoDS_Shape> aResultShapesMap;
   NCollection_List<TopoDS_Shape> aResultShapesList;
-  anAlgoShapes.Add(theShape->impl<TopoDS_Shape>());
-  aResultShapesMap.Add(theShape->impl<TopoDS_Shape>());
-  aResultShapesList.Append(theShape->impl<TopoDS_Shape>());
+  anAlgoShapes.Add(theOldShape->impl<TopoDS_Shape>());
+  aResultShapesMap.Add(theOldShape->impl<TopoDS_Shape>());
+  aResultShapesList.Append(theOldShape->impl<TopoDS_Shape>());
 
   for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
-      aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
-    std::shared_ptr<GeomAlgoAPI_MakeShape> aMakeShape = *aBuilderIt;
+      aBuilderIt != myListOfMakeShape.end();
+      ++aBuilderIt)
+  {
+    GeomMakeShapePtr aMakeShape = *aBuilderIt;
     NCollection_Map<TopoDS_Shape> aTempShapes;
-    for(NCollection_Map<TopoDS_Shape>::Iterator
-        aShapeIt(anAlgoShapes); aShapeIt.More(); aShapeIt.Next()) {
+    for (NCollection_Map<TopoDS_Shape>::Iterator aShapeIt(anAlgoShapes);
+         aShapeIt.More();
+         aShapeIt.Next())
+    {
       bool hasResults = false;
       bool anArgumentIsInResult = false;
-      std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape);
+      GeomShapePtr aShape(new GeomAPI_Shape);
       aShape->setImpl(new TopoDS_Shape(aShapeIt.Value()));
       ListOfShape aGeneratedShapes;
       aMakeShape->generated(aShape, aGeneratedShapes);
-      for (ListOfShape::const_iterator
-        anIt = aGeneratedShapes.cbegin(); anIt != aGeneratedShapes.cend(); anIt++) {
+      for (ListOfShape::const_iterator anIt = aGeneratedShapes.cbegin();
+           anIt != aGeneratedShapes.cend();
+           ++anIt)
+      {
         const TopoDS_Shape& anItShape = (*anIt)->impl<TopoDS_Shape>();
         if (anItShape.IsSame(aShapeIt.Value())) {
           anArgumentIsInResult = true;
@@ -146,8 +161,10 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr<GeomAPI_Shape> theS
       }
       ListOfShape aModifiedShapes;
       aMakeShape->modified(aShape, aModifiedShapes);
-      for(ListOfShape::const_iterator
-          anIt = aModifiedShapes.cbegin(); anIt != aModifiedShapes.cend(); anIt++) {
+      for (ListOfShape::const_iterator anIt = aModifiedShapes.cbegin();
+           anIt != aModifiedShapes.cend();
+           ++anIt)
+      {
         const TopoDS_Shape& anItShape = (*anIt)->impl<TopoDS_Shape>();
         if (anItShape.IsSame(aShapeIt.Value())) {
           anArgumentIsInResult = true;
@@ -175,10 +192,14 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr<GeomAPI_Shape> theS
     anAlgoShapes.Unite(aTempShapes);
   }
 
-  for(NCollection_List<TopoDS_Shape>::Iterator
-      aShapeIt(aResultShapesList); aShapeIt.More(); aShapeIt.Next()) {
-    std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+  for (NCollection_List<TopoDS_Shape>::Iterator aShapeIt(aResultShapesList);
+       aShapeIt.More();
+       aShapeIt.Next())
+  {
+    GeomShapePtr aShape(new GeomAPI_Shape());
     aShape->setImpl(new TopoDS_Shape(aShapeIt.Value()));
-    theHistory.push_back(aShape);
+    if (!isValidForHistory(aShape)) continue;
+    fixOrientation(aShape);
+    theNewShapes.push_back(aShape);
   }
 }
index e79826e89f86c2c4eaf2866ea8d422183abc2c66..e5e5f0c1b45df99f4a1a0d2b337370762899bce8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_MakeShapeList_H_
@@ -49,26 +48,29 @@ public:
   /// \param[in] theMakeShapeList list of algorithms.
   GEOMALGOAPI_EXPORT void init(const ListOfMakeShape& theMakeShapeList);
 
+  /// \return the list reference
+  GEOMALGOAPI_EXPORT const ListOfMakeShape& list() const;
+
   /// \brief Adds algo to the end of list.
   /// \param[in] theMakeShape algo to be added.
-  GEOMALGOAPI_EXPORT void appendAlgo(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
+  GEOMALGOAPI_EXPORT void appendAlgo(const GeomMakeShapePtr theMakeShape);
 
   /// \return a shape built by the shape construction algorithms
-  GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
+  GEOMALGOAPI_EXPORT virtual const GeomShapePtr shape() const;
 
   /// \return the list of shapes generated from the shape \a theShape
-  GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
+  GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theShape,
                                             ListOfShape& theHistory);
 
   /// \return the list of shapes modified from the shape \a theShape
-  GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
+  GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theShape,
                                            ListOfShape& theHistory);
 
   /// \return whether the shape is deleted
-  GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+  GEOMALGOAPI_EXPORT virtual bool isDeleted(const GeomShapePtr theShape);
 
 private:
-  void result(const std::shared_ptr<GeomAPI_Shape> theShape,
+  void result(const GeomShapePtr theShape,
               OperationType theOperationType,
               ListOfShape& theHistory);
 
index d4e3429315cd36d9d709a8d8ce892f71fd416cb9..aeca83f14f16ddd3c62ee27602ccd78f74cd61b7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_MakeSweep.h"
index 0d6bfd38c8997471761875f7742f8628f1a865c5..54db4a18886b18c6e7e0c05c8a6d90739a2b51c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_MakeSweep_H_
index f730342fdf58d1547395c6701556cade9d6fd4ee..c09e24f98020f7f8d6f12aabfabc8ff00c5127d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_MakeVolume.h"
 
+#include <GeomAPI_ShapeExplorer.h>
+
 #include <GeomAlgoAPI_ShapeTools.h>
 
 #include <BOPAlgo_MakerVolume.hxx>
@@ -91,3 +92,32 @@ void GeomAlgoAPI_MakeVolume::build(const ListOfShape& theFaces)
   this->setShape(aShape);
   this->setDone(true);
 }
+
+//=================================================================================================
+void GeomAlgoAPI_MakeVolume::modified(const GeomShapePtr theOldShape,
+                                      ListOfShape& theNewShapes)
+{
+  if (theOldShape->shapeType() == GeomAPI_Shape::SOLID) {
+    ListOfShape aNewShapes;
+    // collect faces and parent shapes, if it is not done yet
+    if (!isNewShapesCollected(theOldShape, GeomAPI_Shape::FACE))
+      collectNewShapes(theOldShape, GeomAPI_Shape::FACE);
+
+    for (GeomAPI_ShapeExplorer anIt(shape(), GeomAPI_Shape::SOLID); anIt.more(); anIt.next()) {
+      for (GeomAPI_ShapeExplorer anExp(anIt.current(), GeomAPI_Shape::FACE);
+           anExp.more(); anExp.next()) {
+        GeomShapePtr anOldShapesCompound =
+            oldShapesForNew(theOldShape, anExp.current(), GeomAPI_Shape::FACE);
+        if (!anOldShapesCompound->isNull()) {
+          aNewShapes.push_back(anIt.current());
+          break;
+        }
+      }
+    }
+
+    if (!aNewShapes.empty())
+      theNewShapes = aNewShapes;
+  }
+  else
+    GeomAlgoAPI_MakeShape::modified(theOldShape, theNewShapes);
+}
index c8bcf3005f38812d5b854586fb54bd9e9eaee456..c478d9808a003c739cd0e619612eb47b54f0eef4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_MakeVolume_H_
@@ -44,6 +43,12 @@ public:
   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces,
     const bool theAvoidInternal);
 
+  /// \return the list of shapes modified from the shape \a theShape.
+  /// \param[in] theOldShape base shape.
+  /// \param[out] theNewShapes shapes modified from \a theShape. Does not cleared!
+  GEOMALGOAPI_EXPORT virtual void modified(const GeomShapePtr theOldShape,
+                                           ListOfShape& theNewShapes);
+
 private:
   /// Builds resulting shape.
   void build(const ListOfShape& theFaces);
index 392ac4c4c85dab9d2012ba99eaec6621006b7c8e..6af492d61febc04a4e28d34ad087c1304414115a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_NExplode.h"
@@ -124,10 +123,12 @@ bool CompareShapes::operator() (const TopoDS_Shape& theShape1,
           if ((val1 - val2) >= tol) {
             exchange = Standard_True;
           }
+          else // compare adresses if shapes are geometrically equal
+            exchange = theShape1.TShape().get() > theShape2.TShape().get();
         }
       }
     } else // compare adresses if shapes are geometrically equal
-      return theShape1.TShape().get() > theShape2.TShape().get();
+      exchange = theShape1.TShape().get() > theShape2.TShape().get();
   }
 
   //return val1 < val2;
index 146ab9a49c6e27ec5dff94f32800ecfa0d89dca9..7a951931995e0ca3ac7b45d073a98f9a2f27dc6b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_NExplode_H_
index 092299ec62d318e2001ccea483eb005ee4481381..14d5f5593a26b299796afb8b9729c66d9616fc2d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Partition.h"
@@ -126,17 +125,6 @@ static void sortCompound(TopoDS_Shape& theCompound, GEOMAlgo_Splitter* theOperat
   theCompound = aResCompound;
 }
 
-//=================================================================================================
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Partition::make(const ListOfShape& theObjects,
-                                                           const ListOfShape& theTools)
-{
-  GeomAlgoAPI_Partition aPartitionAlgo(theObjects, theTools);
-  if(aPartitionAlgo.isDone() && !aPartitionAlgo.shape()->isNull() && aPartitionAlgo.isValid()) {
-    return aPartitionAlgo.shape();
-  }
-  return std::shared_ptr<GeomAPI_Shape>();
-}
-
 //=================================================================================================
 GeomAlgoAPI_Partition::GeomAlgoAPI_Partition(const ListOfShape& theObjects,
                                              const ListOfShape& theTools)
index 17e7c40c7bf184d941fbdd52184674a852963643..1d0f35c56ace417324b801c6568d0d8e41cbb13f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Partition_H_
 class GeomAlgoAPI_Partition : public GeomAlgoAPI_MakeShape
 {
 public:
-  /// \brief Creates common partition operation.
-  /// \param[in] theObjects the main shape.
-  /// \param[in] theTools  second shape.
-  /// \param[in] theGroupConnectedTopology if true then result will be a compound of groups
-  ///            with connected topology(compsolids or compounds of shapes with shared topology).
-  /// \return a solid as result of operation.
-  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> make(const ListOfShape& theObjects,
-                                                                const ListOfShape& theTools);
-
   /// Constructor.
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Partition(const ListOfShape& theObjects,
                                            const ListOfShape& theTools);
index de0eee7eb3697b91002beda20f49729683832a45..7a2e45baa02b9ae2d7dc8bc5f448105f0631695c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_PaveFiller.h"
@@ -73,11 +72,10 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
   if(theIsMakeCompSolids && aResult.ShapeType() == TopAbs_COMPOUND) {
     std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
     aGeomShape->setImpl(new TopoDS_Shape(aResult));
-    ListOfShape aCompSolids, aFreeSolids;
+    ListOfShape aResults;
     aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                        GeomAPI_Shape::COMPSOLID,
-                                                       aCompSolids,
-                                                       aFreeSolids);
+                                                       aResults);
     aResult = aGeomShape->impl<TopoDS_Shape>();
   }
 
index ae11813f11ff3003ae30f542a2bffc7cbdcaf0c6..d9063228a41ff72e9861ad5df8d00a45d4792951 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_PaveFiller_H_
index 419854e011d8aa31abcf2b0053210497f04047e2..b0a693cebbea4a10e5e1bccfaeaa90be2a26594c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Pipe.h"
@@ -131,25 +130,19 @@ void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape,
                              const GeomShapePtr thePathShape,
                              const GeomShapePtr theBiNormal)
 {
-  // Getting base shape.
+  // Getting base shape and path.
   TopoDS_Shape aBaseShape;
   TopAbs_ShapeEnum aBaseShapeType;
-  if(!getBase(aBaseShape, aBaseShapeType, theBaseShape)) {
-    return;
-  }
-
-  // Getting path.
   TopoDS_Wire aPathWire;
-  if(!getPath(aPathWire, thePathShape)) {
+  if (!getBase(aBaseShape, aBaseShapeType, theBaseShape) ||
+      !getPath(aPathWire, thePathShape) ||
+      !theBiNormal.get()) {
     return;
   }
 
   aPathWire.Move(getPathToBaseTranslation(theBaseShape->impl<TopoDS_Shape>(), aPathWire));
 
   // Getting Bi-Normal.
-  if(!theBiNormal.get()) {
-    return;
-  }
   TopoDS_Shape aBiNormalShape = theBiNormal->impl<TopoDS_Shape>();
   if(aBiNormalShape.IsNull() || aBiNormalShape.ShapeType() != TopAbs_EDGE) {
     return;
@@ -177,10 +170,8 @@ void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape,
   this->initialize(aPipeBuilder);
 
   // Checking result.
-  if(aBaseShapeType == TopAbs_FACE) {
-    if(aPipeBuilder->MakeSolid() == Standard_False) {
-      return;
-    }
+  if(aBaseShapeType == TopAbs_FACE && !aPipeBuilder->MakeSolid()) {
+    return;
   }
   TopoDS_Shape aResult = aPipeBuilder->Shape();
   if(aResult.IsNull()) {
@@ -209,15 +200,12 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape& theBaseShapes,
     return;
   }
 
-  // Getting path.
+  // Getting base shape and path.
   TopoDS_Shape aBaseShape;
   TopAbs_ShapeEnum aBaseShapeType;
-  if (!getBase(aBaseShape, aBaseShapeType, theBaseShapes.front())) {
-    return;
-  }
-
   TopoDS_Wire aPathWire;
-  if(!getPath(aPathWire, thePathShape)) {
+  if (!getBase(aBaseShape, aBaseShapeType, theBaseShapes.front()) ||
+      !getPath(aPathWire, thePathShape)) {
     return;
   }
 
@@ -312,10 +300,8 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape& theBaseShapes,
   this->initialize(aPipeBuilder);
 
   // Checking result.
-  if(anIsSolidNeeded) {
-    if(aPipeBuilder->MakeSolid() == Standard_False) {
-      return;
-    }
+  if(anIsSolidNeeded && !aPipeBuilder->MakeSolid()) {
+    return;
   }
   TopoDS_Shape aResult = aPipeBuilder->Shape();
 
@@ -323,6 +309,8 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape& theBaseShapes,
   GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
   aFromShape->setImpl(new TopoDS_Shape(aPipeBuilder->FirstShape()));
   aToShape->setImpl(new TopoDS_Shape(aPipeBuilder->LastShape()));
+  fixOrientation(aFromShape);
+  fixOrientation(aToShape);
   this->addFromShape(aFromShape);
   this->addToShape(aToShape);
 
index 17c11374ac76ba0db79bd71366e4ea2a678a952b..bc97bef65d4a9af03925521b902ef20ed38b1ba3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Pipe_H_
index 3e3ed5d4edfaa4fd84df68c8243bb6ddcc082986..a7424cd73858c3eb5307933439c317d605ab384b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Placement.h"
 
 #include <GeomAlgoAPI_DFLoader.h>
+#include <GeomAlgoAPI_ShapeTools.h>
 
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Edge.h>
@@ -28,6 +28,7 @@
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Pln.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Vertex.h>
 #include <GeomAPI_XYZ.h>
 
@@ -70,29 +71,48 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr<GeomAPI_Shape>& theSourc
 
   GProp_GProps aProps;
   static const double aPropEps = 1.e-4;
+  GeomShapePtr aShape;
+  bool isCompound = false;
   for (int i = 0; i < aNbObjects; i++) {
-    if (aShapes[i]->isFace()) {
-      std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aShapes[i]));
+    aShape = aShapes[i];
+    isCompound = false;
+    if (aShapes[i]->isCompound()) {
+      isCompound = true;
+      GeomAPI_ShapeIterator anIt(aShapes[i]);
+      aShape = anIt.current();
+
+      GeomPointPtr aPnt = GeomAlgoAPI_ShapeTools::centreOfMass(aShapes[i]);
+      aSrcDstPoints[i].SetCoord(aPnt->x(), aPnt->y(), aPnt->z());
+    }
+
+    if (aShape->isFace()) {
+      std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aShape));
       std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
       std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
       aSrcDstNormals[i].SetCoord(aDir->x(), aDir->y(), aDir->z());
 
-      BRepGProp::SurfaceProperties(aFace->impl<TopoDS_Face>(), aProps, aPropEps);
-      gp_Pnt aLoc = aProps.CentreOfMass();
-      aSrcDstPoints[i].SetCoord(aLoc.X(), aLoc.Y(), aLoc.Z());
+      if (!isCompound) {
+        BRepGProp::SurfaceProperties(aFace->impl<TopoDS_Face>(), aProps, aPropEps);
+        gp_Pnt aLoc = aProps.CentreOfMass();
+        aSrcDstPoints[i].SetCoord(aLoc.X(), aLoc.Y(), aLoc.Z());
+      }
     }
-    else if (aShapes[i]->isEdge()) {
-      std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShapes[i]));
+    else if (aShape->isEdge()) {
+      std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShape));
       std::shared_ptr<GeomAPI_Lin> aLine = anEdge->line();
       std::shared_ptr<GeomAPI_Dir> aDir = aLine->direction();
-      std::shared_ptr<GeomAPI_Pnt> aFirstPnt = anEdge->firstPoint();
-      std::shared_ptr<GeomAPI_Pnt> aLastPnt = anEdge->lastPoint();
-      std::shared_ptr<GeomAPI_XYZ> aLoc = aFirstPnt->xyz()->added(aLastPnt->xyz())->multiplied(0.5);
-      aSrcDstPoints[i].SetCoord(aLoc->x(), aLoc->y(), aLoc->z());
       aSrcDstDirections[i].SetCoord(aDir->x(), aDir->y(), aDir->z());
+
+      if (!isCompound) {
+        std::shared_ptr<GeomAPI_Pnt> aFirstPnt = anEdge->firstPoint();
+        std::shared_ptr<GeomAPI_Pnt> aLastPnt = anEdge->lastPoint();
+        std::shared_ptr<GeomAPI_XYZ> aLoc = aFirstPnt->xyz()->added(aLastPnt->xyz())
+                                                            ->multiplied(0.5);
+        aSrcDstPoints[i].SetCoord(aLoc->x(), aLoc->y(), aLoc->z());
+      }
     }
-    else if (aShapes[i]->isVertex()) {
-      std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aShapes[i]));
+    else if (aShape->isVertex()) {
+      std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aShape));
       std::shared_ptr<GeomAPI_Pnt> aPnt = aVertex->point();
       aSrcDstPoints[i].SetCoord(aPnt->x(), aPnt->y(), aPnt->z());
     } else // something goes wrong
@@ -156,7 +176,7 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr<GeomAPI_Shape>& theSourc
           aVec = aSrcDstDirections[0].Crossed(gp_Vec(aSrcDstPoints[0], aSrcDstPoints[1]));
           if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // lines are equal
             if (Abs(aSrcDstDirections[0].Y()) >= Precision::Confusion() ||
-              Abs(aSrcDstDirections[0].Z()) >= Precision::Confusion())
+                Abs(aSrcDstDirections[0].Z()) >= Precision::Confusion())
               aVec = gp::DX();
             else
               aVec = gp::DY();
@@ -177,8 +197,8 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr<GeomAPI_Shape>& theSourc
         gp_Vec aVec(aSrcDstPoints[anInd], aSrcDstPoints[1 - anInd]);
         aVec.Cross(aSrcDstDirections[anInd]);
         if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // point is on line
-          if (Abs(aSrcDstDirections[1 - anInd].Y()) >= Precision::Confusion() ||
-            Abs(aSrcDstDirections[1 - anInd].Z()) >= Precision::Confusion())
+          if (Abs(aSrcDstDirections[anInd].Y()) >= Precision::Confusion() ||
+              Abs(aSrcDstDirections[anInd].Z()) >= Precision::Confusion())
             aVec = gp::DX();
           else
             aVec = gp::DY();
index 76dae6f6316dcf369462ea2895f273a19e28ebaa..3a5b2a04fbdf775c714c3d587f3cf85339850396 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Placement_H_
index ce7be932c4557724520697e7176ff191817a03d1..7b46a50ff1ed6737d00aa27467175433abe0bdc6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_PointBuilder.h"
@@ -148,14 +147,11 @@ std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexByProjection(
 
   GeomAPI_ProjectPointOnCurve aProjection(aPnt, aCurve);
 
-  if (aProjection.NbPoints() == 0) {
-    return aVertex;
+  if (aProjection.NbPoints() != 0) {
+    gp_Pnt aNearestPoint = aProjection.NearestPoint();
+    aVertex.reset(new GeomAPI_Vertex(aNearestPoint.X(), aNearestPoint.Y(), aNearestPoint.Z()));
   }
 
-  gp_Pnt aNearestPoint = aProjection.NearestPoint();
-
-  aVertex.reset(new GeomAPI_Vertex(aNearestPoint.X(), aNearestPoint.Y(), aNearestPoint.Z()));
-
   return aVertex;
 }
 
@@ -166,21 +162,16 @@ std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexByProjection(
 {
   std::shared_ptr<GeomAPI_Vertex> aVertex;
 
-  if(!theVertex.get() || !theFace.get() || !theFace->isPlanar()) {
-    return aVertex;
-  }
-
-  std::shared_ptr<GeomAPI_Pnt> aProjPnt = theVertex->point();
-  std::shared_ptr<GeomAPI_Pln> aProjPln = theFace->getPlane();
+  if (theVertex.get() && theFace.get() && theFace->isPlanar()) {
+    std::shared_ptr<GeomAPI_Pnt> aProjPnt = theVertex->point();
+    std::shared_ptr<GeomAPI_Pln> aProjPln = theFace->getPlane();
 
-  std::shared_ptr<GeomAPI_Pnt> aPnt = aProjPln->project(aProjPnt);
+    std::shared_ptr<GeomAPI_Pnt> aPnt = aProjPln->project(aProjPnt);
 
-  if(!aPnt.get()) {
-    return aVertex;
+    if (aPnt.get())
+      aVertex.reset(new GeomAPI_Vertex(aPnt->x(), aPnt->y(), aPnt->z()));
   }
 
-  aVertex.reset(new GeomAPI_Vertex(aPnt->x(), aPnt->y(), aPnt->z()));
-
   return aVertex;
 }
 
@@ -191,45 +182,15 @@ std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexByIntersection(
 {
   std::shared_ptr<GeomAPI_Vertex> aVertex;
 
-  if(!theEdge1.get() || !theEdge2.get() || !theEdge1->isLine() || !theEdge2->isLine()) {
-    return aVertex;
-  }
-
-  std::shared_ptr<GeomAPI_Lin> aLin1 = theEdge1->line();
-  std::shared_ptr<GeomAPI_Lin> aLin2 = theEdge2->line();
-
-  std::shared_ptr<GeomAPI_Pnt> aPnt = aLin1->intersect(aLin2);
-
-  if(!aPnt.get()) {
-    return aVertex;
-  }
-
-  aVertex.reset(new GeomAPI_Vertex(aPnt->x(), aPnt->y(), aPnt->z()));
-
-  return aVertex;
-}
-
-//==================================================================================================
-std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexByIntersection(
-    const std::shared_ptr<GeomAPI_Edge> theEdge,
-    const std::shared_ptr<GeomAPI_Face> theFace)
-{
-  std::shared_ptr<GeomAPI_Vertex> aVertex;
-
-  if(!theEdge.get() || !theFace.get() || !theEdge->isLine() || !theFace->isPlanar()) {
-    return aVertex;
-  }
-
-  std::shared_ptr<GeomAPI_Lin> aLin = theEdge->line();
-  std::shared_ptr<GeomAPI_Pln> aPln = theFace->getPlane();
+  if (theEdge1.get() && theEdge2.get() && theEdge1->isLine() && theEdge2->isLine()) {
+    std::shared_ptr<GeomAPI_Lin> aLin1 = theEdge1->line();
+    std::shared_ptr<GeomAPI_Lin> aLin2 = theEdge2->line();
 
-  std::shared_ptr<GeomAPI_Pnt> aPnt = aPln->intersect(aLin);
+    std::shared_ptr<GeomAPI_Pnt> aPnt = aLin1->intersect(aLin2);
 
-  if(!aPnt.get()) {
-    return aVertex;
+    if (aPnt.get())
+      aVertex.reset(new GeomAPI_Vertex(aPnt->x(), aPnt->y(), aPnt->z()));
   }
 
-  aVertex.reset(new GeomAPI_Vertex(aPnt->x(), aPnt->y(), aPnt->z()));
-
   return aVertex;
 }
index f75ecd2ab5c2d8eb3568be8827c51d7f8cd5305e..fe2a56e1e2c5df350493c4900a9588325d3f8a08 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_PointBuilder_H_
@@ -80,14 +79,6 @@ public:
     vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge1,
                          const std::shared_ptr<GeomAPI_Edge> theEdge2);
 
-  /// \brief Creates vertex by intersection line and plane.
-  /// \param[in] theEdge linear edge.
-  /// \param[in] theFace planar face.
-  /// \return created vertex.
-  static std::shared_ptr<GeomAPI_Vertex>
-    vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge,
-                         const std::shared_ptr<GeomAPI_Face> theFace);
-
   /// Return point by shape vertex
   static std::shared_ptr<GeomAPI_Pnt> point(const std::shared_ptr<GeomAPI_Shape> theVertex);
 };
index 2576423e74ceb37811b60bbd5cd556b347a1cf96..df1b159766611e80ea2d6b0631ae3a0ba6e9d1c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Prism.h"
@@ -66,35 +65,6 @@ static void storeGenerationHistory(GeomAlgoAPI_Prism* thePrismAlgo,
                                    const TopoDS_Face& theFromFace);
 
 
-//==================================================================================================
-GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
-                                     const double       theToSize,
-                                     const double       theFromSize)
-{
-  build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), GeomShapePtr(),
-    theToSize, GeomShapePtr(), theFromSize);
-}
-
-//==================================================================================================
-GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
-                                     const std::shared_ptr<GeomAPI_Dir> theDirection,
-                                     const double                       theToSize,
-                                     const double                       theFromSize)
-{
-  build(theBaseShape, theDirection, GeomShapePtr(), theToSize, GeomShapePtr(), theFromSize);
-}
-
-//==================================================================================================
-GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
-                                     const GeomShapePtr theToShape,
-                                     const double       theToSize,
-                                     const GeomShapePtr theFromShape,
-                                     const double       theFromSize)
-{
-  build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), theToShape,
-        theToSize, theFromShape, theFromSize);
-}
-
 //==================================================================================================
 GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
                                      const std::shared_ptr<GeomAPI_Dir> theDirection,
@@ -222,27 +192,21 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr&                theBaseShape,
     aTrsf.SetTranslation(anExtVec * -theFromSize);
     BRepBuilderAPI_Transform* aTransformBuilder =
       new BRepBuilderAPI_Transform(aBaseShape, aTrsf);
-    if(!aTransformBuilder) {
+    if(!aTransformBuilder || !aTransformBuilder->IsDone()) {
       return;
     }
     this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
       new GeomAlgoAPI_MakeShape(aTransformBuilder)));
-    if(!aTransformBuilder->IsDone()) {
-      return;
-    }
     TopoDS_Shape aMovedBase = aTransformBuilder->Shape();
 
     // Making prism.
     BRepPrimAPI_MakePrism* aPrismBuilder =
       new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * (theFromSize + theToSize));
-    if(!aPrismBuilder) {
+    if(!aPrismBuilder || !aPrismBuilder->IsDone()) {
       return;
     }
     this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
       new GeomAlgoAPI_MakeShape(aPrismBuilder)));
-    if(!aPrismBuilder->IsDone()) {
-      return;
-    }
     aResult = aPrismBuilder->Shape();
 
     // Setting naming.
@@ -322,27 +286,21 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr&                theBaseShape,
     gp_Trsf aTrsf;
     aTrsf.SetTranslation(anExtVec * -aPrismLength);
     BRepBuilderAPI_Transform* aTransformBuilder = new BRepBuilderAPI_Transform(aBaseShape, aTrsf);
-    if(!aTransformBuilder) {
+    if(!aTransformBuilder || !aTransformBuilder->IsDone()) {
       return;
     }
     this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
       new GeomAlgoAPI_MakeShape(aTransformBuilder)));
-    if(!aTransformBuilder->IsDone()) {
-      return;
-    }
     TopoDS_Shape aMovedBase = aTransformBuilder->Shape();
 
     // Making prism.
     BRepPrimAPI_MakePrism* aPrismBuilder =
       new BRepPrimAPI_MakePrism(aMovedBase, anExtVec * 2 * aPrismLength);
-    if(!aPrismBuilder) {
+    if(!aPrismBuilder || !aPrismBuilder->IsDone()) {
       return;
     }
     this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
       new GeomAlgoAPI_MakeShape(aPrismBuilder)));
-    if(!aPrismBuilder->IsDone()) {
-      return;
-    }
     aResult = aPrismBuilder->Shape();
 
     // Orienting bounding planes.
@@ -411,6 +369,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr&                theBaseShape,
       for(TopTools_ListIteratorOfListOfShape anIt(aToShapes); anIt.More(); anIt.Next()) {
         GeomShapePtr aGeomSh(new GeomAPI_Shape());
         aGeomSh->setImpl(new TopoDS_Shape(anIt.Value()));
+        fixOrientation(aGeomSh);
         this->addToShape(aGeomSh);
       }
     }
@@ -436,6 +395,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr&                theBaseShape,
       for(TopTools_ListIteratorOfListOfShape anIt(aFromShapes); anIt.More(); anIt.Next()) {
         GeomShapePtr aGeomSh(new GeomAPI_Shape());
         aGeomSh->setImpl(new TopoDS_Shape(anIt.Value()));
+        fixOrientation(aGeomSh);
         this->addFromShape(aGeomSh);
       }
     }
@@ -451,24 +411,22 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr&                theBaseShape,
     if(aResult.ShapeType() == TopAbs_COMPOUND) {
       std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
       aGeomShape->setImpl(new TopoDS_Shape(aResult));
-      ListOfShape aCompSolids, aFreeSolids;
+      ListOfShape aResults;
       aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                          GeomAPI_Shape::COMPSOLID,
-                                                         aCompSolids,
-                                                         aFreeSolids);
+                                                         aResults);
       aResult = aGeomShape->impl<TopoDS_Shape>();
     }
   }
 
   // Setting result.
-  if(aResult.IsNull()) {
-    return;
+  if (!aResult.IsNull()) {
+    aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
+    GeomShapePtr aGeomSh(new GeomAPI_Shape());
+    aGeomSh->setImpl(new TopoDS_Shape(aResult));
+    this->setShape(aGeomSh);
+    this->setDone(true);
   }
-  aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
-  GeomShapePtr aGeomSh(new GeomAPI_Shape());
-  aGeomSh->setImpl(new TopoDS_Shape(aResult));
-  this->setShape(aGeomSh);
-  this->setDone(true);
 }
 
 // Auxilary functions:
@@ -483,6 +441,8 @@ void storeGenerationHistory(GeomAlgoAPI_Prism* thePrismAlgo,
     GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
     aFromShape->setImpl(new TopoDS_Shape(thePrismBuilder->FirstShape(aShape)));
     aToShape->setImpl(new TopoDS_Shape(thePrismBuilder->LastShape(aShape)));
+    thePrismAlgo->fixOrientation(aFromShape);
+    thePrismAlgo->fixOrientation(aToShape);
     thePrismAlgo->addFromShape(aFromShape);
     thePrismAlgo->addToShape(aToShape);
   }
@@ -504,11 +464,13 @@ void storeGenerationHistory(GeomAlgoAPI_Prism* thePrismAlgo,
       if(anIntTools.IsValidPointForFace(aPnt,
           theToFace, Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        thePrismAlgo->fixOrientation(aGeomSh);
         thePrismAlgo->addToShape(aGeomSh);
       }
       if(anIntTools.IsValidPointForFace(aPnt,
           theFromFace, Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        thePrismAlgo->fixOrientation(aGeomSh);
         thePrismAlgo->addFromShape(aGeomSh);
       }
     } else if(theType == TopAbs_EDGE) {
@@ -517,12 +479,14 @@ void storeGenerationHistory(GeomAlgoAPI_Prism* thePrismAlgo,
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        thePrismAlgo->fixOrientation(aGeomSh);
         thePrismAlgo->addToShape(aGeomSh);
       }
       anEdgeCheck.Init(anEdge, theFromFace);
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        thePrismAlgo->fixOrientation(aGeomSh);
         thePrismAlgo->addFromShape(aGeomSh);
       }
     } else {
index 0309004ed20f3d981e019354900f2f419cba7d26..7d2d2dbddb6eb6710c7ccee7c1da79d7e1936565 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Prism_H_
 class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
 {
 public:
-  /// \brief Creates extrusion for the given shape along the normal for this shape.
-  /// \param[in] theBaseShape planar face or wire to be extruded.
-  /// \param[in] theToSize offset for "to" plane.
-  /// \param[in] theFromSize offset for "from" plane.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
-                                       const double       theToSize,
-                                       const double       theFromSize);
-
-  /// \brief Creates extrusion for the given shape along the normal for this shape.
-  /// \param[in] theBaseShape vertex, edge, wire, face or shell.
-  /// \param[in] theDirection direction of extrusion.
-  ///                         Can be empty if theBaseShape is planar wire or face.
-  /// \param[in] theToSize offset for "to" plane.
-  /// \param[in] theFromSize offset for "from" plane.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
-                                       const std::shared_ptr<GeomAPI_Dir> theDirection,
-                                       const double                       theToSize,
-                                       const double                       theFromSize);
-
-  /// \brief Creates extrusion for the given shape along the normal for this shape.
-  /// \param[in] theBaseShape planar face or wire to be extruded.
-  /// \param[in] theToShape top bounding shape. Can be empty.
-  ///                       In this case offset will be applied to the basis.
-  /// \param[in] theToSize offset for "to" plane.
-  /// \param[in] theFromShape bottom bounding shape. Can be empty.
-  ///                         In this case offset will be applied to the basis.
-  /// \param[in] theFromSize offset for "from" plane.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
-                                       const GeomShapePtr theToShape,
-                                       const double       theToSize,
-                                       const GeomShapePtr theFromShape,
-                                       const double       theFromSize);
-
   /// \brief Creates extrusion for the given shape along the normal for this shape.
   /// \param[in] theBaseShape planar face or wire to be extruded.
   /// \param[in] theDirection direction of extrusion.
index 770580963c188d6fc2eb511777f421aa2729628e..6a2221e16efb9f8957e7f664591de8e54a76255c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Revolution.h"
@@ -89,15 +88,6 @@ static void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
                                    const TopoDS_Shape& theModifiedBaseShape,
                                    const bool theIsFromFaceSet);
 
-//==================================================================================================
-GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(const GeomShapePtr                 theBaseShape,
-                                               const std::shared_ptr<GeomAPI_Ax1> theAxis,
-                                               const double                       theToAngle,
-                                               const double                       theFromAngle)
-{
-  build(theBaseShape, theAxis, GeomShapePtr(), theToAngle, GeomShapePtr(), theFromAngle);
-}
-
 //==================================================================================================
 GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(const GeomShapePtr                 theBaseShape,
                                                const std::shared_ptr<GeomAPI_Ax1> theAxis,
@@ -323,11 +313,10 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr&                 theBaseSh
     if(aResult.ShapeType() == TopAbs_COMPOUND) {
       std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
       aGeomShape->setImpl(new TopoDS_Shape(aResult));
-      ListOfShape aCompSolids, aFreeSolids;
+      ListOfShape aResults;
       aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                          GeomAPI_Shape::COMPSOLID,
-                                                         aCompSolids,
-                                                         aFreeSolids);
+                                                         aResults);
       aResult = aGeomShape->impl<TopoDS_Shape>();
     }
 
@@ -418,6 +407,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr&                 theBaseSh
       for(TopTools_ListIteratorOfListOfShape anIt(aBndShapes); anIt.More(); anIt.Next()) {
         GeomShapePtr aShape(new GeomAPI_Shape());
         aShape->setImpl(new TopoDS_Shape(anIt.Value()));
+        fixOrientation(aShape);
         isFromFaceSet ? this->addFromShape(aShape) : this->addToShape(aShape);
       }
     }
@@ -482,6 +472,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr&                 theBaseSh
           for(TopTools_ListIteratorOfListOfShape anIt(aBsShapes); anIt.More(); anIt.Next()) {
             GeomShapePtr aShape(new GeomAPI_Shape());
             aShape->setImpl(new TopoDS_Shape(anIt.Value()));
+            fixOrientation(aShape);
             isFromFaceSet ? this->addToShape(aShape) : this->addFromShape(aShape);
           }
         }
@@ -491,11 +482,10 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr&                 theBaseSh
     if(aResult.ShapeType() == TopAbs_COMPOUND) {
       std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
       aGeomShape->setImpl(new TopoDS_Shape(aResult));
-      ListOfShape aCompSolids, aFreeSolids;
+      ListOfShape aResults;
       aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                          GeomAPI_Shape::COMPSOLID,
-                                                         aCompSolids,
-                                                         aFreeSolids);
+                                                         aResults);
       aResult = aGeomShape->impl<TopoDS_Shape>();
     }
 
@@ -612,6 +602,8 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
     GeomShapePtr aFromShape(new GeomAPI_Shape), aToShape(new GeomAPI_Shape);
     aFromShape->setImpl(new TopoDS_Shape(theRevolBuilder->FirstShape(aShape)));
     aToShape->setImpl(new TopoDS_Shape(theRevolBuilder->LastShape(aShape)));
+    theRevolutionAlgo->fixOrientation(aFromShape);
+    theRevolutionAlgo->fixOrientation(aToShape);
     theRevolutionAlgo->addFromShape(aFromShape);
     theRevolutionAlgo->addToShape(aToShape);
   }
@@ -633,11 +625,13 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theToFace),
           Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addToShape(aGeomSh);
       }
       if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theFromFace),
           Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addFromShape(aGeomSh);
       }
     } else if(theType == TopAbs_EDGE) {
@@ -646,12 +640,14 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addToShape(aGeomSh);
       }
       anEdgeCheck.Init(anEdge, TopoDS::Face(theFromFace));
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addFromShape(aGeomSh);
       }
     } else {
@@ -660,10 +656,12 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       Handle(Geom_Surface) aToSurface = BRep_Tool::Surface(TopoDS::Face(theToFace));
       if(aFaceSurface == aFromSurface) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addFromShape(aGeomSh);
       }
       if(aFaceSurface == aToSurface) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theRevolutionAlgo->addToShape(aGeomSh);
       }
     }
@@ -686,12 +684,14 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theRotatedBoundingFace),
           Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
                            theRevolutionAlgo->addToShape(aGeomSh);
       }
       if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theModifiedBaseShape),
          Precision::Confusion()) == Standard_True) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
                            theRevolutionAlgo->addFromShape(aGeomSh);
       }
@@ -701,6 +701,7 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
                            theRevolutionAlgo->addToShape(aGeomSh);
       }
@@ -708,6 +709,7 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       anEdgeCheck.Perform();
       if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
                            theRevolutionAlgo->addFromShape(aGeomSh);
       }
@@ -718,11 +720,13 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
       Handle(Geom_Surface) aBaseSurface = BRep_Tool::Surface(TopoDS::Face(theModifiedBaseShape));
       if(aFaceSurface == aBoundingSurface) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
                            theRevolutionAlgo->addToShape(aGeomSh);
       }
       if(aFaceSurface == aBaseSurface) {
         aGeomSh->setImpl(new TopoDS_Shape(aShape));
+        theRevolutionAlgo->fixOrientation(aGeomSh);
         theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
                            theRevolutionAlgo->addFromShape(aGeomSh);
       }
index b951c9867bc389854d787b0fcdee1fb8907875ca..e96817723e1f9bfbb14e974b722d42f142b5b32e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Revolution_H_
 class GeomAlgoAPI_Revolution : public GeomAlgoAPI_MakeSweep
 {
 public:
-  /// \brief Creates revolution for the given shape.
-  /// \param[in] theBaseShape face for revolution.
-  /// \param[in] theAxis axis for revolution.
-  /// \param[in] theToAngle to angle.
-  /// \param[in] theFromAngle from angle.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr                 theBaseShape,
-                                            const std::shared_ptr<GeomAPI_Ax1> theAxis,
-                                            const double                       theToAngle,
-                                            const double                       theFromAngle);
-
   /// \brief Creates revolution for the given shape.
   /// \param[in] theBaseShape face for revolution.
   /// \param[in] theAxis axis for revolution.
index c8a76a01dbeaea3485077a75d65575ea4202b693..cea4cc57ecd5426c34dbc3534f70c3d1da3f99ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Rotation.h"
index 77b5d564676eb6b7a60b2cea3eb92add756c9a5a..4a884451d0f73aa3591b08605d6f11ed7c489bb4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Rotation_H_
index 937addfb2bb724592e1443e0cc8b43948d7530d1..b2125b91a538e0d675fc72cdef77392e0917610b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_STEPExport.h>
index e008ebebf58f42e3c33aaef543b9842cab8f1f20..b3c77f325f6db3aaeaf37613d5a82cee66155ed9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_STEPEXPORT_H_
index 837237a79c761ceb7fdd886a2e0b2debffd30913..71fa47ac5f9c6c75858bebde2c34995e7358040c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_STEPImport.h>
index 49c40df84123947c7157c24eefd5be9a9ee02ab0..86bfdf11c9e14cf2ba7d51c0e7271822f8d5cf70 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_STEPIMPORT_H_
index d680aaad2339c9f9eb8eddfdc42ec9cd0fb42808..3165c022716b2f49a13e8a4399cb51316106585d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Scale.h"
index 701f9e95beb252edfe2543f148629bdbaeac519a..583fd7501579ba5928f0e4ae03ca8b1238b98f52 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_SCALE_H_
index b30d1dd60dff6c9a82730b1f1f6534ecffac00d3..264c6bd30367566b8e8d401cf51d0cbaef9c7f38 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Sewing.h"
@@ -80,6 +79,30 @@ void GeomAlgoAPI_Sewing::build(const ListOfShape& theShapes)
 }
 
 //==================================================================================================
+#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
+
+typedef std::map<GeomShapePtr, ListOfShape, GeomAPI_Shape::Comparator> MapFaceSolid;
+static void facesBelongingToSolids(const GeomShapePtr& theShape,
+                                   MapFaceSolid& theShapeRelations)
+{
+  for (GeomAPI_ShapeExplorer aSolidExp(theShape, GeomAPI_Shape::SHELL);
+       aSolidExp.more(); aSolidExp.next()) {
+    GeomShapePtr aSolid = aSolidExp.current();
+    for (GeomAPI_ShapeExplorer aFaceExp(aSolid, GeomAPI_Shape::FACE);
+         aFaceExp.more(); aFaceExp.next())
+      theShapeRelations[aFaceExp.current()].push_back(aSolid);
+  }
+}
+
+static bool isShapeInList(const GeomShapePtr& theShape, const ListOfShape& theList)
+{
+  for (ListOfShape::const_iterator anIt = theList.begin(); anIt != theList.end(); ++anIt)
+    if (theShape->isEqual(*anIt))
+      return true;
+  return false;
+}
+
 void GeomAlgoAPI_Sewing::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
                                   ListOfShape& theHistory)
 {
@@ -101,4 +124,21 @@ void GeomAlgoAPI_Sewing::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
     aGeomShape->setImpl(new TopoDS_Shape(anExp.Current()));
     theHistory.push_back(aGeomShape);
   }
+
+  if (theShape->shapeType() < GeomAPI_Shape::FACE) {
+    ListOfShape aNewShapes;
+    // collect faces and parent shapes, if it is not done yet
+    if (!isNewShapesCollected(theShape, GeomAPI_Shape::FACE))
+      collectNewShapes(theShape, GeomAPI_Shape::FACE);
+
+    for (GeomAPI_ShapeIterator anIt(shape()); anIt.more(); anIt.next()) {
+      GeomShapePtr anOldShapesCompound =
+          oldShapesForNew(theShape, anIt.current(), GeomAPI_Shape::FACE);
+      if (!anOldShapesCompound->isNull())
+        aNewShapes.push_back(anIt.current());
+    }
+
+    if (!aNewShapes.empty())
+      theHistory = aNewShapes;
+  }
 }
index ca17c36cb22ab1942b5c6ffac48b707347303ca9..116bff56a2cd6ca5a6e15881eba48cb272127504 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Sewing_H_
index 550bf68f3f0b74d9d9e824b29c685f244d4e172e..55567c40a1fc167652428327c24c95d0cf57bac8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_ShapeAPI.h"
 
 #include <math.h>
 
+static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo)  throw (GeomAlgoAPI_Exception)
+{
+  if (!theAlgo.check())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  theAlgo.build();
+
+  if (!theAlgo.isDone())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  return theAlgo.shape();
+}
+
+static GeomShapePtr runAlgoAndCheckShape(GeomAlgoAPI_MakeShape& theAlgo, const std::string& theMsg)
+throw (GeomAlgoAPI_Exception)
+{
+  if (!theAlgo.check())
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  theAlgo.build();
+
+  if (!theAlgo.isDone() || !theAlgo.checkValid(theMsg))
+    throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+  return theAlgo.shape();
+}
+
 namespace GeomAlgoAPI_ShapeAPI
 {
   //===============================================================================================
@@ -44,21 +70,9 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDx, const double theDy,
     const double theDz) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Box builder with dimensions");
     GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz);
-
-    if (!aBoxAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-
-    aBoxAlgo.build();
-
-    if(!aBoxAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    if (!aBoxAlgo.checkValid("Box builder with dimensions")) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    return aBoxAlgo.shape();
+    return runAlgoAndCheckShape(aBoxAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -66,21 +80,9 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
     std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Box builder with two points");
     GeomAlgoAPI_Box aBoxAlgo(theFirstPoint, theSecondPoint);
-
-    if (!aBoxAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-
-    aBoxAlgo.build();
-
-    if(!aBoxAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    if (!aBoxAlgo.checkValid("Box builder with two points")) {
-      throw GeomAlgoAPI_Exception(aBoxAlgo.getError());
-    }
-    return aBoxAlgo.shape();
+    return runAlgoAndCheckShape(aBoxAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -103,19 +105,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -138,19 +129,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder portion builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -166,19 +146,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -194,41 +163,17 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cylinder aCylinderAlgo(anAxis, theRadius, theHeight, theAngle);
 
-    if (!aCylinderAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-
-    aCylinderAlgo.build();
-
-    if(!aCylinderAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    if (!aCylinderAlgo.checkValid("Cylinder portion builder")) {
-      throw GeomAlgoAPI_Exception(aCylinderAlgo.getError());
-    }
-    return aCylinderAlgo.shape();
+    static const std::string aMsg("Cylinder portion builder");
+    return runAlgoAndCheckShape(aCylinderAlgo, aMsg);
   }
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSphere(
       std::shared_ptr<GeomAPI_Pnt> theCenterPoint, double theRadius) throw (GeomAlgoAPI_Exception)
   {
+    static const std::string aMsg("Sphere builder");
     GeomAlgoAPI_Sphere aSphereAlgo(theCenterPoint, theRadius);
-
-    if (!aSphereAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    aSphereAlgo.build();
-
-    if(!aSphereAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    if (!aSphereAlgo.checkValid("Sphere builder")) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-    return aSphereAlgo.shape();
+    return runAlgoAndCheckShape(aSphereAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -240,20 +185,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Sphere aSphereAlgo(aCenterPoint, theRadius);
 
-    if (!aSphereAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    aSphereAlgo.build();
-
-    if(!aSphereAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-
-    if (!aSphereAlgo.checkValid("Sphere builder")) {
-      throw GeomAlgoAPI_Exception(aSphereAlgo.getError());
-    }
-    return aSphereAlgo.shape();
+    static const std::string aMsg("Sphere builder");
+    return runAlgoAndCheckShape(aSphereAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -277,20 +210,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Torus aTorusAlgo(anAxis, theRadius, theRingRadius);
 
-    if (!aTorusAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    aTorusAlgo.build();
-
-    if(!aTorusAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    if (!aTorusAlgo.checkValid("Torus builder")) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-    return aTorusAlgo.shape();
+    static const std::string aMsg("Torus builder");
+    return runAlgoAndCheckShape(aTorusAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -306,20 +227,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Torus aTorusAlgo(anAxis, theRadius, theRingRadius);
 
-    if (!aTorusAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    aTorusAlgo.build();
-
-    if(!aTorusAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-
-    if (!aTorusAlgo.checkValid("Torus builder")) {
-      throw GeomAlgoAPI_Exception(aTorusAlgo.getError());
-    }
-    return aTorusAlgo.shape();
+    static const std::string aMsg("Torus builder");
+    return runAlgoAndCheckShape(aTorusAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -344,20 +253,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cone aConeAlgo(anAxis, theBaseRadius, theTopRadius, theHeight);
 
-    if (!aConeAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    aConeAlgo.build();
-
-    if(!aConeAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    if (!aConeAlgo.checkValid("Cone builder")) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-    return aConeAlgo.shape();
+    static const std::string aMsg("Cone builder");
+    return runAlgoAndCheckShape(aConeAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -374,20 +271,8 @@ namespace GeomAlgoAPI_ShapeAPI
 
     GeomAlgoAPI_Cone aConeAlgo(anAxis, theBaseRadius, theTopRadius, theHeight);
 
-    if (!aConeAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    aConeAlgo.build();
-
-    if(!aConeAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-
-    if (!aConeAlgo.checkValid("Cone builder")) {
-      throw GeomAlgoAPI_Exception(aConeAlgo.getError());
-    }
-    return aConeAlgo.shape();
+    static const std::string aMsg("Cone builder");
+    return runAlgoAndCheckShape(aConeAlgo, aMsg);
   }
 
   //===============================================================================================
@@ -397,18 +282,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDistance) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theAxis, theDistance);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -419,18 +293,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theDz) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theDx, theDy, theDz);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -440,18 +303,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt>   theEndPoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theStartPoint, theEndPoint);
-
-    if (!aTranslationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    aTranslationAlgo.build();
-
-    if(!aTranslationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aTranslationAlgo.getError());
-    }
-
-    return aTranslationAlgo.shape();
+    return runAlgo(aTranslationAlgo);
   }
 
   //===============================================================================================
@@ -461,18 +313,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theAngle) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theAxis, theAngle);
-
-    if (!aRotationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    aRotationAlgo.build();
-
-    if(!aRotationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    return aRotationAlgo.shape();
+    return runAlgo(aRotationAlgo);
   }
 
   //===============================================================================================
@@ -483,18 +324,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theCenterPoint, theStartPoint, theEndPoint);
-
-    if (!aRotationAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    aRotationAlgo.build();
-
-    if(!aRotationAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aRotationAlgo.getError());
-    }
-
-    return aRotationAlgo.shape();
+    return runAlgo(aRotationAlgo);
   }
 
   //===============================================================================================
@@ -503,18 +333,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt>   thePoint) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePoint);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -523,18 +342,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Ax1>   theAxis) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, theAxis);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -543,18 +351,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Ax2>   thePlane) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePlane);
-
-    if (!aSymmetryAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    aSymmetryAlgo.build();
-
-    if(!aSymmetryAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aSymmetryAlgo.getError());
-    }
-
-    return aSymmetryAlgo.shape();
+    return runAlgo(aSymmetryAlgo);
   }
 
   //===============================================================================================
@@ -564,18 +361,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double                   theScaleFactor) throw (GeomAlgoAPI_Exception)
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint, theScaleFactor);
-
-    if (!aScaleAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    aScaleAlgo.build();
-
-    if(!aScaleAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    return aScaleAlgo.shape();
+    return runAlgo(aScaleAlgo);
   }
 
   //===============================================================================================
@@ -588,18 +374,7 @@ namespace GeomAlgoAPI_ShapeAPI
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint,
                                  theScaleFactorX, theScaleFactorY, theScaleFactorZ);
-
-    if (!aScaleAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    aScaleAlgo.build();
-
-    if(!aScaleAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aScaleAlgo.getError());
-    }
-
-    return aScaleAlgo.shape();
+    return runAlgo(aScaleAlgo);
   }
 
   //===============================================================================================
@@ -691,7 +466,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeMultiRotation(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
-    const int theNumber)
+    const int theNumber) throw (GeomAlgoAPI_Exception)
   {
     if (!theAxis) {
       std::string aError = "Multirotation builder ";
@@ -720,7 +495,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
     const double theStep,
-    const int theNumber)
+    const int theNumber) throw (GeomAlgoAPI_Exception)
   {
     if (!theAxis) {
       std::string aError = "Multirotation builder ";
@@ -752,18 +527,7 @@ namespace GeomAlgoAPI_ShapeAPI
     GeomAlgoAPI_ConeSegment aConeSegmentAlgo(theRMin1, theRMax1, theRMin2, theRMax2,
                                              theZ, theStartPhi, theDeltaPhi);
 
-    if (!aConeSegmentAlgo.check()) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-
-    aConeSegmentAlgo.build();
-
-    if(!aConeSegmentAlgo.isDone()) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-    if (!aConeSegmentAlgo.checkValid("Cone Segment builder")) {
-      throw GeomAlgoAPI_Exception(aConeSegmentAlgo.getError());
-    }
-    return aConeSegmentAlgo.shape();
+    static const std::string aMsg("Cone Segment builder");
+    return runAlgoAndCheckShape(aConeSegmentAlgo, aMsg);
   }
 }
index 65b3f1769402a809e729304482396ecb4a54532a..fe1f86f2b54b8aa4bdbff503ecd8ccf5a105248a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_SHAPEAPI_H
@@ -263,7 +262,7 @@ public:
   static std::shared_ptr<GeomAPI_Shape> makeMultiRotation(
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
                      std::shared_ptr<GeomAPI_Ax1> theAxis,
-                     const int theNumber);
+                     const int theNumber) throw (GeomAlgoAPI_Exception);
 
   /// Performs a multi rotation along one axis, at a step and a number of times
   /// \param theSourceShape Shape to be moved
@@ -274,7 +273,7 @@ public:
                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
                      std::shared_ptr<GeomAPI_Ax1> theAxis,
                      const double theStep,
-                     const int theNumber);
+                     const int theNumber) throw (GeomAlgoAPI_Exception);
 
   /// Creates a cone segment using standard GDML parameters.
   /// \param theRMin1 Inner radius at base of cone
index 49b66507b73560f18f9f5bfac072b837599091ea..cb25126c54996aa879b9e14ea525a87e027c61de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_ShapeBuilder.h"
index a55e3caeba7841c6adabfeb5046da87753c7de90..e12295e5d11844effea7ae3585f2e38384a6d8b3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_ShapeBuilder_H_
index a47c77c7f28d1fa298a72a1613b71a5eabdd06ff..301717b15313218b7474810b88ee4005bc837452 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_ShapeTools.h"
@@ -200,9 +199,12 @@ double GeomAlgoAPI_ShapeTools::minimalDistance(const GeomShapePtr& theShape1,
 std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
   const std::shared_ptr<GeomAPI_Shape> theCompound,
   const GeomAPI_Shape::ShapeType theType,
-  ListOfShape& theCombinedShapes,
-  ListOfShape& theFreeShapes)
+  ListOfShape& theResuts)
 {
+
+  ListOfShape aResCombinedShapes;
+  ListOfShape aResFreeShapes;
+
   GeomShapePtr aResult = theCompound;
 
   if(!theCompound.get()) {
@@ -220,28 +222,37 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
     aTA = TopAbs_SOLID;
   }
 
-  theCombinedShapes.clear();
-  theFreeShapes.clear();
+  // map from the resulting shapes to minimal index of the used shape from theCompound list
+  std::map<GeomShapePtr, int> anInputOrder;
+  // map from ancestors-shapes to the index of shapes in theCompound
+  NCollection_DataMap<TopoDS_Shape, int> anAncestorsOrder;
 
   // Get free shapes.
+  int anOrder = 0;
   const TopoDS_Shape& aShapesComp = theCompound->impl<TopoDS_Shape>();
-  for(TopoDS_Iterator anIter(aShapesComp); anIter.More(); anIter.Next() ) {
+  for(TopoDS_Iterator anIter(aShapesComp); anIter.More(); anIter.Next(), anOrder++) {
     const TopoDS_Shape& aShape = anIter.Value();
     if(aShape.ShapeType() > aTA) {
       std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
       aGeomShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aShape));
-      theFreeShapes.push_back(aGeomShape);
+      aResFreeShapes.push_back(aGeomShape);
+      anInputOrder[aGeomShape] = anOrder;
+    } else {
+      for(TopExp_Explorer anExp(aShape, aTA); anExp.More(); anExp.Next()) {
+        anAncestorsOrder.Bind(anExp.Current(), anOrder);
+      }
     }
   }
 
-  // Map subshapes and shapes.
+  // Map sub-shapes and shapes.
   TopTools_IndexedDataMapOfShapeListOfShape aMapSA;
   TopExp::MapShapesAndAncestors(aShapesComp, aTS, aTA, aMapSA);
   if(aMapSA.IsEmpty()) {
     return aResult;
   }
+  theResuts.clear();
 
-  // Get all shapes with common subshapes and free shapes.
+  // Get all shapes with common sub-shapes and free shapes.
   NCollection_Map<TopoDS_Shape> aFreeShapes;
   NCollection_Vector<NCollection_Map<TopoDS_Shape>> aShapesWithCommonSubshapes;
   for(TopTools_IndexedDataMapOfShapeListOfShape::Iterator
@@ -299,12 +310,13 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
     }
   }
 
-  // Combine shapes with common subshapes.
+  // Combine shapes with common sub-shapes.
   for(NCollection_Vector<NCollection_Map<TopoDS_Shape>>::Iterator
       anIter(aShapesWithCommonSubshapes); anIter.More(); anIter.Next()) {
     TopoDS_Shell aShell;
     TopoDS_CompSolid aCSolid;
     TopoDS_Builder aBuilder;
+    anOrder = -1;
     theType ==
       GeomAPI_Shape::COMPSOLID ? aBuilder.MakeCompSolid(aCSolid) : aBuilder.MakeShell(aShell);
     NCollection_Map<TopoDS_Shape>& aShapesMap = anIter.ChangeValue();
@@ -314,13 +326,17 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
         theType ==
           GeomAPI_Shape::COMPSOLID ? aBuilder.Add(aCSolid, aShape) : aBuilder.Add(aShell, aShape);
         aShapesMap.Remove(aShape);
+        int aThisOrder = anAncestorsOrder.Find(aShape);
+        if (anOrder == -1 || aThisOrder < anOrder)
+          anOrder = aThisOrder; // take the minimum order position
       }
     }
     std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
     TopoDS_Shape* aSh = theType == GeomAPI_Shape::COMPSOLID ? new TopoDS_Shape(aCSolid) :
                                                               new TopoDS_Shape(aShell);
     aGeomShape->setImpl<TopoDS_Shape>(aSh);
-    theCombinedShapes.push_back(aGeomShape);
+    aResCombinedShapes.push_back(aGeomShape);
+    anInputOrder[aGeomShape] = anOrder;
   }
 
   // Adding free shapes.
@@ -329,25 +345,30 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
     if(aFreeShapes.Contains(aShape)) {
       std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
       aGeomShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aShape));
-      theFreeShapes.push_back(aGeomShape);
+      aResFreeShapes.push_back(aGeomShape);
+      anInputOrder[aGeomShape] = anAncestorsOrder.Find(aShape);
     }
   }
 
-  if(theCombinedShapes.size() == 1 && theFreeShapes.size() == 0) {
-    aResult = theCombinedShapes.front();
-  } else if(theCombinedShapes.size() == 0 && theFreeShapes.size() == 1) {
-    aResult = theFreeShapes.front();
+  if(aResCombinedShapes.size() == 1 && aResFreeShapes.size() == 0) {
+    aResult = aResCombinedShapes.front();
+    theResuts.push_back(aResult);
+  } else if(aResCombinedShapes.size() == 0 && aResFreeShapes.size() == 1) {
+    aResult = aResFreeShapes.front();
+    theResuts.push_back(aResult);
   } else {
     TopoDS_Compound aResultComp;
     TopoDS_Builder aBuilder;
     aBuilder.MakeCompound(aResultComp);
-    for(ListOfShape::const_iterator anIter = theCombinedShapes.cbegin();
-        anIter != theCombinedShapes.cend(); anIter++) {
-      aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
-    }
-    for(ListOfShape::const_iterator anIter = theFreeShapes.cbegin();
-        anIter != theFreeShapes.cend(); anIter++) {
-      aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
+    // put to result compound and result list in accordance to the order numbers
+    std::map<GeomShapePtr, int>::iterator anInputIter = anInputOrder.begin();
+    std::map<int, GeomShapePtr> aNums;
+    for(; anInputIter != anInputOrder.end(); anInputIter++)
+      aNums[anInputIter->second] = anInputIter->first;
+    std::map<int, GeomShapePtr>::iterator aNumsIter = aNums.begin();
+    for(; aNumsIter != aNums.end(); aNumsIter++) {
+      aBuilder.Add(aResultComp, (aNumsIter->second)->impl<TopoDS_Shape>());
+      theResuts.push_back(aNumsIter->second);
     }
     aResult->setImpl(new TopoDS_Shape(aResultComp));
   }
@@ -444,7 +465,7 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::groupSharedTopology(
         aKeysIt.Next()) {
         const TopTools_ListOfShape& anOtherConnected = aVertexShapesMap(aKeysIt.Value());
         if (!anOtherConnected.Contains(aConnected)) {
-          // Other connected group does not containt shape from our connected group
+          // Other connected group does not contain shape from our connected group
           continue;
         }
         // Other is connected to our, so add them to our connected
@@ -487,7 +508,7 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::groupSharedTopology(
   TopoDS_Compound aCompound;
   BRep_Builder aBuilder;
   aBuilder.MakeCompound(aCompound);
-  ListOfShape aCompSolids, aFreeSolids;
+  ListOfShape aSolids;
   for (NCollection_Vector<TopTools_MapOfShape>::Iterator anIt(aGroups); anIt.More(); anIt.Next()) {
     const TopTools_MapOfShape& aGroup = anIt.ChangeValue();
     GeomShapePtr aGeomShape(new GeomAPI_Shape());
@@ -505,8 +526,7 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::groupSharedTopology(
       aGeomShape->setImpl(new TopoDS_Shape(makeCompound(anOrderedGoup)));
       aGeomShape = GeomAlgoAPI_ShapeTools::combineShapes(aGeomShape,
                                                          GeomAPI_Shape::COMPSOLID,
-                                                         aCompSolids,
-                                                         aFreeSolids);
+                                                         aSolids);
     }
     aBuilder.Add(aCompound, aGeomShape->impl<TopoDS_Shape>());
   }
@@ -554,29 +574,6 @@ std::list<std::shared_ptr<GeomAPI_Pnt> >
   return aResultPoints;
 }
 
-//==================================================================================================
-std::shared_ptr<GeomAPI_Shape>
-  GeomAlgoAPI_ShapeTools::faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace)
-{
-  if (!theFace.get())
-    return std::shared_ptr<GeomAPI_Shape>();
-
-  TopoDS_Face aPlaneFace = TopoDS::Face(theFace->impl<TopoDS_Shape>());
-  if (aPlaneFace.IsNull())
-    return std::shared_ptr<GeomAPI_Shape>();
-
-  Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(BRep_Tool::Surface(aPlaneFace));
-  if (aPlane.IsNull())
-    return std::shared_ptr<GeomAPI_Shape>();
-
-  // make an infinity face on the plane
-  TopoDS_Shape anInfiniteFace = BRepBuilderAPI_MakeFace(aPlane->Pln()).Shape();
-
-  std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
-  aResult->setImpl(new TopoDS_Shape(anInfiniteFace));
-  return aResult;
-}
-
 //==================================================================================================
 std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_ShapeTools::fitPlaneToBox(
   const std::shared_ptr<GeomAPI_Shape> thePlane,
@@ -637,23 +634,26 @@ void GeomAlgoAPI_ShapeTools::findBounds(const std::shared_ptr<GeomAPI_Shape> the
                                         std::shared_ptr<GeomAPI_Vertex>& theV1,
                                         std::shared_ptr<GeomAPI_Vertex>& theV2)
 {
-  if(!theShape.get()) {
-    std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex);
+  static GeomVertexPtr aVertex;
+  if (!aVertex) {
+    aVertex = GeomVertexPtr(new GeomAPI_Vertex);
     aVertex->setImpl(new TopoDS_Vertex());
-    theV1 = aVertex;
-    theV2 = aVertex;
-    return;
   }
 
-  const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
-  TopoDS_Vertex aV1, aV2;
-  ShapeAnalysis::FindBounds(aShape, aV1, aV2);
-
-  std::shared_ptr<GeomAPI_Vertex> aGeomV1(new GeomAPI_Vertex()), aGeomV2(new GeomAPI_Vertex());
-  aGeomV1->setImpl(new TopoDS_Vertex(aV1));
-  aGeomV2->setImpl(new TopoDS_Vertex(aV2));
-  theV1 = aGeomV1;
-  theV2 = aGeomV2;
+  theV1 = aVertex;
+  theV2 = aVertex;
+
+  if (theShape) {
+    const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
+    TopoDS_Vertex aV1, aV2;
+    ShapeAnalysis::FindBounds(aShape, aV1, aV2);
+
+    std::shared_ptr<GeomAPI_Vertex> aGeomV1(new GeomAPI_Vertex()), aGeomV2(new GeomAPI_Vertex());
+    aGeomV1->setImpl(new TopoDS_Vertex(aV1));
+    aGeomV2->setImpl(new TopoDS_Vertex(aV2));
+    theV1 = aGeomV1;
+    theV2 = aGeomV2;
+  }
 }
 
 //==================================================================================================
@@ -997,6 +997,7 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::findShape(
 }
 
 //==================================================================================================
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
 std::shared_ptr<GeomAPI_Dir> GeomAlgoAPI_ShapeTools::buildDirFromAxisAndShape(
                                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                                     const std::shared_ptr<GeomAPI_Ax1> theAxis)
@@ -1012,6 +1013,7 @@ std::shared_ptr<GeomAPI_Dir> GeomAlgoAPI_ShapeTools::buildDirFromAxisAndShape(
                                                     aCentreOfMassPoint.Z()-aPoint.Z()));
   return aDir;
 }
+#endif
 
 //==================================================================================================
 static TopoDS_Wire fixParametricGaps(const TopoDS_Wire& theWire)
index af2a81f5c3e1580ecb5ccfb6fac7a98a6dcfb439..4127ccf2cd7261b6acd0e892faac8f362ef7e0a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_ShapeTools_H_
@@ -52,7 +51,7 @@ public:
   /// \return the total area of the faces of the current shape or 0.0 if it can be computed.
   GEOMALGOAPI_EXPORT static double area(const std::shared_ptr<GeomAPI_Shape> theShape);
 
-  /// \return the centre of mass of the current face.
+  /// \return the center of mass of the current face.
   /// The coordinates returned for the center of mass
   /// are expressed in the absolute Cartesian coordinate system.
   /// (This function works only for surfaces).
@@ -70,13 +69,10 @@ public:
   /// \brief Combines faces with common edges to shells, or solids to compsolids.
   /// \param[in] theCompound compound of shapes.
   /// \param[in] theType type of combine.
-  /// \param[out] theCombinedShapes resulting shapes.
-  /// \param[out] theFreeShapes shapes that does not have common subshapes.
+  /// \param[out] theResults resulting shapes.
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> combineShapes(
     const std::shared_ptr<GeomAPI_Shape> theCompound,
-    const GeomAPI_Shape::ShapeType theType,
-    ListOfShape& theCombinedShapes,
-    ListOfShape& theFreeShapes);
+    const GeomAPI_Shape::ShapeType theType, ListOfShape& theResults);
 
   /// \brief Groups shapes with shared topology to compounds.
   /// \param[in] theCompound compound of shapes.
@@ -92,14 +88,10 @@ public:
     std::list<std::shared_ptr<GeomAPI_Pnt> > getBoundingBox(const ListOfShape& theShapes,
                                                             const double theEnlarge = 0.0);
 
-  /// \return infinite plane received from theFace plane.
-  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape>
-    faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace);
-
   /// \brief Enlarges or reduces plane to fit bounding box.
   /// \return plane that fits to bounding box.
   /// \param[in] thePlane base plane.
-  /// \param[in] thePoints bounding box points (shoud be eight).
+  /// \param[in] thePoints bounding box points (should be eight).
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Face> fitPlaneToBox(
     const std::shared_ptr<GeomAPI_Shape> thePlane,
     const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints);
@@ -124,10 +116,10 @@ public:
 
   /// \brief Return a plane for list of shapes if they are all planar.
   /// \param[in] theShapes shapes to find plane.
-  /// \return plane where all shapes lie or empty ptr if they not planar.
+  /// \return plane where all shapes lie or empty pointer if they not planar.
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Pln> findPlane(const ListOfShape& theShapes);
 
-  /// \brief Checks that vertex/edge is inside face or vertext inside wire.
+  /// \brief Checks that vertex/edge is inside face or vertex inside wire.
   /// \param[in] theSubShape shape that should be inside.
   /// \param[in] theBaseShape base shape.
   /// \return true if edge inside the face.
@@ -157,7 +149,7 @@ public:
                    std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
                              std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
   /// \brief Performs the split of the shape by points.
-  /// \param[in] theBaseShape shape that should be splitted.
+  /// \param[in] theBaseShape shape that should be divided.
   /// \param[in] thePoints container of points to split
   /// \param[out] theShapes container of shapes after split
   GEOMALGOAPI_EXPORT static void splitShape(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
@@ -165,7 +157,7 @@ public:
                                       std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
   /// \brief Performs the split of the shape by points.
-  /// \param[in] theBaseShape shape that should be splitted.
+  /// \param[in] theBaseShape shape that should be divided.
   /// \param[in] thePoints container of points to split
   /// \param[out] theShapes container of shapes after split
   GEOMALGOAPI_EXPORT static void splitShape_p(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
@@ -176,15 +168,17 @@ public:
                                     const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
                                     const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
-  /// \brief Returns a dir from a shape and an axis.
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+  /// \brief Returns a direction from a shape and an axis.
   /// \param[in] theBaseShape shape whose center of mass serves as the starting point of the dir.
   /// \param[in] theAxis axis that serves as a direction for the dir
   /// \return dir that builds from center of mass of the base shape and the axis
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Dir> buildDirFromAxisAndShape(
                                     const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                                     const std::shared_ptr<GeomAPI_Ax1> theAxis);
+#endif
 
-  /// \brief Reapproximate a wire to build a single edge
+  /// \brief Re-approximate a wire to build a single edge
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Edge> wireToEdge(
       const std::shared_ptr<GeomAPI_Wire>& theWire);
 
index ce3f7c82e6231e754610a8916f61cae427f1f21a..c193b3a8315d4c50cd708f8a903eb4fb05438c53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_SketchBuilder.h>
 #include <GeomAPI_PlanarEdges.h>
 
+#include <GeomAPI_Pln.h>
+
 #include <BOPAlgo_Builder.hxx>
 #include <BRep_Builder.hxx>
 #include <BRepTools_WireExplorer.hxx>
@@ -199,14 +200,15 @@ static void sortFaces(TopTools_ListOfShape& theAreas,
   }
 }
 
-void GeomAlgoAPI_SketchBuilder::createFaces(
+void GeomAlgoAPI_SketchBuilder::build(
     const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
     const std::shared_ptr<GeomAPI_Dir>& theDirX,
     const std::shared_ptr<GeomAPI_Dir>& theNorm,
-    const std::list<std::shared_ptr<GeomAPI_Shape> >& theFeatures,
-    std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces)
+    const std::list<std::shared_ptr<GeomAPI_Shape> >& theEdges)
 {
-  if (theFeatures.empty())
+  myResultFaces.clear();
+  setDone(false);
+  if (theEdges.empty())
     return;
 
   BRep_Builder aBuilder;
@@ -216,24 +218,31 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
   aBuilder.MakeFace(aPlnFace, aPlane, Precision::Confusion());
 
   // Use General Fuse algorithm to prepare all subfaces, bounded by given list of edges
-  BOPAlgo_Builder aBB;
-  aBB.AddArgument(aPlnFace);
+  BOPAlgo_Builder* aBB = new BOPAlgo_Builder;
+  aBB->AddArgument(aPlnFace);
+
+  setImpl(aBB);
+  setBuilderType(OCCT_BOPAlgo_Builder);
 
   NCollection_List<TopoDS_Shape> anEdges;
   NCollection_List<TopoDS_Shape>::Iterator aShapeIt;
-  std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator aFeatIt = theFeatures.begin();
-  for (; aFeatIt != theFeatures.end(); aFeatIt++) {
+  std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator aFeatIt = theEdges.begin();
+  for (; aFeatIt != theEdges.end(); aFeatIt++) {
     std::shared_ptr<GeomAPI_Shape> aShape(*aFeatIt);
     const TopoDS_Edge& anEdge = aShape->impl<TopoDS_Edge>();
     if (anEdge.ShapeType() == TopAbs_EDGE)
-      aBB.AddArgument(anEdge);
+      aBB->AddArgument(anEdge);
   }
-  aBB.Perform();
-  if (aBB.HasErrors())
+  aBB->Perform();
+  if (aBB->HasErrors())
     return;
+
+  TopoDS_Compound aResult;
+  aBuilder.MakeCompound(aResult);
+
   // Collect faces
-  TopTools_ListOfShape anAreas = aBB.Modified(aPlnFace);
-  sortFaces(anAreas, theFeatures); // sort faces by the edges in them
+  TopTools_ListOfShape anAreas = aBB->Modified(aPlnFace);
+  sortFaces(anAreas, theEdges); // sort faces by the edges in them
   TopTools_ListIteratorOfListOfShape anIt(anAreas);
   for (; anIt.More(); anIt.Next()) {
     TopoDS_Face aFace = TopoDS::Face(anIt.Value());
@@ -253,7 +262,7 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
 
       // to make faces equal on different platforms, we will find
       // a vertex lying on an edge with the lowest index in the list of initial edges
-      TopoDS_Vertex aStartVertex = findStartVertex(aWire, aFace, theFeatures);
+      TopoDS_Vertex aStartVertex = findStartVertex(aWire, aFace, theEdges);
 
       TopoDS_Wire aNewWire;
       aBuilder.MakeWire(aNewWire);
@@ -289,30 +298,43 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
     }
 
     // store face
-    aFace = aNewFace;
+    aBuilder.Add(aResult, aNewFace);
     std::shared_ptr<GeomAPI_Shape> aResFace(new GeomAPI_Shape);
-    aResFace->setImpl(new TopoDS_Face(aFace));
-    theResultFaces.push_back(aResFace);
+    aResFace->setImpl(new TopoDS_Face(aNewFace));
+    myResultFaces.push_back(aResFace);
   }
+
+  // update results
+  GeomShapePtr aResShape(new GeomAPI_Shape);
+  aResShape->setImpl(new TopoDS_Shape(aResult));
+  setShape(aResShape);
+  setDone(true);
 }
 
-void GeomAlgoAPI_SketchBuilder::createFaces(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
-                                            const std::shared_ptr<GeomAPI_Dir>& theDirX,
-                                            const std::shared_ptr<GeomAPI_Dir>& theNorm,
-                                            const std::shared_ptr<GeomAPI_Shape>& theWire,
-                                std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces)
+GeomAlgoAPI_SketchBuilder::GeomAlgoAPI_SketchBuilder(
+  const std::shared_ptr<GeomAPI_Pln>& thePlane,
+  const std::list<std::shared_ptr<GeomAPI_Shape> >& theEdges)
+{
+  build(thePlane->location(), thePlane->xDirection(), thePlane->direction(), theEdges);
+}
+
+GeomAlgoAPI_SketchBuilder::GeomAlgoAPI_SketchBuilder(
+    const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
+    const std::shared_ptr<GeomAPI_Dir>& theDirX,
+    const std::shared_ptr<GeomAPI_Dir>& theNorm,
+    const std::shared_ptr<GeomAPI_Shape>& theWire)
 {
   std::shared_ptr<GeomAPI_PlanarEdges> aWire =
     std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(theWire);
   if(aWire) {
     // Filter wires, return only faces.
-    createFaces(theOrigin, theDirX, theNorm, aWire->getEdges(), theResultFaces);
+    build(theOrigin, theDirX, theNorm, aWire->getEdges());
   } else { // it may be only one circle
     std::shared_ptr<GeomAPI_Edge> anEdge = std::dynamic_pointer_cast<GeomAPI_Edge>(theWire);
     if (anEdge) {
       std::list<std::shared_ptr<GeomAPI_Shape> > aList;
       aList.push_back(anEdge);
-      createFaces(theOrigin, theDirX, theNorm, aList, theResultFaces);
+      build(theOrigin, theDirX, theNorm, aList);
     }
   }
 }
index 9fcaec2c3c839a7767190a2bde7a42abbc0fc1fe..fe29d89be27d1190411e5381b2c14907fb6f3e39 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_SketchBuilder_H_
 #define GeomAlgoAPI_SketchBuilder_H_
 
 #include <GeomAlgoAPI.h>
+#include <GeomAlgoAPI_MakeShape.h>
 
 #include <memory>
 #include <list>
 
-#include <GeomAPI_Dir.h>
-#include <GeomAPI_Pnt.h>
-#include <GeomAPI_Shape.h>
+class GeomAPI_Dir;
+class GeomAPI_Pln;
+class GeomAPI_Pnt;
+class GeomAPI_Shape;
 
 /** \class GeomAlgoAPI_SketchBuilder
  *  \ingroup DataAlgo
  *  \brief Creates planar faces based on the list of Sketch features
  */
-class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder
+class GeomAlgoAPI_SketchBuilder : public GeomAlgoAPI_MakeShape
 {
- public:
-  /** \brief Creates list of faces based on the features of the sketch
-   *  \param[in]  theOrigin      origin point of the sketch
-   *  \param[in]  theDirX        x-direction of the sketch
-   *  \param[in]  theNorm        normal of the sketch
-   *  \param[in]  theFeatures    initial features of the sketch
-   *  \param[out] theResultFaces faces based on closed wires
+public:
+  /** \brief Creates list of faces based on the edges of the sketch
+   *  \param[in]  thePlane  plane of the sketch
+   *  \param[in]  theEdges  initial edges of the sketch
    *
    *  The algorithm searches all loops of edges surrounding lesser areas.
    */
-  static void createFaces(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
-                          const std::shared_ptr<GeomAPI_Dir>& theDirX,
-                          const std::shared_ptr<GeomAPI_Dir>& theNorm,
-                          const std::list<std::shared_ptr<GeomAPI_Shape> >& theFeatures,
-                          std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces);
+  GEOMALGOAPI_EXPORT
+  GeomAlgoAPI_SketchBuilder(const std::shared_ptr<GeomAPI_Pln>& thePlane,
+                            const std::list<std::shared_ptr<GeomAPI_Shape> >& theEdges);
 
   /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
    *  \param[in]  theOrigin      origin point of the sketch
    *  \param[in]  theDirX        x-direction of the sketch
    *  \param[in]  theNorm        normal of the sketch
    *  \param[in]  theWire        a wire which contains all edges
-   *  \param[out] theResultFaces faces based on closed wires
    *
    *  The algorithm searches all loops of edges surrounding lesser areas.
    */
-  static void createFaces(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
-                          const std::shared_ptr<GeomAPI_Dir>& theDirX,
-                          const std::shared_ptr<GeomAPI_Dir>& theNorm,
-                          const std::shared_ptr<GeomAPI_Shape>& theWire,
-                          std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces);
+  GEOMALGOAPI_EXPORT
+  GeomAlgoAPI_SketchBuilder(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
+                            const std::shared_ptr<GeomAPI_Dir>& theDirX,
+                            const std::shared_ptr<GeomAPI_Dir>& theNorm,
+                            const std::shared_ptr<GeomAPI_Shape>& theWire);
+
+  /// Return list of created faces
+  GEOMALGOAPI_EXPORT const std::list<std::shared_ptr<GeomAPI_Shape> >& faces() const
+  { return myResultFaces; }
+
+private:
+  void build(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
+             const std::shared_ptr<GeomAPI_Dir>& theDirX,
+             const std::shared_ptr<GeomAPI_Dir>& theNorm,
+             const std::list<std::shared_ptr<GeomAPI_Shape> >& theEdges);
+
+private:
+  std::list<std::shared_ptr<GeomAPI_Shape> > myResultFaces;
 };
 
 #endif
index 80cd5e2cce57bdb496a967c5ce168f151e3655fd..6fb16bc23003ffd1afc01853a816d24fc21f091c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_SortListOfShapes.h"
index 0159b81fc1c45bf5090da4174fb0d8a4ea7be0d2..b2efd5b6d0eb3d780771819dae526b9468f9d63c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_SortListOfShapes_H_
index b2642c94cfbc2b27810f47d251ece8995f856788..d307fe54e649718a70f01d8d61f1dc14586d4f7c 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Sphere.h
 // Created:     16 Mar 2017
@@ -8,11 +25,6 @@
 
 #include <BRepPrimAPI_MakeSphere.hxx>
 
-//=================================================================================================
-GeomAlgoAPI_Sphere::GeomAlgoAPI_Sphere()
-{
-}
-
 //=================================================================================================
 GeomAlgoAPI_Sphere::GeomAlgoAPI_Sphere(std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
                                        const double theRadius)
index f317a26eeef980c37d011f89ffc3f314f4f03c8a..fe3b3d4e5d66053cb9bcf05be70deb776f420b0a 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Sphere.h
 // Created:     16 Mar 2017
@@ -18,8 +35,6 @@
 class GeomAlgoAPI_Sphere : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Sphere();
-
   /// Creates a sphere.
   /// \param theCenterPoint The center point of the sphere
   /// \param theRadius The radius of the sphere
index dbbecc9a7b44516071eedcaa5133dff1fc4bf5d7..3497664ff7ca189fd5301149a9a2807c619eac0f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Symmetry.h"
index 119386db244480d701e61ab329f4fd04cdc2ea2c..f0f33aa90bc16722d7e8fba4fbd0b77c206c523a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_SYMMETRY_H_
index 5a893f50b218d813a3530f39685d26f19ce924ed..9f7f5ec7848bf162c2355050222202457f16e86d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Tools.h"
+#include "GeomAlgoAPI_MakeShape.h"
 
 #include <clocale>
 
@@ -58,3 +58,32 @@ std::string File_Tools::name(const std::string& theFileName)
   OSD_Path aPath(aFileName);
   return aPath.Name().ToCString();
 }
+
+bool AlgoError::isAlgorithmFailed(const GeomMakeShapePtr& theAlgorithm,
+                                  const std::string& theFeature,
+                                  std::string& theError)
+{
+  theError.clear();
+  if (!theAlgorithm->isDone()) {
+    theError = "Error: " + (theFeature.empty() ? "The" : theFeature) + " algorithm failed.";
+    std::string anAlgoError = theAlgorithm->getError();
+    if (!anAlgoError.empty())
+      theError += " " + anAlgoError;
+    return true;
+  }
+  if (!theAlgorithm->shape() || theAlgorithm->shape()->isNull()) {
+    theError = "Error: Resulting shape";
+    if (!theFeature.empty())
+      theError += "of " + theFeature;
+    theError += " is Null.";
+    return true;
+  }
+  if (!theAlgorithm->isValid()) {
+    theError = "Error: Resulting shape";
+    if (!theFeature.empty())
+      theError += "of " + theFeature;
+    theError += " is not valid.";
+    return true;
+  }
+  return false;
+}
index f17efdc3b735b1040812bb1872adab95d602ebb2..2cb26c75b8c532ae85288392836e00ad6bb3aafa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_TOOLS_H_
 
 #include <GeomAlgoAPI.h>
 
+#include <memory>
 #include <string>
 
+class GeomAlgoAPI_MakeShape;
+
 namespace GeomAlgoAPI_Tools {
 
 /** \class Localizer
@@ -56,6 +58,24 @@ public:
   GEOMALGOAPI_EXPORT static std::string name(const std::string& theFileName);
 };
 
+/** \class AlgoError
+ *  \ingroup DataAlgo
+ *  \brief Verify error in MakeShape algorithm.
+ */
+class AlgoError {
+public:
+  /** \brief Verify MakeShape algorithm for failures
+   *  \param[in]  theAlgorithm object to verify the failure
+   *  \param[in]  theFeature   kind of the feature, the algorithm belongs to
+   *  \param[out] theError     error string (empty if the feature succeed)
+   *  \return \c true if succeed
+   */
+  GEOMALGOAPI_EXPORT static bool isAlgorithmFailed(
+      const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm,
+      const std::string& theFeature,
+      std::string& theError);
+};
+
 } // GeomAlgoAPI_Tools
 
 #endif /* GEOMALGOAPI_TOOLS_H_ */
index 3bc0653d8487162c057f32e4d1e1ab1783b23794..09c57ac786a7186da51e75d99b7894ab04c7651a 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Torus.cpp
 // Created:     20 Mar 2017
 
 #include <BRepPrimAPI_MakeTorus.hxx>
 
-//=================================================================================================
-GeomAlgoAPI_Torus::GeomAlgoAPI_Torus()
-{
-}
-
 //=================================================================================================
 GeomAlgoAPI_Torus::GeomAlgoAPI_Torus(std::shared_ptr<GeomAPI_Ax2> theAxis,
                                      const double theRadius,
@@ -75,4 +87,4 @@ void GeomAlgoAPI_Torus::build()
   setImpl(aTorusMaker);
 
   setDone(true);
-}
\ No newline at end of file
+}
index 10f66f53ecabb3513d0ad93fba371e65d791664e..0c25d8e398acf4e4834011045ace4e165c156b30 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        GeomAlgoAPI_Torus.h
 // Created:     20 Mar 2017
@@ -18,8 +35,6 @@
 class GeomAlgoAPI_Torus : public GeomAlgoAPI_MakeShape
 {
  public:
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Torus();
-
   /// Creates a torus.
   /// \param theAxis The axis of the torus
   /// \param theRadius The radius of the torus
@@ -40,4 +55,4 @@ class GeomAlgoAPI_Torus : public GeomAlgoAPI_MakeShape
   double myRingRadius; /// Ring radius of the torus.
 };
 
-#endif // GEOMALGOAPI_TORUS_H_
\ No newline at end of file
+#endif // GEOMALGOAPI_TORUS_H_
index 0b6db67e06ea449911c079a6ec5a9ad08c8b651c..8ef306ef658b072f49ade9a72ae390f2a0603024 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Transform.h"
index b941298ae39ae96a1e5f077695bda86aac7135c8..cb5382d48a54e4157f5bd147e68d19313e58fab1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Transform_H_
index f2b58b1a03367cdf188c5a219b6b124ee99c3434..b73713a8b52c6b1bf70f4edc435b6238a33ef7a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_Translation.h"
index dc5bf46f22691b463479ef545826002b0eec29d4..f7b3be95e627a2dcbe0eb621d9550a2075829c90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_Translation_H_
index ee9c6fecac07a7e1f67ee24b67edc6119ebdb8bf..c33177b73d961182d402d189ed6032270f9c3203 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_UnifySameDomain.h"
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS_Shape.hxx>
+#include <Precision.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
 
 //==================================================================================================
 GeomAlgoAPI_UnifySameDomain::GeomAlgoAPI_UnifySameDomain(const ListOfShape& theShapes)
@@ -48,24 +52,50 @@ void GeomAlgoAPI_UnifySameDomain::build(const ListOfShape& theShapes)
 
   // Make compound.
   GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(theShapes);
-  ListOfShape aCombined, aFree;
+  ListOfShape aResults;
   GeomAlgoAPI_ShapeTools::combineShapes(
     aCompound,
     GeomAPI_Shape::SHELL,
-    aCombined,
-    aFree);
+    aResults);
 
-  if(aFree.size() > 0 || aCombined.size() > 1) {
+  if(aResults.size() > 1 ||
+     (aResults.size() == 1 && aResults.front()->shapeType() > GeomAPI_Shape::SHELL)) {
     return;
   }
 
-  const TopoDS_Shape& aShell = aCombined.front()->impl<TopoDS_Shape>();
+  const TopoDS_Shape& aShell = aResults.front()->impl<TopoDS_Shape>();
 
   std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
   aShape->setImpl(new TopoDS_Shape(aShell));
   build(aShape, true);
 }
 
+// calculates maximum possible tolerance on edges of shape
+// (method from GEOM module BlockFix_UnionFaces.cxx)
+static Standard_Real defineLinearTolerance(const TopoDS_Shape& theShape)
+{
+  Standard_Real aTol = Precision::Confusion();
+
+  Standard_Real MinSize = RealLast();
+  TopExp_Explorer Explo(theShape, TopAbs_EDGE);
+  for (; Explo.More(); Explo.Next())
+  {
+    const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
+    Bnd_Box aBox;
+    BRepBndLib::Add(anEdge, aBox);
+    Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax;
+    aBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
+    Standard_Real MaxSize = Max(Xmax - Xmin, Max(Ymax - Ymin, Zmax - Zmin));
+    if (MaxSize < MinSize)
+      MinSize = MaxSize;
+  }
+
+  if (!Precision::IsInfinite(MinSize))
+    aTol = 0.1 * MinSize;
+
+  return aTol;
+}
+
 //==================================================================================================
 void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape,
                                         const bool theIsToSimplifyShell)
@@ -75,6 +105,8 @@ void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape,
 
   const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
   aUnifyAlgo->Initialize(aShape);
+  aUnifyAlgo->SetLinearTolerance(defineLinearTolerance(aShape));
+  aUnifyAlgo->SetAngularTolerance(1.e-6); // for #2697
   aUnifyAlgo->Build();
 
   TopoDS_Shape aResult = aUnifyAlgo->Shape();
@@ -113,6 +145,8 @@ void GeomAlgoAPI_UnifySameDomain::modified(const std::shared_ptr<GeomAPI_Shape>
   const ShapeUpgrade_UnifySameDomain& aUnifyAlgo = this->impl<ShapeUpgrade_UnifySameDomain>();
 
   for (int aIsModified = 0; aIsModified <= 1; aIsModified++) {
+    if (!aUnifyAlgo.History()->IsSupportedType(aShape)) // to avoid crash in BRepTools_History
+      continue;
     const TopTools_ListOfShape& aMList = aIsModified ?
       aUnifyAlgo.History()->Modified(aShape) : aUnifyAlgo.History()->Generated(aShape);
     for (TopTools_ListIteratorOfListOfShape aModified(aMList); aModified.More(); aModified.Next()) {
index 1b70f43a2f41e8840f1e3b7c408aa2adb1470762..471fc79ab80bbea14d2b2294239339d93989e819 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_UnifySameDomain_H_
index f342ccdef0386d1c104975ad780397709dc16ead..00c1e79d1e91119604b75a4f495e7127820e7f4c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAlgoAPI_WireBuilder.h"
index 9d204ade706018e8c3b52733b44961095416941c..8de0888e6ef25b08cea25c0fa0570c6778ad200d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomAlgoAPI_WireBuilder_H_
index da570238bb852736a83f63936eaf7693eb442404..22abe96f8768d12b2911a9d1c20898b3760b75f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_XAOExport.h>
index 66c8e3b0865601d226b897aedd92c04669844030..0ec9a689acd8ab384937e92f718145e44703f412 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_XAOEXPORT_H_
index a7dbe399635937e53fc588019ca6e23dd86c210c..4303861eefb6885cad5ef291860ba50480addae2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAlgoAPI_XAOImport.h>
index 4935f592d5bf48555644a327b858a1a69a279bea..d0407718691ca0e462d4076600f8e844f21bf2de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOAPI_XAOIMPORT_H_
index 8c9a49d70e7ad0005d844b70899cd7f5c88aa991..91970e2ec4ebed95d7c5bcd51967b48a57677f56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_
@@ -26,7 +25,9 @@
   #include "GeomAlgoAPI.h"
   #include "GeomAlgoAPI_MakeShape.h"
   #include "GeomAlgoAPI_Boolean.h"
+  #include "GeomAlgoAPI_Circ2dBuilder.h"
   #include "GeomAlgoAPI_CompoundBuilder.h"
+  #include "GeomAlgoAPI_CurveBuilder.h"
   #include "GeomAlgoAPI_DFLoader.h"
   #include "GeomAlgoAPI_EdgeBuilder.h"
   #include "GeomAlgoAPI_FaceBuilder.h"
index ee09836524c4c132d387972f1c33dc4fb2ff6951..7a7da432be01843ba4f29216300a6563f42527ec 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 
old mode 100755 (executable)
new mode 100644 (file)
index 0bdebe8..094a682
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index a698781e9d9505bb0e3073c47fc746301f7184f0..58020b2b1ed6ec3b119faf62d8a2f9b16a508393 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index de1abec98b7abaa10079d02407cb8329d8cdc359..4d2b37e8675acd7b50539b81aa02ec0e300d154d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMALGOIMPL_H
index ee4251e4bc8fd2eb79933ef9a54811c193829a8b..d6ef692308a1190888a64974b3f053528bf820f4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index ea34303bb2825d46f13393f308267e589a1415e7..37f49d67db9c8284db61e6462d9a374252c56514 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMDATA_H
index 8279b611db632297a2de5ec7f2f81639444ae5d1..d03030e359c845a8f83594f45ff13137bde423ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomData_Dir.h"
index 62b229c611a678ab405a144980458cde3a1a9d77..1cc7f2ff92a0887c99e691ec294f50ceefdeb38c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomData_Dir_H_
index 47d6c70ba5cb062a95567c4f453f597e612660b9..0d1ff198f41dec8874ff0705fb052862a75c88a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomData_Point.h"
index dbb6baf4510285fbeae520e2284a995a152670f7..cbd9d5f84b81537bb67966e0201aceec34215d19 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomData_Point_H_
index 3fbd659d11ef7e734fd773525b86e99f886fb42d..d2a00bf5a873a085601fc494780119cf1ca42c98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomData_Point2D.h"
index f72a067d0aaf4bcd45577538ef28abd4efcd5b4d..0bc2bbcac2d78d72c322290e1d3b147324c778c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomData_Point2D_H_
index f22839d32ed01989d9b8863627ab528b3afe6c19..fe7c87d8c868d0fbd48471b21b4954cb8668d22e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
index 41c35179cfe2f049502cdbf7e91696c24f6cd3c4..d02441ffd5579272fc72026105da80050ac350cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMDATAAPI_H
index e46422fc49d1b95f6e6f50249a030dfe3a3983d3..3fd23f6c8a11db58ea4ae7ec33a7e287f1a3fd3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* GeomDataAPI.i */
index a9086c98bd010bc3648e225496764b519d42360b..7efe0fdf774f89b4e181335c8cf128107d966cbf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomDataAPI_Dir.h>
index 05a1879f092a1dc62c0892da27315954eca54518..8fdcecd162b0aa4043070b5560799ae2a9759e45 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomDataAPI_Dir_H_
index 430ef71656cbb0914e7befe1b28239dfcf47a91f..84e539d38f4cce1f67d999b01d99b2f7e42ee043 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomDataAPI_Point.h>
index d47e3048d6aead1f5d29553e27a698353bcd57d2..e679bc9de835851cb7db9e4b0fc8fecebee9653e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomDataAPI_Point_H_
index 45b2c51eb808731c08b95610bd81540884f8cacb..9faf3870dd745b022280ef11619092df784f9490 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomDataAPI_Point2D.h>
index adb1f5320ebf8945cd2c7ccd763ecfad683ecd63..16a5ee58d0165d75f6ce4e901269570aa1516f0f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomDataAPI_Point2D_H_
index 9b91dd561ae5afba7602b0145163fd1bd02e68b6..df13808e459934ca4cd9946a2f4a2d5442492a43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_GEOMDATAAPI_GEOMDATAAPI_SWIG_H_
index 868a40c619de54de238179b18b2e11d84fa98281..af0d2cd6a5d302e0df1e31c4af010138e7e90621 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #===============================================================================
 # Test GeomDataAPI static methods
index 85527474ee0c0ee69d3903a1a19228be3331a348..18e5c437c1cd10d24fbde0d7dc9328af5d1a9b8c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
@@ -28,7 +27,6 @@ SET(PROJECT_HEADERS
     GeomValidators_Face.h
     GeomValidators_FeatureKind.h
     GeomValidators_Finite.h
-    GeomValidators_PartitionArguments.h
     GeomValidators_Plugin.h
     GeomValidators_Positive.h
     GeomValidators_ShapeType.h
@@ -48,7 +46,6 @@ SET(PROJECT_SOURCES
     GeomValidators_Face.cpp
     GeomValidators_FeatureKind.cpp
     GeomValidators_Finite.cpp
-    GeomValidators_PartitionArguments.cpp
     GeomValidators_Plugin.cpp
     GeomValidators_Positive.cpp
     GeomValidators_ShapeType.cpp
index b9c6559051bff0955833b38243254e2e2e3014bd..0d50ec6f2d5987b411c340b51dbdd3e40aeed107 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMVALIDATORS_H
index ff040cecb1c5e1965e47445620e8d830e2182605..b00864d4d7851f00d74851041d68dbb79b0162a9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_BodyShapes.h"
@@ -82,9 +81,11 @@ bool GeomValidators_BodyShapes::isValid(const AttributePtr& theAttribute,
       }
     }
   } else {
+// LCOV_EXCL_START
     theError = "Error: Attribute \"%1\" does not supported by this validator.";
     theError.arg(anAttributeType);
     return false;
+// LCOV_EXCL_STOP
   }
 
   return true;
index ca76bd19ff23ab117e5316d3c1a5f94753f0ecc7..6bc48ae12eecb762c04704cedc2f202d644807fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_BodyShapes_H
index c065b0eb8b92a12e0c4d45fc46e5cfa633b4decd..09ac33386f428c37c98c6ab90ddf8780b42c3b56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_ConstructionComposite.h"
@@ -32,10 +31,12 @@ bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttrib
 {
   bool aValid = true;
   if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
     aValid = false;
     theError = "The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return aValid;
+// LCOV_EXCL_STOP
   }
 
   AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
index c3ba7ab24fc41a084cd03d33212e6a409cd41c1a..8f652a5253862bf8a5f043fa56ffc9e602f80d7f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_ConstructionComposite_H
index 012727330302dd2b15c738064a3611e8369c6835..f179190f7bc2344e479bf884f14859612065682e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomValidators_Different.h>
@@ -109,7 +108,9 @@ bool GeomValidators_Different::isValid(const std::shared_ptr<ModelAPI_Feature>&
   return true;
 }
 
+// LCOV_EXCL_START
 bool GeomValidators_Different::isNotObligatory(std::string theFeature, std::string theAttribute)
 {
   return true;
 }
+// LCOV_EXCL_STOP
index a75059ad47ada4fa81da9281855079d5a3836703..350e7ff9bc8c01db86e6d23078bf44b9d305260f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_Different_H
index 69a981be699f7741b1e34a6091e1d5dc344c0afb..58f6892dfe705d0f5215562c3075abe4f26a2d1f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_DifferentShapes.h"
@@ -171,5 +170,7 @@ bool GeomValidators_DifferentShapes::isAttrShapesEqual(const AttributePtr& theAt
   }
   GeomShapePtr aOtherTypedShape = GeomAPI_Tools::getTypedShape(anOtherShape);
 
+  if (!aTypedShape.get())
+    return !aTypedShape.get() && !aOtherTypedShape.get();
   return aTypedShape->isEqual(aOtherTypedShape);
-}
\ No newline at end of file
+}
index f1d826cc4430c7c3ff78f23fc91caae369462439..f5647dfb9a06de3e5b8ff2fe1cd19465053b219b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_DifferentShapes_H
index 945f9bc34d306c14beda27425213d5b0cadb4100..82d0f476e915d8330ea0b430b6cdd4bd579a2de5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_Face.h"
@@ -24,6 +23,7 @@
 #include "ModelAPI_AttributeSelection.h"
 
 #include <GeomAPI_Face.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAbs_SurfaceType.hxx>
 
@@ -42,8 +42,44 @@ GeomAbs_SurfaceType faceType(const std::string& theType)
   if (MyFaceTypes.find(aType) != MyFaceTypes.end())
     return MyFaceTypes[aType];
 
+// LCOV_EXCL_START
   Events_InfoMessage("GeomValidators_Face", "Face type defined in XML is not implemented!").send();
   return GeomAbs_Plane;
+// LCOV_EXCL_STOP
+}
+
+bool isValidFace(const GeomShapePtr theShape,
+                 const GeomAbs_SurfaceType theFaceType,
+                 Events_InfoMessage& theError)
+{
+  GeomFacePtr aGeomFace = theShape->face();
+
+  if (!aGeomFace.get()) {
+    theError = "The shape is not a face.";
+      return false;
+  }
+
+  bool aValid = true;
+
+  switch (theFaceType) {
+    case GeomAbs_Plane: {
+      aValid = aGeomFace->isPlanar();
+      if (!aValid) theError = "The shape is not a plane.";
+      break;
+    }
+    case GeomAbs_Cylinder: {
+      aValid = aGeomFace->isCylindrical();
+      if (!aValid) theError = "The shape is not a cylinder.";
+      break;
+    }
+    default: {
+      aValid = false;
+      theError = "The shape is not an available face.";
+      break;
+    }
+  }
+
+  return aValid;
 }
 
 bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
@@ -52,9 +88,11 @@ bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
 {
   std::string anAttributeType = theAttribute->attributeType();
   if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
     theError = "The attribute with the %1 type is not processed";
     theError.arg(theAttribute->attributeType());
     return false;
+// LCOV_EXCL_STOP
   }
 
   bool aValid = true;
@@ -73,42 +111,21 @@ bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
     // it is necessary to check whether the shape is face in order to set in selection a value
     // with any type and check the type in this validator
     // It is realized to select any object in OB and filter it in this validator (sketch plane)
-    if (!aGeomShape->isFace()) {
-      aValid = false;
-      theError = "The shape is not a face.";
+    GeomAbs_SurfaceType aFaceType = GeomAbs_Plane;
+    if (theArguments.size() == 1)
+      aFaceType = faceType(theArguments.front());
+    if (aGeomShape->isFace()) {
+      aValid = isValidFace(aGeomShape, aFaceType, theError);
     }
-    else {
-      std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
-      if (!aGeomFace.get()) {
-        aValid = false;
-        theError = "The shape is not a face.";
-      }
-      else {
-        GeomAbs_SurfaceType aFaceType = GeomAbs_Plane;
-        if (theArguments.size() == 1)
-          aFaceType = faceType(theArguments.front());
-
-        switch (aFaceType) {
-          case GeomAbs_Plane: {
-            aValid = aGeomFace->isPlanar();
-            if (!aValid)
-              theError = "The shape is not a plane.";
-          }
-          break;
-          case GeomAbs_Cylinder:{
-            aValid = aGeomFace->isCylindrical();
-            if (!aValid)
-              theError = "The shape is not a cylinder.";
-          }
-          break;
-          default: {
-            aValid = false;
-            theError = "The shape is not an available face.";
-            break;
-          }
-        }
+    else if (aSelectionAttr->isGeometricalSelection() && aGeomShape->isCompound()) {
+      for (GeomAPI_ShapeIterator anIt(aGeomShape); anIt.more() && aValid; anIt.next()) {
+        aValid = isValidFace(anIt.current(), aFaceType, theError);
       }
     }
+    else {
+      aValid = false;
+      theError = "The shape is not a face.";
+    }
   }
   return aValid;
 }
index 26de82ea0d54ee3137e6add6b858caf195598e5d..8396adde3cd5e5f74a1b88310e2426273710577d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_Face_H
old mode 100755 (executable)
new mode 100644 (file)
index e25ef26..746e184
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_FeatureKind.h"
@@ -49,30 +48,6 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute,
   }
 
   std::string anAttributeType = theAttribute->attributeType();
-  if (anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
-    AttributeSelectionListPtr aSelectionListAttr =
-                      std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
-    // all context objects should be sketch entities
-    for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize && isSketchEntities; i++) {
-      AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
-      ObjectPtr anObject = aSelectAttr->context();
-      // a context of the selection attribute is a feature result. It can be a case when the result
-      // of the feature is null, e.g. the feature is modified and has not been executed yet.
-      // The validator returns an invalid result here. The case is an extrusion built on a sketch
-      // feature. A new sketch element creation leads to an empty result.
-      if (!anObject.get())
-        isSketchEntities = false;
-      else {
-        FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-        isSketchEntities = anEntityKinds.find(aFeature->getKind()) != anEntityKinds.end();
-#ifdef DEBUG_EXTRUSION_INVALID_SKETCH
-        CompositeFeaturePtr aComp = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
-        if (aComp.get() && aComp->numberOfSubs() == 1)
-          return false;
-#endif
-      }
-    }
-  }
   if (anAttributeType == ModelAPI_AttributeSelection::typeId()) {
     AttributeSelectionPtr aSelectAttr =
                       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
@@ -88,52 +63,6 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute,
       isSketchEntities = anEntityKinds.find(aFeature->getKind()) != anEntityKinds.end();
     }
   }
-  if (anAttributeType == ModelAPI_AttributeRefList::typeId()) {
-    AttributeRefListPtr aRefListAttr =
-      std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttribute);
-    // all context objects should be sketch entities
-    for (int i = 0, aSize = aRefListAttr->size(); i < aSize && isSketchEntities; i++) {
-      ObjectPtr anObject = aRefListAttr->object(i);
-      // a context of the selection attribute is a feature result. It can be a case when the result
-      // of the feature is null, e.g. the feature is modified and has not been executed yet.
-      // The validator returns an invalid result here. The case is an extrusion built on a sketch
-      // feature. A new sketch element creation leads to an empty result.
-      if (!anObject.get())
-        isSketchEntities = false;
-      else {
-        FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-        isSketchEntities = anEntityKinds.find(aFeature->getKind()) != anEntityKinds.end();
-      }
-    }
-  }
-  if (anAttributeType == ModelAPI_AttributeRefAttr::typeId()) {
-    std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-                     std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-    isSketchEntities = false;
-    if (aRef->isObject()) {
-      ObjectPtr anObject = aRef->object();
-      if (anObject.get() != NULL) {
-        FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-        if (aFeature.get() != NULL)
-          isSketchEntities = anEntityKinds.find(aFeature->getKind()) != anEntityKinds.end();
-      }
-    }
-  }
-  if (anAttributeType == ModelAPI_AttributeReference::typeId()) {
-    AttributeReferencePtr aRefAttr =
-                      std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
-    ObjectPtr anObject = aRefAttr->value();
-    // a context of the selection attribute is a feature result. It can be a case when the result
-    // of the feature is null, e.g. the feature is modified and has not been executed yet.
-    // The validator returns an invalid result here. The case is an extrusion built on a sketch
-    // feature. A new sketch element creation leads to an empty result.
-    if (!anObject.get())
-      isSketchEntities = false;
-    else {
-      FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-      isSketchEntities = anEntityKinds.find(aFeature->getKind()) != anEntityKinds.end();
-    }
-  }
   if (!isSketchEntities) {
     theError = "It refers to feature, which kind is not in the list: " + anEntityKindsStr;
   }
old mode 100755 (executable)
new mode 100644 (file)
index dde6902..558e57b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_FeatureKind_H
old mode 100755 (executable)
new mode 100644 (file)
index 6138cd9..3058751
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomValidators_Finite.h>
old mode 100755 (executable)
new mode 100644 (file)
index a5801b5..6cf2fd5
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_Finite_H
index aeef9bd120cabd10a572bfd7e7df22bae3c403be..7ec4bb130190f2918c99eefd2535e164f0069109 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_Intersected.h"
@@ -31,6 +30,7 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
                                          const std::list<std::string>& theArguments,
                                          Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (!theAttribute) {
     theError = "Error: empty selection.";
     return false;
@@ -40,6 +40,7 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
     theError = "Error: compare with nothing";
     return false;
   }
+// LCOV_EXCL_STOP
 
   FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
 
@@ -59,10 +60,12 @@ bool GeomValidators_Intersected::isValid(const AttributePtr& theAttribute,
   for (std::list<std::string>::const_iterator anIt = theArguments.begin();
        anIt != theArguments.end() && isOk; ++anIt) {
     aSelection = aFeature->selection(*anIt);
+// LCOV_EXCL_START
     if (!aSelection) {
       theError = "Error: incorrect type of attribute";
       return false;
     }
+// LCOV_EXCL_STOP
 
     GeomShapePtr aShape;
     if (aSelection)
index 18e831318d8d8eeae3f466af158e4717c02acd11..d540bfe8f6ad32ecbdd6586e83f0d91ffda091c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_Intersected_H
index fe437a01a8884929d87658487fbb0595ca876044..b539b8748355450bf20ae83bfaa028522e1076fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_IntersectionSelection.h"
index 8a7d171db46265395473cb69ce87cd13a9887850..56f93b2bfaf7763eb1223a4dd1b42f320807f10d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomValidators_MinObjectsSelected.h>
@@ -31,17 +30,21 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr<ModelAPI_F
                                                 Events_InfoMessage& theError) const
 {
   if(theArguments.size() != 2) {
+// LCOV_EXCL_START
     theError =
       "Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
     return false;
+// LCOV_EXCL_STOP
   }
 
   std::string aSelectionListId = theArguments.front();
   AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId);
   if(!anAttrSelList.get()) {
+// LCOV_EXCL_START
     theError = "Error: Could not get attribute \"%1\".";
     theError.arg(aSelectionListId);
     return false;
+// LCOV_EXCL_STOP
   }
   int anObjectsNb = anAttrSelList->size();
 
index a1146189f25ffa9c6192b051d0016a2514102c34..b5238af9cb44904cc4dfcc5a149b67bc6d734445 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_MinObjectsSelected_H
index aa017935d63ced7532dd32c0521f85cc9e0dde35..46981b8223edcd595fe659c3e2c186dbb0b7d9f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_NotSelfIntersected.h"
@@ -32,10 +31,12 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
                                                 const std::list<std::string>& theArguments,
                                                 Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.empty()) {
     theError = "Error: empty selection.";
     return false;
   }
+// LCOV_EXCL_STOP
 
   for (std::list<std::string>::const_iterator anIt = theArguments.cbegin();
        anIt != theArguments.cend();
@@ -44,8 +45,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
     std::string anArgument = *anIt;
     AttributePtr anAttribute = theFeature->attribute(anArgument);
     if (!anAttribute.get()) {
+// LCOV_EXCL_START
       theError = std::string("Error: Feature does not contain attribute: ") + anArgument;
       return false;
+// LCOV_EXCL_STOP
     }
     if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
       AttributeSelectionListPtr anAttrSelectionList =
@@ -53,8 +56,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
       for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
         AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
         if (!anAttrSelection.get()) {
+// LCOV_EXCL_START
           theError = "Error: Empty attribute selection.";
           return false;
+// LCOV_EXCL_STOP
         }
         ResultPtr aContext = anAttrSelection->context();
         if (!aContext.get()) {
@@ -80,17 +85,21 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
         }*/
       }
     } else {
+// LCOV_EXCL_START
       theError = std::string("Error: validator does not support attribute with type: ")
         + anAttribute->attributeType();
       return false;
+// LCOV_EXCL_STOP
     }
   }
 
   return true;
 }
 
+// LCOV_EXCL_START
 bool GeomValidators_NotSelfIntersected::isNotObligatory(std::string /*theFeature*/,
                                                         std::string /*theAttribute*/)
 {
   return false;
 }
+// LCOV_EXCL_STOP
index 1244389e219a0096ee852b51c69bb43ff5caa5c1..b569493ce1d02c8233203f3d9df739377ff883ef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_NotSelfIntersected_H
diff --git a/src/GeomValidators/GeomValidators_PartitionArguments.cpp b/src/GeomValidators/GeomValidators_PartitionArguments.cpp
deleted file mode 100644 (file)
index 0231eda..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-//
-// 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<mailto:webmaster.salome@opencascade.com>
-//
-
-#include <GeomValidators_PartitionArguments.h>
-
-#include <Events_InfoMessage.h>
-
-#include <ModelAPI_AttributeBoolean.h>
-#include <ModelAPI_AttributeSelectionList.h>
-
-//=================================================================================================
-bool GeomValidators_PartitionArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                              const std::list<std::string>& theArguments,
-                                              Events_InfoMessage& theError) const
-{
-  if(theArguments.size() != 3) {
-    theError = "Wrong number of arguments (expected 3).";
-    return false;
-  }
-
-  int anObjectsNb = 0, aToolsNb = 0;
-  bool isCombine = true;
-
-  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
-
-  std::shared_ptr<ModelAPI_AttributeSelectionList> anAttrSelList = theFeature->selectionList(*anIt);
-  if(anAttrSelList) {
-    anObjectsNb = anAttrSelList->size();
-  }
-  anIt++;
-
-  anAttrSelList = theFeature->selectionList(*anIt);
-  if(anAttrSelList) {
-    aToolsNb = anAttrSelList->size();
-  }
-  anIt++;
-
-  std::shared_ptr<ModelAPI_AttributeBoolean> anAttrBool = theFeature->boolean(*anIt);
-  if(anAttrBool) {
-    isCombine = anAttrBool->value();
-  }
-
-  if((anObjectsNb > 0 && aToolsNb > 0) ||
-     (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) {
-    return true;
-  }
-
-  theError = "Not enough arguments";
-  return false;
-}
-
-//=================================================================================================
-bool GeomValidators_PartitionArguments::isNotObligatory(std::string theFeature,
-                                                        std::string theAttribute)
-{
-  if(theAttribute == "tool_objects") {
-    return true;
-  }
-
-  return false;
-}
diff --git a/src/GeomValidators/GeomValidators_PartitionArguments.h b/src/GeomValidators/GeomValidators_PartitionArguments.h
deleted file mode 100644 (file)
index 8a8f072..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-//
-// 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<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef GeomValidators_PartitionArguments_H
-#define GeomValidators_PartitionArguments_H
-
-#include <GeomValidators.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_FeatureValidator.h>
-
-/** \class GeomValidators_PartitionArguments
- *  \ingroup Validators
- *  \brief Validates that partition operation have enough arguments.
- */
-class GeomValidators_PartitionArguments : public ModelAPI_FeatureValidator
-{
-public:
-  /** \brief Returns true if feature and/or attributes are valid.
-   *  \param[in] theFeature the validated feature.
-   *  \param[in] theArguments the arguments in the configuration file for this validator.
-   *  \param[out] theError error message.
-   *  \returns true if feature is valid.
-   */
-  GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                             const std::list<std::string>& theArguments,
-                                             Events_InfoMessage& theError) const;
-
-  /// \return true if the attribute in feature is not obligatory for the feature execution.
-  GEOMVALIDATORS_EXPORT virtual
-    bool isNotObligatory(std::string theFeature, std::string theAttribute);
-};
-
-#endif
index 733fc17bf384b193aec4fecd1c625be21f950a84..ff4e2157803136dff18487f1ce34fd8159612b83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomValidators_Plugin.h>
@@ -26,7 +25,6 @@
 #include <GeomValidators_DifferentShapes.h>
 #include <GeomValidators_Face.h>
 #include <GeomValidators_Finite.h>
-#include <GeomValidators_PartitionArguments.h>
 #include <GeomValidators_ShapeType.h>
 #include <GeomValidators_ZeroOffset.h>
 #include <GeomValidators_FeatureKind.h>
@@ -54,8 +52,6 @@ GeomValidators_Plugin::GeomValidators_Plugin()
                               new GeomValidators_DifferentShapes);
   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
   aFactory->registerValidator("GeomValidators_Finite", new GeomValidators_Finite);
-  aFactory->registerValidator("GeomValidators_PartitionArguments",
-                              new GeomValidators_PartitionArguments);
   aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
   aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset);
   aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind);
index 7f86935b698c4eeb3cbf1804cf69b4f517206a14..4e5b46c9ab2761e1fbbb4b874640c2b61e6e016f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GEOMVALIDATORS_PLUGIN_H_
index 139239be9aaac39a943194ec5d31c6f98d171eec..13e9a0241e4bd6edf077998d133c4e5056e412d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_Positive.h"
index 7dd7e273376247798027f792ecf405ee17dfa764..294ef39bbefc1dd84d02136009829a64d7706789 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_ValidatorPositive_H
old mode 100755 (executable)
new mode 100644 (file)
index afb7dd0..44d9fe2
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_ShapeType.h"
 #include "GeomValidators_Tools.h"
 
 #include <GeomAPI_Curve.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomDataAPI_Point2D.h>
 
 #include <ModelAPI_Result.h>
@@ -61,10 +61,13 @@ GeomValidators_ShapeType::TypeOfShape
   if (MyShapeTypes.find(aType) != MyShapeTypes.end())
     return MyShapeTypes[aType];
 
+// LCOV_EXCL_START
   Events_InfoMessage("Shape type defined in XML is not implemented!").send();
   return AnyShape;
+// LCOV_EXCL_STOP
 }
 
+// LCOV_EXCL_START
 std::string getShapeTypeDescription(const GeomValidators_ShapeType::TypeOfShape& theType)
 {
   std::string aValue = "";
@@ -80,6 +83,7 @@ std::string getShapeTypeDescription(const GeomValidators_ShapeType::TypeOfShape&
   }
   return aValue;
 }
+// LCOV_EXCL_STOP
 
 bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute,
                                        const std::list<std::string>& theArguments,
@@ -130,18 +134,27 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
     GeomShapePtr aShape = anAttr->value();
     if (aShape.get())
-      aValid = isValidShape(aShape, theShapeType, theError);
+      aValid = isValidShape(aShape, theShapeType, anAttr->isGeometricalSelection(), theError);
     else {
       if (anAttr->context().get())
-        aValid = isValidObject(anAttr->context(), theShapeType, theError);
+        aValid = isValidObject(anAttr->context(),
+                               theShapeType,
+                               anAttr->isGeometricalSelection(),
+                               theError);
       else
-        aValid = isValidObject(anAttr->contextFeature(), theShapeType, theError);
+        aValid = isValidObject(anAttr->contextFeature(),
+                               theShapeType,
+                               anAttr->isGeometricalSelection(),
+                               theError);
     }
   }
   else if (anAttributeType == ModelAPI_AttributeRefAttr::typeId()) {
     AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
     if (anAttr->isObject()) {
-      aValid = isValidObject(anAttr->object(), theShapeType, theError);
+      aValid = isValidObject(anAttr->object(),
+                             theShapeType,
+                             false,
+                             theError);
     }
     else if (theShapeType == Vertex) {
       AttributePtr aRefAttr = anAttr->attr();
@@ -153,8 +166,10 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
         std::string anAttributeType = aRefAttr->attributeType();
         aValid = anAttributeType == GeomDataAPI_Point2D::typeId();
         if (!aValid) {
+// LCOV_EXCL_START
           theError = "Shape type is \"%1\", it should be \"%2\"";
           theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType));
+// LCOV_EXCL_STOP
         }
       }
     }
@@ -162,7 +177,7 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
   else if (anAttributeType == ModelAPI_AttributeReference::typeId()) {
     AttributeReferencePtr anAttr =
                               std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
-    aValid = isValidObject(anAttr->value(), theShapeType, theError);
+    aValid = isValidObject(anAttr->value(), theShapeType, false, theError);
   }
   else if (anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
     AttributeSelectionListPtr aListAttr =
@@ -179,9 +194,11 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
     }
   }
   else {
+// LCOV_EXCL_START
     aValid = false;
     theError = "The attribute with the %1 type is not processed";
     theError.arg(anAttributeType);
+// LCOV_EXCL_STOP
   }
   if (aValid)
     theError = "";
@@ -190,6 +207,7 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute
 
 bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject,
                                              const TypeOfShape theShapeType,
+                                             const bool theIsGeometricalSelection,
                                              Events_InfoMessage& theError) const
 {
   bool aValid = true;
@@ -214,7 +232,7 @@ bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject,
         aValid = false;
         theError = "The result is empty";
       } else {
-        aValid = isValidShape(aResult->shape(), theShapeType, theError);
+        aValid = isValidShape(aResult->shape(), theShapeType, theIsGeometricalSelection, theError);
       }
     } else {
       FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
@@ -231,6 +249,7 @@ bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject,
 
 bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape,
                                             const TypeOfShape theShapeType,
+                                            const bool theIsGeometricalSelection,
                                             Events_InfoMessage& theError) const
 {
   bool aValid = true;
@@ -247,9 +266,21 @@ bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape,
     case Edge:
       aValid = theShape->isEdge();
       break;
-    case Line:
-      aValid = theShape->isEdge() && GeomAPI_Curve(theShape).isLine();
+    case Line: {
+      if (theIsGeometricalSelection && theShape->isCompound()) {
+        aValid = true;
+        for (GeomAPI_ShapeIterator anIt(theShape); anIt.more(); anIt.next()) {
+          if (!anIt.current()->isEdge() || !GeomAPI_Curve(anIt.current()).isLine()) {
+            aValid = false;
+            break;
+          }
+        }
+      }
+      else {
+        aValid = theShape->isEdge() && GeomAPI_Curve(theShape).isLine();
+      }
       break;
+    }
     case Circle:
       aValid = theShape->isEdge() && GeomAPI_Curve(theShape).isCircle();
       break;
index daf9fda38d230c7d73c38e318c4a809baea31e59..d4f38cf5bfc3504cbdbb1b19ff8aaa2813814fa9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_ShapeType_H
@@ -83,6 +82,7 @@ protected:
   /// \param[out] theError error message.
   bool isValidObject(const ObjectPtr& theObject,
                      const TypeOfShape theShapeType,
+                     const bool theIsGeometricalSelection,
                      Events_InfoMessage& theError) const;
 
   /// Returns true if the attibute's object type satisfies the argument value
@@ -91,6 +91,7 @@ protected:
   /// \param[out] theError error message.
   bool isValidShape(const GeomShapePtr theShape,
                     const TypeOfShape theShapeType,
+                    const bool theIsGeometricalSelection,
                     Events_InfoMessage& theError) const;
 
 };
index 00212729281b900b3710efed912484826b680104..80864331d10394b33bd82448b933e433da5ac5a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_Tools.h"
index 37e1b24015bb12c8d13dcca6834950c1f7467680..69d2af79fa7dead6c80dde3fea3e566edece1ed7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_Tools_HeaderFile
index 03654381f7494b4d026a12fa181d141ae6cdbdab..a7da6088749f0686cda202bd1a1740dd69d46519 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_ValueOrder.h"
@@ -28,6 +27,7 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
 
+// LCOV_EXCL_START
 static double attributeValue(AttributePtr theAttr)
 {
   AttributeIntegerPtr anIntAttr = std::dynamic_pointer_cast<ModelAPI_AttributeInteger>(theAttr);
@@ -92,7 +92,7 @@ static bool isValidOrder(const AttributePtr& theAttribute,
 
   return true;
 }
-
+// LCOV_EXCL_STOP
 
 
 /// Global instance for validators factory
@@ -107,13 +107,14 @@ GeomValidators_GreaterOrEqual::GeomValidators_GreaterOrEqual()
   aFactory->registerValidator("GeomValidators_GreaterOrEqual", this);
 }
 
+// LCOV_EXCL_START
 bool GeomValidators_GreaterOrEqual::isValid(const AttributePtr& theAttribute,
                                             const std::list<std::string>& theArguments,
                                             Events_InfoMessage& theError) const
 {
   return isValidOrder(theAttribute, theArguments, theError, &isGreaterOrEqual);
 }
-
+// LCOV_EXCL_STOP
 
 
 GeomValidators_LessOrEqual::GeomValidators_LessOrEqual()
@@ -124,9 +125,11 @@ GeomValidators_LessOrEqual::GeomValidators_LessOrEqual()
   aFactory->registerValidator("GeomValidators_LessOrEqual", this);
 }
 
+// LCOV_EXCL_START
 bool GeomValidators_LessOrEqual::isValid(const AttributePtr& theAttribute,
                                          const std::list<std::string>& theArguments,
                                          Events_InfoMessage& theError) const
 {
   return isValidOrder(theAttribute, theArguments, theError, &isLessOrEqual);
 }
+// LCOV_EXCL_STOP
index f4dd4fb26830742ad37bd31ea01f74503f62bff9..8ce3b22371b2a95814d3466a537f5ff26a1ed98e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_ValueOrder_H
index 4a919d0c4b6afe96dc4c0fe774509a0478fb1863..0b42176575ff4433a1d44ad162c306dc54e06ff0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomValidators_ZeroOffset.h>
@@ -31,6 +30,7 @@
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Face.h>
 #include <GeomAPI_Shape.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_Pnt.h>
 
@@ -39,10 +39,12 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
                                         const std::list<std::string>& theArguments,
                                         Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if(theArguments.size() != 9) {
     theError = "Wrong number of validator arguments in xml(expected 9).";
     return false;
   }
+// LCOV_EXCL_STOP
 
   std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
 
@@ -56,6 +58,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
 
   ListOfShape aFacesList;
   if(theFeature->selection(*anIt)) {
+// LCOV_EXCL_START
     AttributeSelectionPtr aFaceSelection = theFeature->selection(*anIt);
     ResultConstructionPtr aConstruction =
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFaceSelection->context());
@@ -69,6 +72,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
         }
       }
     }
+// LCOV_EXCL_STOP
   } else if(theFeature->selectionList(*anIt)) {
     AttributeSelectionListPtr aFacesSelectionList = theFeature->selectionList(*anIt);
     for(int anIndex = 0; anIndex < aFacesSelectionList->size(); anIndex++) {
@@ -131,6 +135,10 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
     if(aToShape.get() == NULL && anAttrSel->context().get() != NULL) {
       aToShape =  anAttrSel->context()->shape();
     }
+    if (aToShape->isCompound()) {
+      GeomAPI_ShapeIterator anIt(aToShape);
+      aToShape = anIt.current();
+    }
   }
   anIt++;
 
@@ -146,6 +154,10 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
     if(aFromShape.get() == NULL && anAttrSel->context().get() != NULL) {
       aFromShape = anAttrSel->context()->shape();
     }
+    if (aFromShape->isCompound()) {
+      GeomAPI_ShapeIterator anIt(aFromShape);
+      aFromShape = anIt.current();
+    }
   }
   anIt++;
 
@@ -214,6 +226,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>&
 }
 
 //=================================================================================================
+// LCOV_EXCL_START
 bool GeomValidators_ZeroOffset::isNotObligatory(std::string theFeature, std::string theAttribute)
 {
   if(theAttribute == "from_object" || theAttribute == "to_object") {
@@ -222,3 +235,4 @@ bool GeomValidators_ZeroOffset::isNotObligatory(std::string theFeature, std::str
 
   return false;
 }
+// LCOV_EXCL_STOP
index b8bf60451c7f5a3fe5a8026a36fcb758974e73f0..ad4aac7c74f5f21580c8188da07c62c7d03f1015 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef GeomValidators_ZeroOffset_H
index a1951fdd28a64b134c8b29343a47943cd4f49788..f60b8995251f49ef3944cee831aa9a443b1d0d30 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index 23cf7d374af45601c93345f5903bc7ebaa9d68c7..52c5b090ef6cf46c4307e16378a031385480ac92 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef INITIALIZATIONPLUGIN_H
index 79993dc4d6b651db0703a0e1ece76cb898ea46db..534b122b75bf216e443fe1b316931f1a7d1f132b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
index 5835766217bf882a2e587da726ac2ca4a03c53c8..9ceed916458245f5a87499f1a2a1c5c67fb2851d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_INITIALIZATIONPLUGIN_EVALLISTENER_H_
index c71d8f767d143d3cb01995937782b7718d769093..5920c21a7f720cdb6d1edc9f76631bc392619264 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <InitializationPlugin_Plugin.h>
index 53d95b059591129711a34a9706a5f17e352752ce..dca223f04bcfe065cca002e18158592dc99e544b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef INITIALIZATIONPLUGIN_PLUGIN_H_
index 3d9f7e8e75fadd8a54f9746befa442e626363fae..de62f8b742a3e692580d06568948665085e89da7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <InitializationPlugin_PyInterp.h>
index 3f765861bd2dc6c9982204cc293922d1394b939d..cb35a69f09682423530c79321ec17b2682a6881d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef INITIALIZATIONPLUGIN_PYINTERP_H_
index 33ec73c00da0d180a8b3d58b10c09f869ab09ae8..2e6c3638b5a9fa43f01ae65d7844f3adac929b1b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
@@ -55,7 +54,6 @@ SET(PROJECT_HEADERS
     Model_ResultParameter.h
     Model_FeatureValidator.h
     Model_AttributeValidator.h
-    Model_SelectionNaming.h
 )
 
 SET(PROJECT_SOURCES
@@ -92,13 +90,13 @@ SET(PROJECT_SOURCES
     Model_ResultParameter.cpp
     Model_FeatureValidator.cpp
     Model_AttributeValidator.cpp
-    Model_SelectionNaming.cpp
 )
 
 SET(PROJECT_LIBRARIES
     ModelAPI
     Events
     Config
+    Selector
     GeomData
     GeomAPI
     GeomAlgoAPI
@@ -109,6 +107,7 @@ SET(PROJECT_INCLUDES
   ../ModelAPI
   ../Events
   ../Config
+  ../Selector
   ../GeomData
   ../GeomDataAPI
   ../GeomAlgoAPI
index 0119aa2f86e22a66f2fc835ff6b6a43514731fff..5e572a81cb71755962cd37e9efcfec7f0c8d1923 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODEL_H
index a5688b66e5e7f1150ec8bec91434ae16c32cc82c..6cfb6a3a38db0fce52b852cab4547a685ca39aaf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Application.h>
@@ -143,26 +142,6 @@ bool Model_Application::isLoadByDemand(std::string theID, const int theDocIndex)
 }
 
 //=======================================================================
-void Model_Application::removeUselessDocuments(
-  std::list<std::shared_ptr<ModelAPI_Document> > theUsedDocs)
-{
-  std::map<int, std::shared_ptr<Model_Document> >::iterator aDoc = myDocs.begin();
-  while(aDoc != myDocs.end()) {
-    bool aFound = false;
-    std::list<std::shared_ptr<ModelAPI_Document> >::iterator aUsed = theUsedDocs.begin();
-    for(; !aFound && aUsed != theUsedDocs.end(); aUsed++) {
-      aFound = aDoc->second == *aUsed;
-    }
-    if (!aFound) { // remove the useless
-      aDoc->second->close();
-      myDocs.erase(aDoc);
-      aDoc = myDocs.begin();
-    } else {
-      aDoc++;
-    }
-  }
-}
-
 int Model_Application::generateDocumentId()
 {
   int aResult;
index b91f69a81f98d1c2ed73dcfab282c502c9bd207f..e0fb01c1a2b7798d95a2885961b96be24483abc6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Application_H_
@@ -77,9 +76,6 @@ public:
   void setLoadByDemand(std::string theID, const int theDocID);
   //! Returns true if specified document must be loaded by demand
   bool isLoadByDemand(std::string theID, const int theDocIndex);
-  //! Closes and removes the documents that are not loaded by demand and
-  //! not in the given list
-  void removeUselessDocuments(std::list<std::shared_ptr<ModelAPI_Document> > theUsedDocs);
 
   //! produces new unique identifier of the document
   int generateDocumentId();
index 8fc29d362781953f08a83ebeabe83e172b012e6c..1f59947484bbecceb9a67170ff8190158536a083 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeBoolean.h"
index 4c84c033c483af82a48a8089d899891cc4ab3936..1da2dbd7697a5a28b942e07b05fafd4e68273181 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeBoolean_H_
index 63e0c5fd1cacb09652b9026244aad04cc9a486bf..d57938e8034ad675b6bcda77685fc7476f0f960e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeDocRef.h"
index 8058b9c56ae62a60c3b3426ab0884956080a5136..0feaa0a5b1de80181f2f68817ddd3e6ed5ea3bfa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeDocRef_H_
index 3b123c3f3d0168105a0c1184b7ce5af7122fbb0c..16a5cba736dc77c1343536626a8d9918bc0c0f96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeDouble.h"
index eaf4a82d9570be93d10f856fea3a14a8dd91b9dd..559a4c8cec632dd442447ed89da5eebb576444d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeDouble_H_
index 71cbe9f2659a88d7974020d91dedf72efbcd8b2c..046c4c2fd7ccc79e6c288244958880449a00a6e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeDoubleArray.h"
index bfd717d962afff58a7f7c7993978e904fc89d906..a842a061ddd88f08b93c66cf3cb91b520f8ecf3d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeDoubleArray_H_
index e0548b700803b887270668badb0e9a9f767d3659..3ee8a25dec8776e40f3ef32a561e20ec95510fea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_AttributeIntArray.h>
index f5442085c220550f5fafcb5df1b9f00ebec81acf..1243a14ceb9a6fda73f7baa576cfc2be2ed4a5c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODEL_ATTRIBUTEINTARRAY_H_
index cd939550bb9cb1a2ca21bc976342351f082a5f55..efa3f1567b88b89d4a8f61d2d8169413c57ca373 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_AttributeInteger.h>
index d611afccc3a04427f1b3e640c9ed2a15f2c750ad..c0a3d0c553c4ffe08ae0ee78fc95e818ae1ab722 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODEL_ATTRIBUTEINTEGER_H_
index 402935bb29440d5fa18e02c98473354881bfac63..3ea876bd1ddb3d599e8fa75fab43345483a416ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeRefAttr.h"
index aeda2d757fdff65b463e92bea4b0664a92a08368..ddcf14149b16a54b2bbb71e200c85c8943a6b13b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeRefAttr_H_
old mode 100755 (executable)
new mode 100644 (file)
index 66067c0..db780ea
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeRefAttrList.h"
old mode 100755 (executable)
new mode 100644 (file)
index 326fbac..2827ee8
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeRefAttrList_H_
index 4d77a91f7f2e68663c1be1a7d18c866ab7d1a0a7..313c0bb6bf112116eafba0a7c59225793ffee55d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeRefList.h"
@@ -44,6 +43,12 @@ void Model_AttributeRefList::append(ObjectPtr theObject)
     myExtDocRef->Append(anEntry);
   } else return; // something is wrong
 
+  if (myHashUsed) {
+    myHashObjects.insert(theObject);
+    myHashIndex[myRef->Extent() - 1] = theObject;
+    myHashIndexNoEmpty[int(myHashIndexNoEmpty.size())] = theObject;
+  }
+
   // do it before the transaction finish to make just created/removed objects know dependencies
   // and reference from composite feature is removed automatically
   ADD_BACK_REF(theObject);
@@ -52,6 +57,7 @@ void Model_AttributeRefList::append(ObjectPtr theObject)
 
 void Model_AttributeRefList::remove(ObjectPtr theObject)
 {
+  eraseHash();
   if (theObject.get() != NULL) {
     if (owner()->document() == theObject->document()) {
       std::shared_ptr<Model_Data> aData;
@@ -60,6 +66,7 @@ void Model_AttributeRefList::remove(ObjectPtr theObject)
       REMOVE_BACK_REF(theObject);
       owner()->data()->sendAttributeUpdated(this);
     } else {
+      // LCOV_EXCL_START
       // create new lists because for the current moment remove one of the duplicated elements
       // from the list is buggy
       TDF_LabelList anOldList = myRef->List();
@@ -79,7 +86,7 @@ void Model_AttributeRefList::remove(ObjectPtr theObject)
           if (anExtIter.Value() == anIdString.str().c_str()) {
             TDataStd_ListIteratorOfListOfExtendedString anExtIter2 = anExtIter;
             anExtIter2.Next();
-            if (anExtIter2.Value() == anEntry) { // fully maches, so, remove(don't copy)
+            if (anExtIter2.Value() == anEntry) { // fully matches, so, remove(don't copy)
               aFound = true;
               continue;
             }
@@ -95,6 +102,7 @@ void Model_AttributeRefList::remove(ObjectPtr theObject)
         REMOVE_BACK_REF(theObject);
         owner()->data()->sendAttributeUpdated(this);
       }
+      // LCOV_EXCL_STOP
     }
   }
   else { // in case of empty object remove, the first empty object is removed from the list
@@ -124,6 +132,7 @@ void Model_AttributeRefList::clear()
     REMOVE_BACK_REF((*anOldIter));
   }
   myExtDocRef->Clear();
+  eraseHash();
   owner()->data()->sendAttributeUpdated(this);
 }
 
@@ -131,6 +140,10 @@ int Model_AttributeRefList::size(const bool theWithEmpty) const
 {
   if (theWithEmpty)
     return myRef->Extent();
+
+  if (myHashUsed)
+    return int(myHashIndexNoEmpty.size());
+
   int aResult = 0;
   const TDF_LabelList& aList = myRef->List();
   for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next()) {
@@ -177,15 +190,11 @@ ObjectPtr Model_AttributeRefList::iteratedObject(TDF_ListIteratorOfLabelList& th
 
 std::list<ObjectPtr> Model_AttributeRefList::list()
 {
+  createHash();
   std::list<ObjectPtr> aResult;
-  std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
-      owner()->document());
-  if (aDoc) {
-    const TDF_LabelList& aList = myRef->List();
-    TDataStd_ListIteratorOfListOfExtendedString anExtIter(myExtDocRef->List());
-    for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next()) {
-      aResult.push_back(iteratedObject(aLIter, anExtIter, aDoc));
-    }
+  std::map<int, ObjectPtr>::iterator aHashIter = myHashIndex.begin();
+  for(; aHashIter != myHashIndex.end(); aHashIter++) {
+    aResult.push_back(aHashIter->second);
   }
   return aResult;
 }
@@ -195,65 +204,24 @@ bool Model_AttributeRefList::isInList(const ObjectPtr& theObj)
   if(!theObj.get()) {
     return false;
   }
-  if (theObj->document() == owner()->document()) { // this document object
-    std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
-        owner()->document());
-    if (aDoc) {
-      std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theObj->data());
-      if (aData.get() && aData->isValid()) {
-        TDF_Label anObjLab = aData->label().Father();
-        const TDF_LabelList& aList = myRef->List();
-        for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next()) {
-          if (aLIter.Value().IsEqual(anObjLab)) {
-            return true;
-          }
-        }
-      }
-    }
-  } else { // external document object
-    // create new lists because for the current moment remove one of the duplicated elements
-    // from the list is buggy
-    std::ostringstream anIdString; // string with document Id
-    anIdString<<theObj->document()->id();
-    std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theObj->data());
-    TCollection_AsciiString anEntry;
-    TDF_Tool::Entry(aData->label().Father(), anEntry);
-    bool aFound = false;
-    TDataStd_ListIteratorOfListOfExtendedString anExtIter(myExtDocRef->List());
-    for (; anExtIter.More(); anExtIter.Next()) {
-      if (anExtIter.Value() == anIdString.str().c_str()) {
-        anExtIter.Next();
-        if (anExtIter.Value() == anEntry) { // fully maches
-          return true;
-        }
-      } else {
-        anExtIter.Next();
-      }
-    }
-  }
-  return false;
+  createHash();
+  return myHashObjects.count(theObj) != 0;
 }
 
-ObjectPtr Model_AttributeRefList::object(const int theIndex, const bool theWithEmpty) const
+ObjectPtr Model_AttributeRefList::object(const int theIndex, const bool theWithEmpty)
 {
-  std::shared_ptr<Model_Document> aDoc =
-    std::dynamic_pointer_cast<Model_Document>(owner()->document());
-  if (aDoc) {
-    int anIndex = -1;
-    TDataStd_ListIteratorOfListOfExtendedString anExtIter(myExtDocRef->List());
-    for (TDF_ListIteratorOfLabelList aLIter(myRef->List()); aLIter.More(); aLIter.Next()) {
-      if (theWithEmpty || (!aLIter.Value().IsNull() && !aLIter.Value().IsRoot()))
-        anIndex++;
-      if (anIndex == theIndex) {
-        return iteratedObject(aLIter, anExtIter, aDoc);
-      }
-      if (aLIter.Value() == myRef->Label()) {
-        anExtIter.Next();
-        anExtIter.Next();
-      }
-    }
+  createHash();
+  std::map<int, ObjectPtr>::iterator aFind;
+  if (theWithEmpty) {
+    aFind = myHashIndex.find(theIndex);
+    if (aFind == myHashIndex.end())
+      return ObjectPtr();
+  } else {
+    aFind = myHashIndexNoEmpty.find(theIndex);
+    if (aFind == myHashIndexNoEmpty.end())
+      return ObjectPtr();
   }
-  return ObjectPtr();
+  return aFind->second;
 }
 
 void Model_AttributeRefList::substitute(const ObjectPtr& theCurrent, const ObjectPtr& theNew)
@@ -273,6 +241,7 @@ void Model_AttributeRefList::substitute(const ObjectPtr& theCurrent, const Objec
         aNewLab = aCurrentLab.Root(); // root means null object
       }
       // do the substitution
+      eraseHash();
       ADD_BACK_REF(theNew);
       if (myRef->InsertAfter(aNewLab, aCurrentLab)) {
         myRef->Remove(aCurrentLab);
@@ -283,37 +252,6 @@ void Model_AttributeRefList::substitute(const ObjectPtr& theCurrent, const Objec
   }
 }
 
-void Model_AttributeRefList::exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2)
-{
-  std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
-      owner()->document());
-  if (aDoc) {
-    std::shared_ptr<Model_Data> aData1 = std::dynamic_pointer_cast<Model_Data>(theObject1->data());
-    if (aData1.get() && aData1->isValid()) {
-      TDF_Label aLab1 = aData1->label().Father();
-      if (theObject2.get() && theObject2->data()->isValid()) { // the new may be null
-        std::shared_ptr<Model_Data> aData2 =
-          std::dynamic_pointer_cast<Model_Data>(theObject2->data());
-        if (aData2.get() && aData2->isValid()) {
-          TDF_Label aLab2 = aData2->label().Father();
-          // do the substitution: use the temporary label, as usually in exchange
-          TDF_Label aTmpLab = aLab1.Root();
-          if (myRef->InsertAfter(aTmpLab, aLab1)) {
-            myRef->Remove(aLab1);
-          }
-          if (myRef->InsertAfter(aLab1, aLab2)) {
-            myRef->Remove(aLab2);
-          }
-          if (myRef->InsertAfter(aLab2, aTmpLab)) {
-            myRef->Remove(aTmpLab);
-          }
-          owner()->data()->sendAttributeUpdated(this);
-        }
-      }
-    }
-  }
-}
-
 void Model_AttributeRefList::removeLast()
 {
   std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
@@ -321,6 +259,7 @@ void Model_AttributeRefList::removeLast()
   if (aDoc && !myRef->IsEmpty()) {
     ObjectPtr anObj = aDoc->objects()->object(myRef->Last());
     if (anObj.get()) {
+      eraseHash();
       myRef->Remove(myRef->Last());
       REMOVE_BACK_REF(anObj);
       owner()->data()->sendAttributeUpdated(this);
@@ -333,7 +272,7 @@ void Model_AttributeRefList::remove(const std::set<int>& theIndices)
   std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
       owner()->document());
   if (aDoc && !myRef->IsEmpty()) {
-    // collet labels that will be removed
+    // collect labels that will be removed
     TDF_LabelList aLabelsToRemove;
     TDF_ListIteratorOfLabelList aLabIter(myRef->List());
     for(int aCurrent = 0; aLabIter.More(); aLabIter.Next(), aCurrent++) {
@@ -349,6 +288,7 @@ void Model_AttributeRefList::remove(const std::set<int>& theIndices)
       }
     }
     if (!aLabelsToRemove.IsEmpty()) {
+      eraseHash();
       owner()->data()->sendAttributeUpdated(this);
     }
   }
@@ -369,4 +309,36 @@ void Model_AttributeRefList::reinit()
   if (!myLab.FindAttribute(TDataStd_ExtStringList::GetID(), myExtDocRef)) {
     myExtDocRef = TDataStd_ExtStringList::Set(myLab);
   }
+  eraseHash();
+}
+
+void Model_AttributeRefList::createHash()
+{
+  if (myHashUsed)
+    return;
+  eraseHash();
+  std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(
+    owner()->document());
+  if (aDoc) {
+    const TDF_LabelList& aList = myRef->List();
+    TDataStd_ListIteratorOfListOfExtendedString anExtIter(myExtDocRef->List());
+    for (TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next()) {
+      ObjectPtr anObj = iteratedObject(aLIter, anExtIter, aDoc);
+      myHashIndex[int(myHashIndex.size())] = anObj;
+      if (anObj.get()) {
+        myHashIndexNoEmpty[int(myHashIndexNoEmpty.size())] = anObj;
+        myHashObjects.insert(anObj);
+      }
+    }
+  }
+  if (!myHashObjects.empty()) // on open document with multi-rotation referenced have no results
+    myHashUsed = true;
+}
+
+void Model_AttributeRefList::eraseHash()
+{
+  myHashObjects.clear();
+  myHashIndex.clear();
+  myHashIndexNoEmpty.clear();
+  myHashUsed = false;
 }
index 1964c7d58d26b945bae3dfbd6a80a6a744b202b7..c8d39c652b235263e02e1006c7524ead199ced9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeRefList_H_
 class Model_AttributeRefList : public ModelAPI_AttributeRefList
 {
   TDF_Label myLab; ///< the main label of this attribute
+
   Handle_TDataStd_ReferenceList myRef;  ///< references to the features labels
   /// pairs of doc ID and entries if reference is to external object, appends some in this list if
   /// something in myRef is empty
   Handle_TDataStd_ExtStringList myExtDocRef;
- public:
+  bool myHashUsed; ///< true if the hash stored is valid
+  std::set<ObjectPtr> myHashObjects; ///< hashed information: objects existing in the list
+  std::map<int, ObjectPtr> myHashIndex; ///< index to object in the list
+  std::map<int, ObjectPtr> myHashIndexNoEmpty; ///< index to not empty object in the list
+public:
   /// Appends the feature to the end of a list
   MODEL_EXPORT virtual void append(ObjectPtr theObject);
 
@@ -64,16 +68,12 @@ class Model_AttributeRefList : public ModelAPI_AttributeRefList
   /// Returns the list of features
   ///\param theIndex zero-based index in the list
   ///\param theWithEmpty if it is false, counts the not-empty referenced objects only
-  MODEL_EXPORT virtual ObjectPtr object(const int theIndex, const bool theWithEmpty = true) const;
+  MODEL_EXPORT virtual ObjectPtr object(const int theIndex, const bool theWithEmpty = true);
 
   /// Substitutes the feature by another one. Does nothing if such object is not found.
   /// Does not support the external documents objects yet.
   MODEL_EXPORT virtual void substitute(const ObjectPtr& theCurrent, const ObjectPtr& theNew);
 
-  /// Substitutes the object by another one and back. So, features will become exchanged in the list
-  /// Does not support the external documents objects yet.
-  MODEL_EXPORT virtual void exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2);
-
   /// Removes the last element in the list.
   /// Does not support the external documents objects yet.
   MODEL_EXPORT virtual void removeLast();
@@ -85,7 +85,11 @@ class Model_AttributeRefList : public ModelAPI_AttributeRefList
 
   /// Returns true if attribute was  initialized by some value
   MODEL_EXPORT virtual bool isInitialized();
- protected:
+
+  /// Erases the hashed objects caused by complicated modifications in the list
+  void eraseHash();
+
+protected:
   /// Objects are created for features automatically
   MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
   /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
@@ -94,6 +98,8 @@ class Model_AttributeRefList : public ModelAPI_AttributeRefList
   ObjectPtr iteratedObject(TDF_ListIteratorOfLabelList& theLIter,
     TDataStd_ListIteratorOfListOfExtendedString& theExtIter,
     std::shared_ptr<Model_Document> theDoc) const;
+  /// Creates the hash-objects containers (does nothing if hash is already correct)
+  void createHash();
 
   friend class Model_Data;
 };
index ab0ca8fd3d612a6bc5807f8cb19fe8ed5d80b975..2a2f5fa6791fee09f7b3762587f1663bb988d611 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeReference.h"
index 6a4cc553d1d54dcbfb5a6ab443bb0d1cc44f29e7..dd4296ed4d87e2b9af206459035b5081833198ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeReference_H_
index 7b1259db39ecaa7c013a37deb329fdf113d7fa38..f35b7a6e4a168ffde380671ae94610b704e53591 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeSelection.h"
@@ -23,7 +22,6 @@
 #include "Model_Events.h"
 #include "Model_Data.h"
 #include "Model_Document.h"
-#include "Model_SelectionNaming.h"
 #include <Model_Objects.h>
 #include <Model_AttributeSelectionList.h>
 #include <Model_ResultConstruction.h>
 #include <Events_InfoMessage.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Pnt.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Vertex.h>
+#include <GeomAPI_ShapeExplorer.h>
 #include <GeomAlgoAPI_CompoundBuilder.h>
 #include <GeomAlgoAPI_NExplode.h>
+#include <Selector_Selector.h>
 
-#include <TNaming_Selector.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Tool.hxx>
 #include <TNaming_Builder.hxx>
 #include <TNaming_SameShapeIterator.hxx>
+#include <TNaming_NewShapeIterator.hxx>
 #include <TNaming_Iterator.hxx>
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_UAttribute.hxx>
@@ -59,6 +60,7 @@
 #include <TopExp_Explorer.hxx>
 #include <BRep_Tool.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
 #include <TopExp.hxx>
 #include <TDF_ChildIterator.hxx>
 #include <TDF_ChildIDIterator.hxx>
@@ -88,10 +90,6 @@ Standard_GUID kCIRCLE_CENTER("d0d0e0f1-217a-4b95-8fbb-0c4132f23718");
 Standard_GUID kELLIPSE_CENTER1("f70df04c-3168-4dc9-87a4-f1f840c1275d");
 // identifier of the selection of the second focus point of ellipse on edge
 Standard_GUID kELLIPSE_CENTER2("1395ae73-8e02-4cf8-b204-06ff35873a32");
-// identifier of the weak naming index
-Standard_GUID kWEAK_NAMING("9dcdd9be-a3a9-46eb-9b16-1c957ab20142");
-// identifier of the weak naming sub-shape type
-Standard_GUID kWEAK_NAMING_SHAPETYPE("6b9cc709-e320-4a1f-9c42-df5622369ea7");
 
 // prefix for the whole feature context identification
 const static std::string kWHOLE_FEATURE = "all-in-";
@@ -131,15 +129,13 @@ bool Model_AttributeSelection::setValue(const ObjectPtr& theContext,
     myRef.setValue(theContext);
   }
 
-  // do noth use naming if selected shape is result shape itself, but not sub-shape
+  // do not use naming if selected shape is result shape itself, but not sub-shape
   TDF_Label aSelLab = selectionLabel();
   aSelLab.ForgetAttribute(kSIMPLE_REF_ID);
   aSelLab.ForgetAttribute(kINVALID_SELECTION);
   aSelLab.ForgetAttribute(kCIRCLE_CENTER);
   aSelLab.ForgetAttribute(kELLIPSE_CENTER1);
   aSelLab.ForgetAttribute(kELLIPSE_CENTER2);
-  aSelLab.ForgetAttribute(kWEAK_NAMING);
-  aSelLab.ForgetAttribute(kWEAK_NAMING_SHAPETYPE);
 
   bool isDegeneratedEdge = false;
   // do not use the degenerated edge as a shape, a null context and shape is used in the case
@@ -157,34 +153,30 @@ bool Model_AttributeSelection::setValue(const ObjectPtr& theContext,
       owner()->data()->blockSendAttributeUpdated(false);
     return false;
   }
-  if (theContext->groupName() == ModelAPI_ResultBody::group()) {
-    ResultBodyPtr aContextBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theContext);
+  bool isSelectBody = theContext->groupName() == ModelAPI_ResultBody::group();
+  if (!isSelectBody) {
+    ResultConstructionPtr aContextConstruction =
+      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theContext);
+    isSelectBody = aContextConstruction.get() && !aContextConstruction->isInfinite();
+  }
+  if (isSelectBody) {
+    ResultPtr aContextResult = std::dynamic_pointer_cast<ModelAPI_Result>(theContext);
+    GeomShapePtr aContextShape = aContextResult->shape();
     // do not select the whole shape for body:it is already must be in the data framework
     // equal and null selected objects mean the same: object is equal to context,
-    if (aContextBody->shape().get() &&
-        (aContextBody->shape()->isEqual(theSubShape) || !theSubShape.get())) {
+    if (aContextShape.get() && (aContextShape->isEqual(theSubShape) || !theSubShape.get())) {
       aSelLab.ForgetAllAttributes(true);
       TDataStd_UAttribute::Set(aSelLab, kSIMPLE_REF_ID);
     } else {
-      selectBody(aContextBody, theSubShape);
+      selectBody(aContextResult, theSubShape);
     }
   } else if (theContext->groupName() == ModelAPI_ResultConstruction::group()) {
-    ResultConstructionPtr aContextConstruction =
-      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theContext);
     aSelLab.ForgetAllAttributes(true); // to remove old selection data
     std::shared_ptr<Model_ResultConstruction> aConstruction =
       std::dynamic_pointer_cast<Model_ResultConstruction>(theContext);
     std::shared_ptr<GeomAPI_Shape> aSubShape;
-    if (theSubShape.get() && !aContextConstruction->shape()->isEqual(theSubShape))
+    if (theSubShape.get() && !aConstruction->shape()->isEqual(theSubShape))
       aSubShape = theSubShape; // the whole context
-    if (aConstruction->isInfinite()) {
-      // For correct naming selection, put the shape into the naming structure.
-      // It seems sub-shapes are not needed: only this shape is (and can be ) selected.
-      TNaming_Builder aBuilder(aSelLab);
-      aBuilder.Generated(aContextConstruction->shape()->impl<TopoDS_Shape>());
-    }
-    int anIndex = aConstruction->select(theSubShape, owner()->document());
-    TDataStd_Integer::Set(aSelLab, anIndex);
   } else if (theContext->groupName() == ModelAPI_ResultPart::group()) {
     aSelLab.ForgetAllAttributes(true);
     TDataStd_UAttribute::Set(aSelLab, kPART_REF_ID);
@@ -339,8 +331,8 @@ std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::internalValue(CenterTyp
   if (myRef.isInitialized()) {
     if (aSelLab.IsAttribute(kSIMPLE_REF_ID)) { // it is just reference to shape, not sub-shape
       ResultPtr aContext = context();
-      if (!aContext.get())
-        return aResult; // empty result
+      if (!aContext.get() || aContext->groupName() == ModelAPI_ResultConstruction::group())
+        return aResult; // empty result, for whole construction selection also
       return aContext->shape();
     }
     if (aSelLab.IsAttribute(kPART_REF_ID)) {
@@ -389,30 +381,10 @@ std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::internalValue(CenterTyp
         }
         return GeomAlgoAPI_CompoundBuilder::compound(allShapes);
       }
-    }
-
-    if (aSelLab.IsAttribute(kWEAK_NAMING)) { // a weak naming is used
-      Handle(TDataStd_Integer) aWeakId;
-      aSelLab.FindAttribute(kWEAK_NAMING, aWeakId);
-      // get the context shape
-      GeomShapePtr aContextShape;
-      ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(context());
-      if (aBody.get()) {
-        aContextShape = aBody->shape();
-      } else {
-        ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(myRef.value());
-        if (aResult) {
-          aContextShape = aResult->shape();
-        }
+    } else {
+      if (contextFeature().get()) {
+        return aResult; // for the whole sketch feature selected return null => all faces
       }
-      if (!aContextShape.get())
-        return GeomShapePtr();
-      Handle(TDataStd_Integer) aWeakShapeType;
-      aSelLab.FindAttribute(kWEAK_NAMING_SHAPETYPE, aWeakShapeType);
-      GeomAlgoAPI_NExplode aNExplode(
-        aContextShape, GeomAPI_Shape::ShapeType(aWeakShapeType->Get()));
-      GeomShapePtr aValue = aNExplode.shape(aWeakId->Get());
-      return aValue;
     }
 
     Handle(TNaming_NamedShape) aSelection;
@@ -421,12 +393,7 @@ std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::internalValue(CenterTyp
       aResult = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape);
       aResult->setImpl(new TopoDS_Shape(aSelShape));
     } else if (aConstr) { // simple construction element: just shape of this construction element
-      Handle(TDataStd_Integer) anIndex;
-      if (aSelLab.FindAttribute(TDataStd_Integer::GetID(), anIndex)) {
-        if (anIndex->Get() == 0) // it is just reference to construction, nothing is in value
-          return aResult;
-        return aConstr->shape(anIndex->Get(), owner()->document());
-      }
+      aResult = aConstr->shape();
     }
   }
   return aResult;
@@ -451,19 +418,18 @@ bool Model_AttributeSelection::isInitialized()
       if (selectionLabel().FindAttribute(TNaming_NamedShape::GetID(), aSelection)) {
         return !aSelection->Get().IsNull();
       } else { // for simple construction element: just shape of this construction element
-        std::shared_ptr<Model_ResultConstruction> aConstr =
-          std::dynamic_pointer_cast<Model_ResultConstruction>(context());
-        if (aConstr.get()) {
-          Handle(TDataStd_Integer) anIndex;
-          if (aSelLab.FindAttribute(TDataStd_Integer::GetID(), anIndex)) {
-            // for the whole shape it may return null, so, if index exists, returns true
-            return true;
-          }
-        }
-        // for the whole feature, a feature object
-        FeaturePtr aFeat = contextFeature();
-        if (aFeat.get())
+        if (myRef.value().get())
           return true;
+        // check that this is on open of document, so, results are not initialized yet
+        TDF_Label aRefLab = myRef.myRef->Get();
+        if (aRefLab.IsNull() || !owner().get())
+          return false;
+        std::shared_ptr<Model_Document> aMyDoc =
+          std::dynamic_pointer_cast<Model_Document>(owner()->document());
+        if (!aMyDoc.get())
+          return false;
+        // check at least the feature exists
+        return aMyDoc->featureByLab(aRefLab).get() != NULL;
       }
     }
   }
@@ -471,7 +437,8 @@ bool Model_AttributeSelection::isInitialized()
 }
 
 Model_AttributeSelection::Model_AttributeSelection(TDF_Label& theLabel)
-  : myRef(theLabel)
+: myRef(theLabel),
+  myIsGeometricalSelection(false)
 {
   myIsInitialized = myRef.isInitialized();
   myParent = NULL;
@@ -481,6 +448,14 @@ void Model_AttributeSelection::setID(const std::string theID)
 {
   myRef.setID(theID);
   ModelAPI_AttributeSelection::setID(theID);
+  FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
+  if (myParent) {
+    // to be able to select as geometrical selection and then - split
+    myIsGeometricalSelection = true; // myParent->isGeometricalSelection();
+  } else {
+    myIsGeometricalSelection =
+      ModelAPI_Session::get()->validators()->isGeometricalSelection(aFeature->getKind(), id());
+  }
 }
 
 ResultPtr Model_AttributeSelection::context()
@@ -502,7 +477,7 @@ ResultPtr Model_AttributeSelection::context()
         if(aPart.get() && aPart->data() == aResult->data()) {
           ResultPtr aPartResult = std::dynamic_pointer_cast<ModelAPI_Result>(aPart);
           FeaturePtr anOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
-          // check that this result is not this-feature result (it is forbidden t oselect itself)
+          // check that this result is not this-feature result (it is forbidden tselect itself)
           if(anOwnerFeature.get() && anOwnerFeature->firstResult() != aPartResult) {
             return aPartResult;
           }
@@ -538,69 +513,6 @@ void Model_AttributeSelection::setObject(const std::shared_ptr<ModelAPI_Object>&
   myRef.setObject(theObject);
 }
 
-TDF_LabelMap& Model_AttributeSelection::scope()
-{
-  if (myScope.IsEmpty()) { // create a new scope if not yet done
-    // gets all features with named shapes that are before this feature label (before in history)
-    DocumentPtr aMyDoc = owner()->document();
-    std::list<std::shared_ptr<ModelAPI_Feature> > allFeatures = aMyDoc->allFeatures();
-    std::list<std::shared_ptr<ModelAPI_Feature> >::iterator aFIter = allFeatures.begin();
-    bool aMePassed = false;
-    CompositeFeaturePtr aComposite =
-      std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(owner());
-    FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
-    CompositeFeaturePtr aCompositeOwner, aCompositeOwnerOwner;
-    if (aFeature.get()) {
-      aCompositeOwner = ModelAPI_Tools::compositeOwner(aFeature);
-      if (aCompositeOwner.get()) {
-         aCompositeOwnerOwner = ModelAPI_Tools::compositeOwner(aCompositeOwner);
-      }
-    }
-    // for group Scope is not limitet: this is always up to date objects
-    // this causes problem in galeries.py
-    //bool isGroup = aFeature.get() && aFeature->getKind() == "Group";
-    for(; aFIter != allFeatures.end(); aFIter++) {
-      if (*aFIter == owner()) {  // the left features are created later (except subs of composite)
-        aMePassed = true;
-        continue;
-      }
-      //if (isGroup) aMePassed = false;
-      bool isInScope = !aMePassed;
-      if (!isInScope && aComposite.get()) {
-        // try to add sub-elements of composite if this is composite
-        if (aComposite->isSub(*aFIter))
-          isInScope = true;
-      }
-      // remove the composite-owner of this feature (sketch in extrusion-cut)
-      if (isInScope && (aCompositeOwner == *aFIter || aCompositeOwnerOwner == *aFIter))
-        isInScope = false;
-
-      if (isInScope && aFIter->get() && (*aFIter)->data()->isValid()) {
-        TDF_Label aFeatureLab = std::dynamic_pointer_cast<Model_Data>(
-          (*aFIter)->data())->label().Father();
-        TDF_ChildIDIterator aNSIter(aFeatureLab, TNaming_NamedShape::GetID(), true);
-        for(; aNSIter.More(); aNSIter.Next()) {
-          Handle(TNaming_NamedShape) aNS = Handle(TNaming_NamedShape)::DownCast(aNSIter.Value());
-          if (!aNS.IsNull() && aNS->Evolution() != TNaming_SELECTED) {
-            myScope.Add(aNS->Label());
-          }
-        }
-      }
-    }
-    // also add all naming labels created for external constructions
-    std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(aMyDoc);
-    TDF_Label anExtDocLab = aDoc->extConstructionsLabel();
-    TDF_ChildIDIterator aNSIter(anExtDocLab, TNaming_NamedShape::GetID(), true);
-    for(; aNSIter.More(); aNSIter.Next()) {
-      Handle(TNaming_NamedShape) aNS = Handle(TNaming_NamedShape)::DownCast(aNSIter.Value());
-      if (!aNS.IsNull() && aNS->Evolution() != TNaming_SELECTED) {
-        myScope.Add(aNS->Label());
-      }
-    }
-  }
-  return myScope;
-}
-
 /// Sets the invalid flag if flag is false, or removes it if "true"
 /// Returns theFlag
 static bool setInvalidIfFalse(TDF_Label& theLab, const bool theFlag) {
@@ -642,6 +554,7 @@ bool Model_AttributeSelection::update()
 {
   FeaturePtr aContextFeature = contextFeature();
   if (aContextFeature.get()) {
+    owner()->data()->sendAttributeUpdated(this);  // send updated if "update" called in any way
     return true;
   }
   TDF_Label aSelLab = selectionLabel();
@@ -663,49 +576,27 @@ bool Model_AttributeSelection::update()
   }
 
   if (aContext->groupName() == ModelAPI_ResultBody::group()) {
-    if (aSelLab.IsAttribute(kWEAK_NAMING)) { // a weak naming is used
-      Handle(TDataStd_Integer) aWeakId;
-      aSelLab.FindAttribute(kWEAK_NAMING, aWeakId);
-      // get the context shape
-      GeomShapePtr aContextShape;
-      ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aContext);
-      if (aBody.get()) {
-        aContextShape = aBody->shape();
-      } else {
-        ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(myRef.value());
-        if (aResult) {
-          aContextShape = aResult->shape();
-        }
-      }
-      if (!setInvalidIfFalse(aSelLab, aContextShape.get() != NULL)) // context shape not found
-        return false;
-      Handle(TDataStd_Integer) aWeakShapeType;
-      aSelLab.FindAttribute(kWEAK_NAMING_SHAPETYPE, aWeakShapeType);
-      GeomAlgoAPI_NExplode aNExplode(
-        aContextShape, GeomAPI_Shape::ShapeType(aWeakShapeType->Get()));
-      GeomShapePtr aValue = aNExplode.shape(aWeakId->Get());
-      return setInvalidIfFalse(aSelLab, aValue.get() != NULL);
-    }
-    // body: just a named shape, use selection mechanism from OCCT
-    TNaming_Selector aSelector(aSelLab);
+    // body: just a named shape, use topological selection mechanism
+    bool aResult = false;
     TopoDS_Shape anOldShape;
-    if (!aSelector.NamedShape().IsNull()) {
-      anOldShape = aSelector.NamedShape()->Get();
-    }
-    bool aResult = aSelector.Solve(scope()) == Standard_True;
-    // must be before sending of updated attribute (1556)
-    aResult = setInvalidIfFalse(aSelLab, aResult);
+    Handle(TNaming_NamedShape) aNS;
+    if (aSelLab.FindAttribute(TNaming_NamedShape::GetID(), aNS))
+      anOldShape = aNS->Get();
+
+    TopoDS_Shape aContextShape = aContext->shape()->impl<TopoDS_Shape>();
+    Selector_Selector aSelector(aSelLab, baseDocumentLab());
+    aResult = aSelector.restore(aContextShape);
+    setInvalidIfFalse(aSelLab, aResult);
+
     TopoDS_Shape aNewShape;
-    if (!aSelector.NamedShape().IsNull()) {
-      aNewShape = aSelector.NamedShape()->Get();
-    }
-    if (anOldShape.IsNull() || aNewShape.IsNull() ||
-        !anOldShape.IsEqual(aSelector.NamedShape()->Get())) {
-      // shape type shoud not not changed: if shape becomes compound of such shapes, then split
+    if (aSelLab.FindAttribute(TNaming_NamedShape::GetID(), aNS))
+      aNewShape = aNS->Get();
+
+    if (anOldShape.IsNull() || aNewShape.IsNull() || !anOldShape.IsEqual(aNewShape)) {
+      // shape type should not be changed: if shape becomes compound of such shapes, then split
       if (myParent && !anOldShape.IsNull() && !aNewShape.IsNull() &&
           anOldShape.ShapeType() != aNewShape.ShapeType() &&
-          (aNewShape.ShapeType() == TopAbs_COMPOUND || aNewShape.ShapeType() == TopAbs_COMPSOLID))
-      {
+          aNewShape.ShapeType() == TopAbs_COMPOUND) {
         split(aContext, aNewShape, anOldShape.ShapeType());
       }
       owner()->data()->sendAttributeUpdated(this);  // send updated if shape is changed
@@ -714,22 +605,21 @@ bool Model_AttributeSelection::update()
   }
 
   if (aContext->groupName() == ModelAPI_ResultConstruction::group()) {
-    Handle(TDataStd_Integer) anIndex;
-    if (aSelLab.FindAttribute(TDataStd_Integer::GetID(), anIndex)) {
-      std::shared_ptr<Model_ResultConstruction> aConstructionContext =
-        std::dynamic_pointer_cast<Model_ResultConstruction>(aContext);
-      bool aModified = true;
-      bool aValid = aConstructionContext->update(anIndex->Get(), owner()->document(), aModified);
-      setInvalidIfFalse(aSelLab, aValid);
-      if (aConstructionContext->isInfinite()) {
-        // Update the selected shape.
-        TNaming_Builder aBuilder(aSelLab);
-        aBuilder.Generated(aConstructionContext->shape()->impl<TopoDS_Shape>());
-      }
-      if (aModified)
-        owner()->data()->sendAttributeUpdated(this);
-      return aValid;
+    bool aResult = true;
+    std::shared_ptr<Model_ResultConstruction> aConstructionContext =
+      std::dynamic_pointer_cast<Model_ResultConstruction>(aContext);
+    if (!aConstructionContext->isInfinite()) {
+      TopoDS_Shape aContextShape = aContext->shape()->impl<TopoDS_Shape>();
+      Selector_Selector aSelector(aSelLab, baseDocumentLab());
+      TopoDS_Shape anOldShape = aSelector.value();
+      aResult = aSelector.restore(aContextShape);
+      setInvalidIfFalse(aSelLab, aResult);
+      if (aResult && !anOldShape.IsEqual(aSelector.value()))
+        owner()->data()->sendAttributeUpdated(this);  // send updated if shape is changed
+    } else {
+      owner()->data()->sendAttributeUpdated(this);  // send updated if "update" called in any way
     }
+    return aResult;
   }
   return setInvalidIfFalse(aSelLab, false); // unknown case
 }
@@ -738,10 +628,9 @@ void Model_AttributeSelection::selectBody(
   const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape)
 {
   // perform the selection
-  TNaming_Selector aSel(selectionLabel());
   TopoDS_Shape aContext;
 
-  ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theContext);//myRef.value()
+  ResultPtr aBody = std::dynamic_pointer_cast<ModelAPI_Result>(theContext);
   if (aBody) {
     aContext = aBody->shape()->impl<TopoDS_Shape>();
   } else {
@@ -755,116 +644,25 @@ void Model_AttributeSelection::selectBody(
     }
   }
 
-  // with "recover" feature the selected context may be not up to date (issue 1710)
-  Handle(TNaming_NamedShape) aResult;
-  TDF_Label aSelLab = selectionLabel();
-  TopoDS_Shape aNewContext = aContext;
-  bool isUpdated = true;
-  while(!aNewContext.IsNull() && isUpdated) {
-    // searching for the very last shape that was produced from this one
-    isUpdated = false;
-    if (!TNaming_Tool::HasLabel(aSelLab, aNewContext))
-      // to avoid crash of TNaming_SameShapeIterator if pure shape does not exists
-      break;
-    for(TNaming_SameShapeIterator anIter(aNewContext, aSelLab); anIter.More(); anIter.Next()) {
-      TDF_Label aNSLab = anIter.Label();
-      if (!scope().Contains(aNSLab))
-        continue;
-      Handle(TNaming_NamedShape) aNS;
-      if (aNSLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-        for(TNaming_Iterator aShapesIter(aNS); aShapesIter.More(); aShapesIter.Next()) {
-          if (aShapesIter.Evolution() == TNaming_SELECTED)
-            continue; // don't use the selection evolution
-          if (!aShapesIter.OldShape().IsNull() && aShapesIter.OldShape().IsSame(aNewContext)) {
-             // found the original shape
-            aNewContext = aShapesIter.NewShape(); // go to the newer shape
-            isUpdated = true;
-            break;
-          }
-        }
-      }
-    }
-  }
-  if (aNewContext.IsNull()) { // a context is already deleted
-    setInvalidIfFalse(aSelLab, false);
-    Events_InfoMessage("Model_AttributeSelection", "Failed to select shape already deleted").send();
-    return;
-  }
-
-  TopoDS_Shape aNewSub = theSubShape ? theSubShape->impl<TopoDS_Shape>() : aContext;
-  if (!aNewSub.IsEqual(aContext)) { // searching for subshape in the new context
-    bool isFound = false;
-    TopExp_Explorer anExp(aNewContext, aNewSub.ShapeType());
-    for(; anExp.More(); anExp.Next()) {
-      if (anExp.Current().IsSame(aNewSub)) {
-        isFound = true;
-        break;
-      }
-    }
-    if (!isFound) { // sub-shape is not found in the up-to-date instance of the context shape
-      // if context is sub-result of compound/compsolid, selection of sub-shape better propagate to
-      // the main result (which is may be modified); the case is in 1799
-      ResultBodyPtr aMain = ModelAPI_Tools::bodyOwner(theContext);
-      while(ModelAPI_Tools::bodyOwner(aMain).get())
-        aMain = ModelAPI_Tools::bodyOwner(theContext);
-      if (aMain.get()) {
-        selectBody(aMain, theSubShape);
-        return;
-      }
-      setInvalidIfFalse(aSelLab, false);
-      Events_InfoMessage("Model_AttributeSelection",
-        "Failed to select sub-shape already modified").send();
-      return;
-    }
-  }
-
-  /// fix for issue 411: result modified shapes must not participate in this selection mechanism
   if (!aContext.IsNull()) {
-    FeaturePtr aFeatureOwner = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
-    bool aEraseResults = false;
-    if (aFeatureOwner.get()) {
-      aEraseResults = !aFeatureOwner->results().empty();
-      if (aEraseResults) // erase results without flash deleted and redisplay: do it after Select
-        aFeatureOwner->removeResults(0, false, false);
-    }
+    TDF_Label aSelLab = selectionLabel();
+    TopoDS_Shape aNewSub = theSubShape->impl<TopoDS_Shape>();
+
     bool aSelectorOk = true;
+    Selector_Selector aSelector(aSelLab, baseDocumentLab());
     try {
-      aSel.Select(aNewSub, aNewContext);
+      aSelectorOk = aSelector.select(aContext, aNewSub, myIsGeometricalSelection);
+      if (aSelectorOk) {
+        aSelectorOk = aSelector.store(aContext);
+      }
     } catch(...) {
       aSelectorOk = false;
     }
-    // face may become divided after the model update, so, new labels may be added to the scope
-    myScope.Clear();
-
-    // check that selection is correct, otherwise use weak naming solution
-    TDF_Label aSelLab = selectionLabel();
-    aSelLab.ForgetAttribute(kWEAK_NAMING);
-    Handle(TNaming_NamedShape) aSelectorShape;
-    if (aSelectorOk && aSelLab.FindAttribute(TNaming_NamedShape::GetID(), aSelectorShape))
-    {
-      TopoDS_Shape aShape = aSelectorShape->Get();
-      if (aShape.IsNull() || aShape.ShapeType() != aNewSub.ShapeType())
-        aSelectorOk = false;
-    }
-    if (!aSelectorOk) { // weak naming identifier instead
-      GeomShapePtr aContextShape(new GeomAPI_Shape);
-      aContextShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewContext));
-      GeomShapePtr aValueShape(new GeomAPI_Shape);
-      aValueShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewSub));
-
-      GeomAlgoAPI_NExplode aNExplode(aContextShape, aValueShape->shapeType());
-      int anId = aNExplode.index(aValueShape);
-      if (anId) {
-        TDataStd_Integer::Set(aSelLab, kWEAK_NAMING, anId);
-        TDataStd_Integer::Set(aSelLab, kWEAK_NAMING_SHAPETYPE, int(aValueShape->shapeType()));
-      }
-    }
-
-    if (aEraseResults) { // flash after Select : in Groups it makes selection with shift working
-      static Events_Loop* aLoop = Events_Loop::loop();
-      static const Events_ID kDeletedEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
-      aLoop->flush(kDeletedEvent);
+    if (aSelectorOk) {
+      TopoDS_Shape aShape = aSelector.value();
+      aSelectorOk = !aShape.IsNull() && aShape.ShapeType() == aNewSub.ShapeType();
     }
+    setInvalidIfFalse(aSelLab, aSelectorOk);
   }
 }
 
@@ -947,16 +745,34 @@ std::string Model_AttributeSelection::namingName(const std::string& theDefaultNa
   }
 
   TDF_Label aSelLab = selectionLabel();
-  Handle(TDataStd_Integer) aWeakId;
-  if (aSelLab.FindAttribute(kWEAK_NAMING, aWeakId)) { // a weak naming is used
-    std::ostringstream aNameStream;
-    aNameStream<<aCont->data()->name()<<"/weak_name_"<<aWeakId->Get();
-    return aNameStream.str();
+  if (aSelLab.IsAttribute(kSIMPLE_REF_ID)) { // whole context, no value
+    return contextName(aCont);
   }
 
-  Model_SelectionNaming aSelNaming(aSelLab);
-  std::string aResult = aSelNaming.namingName(
-    aCont, aSubSh, theDefaultName, owner()->document() != aCont->document());
+  // if it is in result of another part
+  if (aCont->groupName() == ModelAPI_ResultPart::group()) {
+    ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aCont);
+    int anIndex;
+    GeomShapePtr aValue = value();
+    if (aValue.get())
+      return aPart->data()->name() + "/" + aPart->nameInPart(aValue, anIndex);
+    else
+      return aPart->data()->name();
+  }
+
+
+  // whole infinitive construction
+  if (aCont->groupName() == ModelAPI_ResultConstruction::group()) {
+    ResultConstructionPtr aConstr = std::dynamic_pointer_cast<Model_ResultConstruction>(aCont);
+    if (aConstr->isInfinite()) {
+      return contextName(aCont);
+    }
+  }
+
+  Selector_Selector aSelector(aSelLab, baseDocumentLab());
+  std::string aResult;
+  if (aCont->shape().get() && aSelector.restore(aCont->shape()->impl<TopoDS_Shape>()))
+    aResult = aSelector.name(this);
   if (aCenterType != NOT_CENTER) {
     aResult += centersMap()[aCenterType];
   }
@@ -989,172 +805,116 @@ void Model_AttributeSelection::selectSubShape(
   CenterType aCenterType = theType[0] == 'v' || theType[0] == 'V' ? // only for vertex-type
     centerTypeByName(aSubShapeName) : NOT_CENTER;
   std::string aType = aCenterType == NOT_CENTER ? theType : "EDGE"; // search for edge now
+  static const GeomShapePtr anEmptyShape;
 
   // first iteration is selection by name without center prefix, second - in case of problem,
   // try with initial name
-  for(int aUseCenter = 1; aUseCenter >= 0; aUseCenter--) {
+  for(int aUseCenter = 1; aUseCenter >= 0; aUseCenter--)  {
     if (aUseCenter == 0 && aCenterType != NOT_CENTER) {
       aSubShapeName = theSubShapeName;
       aCenterType = NOT_CENTER;
       aType = theType;
     } else if (aUseCenter != 1) continue;
+    TopAbs_ShapeEnum aShapeType =  TopAbs_ShapeEnum(GeomAPI_Shape::shapeTypeByStr(aType));
 
+    std::shared_ptr<Model_Document> aDoc =
+      std::dynamic_pointer_cast<Model_Document>(owner()->document());
     // check this is Part-name: 2 delimiters in the name
     std::size_t aPartEnd = aSubShapeName.find('/');
-    if (aPartEnd != std::string::npos && aPartEnd != aSubShapeName.rfind('/')) {
+    if (aPartEnd != std::string::npos) {
       std::string aPartName = aSubShapeName.substr(0, aPartEnd);
-      ObjectPtr aFound = owner()->document()->objectByName(ModelAPI_ResultPart::group(), aPartName);
-      if (aFound.get()) { // found such part, so asking it for the name
-        ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aFound);
-        std::string aNameInPart = aSubShapeName.substr(aPartEnd + 1);
-        int anIndex;
-        std::shared_ptr<GeomAPI_Shape> aSelected = aPart->shapeInPart(aNameInPart, aType, anIndex);
-        if (aSelected.get()) {
-          if (aCenterType != NOT_CENTER) {
-            if (!aSelected->isEdge())
-              continue;
-            std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aSelected));
-            setValueCenter(aPart, aSelectedEdge, aCenterType);
-          } else
-            setValue(aPart, aSelected);
-          TDataStd_Integer::Set(selectionLabel(), anIndex);
-          return;
+      DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
+      if (aPartName == aRootDoc->kind()) {
+        aDoc = std::dynamic_pointer_cast<Model_Document>(aRootDoc);
+        aSubShapeName = aSubShapeName.substr(aPartEnd + 1);
+      } else {
+        ObjectPtr aFound =
+          owner()->document()->objectByName(ModelAPI_ResultPart::group(), aPartName);
+        if (aFound.get()) { // found such part, so asking it for the name
+          ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aFound);
+          std::string aNameInPart = aSubShapeName.substr(aPartEnd + 1);
+          if (aNameInPart.empty()) { // whole part
+            setValue(aPart, anEmptyShape);
+            return;
+          }
+          int anIndex;
+          std::shared_ptr<GeomAPI_Shape> aSelected =
+            aPart->shapeInPart(aNameInPart, aType, anIndex);
+          if (aSelected.get()) {
+            if (aCenterType != NOT_CENTER) {
+              if (!aSelected->isEdge())
+                continue;
+              std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aSelected));
+              setValueCenter(aPart, aSelectedEdge, aCenterType);
+            } else
+              setValue(aPart, aSelected);
+            TDataStd_Integer::Set(selectionLabel(), anIndex);
+            return;
+          }
         }
       }
     }
 
-    std::shared_ptr<Model_Document> aDoc =
-      std::dynamic_pointer_cast<Model_Document>(owner()->document());
     // check this is a whole feature context
     if (aSubShapeName.size() > kWHOLE_FEATURE.size() &&
       aSubShapeName.substr(0, kWHOLE_FEATURE.size()) == kWHOLE_FEATURE) {
       std::string aFeatureName = aSubShapeName.substr(kWHOLE_FEATURE.size());
       ObjectPtr anObj = aDoc->objectByName(ModelAPI_Feature::group(), aFeatureName);
       if (anObj.get()) {
-        static const GeomShapePtr anEmptyShape;
         setValue(anObj, anEmptyShape);
         return;
       }
     }
 
-    Model_SelectionNaming aSelNaming(selectionLabel());
-    std::shared_ptr<GeomAPI_Shape> aShapeToBeSelected;
-    ResultPtr aCont;
-    if (aSelNaming.selectSubShape(aType, aSubShapeName, aDoc, aShapeToBeSelected, aCont)) {
-      // try to find the last context to find the up to date shape
-      if (aCont->shape().get() && !aCont->shape()->isNull() &&
-        aCont->groupName() == ModelAPI_ResultBody::group() && aDoc == owner()->document()) {
-        const TopoDS_Shape aConShape = aCont->shape()->impl<TopoDS_Shape>();
-        if (!aConShape.IsNull()) {
-          Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aConShape, selectionLabel());
-          if (!aNS.IsNull()) {
-            aNS = TNaming_Tool::CurrentNamedShape(aNS);
-            if (!aNS.IsNull() && scope().Contains(aNS->Label())) { // scope check is for 2228
-              TDF_Label aLab = aNS->Label();
-              if (aLab.Depth() % 2 == 0)
-                aLab = aLab.Father();
-              ObjectPtr anObj = aDoc->objects()->object(aLab);
-              while(!anObj.get() && aLab.Depth() > 5) {
-                aLab = aLab.Father().Father();
-                anObj = aDoc->objects()->object(aLab);
-              }
-
-              if (anObj.get()) {
-                ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
-                if (aRes)
-                  aCont = aRes;
-              }
-            }
-          }
-        }
-      }
-      // if compsolid is context, try to take sub-solid as context: like in GUI and scripts
-      if (aCont.get() && aShapeToBeSelected.get()) {
-        ResultBodyPtr aComp = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aCont);
-        if (aComp && aComp->numberOfSubs()) {
-          std::list<ResultPtr> allSubs;
-          ModelAPI_Tools::allSubs(aComp, allSubs);
-          std::list<ResultPtr>::iterator aS = allSubs.begin();
-          for(; aS != allSubs.end(); aS++) {
-            ResultBodyPtr aSub = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aS);
-            if (aSub && aSub->numberOfSubs() == 0 && aSub->shape().get() &&
-                aSub->shape()->isSubShape(aShapeToBeSelected)) {
-              aCont = aSub;
-              break;
-            }
-          }
-        }
+    // the whole result selection check
+    if (aSubShapeName.find('/') == std::string::npos) {
+      ObjectPtr aRes = aDoc->objectByName(ModelAPI_ResultConstruction::group(), aSubShapeName);
+      if (!aRes.get())
+        aRes = aDoc->objectByName(ModelAPI_ResultBody::group(), aSubShapeName);
+      if (aRes.get()) {
+        setValue(aRes, anEmptyShape);
+        return;
       }
-      // try to find the latest active result that must be used instead of the selected
-      // to set the active context (like in GUI selection), not concealed one
-      bool aFindNewContext = true;
-      while(aFindNewContext && aCont.get()) {
-        aFindNewContext = false;
-        // take references to all results: root one, any sub
-        ResultBodyPtr aCompContext = ModelAPI_Tools::bodyOwner(aCont, true);
-        std::list<ResultPtr> allRes;
-        if (aCompContext.get()) {
-          ModelAPI_Tools::allSubs(aCompContext, allRes);
-          allRes.push_back(aCompContext);
-        } else {
-          allRes.push_back(aCont);
-        }
-        for(std::list<ResultPtr>::iterator aSub = allRes.begin(); aSub != allRes.end(); aSub++) {
-          ResultPtr aResCont = *aSub;
-          ResultBodyPtr aResBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResCont);
-          // only lower and higher level subs are counted
-          if (aResBody.get() && aResBody->numberOfSubs() > 0 && aResBody != aCompContext)
-            continue;
-          const std::set<AttributePtr>& aRefs = aResCont->data()->refsToMe();
-          std::set<AttributePtr>::const_iterator aRef = aRefs.begin();
-          for(; !aFindNewContext && aRef != aRefs.end(); aRef++) {
-            if (!aRef->get() || !(*aRef)->owner().get())
-              continue;
-            // concealed attribute only
-            FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
-            if (!ModelAPI_Session::get()->validators()->isConcealed(
-              aRefFeat->getKind(), (*aRef)->id()))
+    }
+
+    Selector_Selector aSelector(selectionLabel(), baseDocumentLab());
+    myRestoreDocument = aDoc;
+    TDF_Label aContextLabel = aSelector.restoreByName(
+      aSubShapeName, aShapeType, this, myIsGeometricalSelection);
+    myRestoreDocument.reset();
+    if (!aContextLabel.IsNull()) {
+      ResultPtr aContext = aDoc->resultByLab(aContextLabel); // any label for document access
+      if (aContext.get() && aContext->shape().get()) {
+        TopoDS_Shape aContextShape = aContext->shape()->impl<TopoDS_Shape>();
+        if (aSelector.solve(aContextShape)) {
+          TopoDS_Shape aSelectorShape = aSelector.value();
+          GeomShapePtr aShapeToBeSelected(new GeomAPI_Shape);
+          aShapeToBeSelected->setImpl<TopoDS_Shape>(new TopoDS_Shape(aSelectorShape));
+          // make the context result the latest existing
+          aContext = newestContext(aContext, aShapeToBeSelected);
+          if (myIsGeometricalSelection || aCenterType == NOT_CENTER) {
+            // store the currently generated name
+            selectionLabel().ForgetAllAttributes(true);
+            bool aToUnblock = false;
+            aToUnblock = !owner()->data()->blockSendAttributeUpdated(true);
+            myRef.setValue(aContext);
+            aSelector.store(aContextShape);
+            owner()->data()->sendAttributeUpdated(this);
+            if (aToUnblock)
+              owner()->data()->blockSendAttributeUpdated(false);
+            return;
+          } else { // re-select center of circle/arc by context and value
+            if (!aShapeToBeSelected->isEdge())
               continue;
-            // search the feature result that contains sub-shape selected
-            std::list<std::shared_ptr<ModelAPI_Result> > aResults;
-
-            // take all sub-results or one result
-            std::list<ResultPtr> aRefFeatResults;
-            ModelAPI_Tools::allResults(aRefFeat, aRefFeatResults);
-            std::list<ResultPtr>::iterator aRefResIter = aRefFeatResults.begin();
-            for(; aRefResIter != aRefFeatResults.end(); aRefResIter++) {
-              ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRefResIter);
-              if (aBody.get() && aBody->numberOfSubs() == 0) // add only lower level subs
-                aResults.push_back(aBody);
-            }
-            std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = aResults.begin();
-            for(; aResIter != aResults.end(); aResIter++) {
-              if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled())
-                continue;
-              GeomShapePtr aShape = (*aResIter)->shape();
-              GeomShapePtr aSelectedShape =
-                aShapeToBeSelected.get() ? aShapeToBeSelected : aCont->shape();
-              if (aShape.get() && aShape->isSubShape(aSelectedShape, false)) {
-                aCont = *aResIter; // found new context (produced from this) with same subshape
-                aFindNewContext = true; // continue searching futher
-                break;
-              }
-            }
+            std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aShapeToBeSelected));
+            setValueCenter(aContext, aSelectedEdge, aCenterType);
           }
+          return;
         }
       }
-
-      if (aCenterType != NOT_CENTER) {
-        if (!aShapeToBeSelected->isEdge())
-          continue;
-        std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aShapeToBeSelected));
-        setValueCenter(aCont, aSelectedEdge, aCenterType);
-      } else
-        setValue(aCont, aShapeToBeSelected);
-      return;
     }
   }
-
+  // invalid
   TDF_Label aSelLab = selectionLabel();
   setInvalidIfFalse(aSelLab, false);
   reset();
@@ -1249,59 +1009,17 @@ void Model_AttributeSelection::selectSubShape(const std::string& theType,
   const std::string& theContextName, const int theIndex)
 {
   // selection of context by name
-  //std::string aNamingContextName = theContextName + "/";
-  //selectSubShape(theType, aNamingContextName);
-  std::shared_ptr<Model_Document> aDoc =
-    std::dynamic_pointer_cast<Model_Document>(owner()->document());
-  if (aDoc.get()) {
-    bool aUnique = true;
-    std::string aContextName = theContextName;
-    std::string anEmptySub = "";
-    ResultPtr aContext = aDoc->findByName(aContextName, anEmptySub, aUnique);
-    //ResultPtr aContext = context();
-    if (aContext.get()) {
-      GeomShapePtr aContShape = aContext->shape();
-      if (aContShape.get()) {
-        GeomAlgoAPI_NExplode aNExp(aContShape, GeomAPI_Shape::shapeTypeByStr(theType));
-        GeomShapePtr aValue = aNExp.shape(theIndex);
-        if (aValue.get())
-          setValue(aContext, aValue);
-      }
-    }
-  }
-}
-
-int Model_AttributeSelection::Id()
-{
-  int anID = 0;
-  std::shared_ptr<GeomAPI_Shape> aSelection = value();
-  ResultPtr aContextRes = context();
-  // support for compsolids:
-  while(ModelAPI_Tools::bodyOwner(aContextRes).get()) {
-    aContextRes = ModelAPI_Tools::bodyOwner(aContextRes);
-  }
-  std::shared_ptr<GeomAPI_Shape> aContext = aContextRes->shape();
-
-
-  TopoDS_Shape aMainShape = aContext->impl<TopoDS_Shape>();
-  const TopoDS_Shape& aSubShape = aSelection->impl<TopoDS_Shape>();
-  // searching for the latest main shape
-  if (aSelection && !aSelection->isNull() && aContext && !aContext->isNull())
-  {
-    std::shared_ptr<Model_Document> aDoc =
-      std::dynamic_pointer_cast<Model_Document>(context()->document());
-    if (aDoc.get()) {
-      Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aMainShape, aDoc->generalLabel());
-      if (!aNS.IsNull()) {
-        aMainShape = TNaming_Tool::CurrentShape(aNS);
-      }
+  selectSubShape(theType, theContextName);
+  ResultPtr aContext = context();
+  if (aContext.get()) {
+    GeomShapePtr aContShape = aContext->shape();
+    if (aContShape.get()) {
+      GeomAlgoAPI_NExplode aNExp(aContShape, GeomAPI_Shape::shapeTypeByStr(theType));
+      GeomShapePtr aValue = aNExp.shape(theIndex);
+      if (aValue.get())
+        setValue(aContext, aValue);
     }
-
-    TopTools_IndexedMapOfShape aSubShapesMap;
-    TopExp::MapShapes(aMainShape, aSubShapesMap);
-    anID = aSubShapesMap.FindIndex(aSubShape);
   }
-  return anID;
 }
 
 void Model_AttributeSelection::setId(int theID)
@@ -1365,18 +1083,12 @@ void Model_AttributeSelection::computeValues(
 {
   bool aWasWholeContext = theValShape.IsNull();
   if (aWasWholeContext) {
-    //theShapes.Append(theValShape);
-    //return;
     theValShape = theOldContext->shape()->impl<TopoDS_Shape>();
   }
-  //TopoDS_Shape anOldContShape = theOldContext->shape()->impl<TopoDS_Shape>();
+  TopAbs_ShapeEnum aValType = theValShape.ShapeType();
   TopoDS_Shape aNewContShape = theNewContext->shape()->impl<TopoDS_Shape>();
-  //if (anOldContShape.IsSame(theValShape)) { // full context shape substituted by new full context
-    //theShapes.Append(aNewContShape);
-    //return;
-  //}
   // if a new value is unchanged in the new context, do nothing: value is correct
-  TopExp_Explorer aSubExp(aNewContShape, theValShape.ShapeType());
+  TopExp_Explorer aSubExp(aNewContShape, aValType);
   for(; aSubExp.More(); aSubExp.Next()) {
     if (aSubExp.Current().IsSame(theValShape)) {
       theShapes.Append(theValShape);
@@ -1408,9 +1120,9 @@ void Model_AttributeSelection::computeValues(
     for(; aNewContIter != aNewToIterate.end(); aNewContIter++) {
       std::shared_ptr<Model_Data> aNewData =
         std::dynamic_pointer_cast<Model_Data>((*aNewContIter)->data());
-      TDF_Label aNewLab = aNewData->label();
+      TDF_Label aNewLab = aNewData->shapeLab();
       // searching for produced sub-shape fully on some label
-      TDF_ChildIDIterator aNSIter(aNewLab, TNaming_NamedShape::GetID(), Standard_True);
+      TDF_ChildIDIterator aNSIter(aNewLab, TNaming_NamedShape::GetID());
       for(; aNSIter.More(); aNSIter.Next()) {
         Handle(TNaming_NamedShape) aNS = Handle(TNaming_NamedShape)::DownCast(aNSIter.Value());
         for(TNaming_Iterator aPairIter(aNS); aPairIter.More(); aPairIter.Next()) {
@@ -1420,16 +1132,16 @@ void Model_AttributeSelection::computeValues(
                 theShapes.Clear();
                 return;
               }
-              theShapes.Append(aPairIter.NewShape());
+              // don't add edges generated from faces
+              if (aPairIter.NewShape().ShapeType() <= aValType)
+                theShapes.Append(aPairIter.NewShape());
             }
           } else if (!aPairIter.OldShape().IsNull()) { // search shape that contains this sub
-            TopExp_Explorer anExp(aPairIter.OldShape(), theValShape.ShapeType());
+            TopExp_Explorer anExp(aPairIter.OldShape(), aValType);
             for(; anExp.More(); anExp.Next()) {
               if (anExp.Current().IsSame(theValShape)) { // found a new container
-                if (aPairIter.NewShape().IsNull()) {// value was removed
-                  theShapes.Clear();
-                  return;
-                }
+                if (aPairIter.NewShape().IsNull()) // skip removed high-level shape
+                  continue;
                 aNewToOld.Bind(aPairIter.NewShape(), aPairIter.OldShape());
                 anOlds.Add(aPairIter.OldShape());
                 break;
@@ -1441,11 +1153,37 @@ void Model_AttributeSelection::computeValues(
     }
   }
   if (aToFindPart == 2 && !aNewToOld.IsEmpty()) {
-    // map of sub-shapes -> number of occurences of these shapes in containers
+    // also iterate the whole old shape to find not-modified shapes that contain this old
+    TopoDS_Shape anOldContShape = theOldContext->shape()->impl<TopoDS_Shape>();
+    NCollection_Map<TopAbs_ShapeEnum> aNewTypes; // types of shapes to iterate
+    TopTools_DataMapOfShapeShape::Iterator aNewTypeIter(aNewToOld);
+    for(; aNewTypeIter.More(); aNewTypeIter.Next()) {
+      if (aNewTypeIter.Key().ShapeType() != aValType)
+        aNewTypes.Add(aNewTypeIter.Key().ShapeType());
+    }
+    NCollection_Map<TopAbs_ShapeEnum>::Iterator aTypeIter(aNewTypes);
+    for(; aTypeIter.More(); aTypeIter.Next()) {
+      for(TopExp_Explorer anExp(anOldContShape, aTypeIter.Value()); anExp.More(); anExp.Next()) {
+        TopoDS_Shape anOld = anExp.Current();
+        if (aNewToOld.IsBound(anOld) || anOlds.Contains(anOld)) // this was modified
+          continue;
+        TopExp_Explorer aValExp(anOld, aValType);
+        for(; aValExp.More(); aValExp.Next()) {
+          const TopoDS_Shape& anUnchanged = aValExp.Current();
+          if (anUnchanged.IsSame(theValShape)) {
+            aNewToOld.Bind(anOld, anOld);
+            anOlds.Add(anOld);
+            break;
+          }
+        }
+      }
+    }
+
+    // map of sub-shapes -> number of occurrences of these shapes in containers
     NCollection_DataMap<TopoDS_Shape, TopTools_MapOfShape, TopTools_ShapeMapHasher> aSubs;
     TopTools_DataMapOfShapeShape::Iterator aContIter(aNewToOld);
     for(; aContIter.More(); aContIter.Next()) {
-      TopExp_Explorer aSubExp(aContIter.Key(), theValShape.ShapeType());
+      TopExp_Explorer aSubExp(aContIter.Key(), aValType);
       for(; aSubExp.More(); aSubExp.Next()) {
         if (!aSubs.IsBound(aSubExp.Current())) {
           aSubs.Bind(aSubExp.Current(), TopTools_MapOfShape());
@@ -1460,12 +1198,51 @@ void Model_AttributeSelection::computeValues(
       aSubsIter(aSubs);
     for(; aSubsIter.More(); aSubsIter.Next()) {
       if (aSubsIter.Value().Size() == aCountInOld) {
-        theShapes.Append(aSubsIter.Key());
+        TopoDS_Shape anOld = aSubsIter.Key();
+        // check this exists in the new shape
+        TopExp_Explorer aNew(aNewContShape, anOld.ShapeType());
+        for (; aNew.More(); aNew.Next()) {
+          if (aNew.Current().IsSame(anOld))
+            break;
+        }
+        if (aNew.More())
+          theShapes.Append(anOld);
       }
     }
   }
   if (theShapes.IsEmpty()) { // nothing was changed
-    theShapes.Append(aWasWholeContext ? TopoDS_Shape() : theValShape);
+    if (aWasWholeContext)
+      theShapes.Append(TopoDS_Shape());
+    else { // if theValShape exists in new context, add it without changes, otherwise - nothing
+      for (TopExp_Explorer aNew(aNewContShape, aValType); aNew.More(); aNew.Next()){
+        if (aNew.Current().IsSame(theValShape)) {
+          theShapes.Append(theValShape);
+          break;
+        }
+      }
+    }
+  } else if (theShapes.Size() > 1) {
+    // check it is possible to remove extra sub-shapes:
+    // keep only shapes with the same number of containers if possible
+    TopAbs_ShapeEnum anAncType = TopAbs_FACE;
+    if (aValType == TopAbs_VERTEX)
+      anAncType = TopAbs_EDGE;
+    TopoDS_Shape anOldContext = theOldContext->shape()->impl<TopoDS_Shape>();
+    TopTools_IndexedDataMapOfShapeListOfShape anOldMap;
+    TopExp::MapShapesAndUniqueAncestors(anOldContext, aValType,  anAncType, anOldMap);
+    if (anOldMap.Contains(theValShape)) {
+      int aNumInOld = anOldMap.FindFromKey(theValShape).Extent();
+      TopTools_IndexedDataMapOfShapeListOfShape aNewMap;
+      TopExp::MapShapesAndUniqueAncestors(aNewContShape, aValType,  anAncType, aNewMap);
+      TopTools_ListOfShape aNewResults;
+      for(TopTools_ListOfShape::Iterator aNewSubs(theShapes); aNewSubs.More(); aNewSubs.Next()) {
+        TopoDS_Shape aCand = aNewSubs.Value();
+        if (aNewMap.Contains(aCand) && aNewMap.FindFromKey(aCand).Extent() == aNumInOld)
+          aNewResults.Append(aCand);
+      }
+      if (!aNewResults.IsEmpty() && aNewResults.Size() < theShapes.Size())
+        theShapes = aNewResults;
+    }
   }
 }
 
@@ -1475,7 +1252,6 @@ bool Model_AttributeSelection::searchNewContext(std::shared_ptr<Model_Document>
   std::list<ResultPtr>& theResults, TopTools_ListOfShape& theValShapes)
 {
   std::set<ResultPtr> aResults; // to avoid duplicates, new context, null if deleted
-  TopTools_ListOfShape aResContShapes;
   // iterate context and shape, but also if it is sub-shape of main shape, check also it
   TopTools_ListOfShape aContextList;
   aContextList.Append(theContShape);
@@ -1502,33 +1278,80 @@ bool Model_AttributeSelection::searchNewContext(std::shared_ptr<Model_Document>
       if (!aModifierFeat.get())
         continue;
       FeaturePtr aThisFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
-      if (aModifierFeat == aThisFeature || theDoc->objects()->isLater(aModifierFeat, aThisFeature))
+      if (aModifierFeat == aThisFeature || !theDoc->isLaterByDep(aThisFeature, aModifierFeat))
         continue; // the modifier feature is later than this, so, should not be used
       FeaturePtr aCurrentModifierFeat = theDoc->feature(theContext);
       if (aCurrentModifierFeat == aModifierFeat ||
-        theDoc->objects()->isLater(aCurrentModifierFeat, aModifierFeat))
+        !theDoc->isLaterByDep(aModifierFeat, aCurrentModifierFeat))
         continue; // the current modifier is later than the found, so, useless
       Handle(TNaming_NamedShape) aNewNS;
       aModifIter.Label().FindAttribute(TNaming_NamedShape::GetID(), aNewNS);
       if (aNewNS->Evolution() == TNaming_MODIFY || aNewNS->Evolution() == TNaming_GENERATED) {
         aResults.insert(aModifierObj);
-        //TNaming_Iterator aPairIter(aNewNS);
-        //aResContShapes.Append(aPairIter.NewShape());
-        aResContShapes.Append(aModifierObj->shape()->impl<TopoDS_Shape>());
       } else if (aNewNS->Evolution() == TNaming_DELETE) { // a shape was deleted => result is empty
         aResults.insert(ResultPtr());
-      } else { // not-precessed modification => don't support it
+      } else { // not-processed modification => don't support it
         continue;
       }
     }
   }
-  if (aResults.empty())
+  // if there exist context composite and sub-result(s), leave only sub(s)
+  for(std::set<ResultPtr>::iterator aResIter = aResults.begin(); aResIter != aResults.end();) {
+    ResultPtr aParent = ModelAPI_Tools::bodyOwner(*aResIter);
+    for(; aParent.get(); aParent = ModelAPI_Tools::bodyOwner(aParent))
+      if (aResults.count(aParent))
+        break;
+    if (aParent.get()) { // erase from set, so, restart iteration
+      aResults.erase(aParent);
+      aResIter = aResults.begin();
+    } else aResIter++;
+  }
+
+  if (aResults.empty()) {
+    // check the context become concealed by operation which is earlier than this selection
+    std::list<ResultPtr> allRes;
+    ResultPtr aRoot = ModelAPI_Tools::bodyOwner(theContext, true);
+    if (!aRoot.get())
+      aRoot = theContext;
+    ResultBodyPtr aRootBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aRoot);
+    if (aRootBody.get()) {
+      ModelAPI_Tools::allSubs(aRootBody, allRes);
+      allRes.push_back(aRootBody);
+    } else
+      allRes.push_back(aRoot);
+
+    FeaturePtr aThisFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
+    for (std::list<ResultPtr>::iterator aSub = allRes.begin(); aSub != allRes.end(); aSub++) {
+      ResultPtr aResCont = *aSub;
+      const std::set<AttributePtr>& aRefs = aResCont->data()->refsToMe();
+      std::set<AttributePtr>::const_iterator aRef = aRefs.begin();
+      for (; aRef != aRefs.end(); aRef++) {
+        if (!aRef->get() || !(*aRef)->owner().get())
+          continue;
+        // concealed attribute only
+        FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
+        if (aRefFeat == aThisFeature)
+          continue;
+        if (!ModelAPI_Session::get()->validators()->isConcealed(
+          aRefFeat->getKind(), (*aRef)->id()))
+          continue;
+        if (theDoc->isLaterByDep(aThisFeature, aRefFeat)) {
+          // for extrusion cut in python script the nested sketch reference may be concealed before
+          // it is nested, so, check this composite feature is valid
+          static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+          // need to be validated to update the "Apply" state if not previewed
+          if (aFactory->validate(aRefFeat))
+            return true; // feature conceals result, return true, so the context will be removed
+        }
+      }
+    }
     return false; // no modifications found, must stay the same
-  // iterate all results to find futher modifications
+  }
+  // iterate all results to find further modifications
   std::set<ResultPtr>::iterator aResIter = aResults.begin();
   for(; aResIter != aResults.end(); aResIter++) {
     if (aResIter->get() != NULL) {
-      // compute new values by two contextes: the old and the new
+      // compute new values by two contexts: the old and the new
       TopTools_ListOfShape aValShapes;
       computeValues(theContext, *aResIter, theValShape, aValShapes);
 
@@ -1543,7 +1366,7 @@ bool Model_AttributeSelection::searchNewContext(std::shared_ptr<Model_Document>
         if (searchNewContext(theDoc, aNewContShape, *aResIter, aNewValSh,
                              theAccessLabel, aNewRes, aNewUpdatedVal))
         {
-          // appeand new results instead of the current ones
+          // append new results instead of the current ones
           std::list<ResultPtr>::iterator aNewIter = aNewRes.begin();
           TopTools_ListIteratorOfListOfShape aNewUpdVal(aNewUpdatedVal);
           for(; aNewIter != aNewRes.end(); aNewIter++, aNewUpdVal.Next()) {
@@ -1560,7 +1383,7 @@ bool Model_AttributeSelection::searchNewContext(std::shared_ptr<Model_Document>
   return true; // theResults must be empty: everything is deleted
 }
 
-void Model_AttributeSelection::updateInHistory()
+void Model_AttributeSelection::updateInHistory(bool& theRemove)
 {
   ResultPtr aContext = std::dynamic_pointer_cast<ModelAPI_Result>(myRef.value());
   // only bodies and parts may be modified later in the history, don't do anything otherwise
@@ -1572,7 +1395,7 @@ void Model_AttributeSelection::updateInHistory()
   std::shared_ptr<Model_Data> aContData = std::dynamic_pointer_cast<Model_Data>(aContext->data());
   if (!aContData.get() || !aContData->isValid())
     return;
-  TDF_Label aContLab = aContData->label(); // named shape where the selected context is located
+  TDF_Label aContLab = aContData->shapeLab(); // named shape where the selected context is located
   Handle(TNaming_NamedShape) aContNS;
   if (!aContLab.FindAttribute(TNaming_NamedShape::GetID(), aContNS)) {
     bool aFoundNewContext = true;
@@ -1589,13 +1412,14 @@ void Model_AttributeSelection::updateInHistory()
             // to avoid detection of part changes by local selection only
             AttributeSelectionPtr aSel =
               std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aRef);
-            if (aSel.get() && !aSel->value()->isSame(aSel->context()->shape()))
+            if (aSel.get() && aSel->value().get() &&
+                !aSel->value()->isSame(aSel->context()->shape()))
               continue;
 
             FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
-            if (aRefFeat.get() && aRefFeat != owner()) {
+            if (aRefFeat.get() && aRefFeat != owner() && aRefFeat->firstResult().get()) {
               FeaturePtr aThisFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
-              if (aDoc->objects()->isLater(aThisFeature, aRefFeat)) { // found better feature
+              if (!aDoc->isLaterByDep(aRefFeat, aThisFeature)) { // found better feature
                 aFoundNewContext = true;
                 aNewContext = aRefFeat->firstResult();
               }
@@ -1632,63 +1456,382 @@ void Model_AttributeSelection::updateInHistory()
   TopTools_ListOfShape aValShapes;
   if (searchNewContext(aDoc, aNewCShape, aContext, aValShape, aContLab, aNewContexts, aValShapes))
   {
-    // update scope to reset to a new one
-    myScope.Clear();
+    std::set<ResultPtr> allContexts, aSkippedContext;
+    std::list<ResultPtr>::iterator aNewContext = aNewContexts.begin();
+    for(; aNewContext != aNewContexts.end(); aNewContext++)
+      allContexts.insert(*aNewContext);
+
+    // if there exist context composite and sub-result(s), leave only sub(s)
+    std::set<ResultPtr>::iterator aResIter = allContexts.begin();
+    for(; aResIter != allContexts.end(); aResIter++) {
+      ResultPtr aParent = ModelAPI_Tools::bodyOwner(*aResIter);
+      for(; aParent.get(); aParent = ModelAPI_Tools::bodyOwner(aParent))
+        if (allContexts.count(aParent))
+          aSkippedContext.insert(aParent);
+    }
+
+    GeomAPI_Shape::ShapeType aListShapeType = GeomAPI_Shape::SHAPE;
+    if (myParent) {
+      if (myParent->selectionType() == "VERTEX" || myParent->selectionType() == "Vertices")
+        aListShapeType = GeomAPI_Shape::VERTEX;
+      else if (myParent->selectionType() == "EDGE" || myParent->selectionType() == "Edges")
+        aListShapeType = GeomAPI_Shape::EDGE;
+      else if (myParent->selectionType() == "FACE" || myParent->selectionType() == "Faces")
+        aListShapeType = GeomAPI_Shape::FACE;
+    }
 
     std::list<ResultPtr>::iterator aNewCont = aNewContexts.begin();
     TopTools_ListIteratorOfListOfShape aNewValues(aValShapes);
-    if (aNewCont == aNewContexts.end()) { // all results were deleted
-      ResultPtr anEmptyContext;
-      std::shared_ptr<GeomAPI_Shape> anEmptyShape;
-      setValue(anEmptyContext, anEmptyShape); // nullify the selection
-      return;
+    bool aFirst = true; // first is set to this, next are appended to parent
+    for(; aNewCont != aNewContexts.end(); aNewCont++, aNewValues.Next()) {
+      if (aSkippedContext.count(*aNewCont))
+        continue;
+
+      GeomShapePtr aValueShape;
+      if (!aNewValues.Value().IsNull()) {
+        aValueShape = std::make_shared<GeomAPI_Shape>();
+        aValueShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewValues.Value()));
+      }
+      // Check that list has the same type of shape selection before adding.
+      GeomAPI_Shape::ShapeType aShapeShapeType = GeomAPI_Shape::SHAPE;
+      if (aValueShape.get()) {
+        aShapeShapeType = aValueShape->shapeType();
+      } else {
+        aShapeShapeType = (*aNewCont)->shape()->shapeType();
+      }
+      if (aListShapeType != GeomAPI_Shape::SHAPE && aListShapeType != aShapeShapeType) {
+        continue;
+      }
+
+      if (aFirst) {
+        if (!myParent || !myParent->isInList(*aNewCont, aValueShape)) { // avoid duplicates
+          setValue(*aNewCont, aValueShape);
+          aFirst = false;
+        }
+      } else if (myParent) {
+        if (!myParent->isInList(*aNewCont, aValueShape)) // avoid addition of duplicates
+          myParent->append(*aNewCont, aValueShape);
+      }
     }
+    if (aFirst) { // nothing was added, all results were deleted
+      if (myParent) {
+        theRemove = true;
+      } else {
+        ResultPtr anEmptyContext;
+        std::shared_ptr<GeomAPI_Shape> anEmptyShape;
+        setValue(anEmptyContext, anEmptyShape); // nullify the selection
+        return;
+      }
+    }
+  }
+}
+
+void Model_AttributeSelection::setParent(Model_AttributeSelectionList* theParent)
+{
+  myParent = theParent;
+}
 
-    GeomShapePtr aValueShape;
-    if (!aNewValues.Value().IsNull()) {
-      aValueShape = std::make_shared<GeomAPI_Shape>();
-      aValueShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewValues.Value()));
+std::string Model_AttributeSelection::contextName(const TDF_Label theSelectionLab)
+{
+  std::shared_ptr<Model_Document> aDoc = myRestoreDocument.get() ? myRestoreDocument :
+    std::dynamic_pointer_cast<Model_Document>(owner()->document());
+  FeaturePtr aFeatureOwner = aDoc->featureByLab(theSelectionLab);
+  bool aBaseDocumnetUsed = false;
+  if (!aFeatureOwner.get()) { // use module document
+    aDoc = std::dynamic_pointer_cast<Model_Document>(ModelAPI_Session::get()->moduleDocument());
+    aFeatureOwner = aDoc->featureByLab(theSelectionLab);
+    aBaseDocumnetUsed = true;
+  }
+  if (aFeatureOwner.get()) {
+    // if it is sub-element of the sketch, the context name is the name of the sketch
+    // searching also for result - real context
+    ResultPtr aResult;
+    FeaturePtr aComposite = ModelAPI_Tools::compositeOwner(aFeatureOwner);
+    if (aComposite.get() && aComposite->results().size() == 1 &&
+        aComposite->firstResult()->groupName() == ModelAPI_ResultConstruction::group()) {
+      aFeatureOwner = aComposite;
+      aResult = aFeatureOwner->firstResult();
+    } else {
+      aResult = aDoc->resultByLab(theSelectionLab);
     }
-    setValue(*aNewCont, aValueShape);
-    // if there are more than one result, put them by "append" into "parent" list
-    if (myParent) {
-      for(aNewCont++, aNewValues.Next(); aNewCont != aNewContexts.end();
-          aNewCont++, aNewValues.Next()) {
-        GeomShapePtr aValueShape;
-        if (!aNewValues.Value().IsNull()) {
-          aValueShape = std::make_shared<GeomAPI_Shape>();
-          aValueShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aNewValues.Value()));
+    if (aResult.get()) {
+      // this is to avoid duplicated names of results problem
+      std::string aContextName = aResult->data()->name();
+      // myLab corresponds to the current time
+      TDF_Label aCurrentLab = selectionLabel();
+      while(aCurrentLab.Depth() > 3)
+        aCurrentLab = aCurrentLab.Father();
+
+      int aNumInHistoryNames =
+        aDoc->numberOfNameInHistory(aResult, aCurrentLab);
+      while(aNumInHistoryNames > 1) { // add "_" before name the needed number of times
+        aContextName = "_" + aContextName;
+        aNumInHistoryNames--;
+      }
+      if (aBaseDocumnetUsed)
+        aContextName = aDoc->kind() + "/" + aContextName;
+      return aContextName;
+    }
+  }
+  return ""; // invalid case
+}
+
+/// This method restores by the context and value name the context label and
+/// sub-label where the value is. Returns true if it is valid.
+bool Model_AttributeSelection::restoreContext(std::string theName,
+  TDF_Label& theContext, TDF_Label& theValue)
+{
+  static const GeomShapePtr anEmptyShape; // to store context only
+  std::string aName = theName;
+  std::shared_ptr<Model_Document> aDoc = myRestoreDocument.get() ? myRestoreDocument :
+    std::dynamic_pointer_cast<Model_Document>(owner()->document());
+
+  // remove the sub-value part if exists
+  std::string aSubShapeName = aName;
+  std::string::size_type n = aName.find('/');
+  if (n != std::string::npos) {
+    aName = aName.substr(0, n);
+  }
+
+  if (aName.empty()) return false;
+  bool anUniqueContext = false;
+  ResultPtr aCont = aDoc->findByName(aName, aSubShapeName, anUniqueContext);
+  if (!aCont.get() || !aCont->shape().get() || aCont->shape()->isNull()) {
+    // name in PartSet?
+    aDoc = std::dynamic_pointer_cast<Model_Document>(
+      ModelAPI_Session::get()->moduleDocument());
+    if (theName.find(aDoc->kind()) == 0) { // remove the document identifier from name if exists
+      aSubShapeName = theName.substr(aDoc->kind().size() + 1);
+      aName = aSubShapeName;
+      std::string::size_type n = aName.find('/');
+      if (n != std::string::npos) {
+        aName = aName.substr(0, n);
+      }
+    }
+    aCont = aDoc->findByName(aName, aSubShapeName, anUniqueContext);
+    if (!aCont.get() || !aCont->shape().get() || aCont->shape()->isNull())
+      return false;
+  }
+
+  // searching the sub-shape
+  static const ResultPtr anEmpty;
+  theValue = aDoc->findNamingName(aSubShapeName, anUniqueContext ? aCont : anEmpty);
+
+  // sketch sub-component shape and name is located in separated feature label, try the sub-name
+  if (theValue.IsNull() && aCont->groupName() == ModelAPI_ResultConstruction::group()) {
+    std::string::size_type aSlash = aSubShapeName.rfind('/');
+    if (aSlash != std::string::npos) {
+      std::string aCompName = aSubShapeName.substr(aSlash + 1);
+      CompositeFeaturePtr aComposite =
+        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aDoc->feature(aCont));
+      if (aComposite.get() && aComposite->numberOfSubs()) {
+        const int aSubNum = aComposite->numberOfSubs();
+        for (int a = 0; a < aSubNum && theValue.IsNull(); a++) {
+          FeaturePtr aSub = aComposite->subFeature(a);
+          const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
+          std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
+          for (; aRes != aResults.cend() && theValue.IsNull(); aRes++) {
+            if ((*aRes)->data()->name() == aCompName) {
+              theValue = std::dynamic_pointer_cast<Model_Data>((*aRes)->data())->shapeLab();
+              break;
+            } else { // any sub-label because the sketch line may be renamed, but not sub-vertices
+              TDF_Label aLab = std::dynamic_pointer_cast<Model_Data>((*aRes)->data())->shapeLab();
+              TDF_ChildIDIterator aSubNames(aLab, TDataStd_Name::GetID());
+              for(; aSubNames.More(); aSubNames.Next()) {
+                if (Handle(TDataStd_Name)::DownCast(aSubNames.Value())->Get().
+                  IsEqual(aCompName.c_str())) {
+                  theValue = aSubNames.Value()->Label();
+                  break;
+                }
+              }
+            }
+          }
         }
+      }
+    }
+  }
+
+  if (aCont.get()) {
+    theContext = std::dynamic_pointer_cast<Model_Data>(aCont->data())->label();
+  }
+  return true;
+}
+
+bool Model_AttributeSelection::isLater(
+  const TDF_Label theResult1, const TDF_Label theResult2) const
+{
+  std::shared_ptr<Model_Document> aDoc = myRestoreDocument.get() ? myRestoreDocument :
+    std::dynamic_pointer_cast<Model_Document>(owner()->document());
+  FeaturePtr aFeat1 = aDoc->featureByLab(theResult1);
+  if (!aFeat1.get())
+    return false;
+  FeaturePtr aFeat2 = aDoc->featureByLab(theResult2);
+  if (!aFeat2.get())
+    return false;
+  return aDoc->isLaterByDep(aFeat1, aFeat2);
+}
 
-        // Check that list has the same type of shape selection before adding.
-        GeomAPI_Shape::ShapeType aListShapeType = GeomAPI_Shape::SHAPE;
-        if (myParent->selectionType() == "VERTEX") aListShapeType = GeomAPI_Shape::VERTEX;
-        else if (myParent->selectionType() == "EDGE") aListShapeType = GeomAPI_Shape::EDGE;
-        else if (myParent->selectionType() == "FACE") aListShapeType = GeomAPI_Shape::FACE;
-
-        GeomAPI_Shape::ShapeType aShapeShapeType = GeomAPI_Shape::SHAPE;
-        if (aValueShape.get()) {
-          aShapeShapeType = aValueShape->shapeType();
-        } else {
-          (*aNewCont)->shape()->shapeType();
+ResultPtr Model_AttributeSelection::newestContext(
+  const ResultPtr theCurrent, const GeomShapePtr theValue)
+{
+  ResultPtr aResult = theCurrent;
+  GeomShapePtr aSelectedShape = theValue.get() ? theValue : theCurrent->shape();
+  std::shared_ptr<Model_Document> aDoc =
+    std::dynamic_pointer_cast<Model_Document>(owner()->document());
+  bool aFindNewContext = true;
+  while (aFindNewContext && aResult.get()) {
+    aFindNewContext = false;
+    // try to find the last context to find the up to date shape
+    TopoDS_Shape aConShape = aResult->shape()->impl<TopoDS_Shape>();
+    if (TNaming_Tool::HasLabel(selectionLabel(), aConShape)) {
+      Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aConShape, selectionLabel());
+      if (!aNS.IsNull()) {
+        aNS = TNaming_Tool::CurrentNamedShape(aNS);
+        if (!aNS.IsNull()
+            && isLater(selectionLabel(), aNS->Label())
+            && isLater(aNS->Label(),
+                       std::dynamic_pointer_cast<Model_Data>(aResult->data())->label()))
+        {
+          TDF_Label aLab = aNS->Label();
+          ResultPtr aRes = aDoc->resultByLab(aLab);
+          if (aRes.get()) {
+            if (aRes->shape()->isSubShape(aSelectedShape)) {
+              aResult = aRes;
+              aFindNewContext = true;
+              continue;
+            }
+          }
         }
+      }
+    }
 
-        if (aListShapeType != GeomAPI_Shape::SHAPE && aListShapeType != aShapeShapeType) {
+    // TestFillWireVertex.py - sketch constructions for wire may participate too
+    //if (aResult->groupName() == ModelAPI_ResultBody::group()) {
+      // try to search newer context by the concealment references
+      // take references to all results: root one, any sub
+    std::list<ResultPtr> allRes;
+    ResultPtr aCompContext;
+    ResultBodyPtr aCompBody = ModelAPI_Tools::bodyOwner(aResult, true);
+    if (aCompBody.get()) {
+      ModelAPI_Tools::allSubs(aCompBody, allRes);
+      allRes.push_back(aCompBody);
+      aCompContext = aCompBody;
+    }
+    if (allRes.empty())
+      allRes.push_back(aResult);
+
+    for (std::list<ResultPtr>::iterator aSub = allRes.begin(); aSub != allRes.end(); aSub++) {
+      ResultPtr aResCont = *aSub;
+      ResultBodyPtr aResBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResCont);
+      if (aResBody.get() && aResBody->numberOfSubs() > 0 && aResBody != aCompContext)
+        continue; // only lower and higher level subs are counted
+      const std::set<AttributePtr>& aRefs = aResCont->data()->refsToMe();
+      std::set<AttributePtr>::const_iterator aRef = aRefs.begin();
+      for (; !aFindNewContext && aRef != aRefs.end(); aRef++) {
+        if (!aRef->get() || !(*aRef)->owner().get())
           continue;
+        // concealed attribute only
+        FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
+        if (!ModelAPI_Session::get()->validators()->isConcealed(
+          aRefFeat->getKind(), (*aRef)->id()))
+          continue;
+        // search the feature result that contains sub-shape selected
+        std::list<std::shared_ptr<ModelAPI_Result> > aResults;
+
+        // take all sub-results or one result
+        std::list<ResultPtr> aRefFeatResults;
+        ModelAPI_Tools::allResults(aRefFeat, aRefFeatResults);
+        std::list<ResultPtr>::iterator aRefResIter = aRefFeatResults.begin();
+        for (; aRefResIter != aRefFeatResults.end(); aRefResIter++) {
+          ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRefResIter);
+          if (aBody.get() && aBody->numberOfSubs() == 0) // add only lower level subs
+            aResults.push_back(aBody);
         }
+        std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = aResults.begin();
 
-        myParent->append(*aNewCont, aValueShape);
+        // searching by sub-shape
+        for (; aResIter != aResults.end(); aResIter++) {
+          if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled())
+            continue;
+          GeomShapePtr aShape = (*aResIter)->shape();
+          if (aShape.get() && aShape->isSubShape(aSelectedShape, false)) {
+            aResult = *aResIter; // found new context (produced from this) with same subshape
+            aFindNewContext = true; // continue searching further
+            break;
+          }
+        }
       }
     }
   }
+  // if compsolid is context, try to take sub-solid as context: like in GUI and scripts
+  ResultBodyPtr aComp = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
+  if (aComp && aComp->numberOfSubs()) {
+    std::list<ResultPtr> allSubs;
+    ModelAPI_Tools::allSubs(aComp, allSubs);
+    std::list<ResultPtr>::iterator aS = allSubs.begin();
+    for (; aS != allSubs.end(); aS++) {
+      ResultBodyPtr aSub = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aS);
+      if (aSub && aSub->numberOfSubs() == 0 && aSub->shape().get() &&
+          aSub->shape()->isSubShape(aSelectedShape)) {
+        aResult = aSub;
+        break;
+      }
+    }
+  }
+  // in case sketch line was selected for wire, but wire was concealed and not such line anymore,
+  // so, actually, the sketch element was selected (which is never concealed)
+  if (aResult != theCurrent && aResult->isConcealed())
+    aResult = theCurrent;
+  return aResult;
 }
 
-void Model_AttributeSelection::setParent(Model_AttributeSelectionList* theParent)
+void Model_AttributeSelection::combineGeometrical()
 {
-  myParent = theParent;
+  if (myTmpContext.get() || myTmpSubShape.get())
+    return;
+  TDF_Label aSelLab = selectionLabel();
+  if (aSelLab.IsAttribute(kINVALID_SELECTION) || !myRef.isInitialized())
+    return;
+
+  if (aSelLab.IsAttribute(kCIRCLE_CENTER) || aSelLab.IsAttribute(kELLIPSE_CENTER1) ||
+      aSelLab.IsAttribute(kELLIPSE_CENTER2) || aSelLab.IsAttribute(kSIMPLE_REF_ID))
+    return;
+
+  if (aSelLab.IsAttribute(kPART_REF_ID)) {
+    ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(context());
+    if (!aPart.get() || !aPart->isActivated())
+      return; // postponed naming needed
+    Handle(TDataStd_Integer) anIndex;
+    if (aSelLab.FindAttribute(TDataStd_Integer::GetID(), anIndex)) {
+      if (anIndex->Get()) { // special selection attribute was created, use it
+        std::string aNewName;
+        aPart->combineGeometrical(anIndex->Get(), aNewName);
+        TDataStd_Name::Set(aSelLab, aNewName.c_str());
+      }
+    }
+    return;
+  }
+
+  std::shared_ptr<Model_ResultConstruction> aConstr =
+    std::dynamic_pointer_cast<Model_ResultConstruction>(context());
+  if (aConstr.get())
+    return;
+  FeaturePtr aFeature = contextFeature();
+  if (aFeature.get())
+    return;
+
+  Selector_Selector aSelector(aSelLab, baseDocumentLab());
+  TopoDS_Shape aContextShape = context()->shape()->impl<TopoDS_Shape>();
+  if (aSelector.restore(aContextShape)) {
+    aSelector.combineGeometrical(aContextShape);
+  }
 }
 
-bool Model_AttributeSelection::isWeakNaming()
+TDF_Label Model_AttributeSelection::baseDocumentLab()
 {
-  return selectionLabel().IsAttribute(kWEAK_NAMING);
+  if (ModelAPI_Session::get()->moduleDocument() != owner()->document())
+    return std::dynamic_pointer_cast<Model_Document>
+      (ModelAPI_Session::get()->moduleDocument())->extConstructionsLabel();
+  static TDF_Label anEmpty;
+  return anEmpty;
 }
index 66f628ebb295069df51d7d450f77351b8b7f386a..1896caa017f435687409907b388f0ac42a6c2d06 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeSelection_H_
@@ -24,6 +23,7 @@
 #include "Model.h"
 #include "Model_AttributeReference.h"
 #include <ModelAPI_AttributeSelection.h>
+#include <Selector_NameGenerator.h>
 #include <TDF_LabelMap.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopTools_ListOfShape.hxx>
@@ -35,24 +35,29 @@ class Model_Document;
  * \ingroup DataModel
  * \brief Attribute that contains reference to the sub-shape of some result, the selected shape.
  */
-class Model_AttributeSelection : public ModelAPI_AttributeSelection
+class Model_AttributeSelection : public ModelAPI_AttributeSelection,
+                                 public Selector_NameGenerator
 {
-  Model_AttributeReference myRef;  ///< The reference functionality reusage
-  TDF_LabelMap myScope; ///< the map of valid labels for naming selection solving
+  Model_AttributeReference myRef;  ///< The reference functionality re-usage
   /// temporarily storages to avoid keeping in the data structure if not needed
   ResultPtr myTmpContext;
   /// temporarily storages to avoid keeping in the data structure if not needed
   std::shared_ptr<GeomAPI_Shape> myTmpSubShape;
   /// temporarily storages to avoid keeping in the data structure if not needed
   CenterType myTmpCenterType;
-  /// Reference to the partent attribute, if any (to split selection compounds in issue 1799)
+  /// Reference to the parent attribute, if any (to split selection compounds in issue 1799)
   Model_AttributeSelectionList* myParent;
+
+  std::shared_ptr<Model_Document> myRestoreDocument; // current document to restore by name
+  /// If true attribute selects geometry instead of shape.
+  bool myIsGeometricalSelection;
+
 public:
   /// Defines the result and its selected sub-shape
   /// \param theContext object where the sub-shape was selected
   /// \param theSubShape selected sub-shape (if null, the whole context is selected)
   /// \param theTemporarily if it is true, do not store and name the added in the data framework
-  ///           (used to remove immideately, without the following updates)
+  ///           (used to remove immediately, without the following updates)
   /// \returns true if attribute was updated
   MODEL_EXPORT virtual bool setValue(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
@@ -86,7 +91,7 @@ public:
   /// Sets the feature object
   MODEL_EXPORT virtual void setObject(const std::shared_ptr<ModelAPI_Object>& theObject);
 
-  /// Updates the underlied selection due to the changes in the referenced objects
+  /// Updates the selection due to the changes in the referenced objects
   /// \returns false if update is failed
   MODEL_EXPORT virtual bool update();
 
@@ -94,17 +99,10 @@ public:
   /// \param theDefaultValue a name, which is returned if the naming name can not be obtained
   MODEL_EXPORT virtual std::string namingName(const std::string& theDefaultValue = "");
 
-  /// Returns an Id of the selection
-  /// NOTE: This method has been added for temporary export of groups towards old GEOM
-  /// It should then be removed when a direct use of objects from SHAPER
-  /// will be possible from SMESH module of SALOME.
-  MODEL_EXPORT virtual int Id();
-
   /// Defines the sub-shape by Id
-  /// NOTE: This method is opposite to Id() method.
   MODEL_EXPORT virtual void setId(int theID);
 
-  /// Selects (i.e. creates Naming data structure) of sub-shape specifed by textual name
+  /// Selects (i.e. creates Naming data structure) of sub-shape specified by textual name
   MODEL_EXPORT virtual void selectSubShape(const std::string& theType,
                                            const std::string& theSubShapeName);
 
@@ -118,16 +116,32 @@ public:
   /// Returns true if attribute was  initialized by some value
   MODEL_EXPORT virtual bool isInitialized();
 
-  /// Returns true if recomute of selection become impossible
+  /// Returns true if recompute of selection become impossible
   MODEL_EXPORT virtual bool isInvalid();
 
   /// Updates the arguments of selection if something was affected by creation
   /// or reorder of features upper in the history line (issue #1757)
-  MODEL_EXPORT virtual void updateInHistory();
+  /// Returns theRemove true if this attribute must be removed (become deleted)
+  MODEL_EXPORT virtual void updateInHistory(bool& theRemove);
+
+  // Implementation of the name generator method from the Selector package
+  // This method returns the context name by the label of the sub-selected shape
+  MODEL_EXPORT virtual std::string contextName(const TDF_Label theSelectionLab) override;
 
-  /// Returns true if the name was stored using weak naming principle
-  MODEL_EXPORT virtual bool isWeakNaming();
+  /// This method restores by the context and value name the context label and
+  /// sub-label where the value is. Returns true if it is valid.
+  MODEL_EXPORT virtual bool restoreContext(std::string theName,
+    TDF_Label& theContext, TDF_Label& theValue) override;
 
+  /// Returns true if the first result is newer than the second one in the tree of features
+  MODEL_EXPORT virtual bool isLater(const TDF_Label theResult1, const TDF_Label theResult2)
+    const override;
+
+  /// Returns the name by context. Adds the part name if the context is located in other document
+  MODEL_EXPORT virtual std::string contextName(const ResultPtr& theContext) const;
+
+  /// Makes the current local selection becomes all sub-shapes with same base geometry.
+  MODEL_EXPORT virtual void combineGeometrical();
 
 protected:
   /// Objects are created for features automatically
@@ -139,9 +153,6 @@ protected:
   /// Returns theType type of the center, or NOT_CENTER if it is not.
   std::shared_ptr<GeomAPI_Shape> internalValue(CenterType& theType);
 
-
-  /// Performs the selection for the body result (TNaming Selection)
-
   /// Performs the selection for the body result (TNaming selection)
   virtual void selectBody(
     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape);
@@ -150,7 +161,7 @@ protected:
   /// \param theContext the result - owner of the selection
   /// \param theSubShape selected shape
   /// \param theUpdate flag that shows that it must be just update, theShape is null
-  /// \returns true if eveything is selected correctly
+  /// \returns true if everything is selected correctly
   virtual bool selectPart(
     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theUpdate = false);
@@ -159,15 +170,9 @@ protected:
   /// Note: there must be no attributes stored at the same label because Selector clears this lab
   TDF_Label selectionLabel();
 
-  /// Returns the prepared map of valid labels for naming selection solving (creates if not exists)
-  TDF_LabelMap& scope();
-
   /// Sets the ID of the attribute in Data (called from Data): here it is used for myRef ID setting
   MODEL_EXPORT virtual void setID(const std::string theID);
 
-  /// Returns the name by context. Adds the part name if the context is located in other document
-  std::string contextName(const ResultPtr& theContext) const;
-
   /// Sets the parent attribute
   void setParent(Model_AttributeSelectionList* theParent);
 
@@ -179,11 +184,24 @@ protected:
                         ResultPtr theContext, TopoDS_Shape theValShape, TDF_Label theAccessLabel,
                         std::list<ResultPtr>& theResults, TopTools_ListOfShape& theValShapes);
 
+  /// Searches for the newest context, modification of the current, that contains theValue
+  ResultPtr newestContext(
+    const ResultPtr theCurrent, const std::shared_ptr<GeomAPI_Shape> theValue);
+
   /// computes theShapes list - shapes that were generated/modified/deleted the theValShape
   /// during creation from new to old context
   void computeValues(ResultPtr theOldContext, ResultPtr theNewContext, TopoDS_Shape theValShape,
     TopTools_ListOfShape& theShapes);
 
+  /// Returns true if is geometrical selection.
+  virtual bool isGeometricalSelection() const {
+    return myIsGeometricalSelection;
+  };
+
+  /// Returns the module document label if this selection attribute is not in this document.
+  /// Returns null label otherwise.
+  TDF_Label baseDocumentLab();
+
   friend class Model_Data;
   friend class Model_AttributeSelectionList;
 };
index 9fb4124075eac962de1a6d8b15a7770541194003..0ef7aeff351e869d8975bff2aff5d56d7d9ba7b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeSelectionList.h"
 
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Shape.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <TDF_AttributeIterator.hxx>
 #include <TDF_ChildIterator.hxx>
 #include <TDF_RelocationTable.hxx>
 #include <TDF_DeltaOnAddition.hxx>
+#include <TDataStd_UAttribute.hxx>
 #include <TopAbs_ShapeEnum.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <NCollection_List.hxx>
 
+/// GUID for UAttribute that indicates the list has "To add all elements that share the same
+/// topology" flag enabled
+static const Standard_GUID kIS_GEOMETRICAL_SELECTION("f16987b6-e6c8-435c-99fa-03a7e0b06e83");
+
 void Model_AttributeSelectionList::append(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theTemporarily)
@@ -231,7 +236,7 @@ void Model_AttributeSelectionList::remove(const std::set<int>& theIndices)
 {
   int anOldSize = mySize->Get();
   int aRemoved = 0;
-  // iterate one by one and shifting the removed indicies
+  // iterate one by one and shifting the removed indices
   for(int aCurrent = 0; aCurrent < anOldSize; aCurrent++) {
     if (theIndices.find(aCurrent) == theIndices.end()) { // not removed
       if (aRemoved) { // but must be shifted to the removed position
@@ -263,6 +268,21 @@ int Model_AttributeSelectionList::size()
   return mySize->Get();
 }
 
+// LCOV_EXCL_START
+
+// returns true if theShape is same with theInList or is contained in it (a compound)
+static bool isIn(GeomShapePtr theInList, GeomShapePtr theShape) {
+  if (theShape->isSame(theInList))
+    return true;
+  if (theInList.get() && theInList->shapeType() == GeomAPI_Shape::COMPOUND) {
+    for(GeomAPI_ShapeIterator anIter(theInList); anIter.more(); anIter.next()) {
+      if (!anIter.current()->isNull() && anIter.current()->isSame(theShape))
+        return true;
+    }
+  }
+  return false;
+}
+
 bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext,
                                             const std::shared_ptr<GeomAPI_Shape>& theSubShape,
                                             const bool theTemporarily)
@@ -281,7 +301,7 @@ bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext,
               return true;
           } else {
             // we need to call here isSame instead of isEqual to do not check shapes orientation
-            if (theSubShape->isSame(*aShapes))
+            if (isIn(*aShapes, theSubShape))
               return true;
           }
         }
@@ -301,7 +321,7 @@ bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext,
           }
         } else {
           // we need to call here isSame instead of isEqual to do not check shapes orientation
-          if (theSubShape->isSame(aValue)) // shapes are equal
+          if (isIn(aValue, theSubShape)) // shapes are equal
             return true;
         }
       }
@@ -309,6 +329,7 @@ bool Model_AttributeSelectionList::isInList(const ObjectPtr& theContext,
   }
   return false;
 }
+// LCOV_EXCL_STOP
 
 const std::string Model_AttributeSelectionList::selectionType() const
 {
@@ -328,15 +349,15 @@ std::shared_ptr<ModelAPI_AttributeSelection>
   }
   TDF_Label aLabel = mySize->Label().FindChild(theIndex + 1);
   // create a new attribute each time, by demand
-  // supporting of old attributes is too slow (synch each time) and buggy on redo
-  // (if attribute is deleted and created, the abort updates attriute and makes the Attr invalid)
+  // supporting of old attributes is too slow (sync each time) and buggy on redo
+  // (if attribute is deleted and created, the abort updates attribute and makes the Attr invalid)
   std::shared_ptr<Model_AttributeSelection> aNewAttr =
     std::shared_ptr<Model_AttributeSelection>(new Model_AttributeSelection(aLabel));
-  aNewAttr->setID(id());
   if (owner()) {
     aNewAttr->setObject(owner());
     aNewAttr->setParent(this);
   }
+  aNewAttr->setID(id());
   return aNewAttr;
 }
 
@@ -371,8 +392,8 @@ bool Model_AttributeSelectionList::isInitialized()
 }
 
 Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
+: myLab(theLabel)
 {
-  myLab = theLabel;
   reinit();
 }
 
@@ -388,7 +409,7 @@ void Model_AttributeSelectionList::reinit()
   myIsCashed = false;
 }
 
-
+// LCOV_EXCL_START
 void Model_AttributeSelectionList::cashValues(const bool theEnabled)
 {
   myIsCashed = theEnabled;
@@ -402,3 +423,60 @@ void Model_AttributeSelectionList::cashValues(const bool theEnabled)
     }
   }
 }
+// LCOV_EXCL_STOP
+
+bool Model_AttributeSelectionList::isGeometricalSelection() const
+{
+  return myLab.IsAttribute(kIS_GEOMETRICAL_SELECTION);
+}
+
+void Model_AttributeSelectionList::setGeometricalSelection(const bool theIsGeometricalSelection)
+{
+  if (isGeometricalSelection() == theIsGeometricalSelection)
+    return; // nothing to do
+  if (theIsGeometricalSelection) // store the state
+    TDataStd_UAttribute::Set(myLab, kIS_GEOMETRICAL_SELECTION);
+  else
+    myLab.ForgetAttribute(kIS_GEOMETRICAL_SELECTION);
+  std::set<int> anIndiciesToRemove;  // Update list according to the flag
+  if (theIsGeometricalSelection) { // all objects with same geometry must be combined into single
+    std::list<AttributeSelectionPtr> anAttributes; // collect attributes with geometrical compounds
+    for(int anIndex = 0; anIndex < size(); anIndex++) {
+      AttributeSelectionPtr anAttr = value(anIndex);
+      if (!anAttr.get() || !anAttr->context().get())
+        continue;
+      anAttr->combineGeometrical();
+      if (!anAttr->value().get() || anAttr->value()->shapeType() != GeomAPI_Shape::COMPOUND)
+        continue;
+      // check it is equal to some other attribute already presented in the list
+      std::list<AttributeSelectionPtr>::iterator anAttrIter = anAttributes.begin();
+      for(; anAttrIter != anAttributes.end(); anAttrIter++) {
+        if (anAttr->context() == (*anAttrIter)->context() &&
+            anAttr->namingName() == (*anAttrIter)->namingName()) {
+          anIndiciesToRemove.insert(anIndex);
+          break;
+        }
+      }
+      if (anAttrIter == anAttributes.end()) // not removed, so, add to the compare-list
+        anAttributes.push_back(anAttr);
+    }
+  } else { // all objects with same geometry must be divided into separated sub-attributes
+    int anInitialSize = size();
+    for(int anIndex = 0; anIndex < anInitialSize; anIndex++) {
+      AttributeSelectionPtr anAttr = value(anIndex);
+      if (!anAttr.get() || !anAttr->context().get())
+        continue;
+      GeomShapePtr aValue = anAttr->value();
+      if (!aValue.get() || aValue->shapeType() != GeomAPI_Shape::COMPOUND)
+        continue;
+      for(GeomAPI_ShapeIterator anIter(aValue); anIter.more(); anIter.next()) {
+        append(anAttr->context(), anIter.current());
+      }
+      anIndiciesToRemove.insert(anIndex);
+    }
+  }
+  remove(anIndiciesToRemove);
+  myIsCashed = false;
+  myCash.clear(); // empty list as indicator that cash is not used
+  owner()->data()->sendAttributeUpdated(this);
+}
index 7e0736fe836a496485a913a9455348321fdb1ffd..839cd431d23cb4049f8ab2547f66d5b941ed89fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeSelectionList_H_
@@ -50,7 +49,7 @@ public:
   /// \param theContext object where the sub-shape was selected
   /// \param theSubShape selected sub-shape (if null, the whole context is selected)
   /// \param theTemporarily if it is true, do not store and name the added in the data framework
-  ///           (used to remove immideately, without the following updates)
+  ///           (used to remove immediately, without the following updates)
   MODEL_EXPORT virtual void append(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theTemporarily = false);
@@ -77,14 +76,14 @@ public:
   /// \param theIndices a list of indices of elements to be removed
   MODEL_EXPORT virtual void remove(const std::set<int>& theIndices);
 
-  /// Returns the number ofselection attributes in the list
+  /// Returns the number of selection attributes in the list
   MODEL_EXPORT virtual int size();
 
   /// Returns true if the object with the shape are in list
   /// \param theContext object where the sub-shape was selected
   /// \param theSubShape selected sub-shape (if null, the whole context is selected)
   /// \param theTemporarily if it is true, it checks also the temporary added item
-  /// \returns true if the pair is found in the attirbute
+  /// \returns true if the pair is found in the attribute
   MODEL_EXPORT virtual bool isInList(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theTemporarily = false);
@@ -111,13 +110,23 @@ public:
   /// during non-modification operations with this attribute)
   MODEL_EXPORT virtual void cashValues(const bool theEnabled);
 
+  MODEL_EXPORT virtual void setGeometricalSelection(const bool theIsGeometricalSelection) override;
+
+  /// Returns true if is geometrical selection.
+  MODEL_EXPORT virtual bool isGeometricalSelection() const override;
+
 protected:
   /// Objects are created for features automatically
   MODEL_EXPORT Model_AttributeSelectionList(TDF_Label& theLabel);
   /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
   virtual void reinit();
 
+  /// Tries to merge attributes in this list with the same result shape. Returns true
+  /// if theStart matches with some later attribute and theStart is removed from the list.
+  bool merge(Model_AttributeSelection* theStart);
+
   friend class Model_Data;
+  friend class Model_AttributeSelection;
 };
 
 #endif
index 2b97d891a5c396da5249affb7ef4cba2ebe829de..4c812fc26744e03ee87060f3d4ee66b9fa0c3a18 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_AttributeString.h>
@@ -41,12 +40,31 @@ void Model_AttributeString::setValue(const std::string& theValue)
   }
 }
 
+void Model_AttributeString::setValue(const std::wstring& theValue)
+{
+  TCollection_ExtendedString aValue(theValue.c_str());
+  if (!myIsInitialized || myString->Get() != aValue) {
+    if (myString.IsNull())
+      myString = TDataStd_Name::Set(myLab, TCollection_ExtendedString());
+    myString->Set(aValue);
+    owner()->data()->sendAttributeUpdated(this);
+  }
+}
+
 std::string Model_AttributeString::value()
 {
   if (myString.IsNull())
     return "";  // not initialized
   return TCollection_AsciiString(myString->Get()).ToCString();
 }
+char16_t* Model_AttributeString::valueU()
+{
+  if (myString.IsNull()) {   // not initialized
+    static TCollection_ExtendedString anEmpty;
+    return (char16_t*)(anEmpty.ToExtString());
+  }
+  return (char16_t*)(myString->Get().ToExtString());
+}
 
 Model_AttributeString::Model_AttributeString(TDF_Label& theLabel)
 {
index deabf77880c6b1a271fb7d34746ddc775f13bf5e..d678d89f9743a9de6ac374f5d9ef4976036b8554 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODEL_ATTRIBUTESTRING_H_
@@ -41,12 +40,16 @@ class Model_AttributeString : public ModelAPI_AttributeString
  public:
   /// Defines the std::string value
   MODEL_EXPORT virtual void setValue(const std::string& theValue);
+  /// Defines the std::wstring value
+  MODEL_EXPORT virtual void setValue(const std::wstring& theValue);
 
   /// Returns the std::string  value
   MODEL_EXPORT virtual std::string value();
+  /// Returns a pointer to Unicode string
+  MODEL_EXPORT virtual char16_t* valueU();
 
  protected:
-  /// Initializes attibutes
+  /// Initializes attributes
   Model_AttributeString(TDF_Label& theLabel);
   /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
   virtual void reinit();
index 12fdbeb47cde301c213d326655c22c07e791bc54..9a6fc2b2039bea5722e11091fcb17f7658f3d15c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeStringArray.h"
index e2a1e8f213e59910a24424fbf13adc6f17f2ce13..5597cddb5c938f14cf39f74ea4245f751b59c02d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeStringArray_H_
index f984c3487d8ca037f0e122885ee3857e3bd75a70..b5bf6d096ea4e624a4ca5c02e300faa5d92507fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeTables.h"
index 6015e5c99e72899ca17112f7233f6c0c4e3b6d8a..d30a3c38a06e0293e9c4635e6cd40fb7e8d8b737 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeTables_H_
index f6a9307e5bd566c9b1204711635a762decc7fd37..cef7202906378c2136bb1aebb90f1f25ae632976 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_AttributeValidator.h"
index 0c793e7e82eb1098317809511a00043405537052..774c2f2087afcf0a8d65ce4afed7a4a7b1b1c3fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_AttributeValidator_H
old mode 100755 (executable)
new mode 100644 (file)
index 8428157..5c89b7c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_BodyBuilder.h>
 
 #include <Model_Data.h>
 #include <Model_Document.h>
+#include <ModelAPI_Session.h>
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Iterator.hxx>
 #include <TNaming_Tool.hxx>
+#include <TNaming_SameShapeIterator.hxx>
 #include <TDataStd_Name.hxx>
 #include <TDataStd_Integer.hxx>
+#include <TDataStd_ExtStringList.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Face.hxx>
 #include <TDF_ChildIterator.hxx>
 #include <TDF_ChildIDIterator.hxx>
 #include <TDF_Reference.hxx>
+#include <TDF_Tool.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepTools_History.hxx>
 #include <GeomAPI_Shape.h>
+#include <GeomAPI_ShapeExplorer.h>
 #include <GeomAlgoAPI_MakeShape.h>
 #include <GeomAlgoAPI_SortListOfShapes.h>
 #include <Config_PropManager.h>
 // DEB
 //#include <TCollection_AsciiString.hxx>
-//#include <TDF_Tool.hxx>
 //#define DEB_IMPORT 1
 
-Model_BodyBuilder::Model_BodyBuilder(ModelAPI_Object* theOwner)
-: ModelAPI_BodyBuilder(theOwner),
-  myDividedIndex(1),
-  myVIndex(1),
-  myEIndex(1),
-  myFIndex(1)
-{
+/// reference to the shape in external document: sting list attribute identifier
+static const Standard_GUID kEXTERNAL_SHAPE_REF("9aa5dd14-6d34-4a8d-8786-05842fd7bbbd");
+
+static const int INVALID_TAG            = -1;
+static const int GENERATED_VERTICES_TAG = 1;
+static const int GENERATED_EDGES_TAG    = 2;
+static const int GENERATED_FACES_TAG    = 3;
+static const int MODIFIED_VERTICES_TAG  = 4;
+static const int MODIFIED_EDGES_TAG     = 5;
+static const int MODIFIED_FACES_TAG     = 6;
+static const int DELETED_TAG            = 7;
+static const int PRIMITIVES_START_TAG   = 11;
+
+static int getGenerationTag(const TopoDS_Shape& theShape) {
+  TopAbs_ShapeEnum aShapeType = theShape.ShapeType();
+  switch (aShapeType) {
+    case TopAbs_VERTEX: return GENERATED_VERTICES_TAG;
+    case TopAbs_EDGE:   return GENERATED_EDGES_TAG;
+    case TopAbs_FACE:   return GENERATED_FACES_TAG;
+  }
+
+  return INVALID_TAG;
 }
 
-// Converts evolution of naming shape to selection evelution and back to avoid
-// naming support on the disabled results. Deeply in the labels tree, recursively.
-static void evolutionToSelectionRec(TDF_Label theLab, const bool theFlag) {
-  std::list<std::pair<TopoDS_Shape, TopoDS_Shape> > aShapePairs; // to store old and new shapes
-  Handle(TNaming_NamedShape) aName;
-  int anEvolution = -1;
-  if (theLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
-    TNaming_Evolution aNSEvol = aName->Evolution();
-    if ((aNSEvol == TNaming_SELECTED && theFlag) ||
-        (aNSEvol != TNaming_SELECTED && !theFlag)) { // nothing to do, it is already correct
-      return;
-    }
-    anEvolution = (int)(aNSEvol);
-    if (!theFlag) {
-      Handle(TDataStd_Integer) anAttrEvol;
-      if (theLab.FindAttribute(TDataStd_Integer::GetID(), anAttrEvol)) {
-        anEvolution = anAttrEvol->Get();
-      }
-    } else {
-      TDataStd_Integer::Set(theLab, anEvolution);
-    }
+static int getModificationTag(const TopoDS_Shape& theShape) {
+  TopAbs_ShapeEnum aShapeType = theShape.ShapeType();
+  switch (aShapeType) {
+    case TopAbs_VERTEX: return MODIFIED_VERTICES_TAG;
+    case TopAbs_EDGE:   return MODIFIED_EDGES_TAG;
+    case TopAbs_FACE:   return MODIFIED_FACES_TAG;
+  }
 
-    for(TNaming_Iterator anIter(aName); anIter.More(); anIter.Next()) {
-      // iterator goes in reversed order relatively to the Builder, to, make the list reversed
-      aShapePairs.push_front(std::pair<TopoDS_Shape, TopoDS_Shape>
-        (anIter.OldShape(), anIter.NewShape()));
+  return INVALID_TAG;
+}
+
+static bool isAlreadyStored(const TNaming_Builder* theBuilder,
+                            const TopoDS_Shape& theOldShape,
+                            const TopoDS_Shape& theNewShape)
+{
+  for (TNaming_Iterator aNamingIt(theBuilder->NamedShape());
+    aNamingIt.More();
+    aNamingIt.Next())
+  {
+    if (aNamingIt.NewShape().IsSame(theNewShape)
+      && aNamingIt.OldShape().IsSame(theOldShape))
+    {
+      return true;
     }
+  }
+
+  return false;
+}
 
-    // create new
-    TNaming_Builder aBuilder(theLab);
-    TNaming_Evolution anEvol = (TNaming_Evolution)(anEvolution);
-    std::list<std::pair<TopoDS_Shape, TopoDS_Shape> >::iterator aPairsIter = aShapePairs.begin();
-    for(; aPairsIter != aShapePairs.end(); aPairsIter++) {
-      if (theFlag) { // disabled => make selection
-        if (anEvolution == TNaming_DELETE) // issue 2274 : don't put too many same null shapes
-          aBuilder.Select(aPairsIter->first, aPairsIter->first);
-        else if (anEvolution == TNaming_PRIMITIVE)
-          aBuilder.Select(aPairsIter->second, aPairsIter->second);
-        else
-          aBuilder.Select(aPairsIter->second, aPairsIter->first);
-      } else if (anEvol == TNaming_GENERATED) {
-        aBuilder.Generated(aPairsIter->first, aPairsIter->second);
-      } else if (anEvol == TNaming_MODIFY) {
-        aBuilder.Modify(aPairsIter->first, aPairsIter->second);
-      } else if (anEvol == TNaming_DELETE) {
-        aBuilder.Delete(aPairsIter->first);
-      } else if (anEvol == TNaming_PRIMITIVE) {
-        aBuilder.Generated(aPairsIter->second);
-      } else if (anEvol == TNaming_SELECTED) {
-        aBuilder.Select(aPairsIter->second, aPairsIter->first);
+Model_BodyBuilder::Model_BodyBuilder(ModelAPI_Object* theOwner)
+: ModelAPI_BodyBuilder(theOwner),
+  myFreePrimitiveTag(PRIMITIVES_START_TAG)
+{
+}
+
+/// Checks that shape is presented in the tree with not-selection evolution
+/// In theOriginalLabel it returns label where NS of old sub-shape is stored
+static bool isShapeInTree(const TDF_Label& theAccess1, const TDF_Label& theAccess2,
+  TopoDS_Shape theShape, TDF_Label& theOriginalLabel)
+{
+  bool aResult = TNaming_Tool::HasLabel(theAccess1, theShape);
+  if (aResult) { //check evolution and a label of this shape
+    for(TNaming_SameShapeIterator aShapes(theShape, theAccess1); aShapes.More(); aShapes.Next())
+    {
+      static Handle(TNaming_NamedShape) aNS;
+      if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+        if (aNS->Evolution() != TNaming_SELECTED) {
+          theOriginalLabel = aNS->Label();
+          return true;
+        }
       }
     }
   }
-  // recursive call for all sub-labels
-  TDF_ChildIterator anIter(theLab, Standard_False);
-  for(; anIter.More(); anIter.Next()) {
-    evolutionToSelectionRec(anIter.Value(), theFlag);
+  if (!theAccess2.IsNull()) {
+    static const TDF_Label anEmpty;
+    return isShapeInTree(theAccess2, anEmpty, theShape, theOriginalLabel);
   }
+  return false;
 }
 
-void Model_BodyBuilder::evolutionToSelection(const bool theFlag)
+/// Stores entry to the external label in the entries list at this label
+static void storeExternalReference(const TDF_Label& theExternal, const TDF_Label theThis)
 {
-  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-  if (!aData || !aData->isValid()) // unknown case
-    return;
-  TDF_Label& aShapeLab = aData->shapeLab();
-  evolutionToSelectionRec(aShapeLab, theFlag);
+  // store information about the external document reference to restore old shape on open
+  if (!theExternal.IsNull() && !theExternal.Root().IsEqual(theThis.Root())) {
+    Handle(TDataStd_ExtStringList) anEntries;
+    if (!theThis.FindAttribute(kEXTERNAL_SHAPE_REF, anEntries)) {
+      anEntries = TDataStd_ExtStringList::Set(theThis, kEXTERNAL_SHAPE_REF);
+    }
+    TCollection_AsciiString anEntry;
+    TDF_Tool::Entry(theExternal, anEntry);
+    // check it already contains this entry
+    TDataStd_ListOfExtendedString::Iterator anIter(anEntries->List());
+    for(; anIter.More(); anIter.Next())
+      if (anIter.Value() == anEntry)
+        break;
+    if (!anIter.More()) {
+      anEntries->Append(anEntry);
+    }
+  }
 }
 
-void Model_BodyBuilder::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
+void Model_BodyBuilder::store(const GeomShapePtr& theShape,
                               const bool theIsStoreSameShapes)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
   if (aData) {
-    TDF_Label& aShapeLab = aData->shapeLab();
+    TDF_Label aShapeLab = aData->shapeLab();
     // clean builders
     clean();
     // store the new shape as primitive
@@ -153,7 +184,8 @@ void Model_BodyBuilder::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
 
     if(!theIsStoreSameShapes) {
       Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShape, aShapeLab);
-      if(!aNS.IsNull() && !aNS->IsEmpty()) {
+      // the last condition is for the issue 2751 : existing shape may be found in compound-NS
+      if(!aNS.IsNull() && !aNS->IsEmpty() && aNS->Get().IsSame(aShape)) {
         // This shape is already in document, store reference instead of shape;
         const TDF_Label aFoundLabel = aNS->Label();
         TDF_Reference::Set(aShapeLab, aFoundLabel);
@@ -179,16 +211,16 @@ void Model_BodyBuilder::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
   }
 }
 
-void Model_BodyBuilder::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-  const std::shared_ptr<GeomAPI_Shape>& theToShape)
+void Model_BodyBuilder::storeGenerated(const GeomShapePtr& theFromShape,
+  const GeomShapePtr& theToShape, const bool theIsCleanStored)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
   if (aData) {
-    TDF_Label& aShapeLab = aData->shapeLab();
+    TDF_Label aShapeLab = aData->shapeLab();
     // clean builders
-    clean();
-    // store the new shape as primitive
-    TNaming_Builder aBuilder(aShapeLab);
+    if (theIsCleanStored)
+      clean();
+    TNaming_Builder* aBuilder = builder(0);
     if (!theFromShape || !theToShape)
       return;  // bad shape
     TopoDS_Shape aShapeBasis = theFromShape->impl<TopoDS_Shape>();
@@ -197,22 +229,70 @@ void Model_BodyBuilder::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& the
     TopoDS_Shape aShapeNew = theToShape->impl<TopoDS_Shape>();
     if (aShapeNew.IsNull())
       return;  // null shape inside
-    aBuilder.Generated(aShapeBasis, aShapeNew);
+
+    // There is no sense to write history if old shape does not exist in the document.
+    TDF_Label anAccess2 = std::dynamic_pointer_cast<Model_Document>(
+      ModelAPI_Session::get()->moduleDocument())->generalLabel();
+    TDF_Label anOriginalLabel;
+    if (!isShapeInTree(aData->shapeLab(), anAccess2, aShapeBasis, anOriginalLabel)) {
+      if (aBuilder->NamedShape()->Get().IsNull()) { // store as primitive if alone anyway
+        aBuilder->Generated(aShapeNew);
+      }
+    } else {
+      if (aBuilder->NamedShape()->Evolution() == TNaming_PRIMITIVE) { // erase primitive before
+        myBuilders.erase(0);
+        aBuilder = builder(0);
+      }
+
+      aBuilder->Generated(aShapeBasis, aShapeNew);
+      // store information about the external document reference to restore old shape on open
+      storeExternalReference(anOriginalLabel, aBuilder->NamedShape()->Label());
+    }
+
     // register name
-    if(!aBuilder.NamedShape()->IsEmpty()) {
+    if(!aBuilder->NamedShape()->IsEmpty()) {
       Handle(TDataStd_Name) anAttr;
-      if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
+      if(aBuilder->NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
         std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString());
         if(!aName.empty()) {
           std::shared_ptr<Model_Document> aDoc =
             std::dynamic_pointer_cast<Model_Document>(document());
-          aDoc->addNamingName(aBuilder.NamedShape()->Label(), aName);
+          aDoc->addNamingName(aBuilder->NamedShape()->Label(), aName);
         }
       }
     }
   }
 }
 
+void Model_BodyBuilder::storeGenerated(const std::list<GeomShapePtr>& theFromShapes,
+  const GeomShapePtr& theToShape, const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+{
+  bool aStored = false;
+  std::list<GeomShapePtr>::const_iterator anOldIter = theFromShapes.cbegin();
+  for (; anOldIter != theFromShapes.cend(); anOldIter++) {
+    bool aStore = (*anOldIter)->isCompound() || (*anOldIter)->isShell() || (*anOldIter)->isWire();
+    if (!aStore) {
+      ListOfShape aNews; // check this old really generates theToShape
+      theMakeShape->generated(*anOldIter, aNews);
+      ListOfShape::iterator aNewIter = aNews.begin();
+      for (; aNewIter != aNews.end(); aNewIter++) {
+        if (theToShape->isSame(*aNewIter))
+          break;
+      }
+      aStore = aNewIter != aNews.end();
+    }
+    if (aStore) {
+      storeGenerated(*anOldIter, theToShape, !aStored);
+      TNaming_Builder* aBuilder = builder(0);
+      aStored = !aBuilder->NamedShape()->IsEmpty();
+    }
+  }
+  if (!aStored) { // store as PRIMITIVE, but clean in any way
+    store(theToShape);
+    return;
+  }
+}
+
 TNaming_Builder* Model_BodyBuilder::builder(const int theTag)
 {
   std::map<int, TNaming_Builder*>::iterator aFind = myBuilders.find(theTag);
@@ -225,16 +305,14 @@ TNaming_Builder* Model_BodyBuilder::builder(const int theTag)
   return aFind->second;
 }
 
-void Model_BodyBuilder::storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theDecomposeSolidsTag)
+void Model_BodyBuilder::storeModified(const GeomShapePtr& theOldShape,
+                                      const GeomShapePtr& theNewShape,
+                                      const bool theIsCleanStored)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
   if (aData) {
-    TDF_Label& aShapeLab = aData->shapeLab();
     // clean builders
-    if (theDecomposeSolidsTag != -2)
-      clean();
-    // store the new shape as primitive
+    if (theIsCleanStored) clean();
     TNaming_Builder* aBuilder = builder(0);
     if (!theOldShape || !theNewShape)
       return;  // bad shape
@@ -244,10 +322,29 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr<GeomAPI_Shape>& theO
     TopoDS_Shape aShapeNew = theNewShape->impl<TopoDS_Shape>();
     if (aShapeNew.IsNull())
       return;  // null shape inside
-    aBuilder->Modify(aShapeOld, aShapeNew);
+
+    // There is no sense to write history if old shape does not exist in the document.
+    TDF_Label anAccess2 = std::dynamic_pointer_cast<Model_Document>(
+      ModelAPI_Session::get()->moduleDocument())->generalLabel();
+    TDF_Label anOriginalLabel;
+    if (!isShapeInTree(aData->shapeLab(), anAccess2, aShapeOld, anOriginalLabel)) {
+      if (aBuilder->NamedShape()->Get().IsNull()) { // store as primitive if alone anyway
+        aBuilder->Generated(aShapeNew);
+      }
+    } else {
+      if (aBuilder->NamedShape()->Evolution() == TNaming_PRIMITIVE) { // erase primitive before
+        myBuilders.erase(0);
+        aBuilder = builder(0);
+      }
+
+      aBuilder->Modify(aShapeOld, aShapeNew);
+      // store information about the external document reference to restore old shape on open
+      storeExternalReference(anOriginalLabel, aBuilder->NamedShape()->Label());
+    }
+
     if(!aBuilder->NamedShape()->IsEmpty()) {
       Handle(TDataStd_Name) anAttr;
-      if(aBuilder->NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
+      if(aBuilder->NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(), anAttr)) {
         std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString());
         if(!aName.empty()) {
           std::shared_ptr<Model_Document> aDoc =
@@ -259,18 +356,33 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr<GeomAPI_Shape>& theO
   }
 }
 
-void  Model_BodyBuilder::storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape)
+void Model_BodyBuilder::storeModified(const std::list<GeomShapePtr>& theOldShapes,
+  const GeomShapePtr& theNewShape, const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-  if (aData) {
-    clean();
-    if (!theShape.get())
-      return; // bad shape
-    TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
-    if (aShape.IsNull())
-      return;  // null shape inside
-    TNaming_Builder aBuilder(aData->shapeLab());
-    aBuilder.Select(aShape, aShape);
+  bool aStored = false;
+  std::list<GeomShapePtr>::const_iterator anOldIter = theOldShapes.cbegin();
+  for(; anOldIter != theOldShapes.cend(); anOldIter++) {
+    // compounds may cause crash if call "modified"
+    bool aStore = (*anOldIter)->isCompound() || (*anOldIter)->isShell() || (*anOldIter)->isWire();
+    if (!aStore) {
+      ListOfShape aNews; // check this old really modifies theNewShape
+      theMakeShape->modified(*anOldIter, aNews);
+      ListOfShape::iterator aNewIter = aNews.begin();
+      for(; aNewIter != aNews.end(); aNewIter++) {
+        if (theNewShape->isSame(*aNewIter))
+          break;
+      }
+      aStore = aNewIter != aNews.end();
+    }
+    if (aStore) {
+      storeModified(*anOldIter, theNewShape, !aStored);
+      TNaming_Builder* aBuilder = builder(0);
+      aStored = !aBuilder->NamedShape()->IsEmpty();
+    }
+  }
+  if (!aStored) { // store as PRIMITIVE, but clean in any way
+    store(theNewShape);
+    return;
   }
 }
 
@@ -281,20 +393,25 @@ void Model_BodyBuilder::clean()
     return;
   std::map<int, TNaming_Builder*>::iterator aBuilder = myBuilders.begin();
   for(; aBuilder != myBuilders.end(); aBuilder++) {
+    Handle(TNaming_NamedShape) aNS = aBuilder->second->NamedShape();
     delete aBuilder->second;
-    // clear also shapes on cleaned sub-labels (#2241)
-    Handle(TNaming_NamedShape) aNS;
-    if (aLab.FindChild(aBuilder->first).FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-      aNS->Clear();
-    }
+    if (!aNS.IsNull() && !aNS->Label().IsNull())
+      aNS->Label().ForgetAttribute(TNaming_NamedShape::GetID());
   }
   myBuilders.clear();
+  myPrimitivesNamesIndexMap.clear();
   // remove the old reference (if any)
   aLab.ForgetAttribute(TDF_Reference::GetID());
-  myDividedIndex = 1;
-  myVIndex = 1;
-  myEIndex = 1;
-  myFIndex = 1;
+  myFreePrimitiveTag = PRIMITIVES_START_TAG;
+  TDF_ChildIDIterator anEntriesIter(aLab, kEXTERNAL_SHAPE_REF, true);
+  for(; anEntriesIter.More(); anEntriesIter.Next()) {
+    anEntriesIter.Value()->Label().ForgetAttribute(kEXTERNAL_SHAPE_REF);
+  }
+}
+
+void Model_BodyBuilder::cleanCash()
+{
+  myPrimitivesNamesIndexMap.clear();
 }
 
 Model_BodyBuilder::~Model_BodyBuilder()
@@ -304,111 +421,130 @@ Model_BodyBuilder::~Model_BodyBuilder()
 
 void Model_BodyBuilder::buildName(const int theTag, const std::string& theName)
 {
-  std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(document());
-  //aDoc->addNamingName(builder(theTag)->NamedShape()->Label(), theName);
-  TDataStd_Name::Set(builder(theTag)->NamedShape()->Label(), theName.c_str());
+  std::string aName = theName;
+  std::string aPrefix = "";
+  switch (theTag) {
+    case GENERATED_VERTICES_TAG: aPrefix = aName.empty() ? "Generated_Vertex" : "GV:"; break;
+    case GENERATED_EDGES_TAG:    aPrefix = aName.empty() ? "Generated_Edge"   : "GE:"; break;
+    case GENERATED_FACES_TAG:    aPrefix = aName.empty() ? "Generated_Face"   : "GF:"; break;
+    case MODIFIED_VERTICES_TAG:  aPrefix = aName.empty() ? "Modified_Vertex"  : "MV:"; break;
+    case MODIFIED_EDGES_TAG:     aPrefix = aName.empty() ? "Modified_Edge"    : "ME:"; break;
+    case MODIFIED_FACES_TAG:     aPrefix = aName.empty() ? "Modified_Face"    : "MF:"; break;
+  }
+  aName.insert(0, aPrefix);
+
+  TDataStd_Name::Set(builder(theTag)->NamedShape()->Label(), aName.c_str());
 }
-void Model_BodyBuilder::generated(
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
+bool Model_BodyBuilder::generated(const GeomShapePtr& theNewShape,
+                                  const std::string& theName,
+                                  const bool theCheckIsInResult)
 {
+  GeomShapePtr aResultShape = shape();
+  if (theCheckIsInResult) {
+    bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(theNewShape, false);
+    if (aNewShapeIsNotInResultShape) {
+      return false;
+    }
+  }
+
   TopoDS_Shape aShape = theNewShape->impl<TopoDS_Shape>();
-  builder(theTag)->Generated(aShape);
-  if(!theName.empty())
-    buildName(theTag, theName);
+  builder(myFreePrimitiveTag)->Generated(aShape);
+  if (!theName.empty()) {
+    std::string aName = theName;
+    if (myPrimitivesNamesIndexMap.find(theName) != myPrimitivesNamesIndexMap.end()) {
+      IndexTags& anIndexTags = myPrimitivesNamesIndexMap.find(theName)->second;
+      aName += "_" + std::to_string(++(anIndexTags.index));
+      anIndexTags.tags.push_back(myFreePrimitiveTag);
+      if (anIndexTags.index == 2) {
+        buildName(anIndexTags.tags.front(), theName + "_1");
+      }
+    }
+    else {
+      IndexTags anIndexTags;
+      anIndexTags.index = 1;
+      anIndexTags.tags.push_back(myFreePrimitiveTag);
+      myPrimitivesNamesIndexMap[theName] = anIndexTags;
+    }
+
+    buildName(myFreePrimitiveTag, aName);
+  }
+  ++myFreePrimitiveTag;
+  return true;
 }
 
-void Model_BodyBuilder::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
+void Model_BodyBuilder::generated(const GeomShapePtr& theOldShape,
+                                  const GeomShapePtr& theNewShape,
+                                  const std::string& theName)
 {
   TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
   TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
-  builder(theTag)->Generated(anOldShape, aNewShape);
-  if(!theName.empty())
-    buildName(theTag, theName);
-  TopAbs_ShapeEnum aGenShapeType = aNewShape.ShapeType();
-  if(aGenShapeType == TopAbs_WIRE || aGenShapeType == TopAbs_SHELL) {
-    TopAbs_ShapeEnum anExplodeShapeType = aGenShapeType == TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE;
-    const TDF_Label aLabel = builder(theTag)->NamedShape()->Label();
-    int aTag = 1;
-    std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(document());
-    for(TopExp_Explorer anExp(aNewShape, anExplodeShapeType); anExp.More(); anExp.Next()) {
-      TDF_Label aChildLabel = aLabel.FindChild(aTag);
-      TNaming_Builder aBuilder(aChildLabel);
-      aBuilder.Generated(anOldShape, anExp.Current());
-      TCollection_AsciiString aChildName = TCollection_AsciiString((theName + "_").c_str()) + aTag;
-      //aDoc->addNamingName(aChildLabel, aChildName.ToCString());
-      TDataStd_Name::Set(aChildLabel, aChildName.ToCString());
-      aTag++;
-    }
+  TopAbs_ShapeEnum aNewShapeType = aNewShape.ShapeType();
+  int aTag;
+  if (aNewShapeType == TopAbs_WIRE || aNewShapeType == TopAbs_SHELL) {
+    // TODO: This is a workaround. New shape should be only vertex, edge or face.
+    TopAbs_ShapeEnum aShapeTypeToExplore = aNewShapeType == TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE;
+    aTag = TopAbs_WIRE ? GENERATED_EDGES_TAG : GENERATED_FACES_TAG;
+    for (TopExp_Explorer anExp(aNewShape, aShapeTypeToExplore); anExp.More(); anExp.Next()) {
+      builder(aTag)->Generated(anOldShape, anExp.Current());
+    }
+    buildName(aTag, theName);
+  } else {
+    aTag = getGenerationTag(aNewShape);
+    if (aTag == INVALID_TAG) return;
+    builder(aTag)->Generated(anOldShape, aNewShape);
+    buildName(aTag, theName);
   }
 }
 
-
-void Model_BodyBuilder::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
+void Model_BodyBuilder::modified(const GeomShapePtr& theOldShape,
+                                 const GeomShapePtr& theNewShape,
+                                 const std::string& theName)
 {
   TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
   TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
-  builder(theTag)->Modify(anOldShape, aNewShape);
-  if(!theName.empty())
-    buildName(theTag, theName);
+  int aTag = getModificationTag(aNewShape);
+  if (aTag == INVALID_TAG) return;
+  builder(aTag)->Modify(anOldShape, aNewShape);
+  buildName(aTag, theName);
 }
 
-void Model_BodyBuilder::deleted(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const int theTag)
+void Model_BodyBuilder::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
+                                          const GeomShapePtr& theOldShape,
+                                          const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                          const GeomShapePtr& theShapesToExclude)
 {
-  TopoDS_Shape aShape = theOldShape->impl<TopoDS_Shape>();
-  builder(theTag)->Delete(aShape);
-}
-
-void Model_BodyBuilder::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-  const int  theKindOfShape,
-  const int  theTag,
-  const GeomShapePtr theShapes)
-{
-  TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
-  TopTools_MapOfShape aView;
-  TopExp_Explorer ShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
+  TopTools_MapOfShape anAlreadyProcessedShapes;
   GeomShapePtr aResultShape = shape();
-  for (; ShapeExplorer.More(); ShapeExplorer.Next ()) {
-    const TopoDS_Shape& aRoot = ShapeExplorer.Current ();
-    if (!aView.Add(aRoot)) continue;
-    std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
-    aRShape->setImpl((new TopoDS_Shape(aRoot)));
-    if (!theMS->isDeleted(aRShape)
-        || aResultShape->isSubShape(aRShape, false)
-        || (theShapes.get() && theShapes->isSubShape(aRShape, false))) {
+  for (GeomAPI_ShapeExplorer anExp(theOldShape, theShapeTypeToExplore);
+       anExp.more();
+       anExp.next())
+  {
+    GeomShapePtr anOldSubShape = anExp.current();
+    const TopoDS_Shape& anOldSubShape_ = anOldSubShape->impl<TopoDS_Shape>();
+    if (!anAlreadyProcessedShapes.Add(anOldSubShape_)
+        || !theAlgo->isDeleted(anOldSubShape)
+        || aResultShape->isSubShape(anOldSubShape, false)
+        || (theShapesToExclude.get() && theShapesToExclude->isSubShape(anOldSubShape, false)))
+    {
       continue;
     }
 
-    ListOfShape aHist;
-    if (BRepTools_History::IsSupportedType(aRoot)) // to avoid crash in #2572
-      theMS->modified(aRShape, aHist);
-    if (aHist.size() == 0 || (aHist.size() == 1 && aHist.front()->isSame(aRShape)))
-      builder(theTag)->Delete(aRoot);
-  }
-}
+    ListOfShape aNewShapes;
+    if (BRepTools_History::IsSupportedType(anOldSubShape_)) { // to avoid crash in #2572
+      theAlgo->modified(anOldSubShape, aNewShapes);
+    }
 
-static void removeBadShapes(ListOfShape& theShapes)
-{
-  ListOfShape::iterator anIt = theShapes.begin();
-  while (anIt != theShapes.end()) {
-    TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
-    bool aSkip = aNewShape.IsNull()
-      || (aNewShape.ShapeType() == TopAbs_EDGE && BRep_Tool::Degenerated(TopoDS::Edge(aNewShape)));
-    if (aSkip) {
-      ListOfShape::iterator aRemoveIt = anIt++;
-      theShapes.erase(aRemoveIt);
-    } else {
-      ++anIt;
+    if (aNewShapes.size() == 0
+        || (aNewShapes.size() == 1 && aNewShapes.front()->isSame(anOldSubShape))) {
+      builder(DELETED_TAG)->Delete(anOldSubShape_);
     }
   }
 }
 
 // Keep only the shapes with minimal shape type
-static void keepTopLevelShapes(ListOfShape& theShapes, const TopoDS_Shape& theRoot,
-  const GeomShapePtr& theResultShape = GeomShapePtr())
+static void keepTopLevelShapes(ListOfShape& theShapes,
+                               const TopoDS_Shape& theRoot,
+                               const GeomShapePtr& theResultShape = GeomShapePtr())
 {
   GeomAPI_Shape::ShapeType aKeepShapeType = GeomAPI_Shape::SHAPE;
   ListOfShape::iterator anIt = theShapes.begin();
@@ -437,348 +573,155 @@ static void keepTopLevelShapes(ListOfShape& theShapes, const TopoDS_Shape& theRo
   }
 }
 
-// returns an ancestor shape-type thaty used for naming-definition of the sub-type
-TopAbs_ShapeEnum typeOfAncestor(const TopAbs_ShapeEnum theSubType) {
-  if (theSubType == TopAbs_VERTEX)
-    return TopAbs_EDGE;
-  if (theSubType == TopAbs_EDGE)
-    return TopAbs_FACE;
-  return TopAbs_VERTEX; // bad case
-}
-
-void Model_BodyBuilder::loadAndOrientModifiedShapes (
-  GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-  const int  theKindOfShape,
-  const int  theTag,
-  const std::string& theName,
-  GeomAPI_DataMapOfShapeShape& theSubShapes,
-  const bool theIsStoreSeparate,
-  const bool theIsStoreAsGenerated)
+void Model_BodyBuilder::loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
+                                           const GeomShapePtr& theOldShape,
+                                           const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                           const std::string& theName)
 {
-  static const int THE_ANCHOR_TAG = 100000;
-
-  int anIndex = 1;
-  int aTag = theTag;
-  bool isBuilt = !theName.empty();
-  std::string aName = theName;
-  std::ostringstream aStream;
   GeomShapePtr aResultShape = shape();
-  TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
-  TopTools_MapOfShape aView;
-  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-
-  TopoDS_Shape aShapeToIterate;
-  if (theMS->newShapesCollected(theShapeIn, theKindOfShape)) {
+  GeomShapePtr aShapeToExplore = theOldShape;
+  if (theAlgo->isNewShapesCollected(theOldShape, theShapeTypeToExplore)) {
     // use optimized set of old shapes for this
-    GeomShapePtr aCompound = theMS->oldShapesForNew(theShapeIn, aResultShape, theKindOfShape);
-    if (aCompound.get())
-      aShapeToIterate = aCompound->impl<TopoDS_Shape>();
-  } else {
-    aShapeToIterate = aShapeIn;
+    GeomShapePtr aCompound = theAlgo->oldShapesForNew(theOldShape,
+                                                      aResultShape,
+                                                      theShapeTypeToExplore);
+    if (aCompound.get()) aShapeToExplore = aCompound;
   }
 
-  TopExp_Explorer aShapeExplorer (aShapeToIterate, (TopAbs_ShapeEnum)theKindOfShape);
-  for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
-    const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
-    if (!aView.Add(aRoot)) continue;
-
-    bool aNotInTree =
-      TNaming_Tool::NamedShape(aRoot, aData->shapeLab()).IsNull();
-    if (aNotInTree && !theIsStoreSeparate) {
-      // there is no sense to write history if old shape does not exist in the document
-      continue; // but if it is stored separately, it will be builded as a primitive
-    }
-    ListOfShape aList;
-    std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
-    aRShape->setImpl((new TopoDS_Shape(aRoot)));
-    theMS->modified(aRShape, aList);
-
-    if (!theIsStoreSeparate) {
-      //keepTopLevelShapes(aList, aRoot, aResultShape);
-      removeBadShapes(aList);
+  TopTools_MapOfShape anAlreadyProcessedShapes;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  for (GeomAPI_ShapeExplorer anOldShapeExp(aShapeToExplore, theShapeTypeToExplore);
+       anOldShapeExp.more();
+       anOldShapeExp.next())
+  {
+    GeomShapePtr anOldSubShape = anOldShapeExp.current();
+    const TopoDS_Shape& anOldSubShape_ = anOldSubShape->impl<TopoDS_Shape>();
+
+    // There is no sense to write history if shape already processed
+    // or old shape does not exist in the document.
+    bool anOldSubShapeAlreadyProcessed = !anAlreadyProcessedShapes.Add(anOldSubShape_);
+    TDF_Label anAccess2 = std::dynamic_pointer_cast<Model_Document>(
+      ModelAPI_Session::get()->moduleDocument())->generalLabel();
+    TDF_Label anOriginalLabel;
+    bool anOldSubShapeNotInTree =
+      !isShapeInTree(aData->shapeLab(), anAccess2, anOldSubShape_, anOriginalLabel);
+    if (anOldSubShapeAlreadyProcessed || anOldSubShapeNotInTree) {
+      continue;
     }
-    // sort the list of images before naming
-    GeomAlgoAPI_SortListOfShapes::sort(aList);
-
-    // to trace situation where several objects are produced by one parent (#2317)
-    int aSameParentShapes = (aShapeIn.ShapeType() == TopAbs_WIRE
-                             || aShapeIn.ShapeType() == TopAbs_SHELL
-                             || aShapeIn.ShapeType() == TopAbs_COMPOUND) ? 0 : -1;
-    std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator
-      anIt = aList.begin(), aLast = aList.end();
-    for (; anIt != aLast; anIt++) {
-      TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
-      if (theSubShapes.isBound(*anIt)) {
-        std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
-        aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
-      }
-      isBuilt = !theName.empty();
-      if(!aRoot.IsSame(aNewShape)
-         && aResultShape->isSubShape((*anIt), false)
-         && !aResultShape->isSame(*anIt)) // to avoid put of same shape on main label and sub
-      {
-        if (!theIsStoreSeparate) {
-          aSameParentShapes++;
-        } else if (aNotInTree) // check this new shape can not be represented as
-                              // a sub-shape of higher level sub-shapes
-        {
-          TopAbs_ShapeEnum aNewType = aNewShape.ShapeType();
-          TopAbs_ShapeEnum anAncestorType = typeOfAncestor(aNewType);
-          if (anAncestorType != TopAbs_VERTEX) {
-            bool aFound = false;
-            TopoDS_Shape aResultTShape = aResultShape->impl<TopoDS_Shape>();
-            TopExp_Explorer anAncestorExp(aResultTShape, anAncestorType);
-            for(; anAncestorExp.More() && !aFound; anAncestorExp.Next()) {
-              if (aResultTShape.IsSame(anAncestorExp.Current()))
-                continue;
-              TopExp_Explorer aSubExp(anAncestorExp.Current(), aNewType);
-              for(; aSubExp.More(); aSubExp.Next()) {
-                if (aNewShape.IsSame(aSubExp.Current())) {
-                  aFound = true;
-                  break;
-                }
-              }
-            }
-            if (aFound) {
-              continue; // not need to store this shape in the BRep structure
-            }
-          }
-        }
 
-        int aFoundTag = 0;
-        bool isFoundSameOld = false;
-        bool isFoundDiffOld = false;
-
-        // Check if new shape was already stored.
-        for (std::map<int, TNaming_Builder*>::iterator aBuildersIt = myBuilders.begin();
-             aBuildersIt != myBuilders.end();
-             ++aBuildersIt)
-        {
-          TNaming_Builder* aBuilder = aBuildersIt->second;
-          for (TNaming_Iterator aNamingIt(aBuilder->NamedShape());
-               aNamingIt.More();
-               aNamingIt.Next())
-          {
-            if (aNamingIt.NewShape().IsSame(aNewShape))
-            {
-              aNamingIt.OldShape().IsSame(aRoot) ? isFoundSameOld = true
-                                                 : isFoundDiffOld = true;
-              aFoundTag = aBuildersIt->first;
-            }
-          }
-
-          if (isFoundSameOld || isFoundDiffOld) break;
-        }
+    // Get new shapes.
+    ListOfShape aNewShapes;
+    theAlgo->modified(anOldSubShape, aNewShapes);
 
-        if (isFoundSameOld) {
-          // Builder already contains same old->new shapes, don't store it twice.
-          continue;
-        }
+    for (ListOfShape::const_iterator aNewShapesIt = aNewShapes.cbegin();
+         aNewShapesIt != aNewShapes.cend();
+         ++aNewShapesIt)
+    {
+      GeomShapePtr aNewShape = *aNewShapesIt;
+      const TopoDS_Shape& aNewShape_ = aNewShape->impl<TopoDS_Shape>();
+      bool isGenerated = anOldSubShape_.ShapeType() != aNewShape_.ShapeType();
 
-        int aBuilderTag = aSameParentShapes > 0 ? THE_ANCHOR_TAG : aTag;
+      bool aNewShapeIsSameAsOldShape = anOldSubShape->isSame(aNewShape);
+      bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(aNewShape, false);
+      if (aNewShapeIsSameAsOldShape || aNewShapeIsNotInResultShape)
+        continue;
 
-        int aCurShapeType = (int)((*anIt)->shapeType());
-        bool needSuffix = false; // suffix for the name based on the shape type
-        if (aCurShapeType != theKindOfShape) {
-          // modified shape has different type => set another tag
-          // to avoid shapes of different types on the same label
-          aBuilderTag = THE_ANCHOR_TAG;
-          needSuffix = true;
-        }
-        std::string aSuffix;
-        if (needSuffix) {
-          switch (aCurShapeType) {
-            case GeomAPI_Shape::VERTEX: aSuffix = "_v_" + std::to_string(myVIndex++); break;
-            case GeomAPI_Shape::EDGE:   aSuffix = "_e_" + std::to_string(myEIndex++); break;
-            case GeomAPI_Shape::FACE:   aSuffix = "_f_" + std::to_string(myFIndex++); break;
-            default: break;
-          }
-        }
-
-        std::vector<std::pair<TopoDS_Shape, TopoDS_Shape>> aKeepShapes, aMoveShapes;
-        if (isFoundDiffOld) {
-          // Found same new shape with different old shape.
-          if (aFoundTag >= THE_ANCHOR_TAG) {
-            // Found on separated tag.
-            aBuilderTag = aFoundTag; // Store it on the same tag.
-            isBuilt = false; // Don't change name;
-          } else {
-            // Found on previous tag.
-            if (aBuilderTag < THE_ANCHOR_TAG) {
-              // New shape shouls not be separated.
-              aBuilderTag = aFoundTag; // Store it on the same tag.
-              isBuilt = false; // Don't change name;
-            } else {
-              // New shape should be separated from others. Move shapes from found tag to new tag.
-              while (myBuilders.find(aBuilderTag) != myBuilders.end()) {
-                ++aBuilderTag;
-              }
-
-              TNaming_Builder* aFoundBuilder = myBuilders.at(aFoundTag);
-              Handle(TNaming_NamedShape) aFoundNamedShape = aFoundBuilder->NamedShape();
-              TDF_Label aFoundLabel = aFoundNamedShape->Label();
-              TNaming_Evolution anEvolution = aFoundNamedShape->Evolution();
-              for (TNaming_Iterator aNamingIt(aFoundNamedShape);
-                   aNamingIt.More();
-                   aNamingIt.Next())
-              {
-                std::pair<TopoDS_Shape, TopoDS_Shape> aShapesPair =
-                  std::make_pair(aNamingIt.OldShape(), aNamingIt.NewShape());
-                aNamingIt.NewShape().IsSame(aNewShape) ? aMoveShapes.push_back(aShapesPair)
-                                                       : aKeepShapes.push_back(aShapesPair);
-              }
-
-              aFoundNamedShape->Clear();
-              for (std::vector<std::pair<TopoDS_Shape, TopoDS_Shape>>::iterator aKeepIt =
-                     aKeepShapes.begin();
-                   aKeepIt != aKeepShapes.end();
-                   ++aKeepIt)
-              {
-                if (anEvolution == TNaming_GENERATED) {
-                  aFoundBuilder->Generated(aKeepIt->first, aKeepIt->second);
-                } else {
-                  aFoundBuilder->Modify(aKeepIt->first, aKeepIt->second);
-                }
-              }
-            }
-          }
-        } else if (aBuilderTag == THE_ANCHOR_TAG) {
-          while (myBuilders.find(aBuilderTag) != myBuilders.end()) {
-            ++aBuilderTag;
-          }
-        }
+      if (aResultShape->isSame(aNewShape))
+        continue; // it is stored on the root level (2241 - history propagation issue)
 
-        if(theIsStoreAsGenerated) {
-          // Here we store shapes as generated, to avoid problem when one parent shape produce
-          // several child shapes. In this case naming could not determine which shape to select.
-          builder(aBuilderTag)->Generated(aRoot, aNewShape);
-          for (std::vector<std::pair<TopoDS_Shape, TopoDS_Shape>>::iterator aMoveIt =
-               aMoveShapes.begin();
-               aMoveIt != aMoveShapes.end();
-               ++aMoveIt)
-          {
-            builder(aBuilderTag)->Generated(aMoveIt->first, aMoveIt->second);
-          }
-        } else if (aNotInTree) {
-          // not in tree -> store as primitive (stored as separated)
-          builder(aBuilderTag)->Generated(aNewShape);
-        } else if (aCurShapeType != theKindOfShape) {
-           // if different shape type is produced, make it as generated
-          builder(aBuilderTag)->Generated(aRoot, aNewShape);
-        } else {
-          builder(aBuilderTag)->Modify(aRoot, aNewShape);
-          for (std::vector<std::pair<TopoDS_Shape, TopoDS_Shape>>::iterator aMoveIt =
-               aMoveShapes.begin();
-               aMoveIt != aMoveShapes.end();
-               ++aMoveIt) {
-            builder(aBuilderTag)->Modify(aMoveIt->first, aMoveIt->second);
-          }
-        }
-        if(isBuilt) {
-          aStream.str(std::string());
-          aStream.clear();
-          aStream << theName;
-          if (theIsStoreSeparate && !isFoundDiffOld)
-             aStream << "_" << anIndex++;
-
-          if (aSameParentShapes > 0) {
-            aStream.str(std::string());
-            aStream.clear();
-            aStream << aName << "_" << "divided" << "_" << myDividedIndex++;
-          }
+      int aTag = isGenerated ? getGenerationTag(aNewShape_) : getModificationTag(aNewShape_);
+      TNaming_Builder*aBuilder = builder(aTag);
+      if (isAlreadyStored(aBuilder, anOldSubShape_, aNewShape_))
+        continue; // new shape was already stored.
 
-          aStream << aSuffix;
-          buildName(aBuilderTag, aStream.str());
-        }
-        if(theIsStoreSeparate && !isFoundDiffOld) {
-          aTag++;
-        }
-      } else if (aResultShape->isSame(*anIt)) {
-        // keep the modification evolution on the root level (2241 - history propagation issue)
-        TNaming_Builder* aBuilder = builder(0);
-        TDF_Label aShapeLab = aBuilder->NamedShape()->Label();
-        Handle(TDF_Reference) aRef;
-        // Store only in case if it does not have reference.
-        if (!aShapeLab.FindAttribute(TDF_Reference::GetID(), aRef)) {
-          if (theIsStoreAsGenerated) {
-            TNaming_Builder* aBuilder = builder(0);
-            if (!aBuilder->NamedShape().IsNull() &&
-                aBuilder->NamedShape()->Evolution() != TNaming_GENERATED) {
-              myBuilders.erase(0); // clear old builder to avoid different evolutions crash
-            }
-            builder(0)->Generated(aRoot, aNewShape);
-          } else {
-            TNaming_Builder* aBuilder = builder(0);
-            if (!aBuilder->NamedShape().IsNull() &&
-              aBuilder->NamedShape()->Evolution() != TNaming_MODIFY) {
-              myBuilders.erase(0); // clear old builder to avoid different evolutions crash
-            }
-            builder(0)->Modify(aRoot, aNewShape);
-          }
-        }
-      }
+      buildName(aTag, theName);
+      isGenerated ? aBuilder->Generated(anOldSubShape_, aNewShape_)
+                  : aBuilder->Modify(anOldSubShape_, aNewShape_);
+      // store information about the external document reference to restore old shape on open
+      storeExternalReference(anOriginalLabel, aBuilder->NamedShape()->Label());
     }
   }
 }
 
-void Model_BodyBuilder::loadAndOrientGeneratedShapes (
-  GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-  const int  theKindOfShape,
-  const int  theTag,
-  const std::string& theName,
-  GeomAPI_DataMapOfShapeShape& theSubShapes)
+void Model_BodyBuilder::loadGeneratedShapes(const GeomMakeShapePtr& theAlgo,
+                                            const GeomShapePtr& theOldShape,
+                                            const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                            const std::string& theName,
+                                            const bool theSaveOldIfNotInTree)
 {
-  TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
-  TopTools_MapOfShape aView;
-  bool isBuilt = !theName.empty();
-  TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
-  for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
-    const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
-    if (!aView.Add(aRoot)) continue;
-    //if (TNaming_Tool::NamedShape(aRoot, builder(theTag)->NamedShape()->Label()).IsNull())
-    //  continue; // there is no sense to write history if old shape does not exist in the document
-    ListOfShape aList;
-    std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
-    aRShape->setImpl((new TopoDS_Shape(aRoot)));
-    theMS->generated(aRShape, aList);
-    keepTopLevelShapes(aList, aRoot);
-    std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator
-      anIt = aList.begin(), aLast = aList.end();
-    for (; anIt != aLast; anIt++) {
-      TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
-      if (theSubShapes.isBound(*anIt)) {
-        std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
-        aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
-      }
-      if (!aRoot.IsSame (aNewShape)) {
-        builder(theTag)->Generated(aRoot,aNewShape);
-        if(isBuilt)
-          buildName(theTag, theName);
+  GeomShapePtr aResultShape = shape();
+  TopTools_MapOfShape anAlreadyProcessedShapes;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  for (GeomAPI_ShapeExplorer anOldShapeExp(theOldShape, theShapeTypeToExplore);
+       anOldShapeExp.more();
+       anOldShapeExp.next())
+  {
+    GeomShapePtr anOldSubShape = anOldShapeExp.current();
+    const TopoDS_Shape& anOldSubShape_ = anOldSubShape->impl<TopoDS_Shape>();
+
+    // There is no sense to write history if shape already processed
+    // or old shape does not exist in the document.
+    bool anOldSubShapeAlreadyProcessed = !anAlreadyProcessedShapes.Add(anOldSubShape_);
+    TDF_Label anAccess2 = std::dynamic_pointer_cast<Model_Document>(
+      ModelAPI_Session::get()->moduleDocument())->generalLabel();
+    TDF_Label anOriginalLabel;
+    bool anOldSubShapeNotInTree =
+      !isShapeInTree(aData->shapeLab(), anAccess2, anOldSubShape_, anOriginalLabel);
+    if (anOldSubShapeAlreadyProcessed || anOldSubShapeNotInTree) {
+      if (theSaveOldIfNotInTree) {
+        std::string aSelectionName = theName + "Selected";
+        generated(anOldSubShape, aSelectionName, false);
+      } else
+        continue;
+    }
+
+    // Get new shapes.
+    ListOfShape aNewShapes;
+    theAlgo->generated(anOldSubShape, aNewShapes);
+
+    keepTopLevelShapes(aNewShapes, anOldSubShape_);
+
+    for (ListOfShape::const_iterator aNewShapesIt = aNewShapes.cbegin();
+         aNewShapesIt != aNewShapes.cend();
+         ++aNewShapesIt)
+    {
+      GeomShapePtr aNewShape = *aNewShapesIt;
+      const TopoDS_Shape& aNewShape_ = aNewShape->impl<TopoDS_Shape>();
+
+      bool aNewShapeIsSameAsOldShape = anOldSubShape->isSame(aNewShape);
+      bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(aNewShape, false);
+      if (aNewShapeIsSameAsOldShape || aNewShapeIsNotInResultShape) {
+        continue;
       }
-      TopAbs_ShapeEnum aGenShapeType = aNewShape.ShapeType();
-      if(aGenShapeType == TopAbs_WIRE || aGenShapeType == TopAbs_SHELL) {
-        TopAbs_ShapeEnum anExplodeShapeType =
-          aGenShapeType == TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE;
-        const TDF_Label aLabel = builder(theTag)->NamedShape()->Label();
-        int aTag = 1;
-        std::shared_ptr<Model_Document> aDoc =
-          std::dynamic_pointer_cast<Model_Document>(document());
-        for(TopExp_Explorer anExp(aNewShape, anExplodeShapeType); anExp.More(); anExp.Next()) {
-          TDF_Label aChildLabel = aLabel.FindChild(aTag);
-          TNaming_Builder aBuilder(aChildLabel);
-          aBuilder.Generated(aRoot, anExp.Current());
-          TCollection_AsciiString aChildName =
-            TCollection_AsciiString((theName + "_").c_str()) + aTag;
-          TDataStd_Name::Set(aChildLabel, aChildName.ToCString());
-          aTag++;
+
+      if (aResultShape->isSame(aNewShape))
+        continue; // it is stored on the root level
+
+      TopAbs_ShapeEnum aNewShapeType = aNewShape_.ShapeType();
+      if (aNewShapeType == TopAbs_WIRE || aNewShapeType == TopAbs_SHELL) {
+        // TODO: This is a workaround. New shape should be only edge or face.
+        TopAbs_ShapeEnum aShapeTypeToExplore = aNewShapeType == TopAbs_WIRE ? TopAbs_EDGE
+                                                                            : TopAbs_FACE;
+        int aTag = TopAbs_WIRE ? GENERATED_EDGES_TAG : GENERATED_FACES_TAG;
+        for (TopExp_Explorer anExp(aNewShape_, aShapeTypeToExplore); anExp.More(); anExp.Next()) {
+          builder(aTag)->Generated(anOldSubShape_, anExp.Current());
+          // store information about the external document reference to restore old shape on open
+          storeExternalReference(anOriginalLabel, builder(aTag)->NamedShape()->Label());
         }
+        buildName(aTag, theName);
+      } else {
+        int aTag = getGenerationTag(aNewShape_);
+        if (aTag == INVALID_TAG) return;
+        builder(aTag)->Generated(anOldSubShape_, aNewShape_);
+        buildName(aTag, theName);
+        // store information about the external document reference to restore old shape on open
+        storeExternalReference(anOriginalLabel, builder(aTag)->NamedShape()->Label());
       }
     }
   }
 }
 
+// LCOV_EXCL_START
 //=======================================================================
 int getDangleShapes(const TopoDS_Shape&           theShapeIn,
   const TopAbs_ShapeEnum        theGeneratedFrom,
@@ -811,10 +754,11 @@ void loadGeneratedDangleShapes(
   for (; itr.More(); itr.Next())
     theBuilder->Generated(itr.Key(), itr.Value());
 }
+// LCOV_EXCL_STOP
 
 //=======================================================================
-void Model_BodyBuilder::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
-  const std::string& theName, int&  theTag)
+void Model_BodyBuilder::loadNextLevels(GeomShapePtr theShape,
+                                       const std::string& theName)
 {
   if(theShape->isNull()) return;
   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
@@ -822,11 +766,11 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
   if (aShape.ShapeType() == TopAbs_SOLID) {
     TopExp_Explorer expl(aShape, TopAbs_FACE);
     for (; expl.More(); expl.Next()) {
-      builder(theTag)->Generated(expl.Current());
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-      theTag++;
+      builder(myFreePrimitiveTag)->Generated(expl.Current());
+      TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+      aName = theName + "_" + aStr.ToCString();
+      buildName(myFreePrimitiveTag, aName);
+      ++myFreePrimitiveTag;
     }
   }
   else if (aShape.ShapeType() == TopAbs_SHELL || aShape.ShapeType() == TopAbs_FACE) {
@@ -836,11 +780,11 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
     if (Faces.Extent() > 1 || (aShape.ShapeType() == TopAbs_SHELL && Faces.Extent() == 1)) {
       TopExp_Explorer expl(aShape, TopAbs_FACE);
       for (; expl.More(); expl.Next()) {
-        builder(theTag)->Generated(expl.Current());
-        TCollection_AsciiString aStr(theTag);
-        aName = theName + aStr.ToCString();
-        buildName(theTag, aName);
-        theTag++;
+        builder(myFreePrimitiveTag)->Generated(expl.Current());
+        TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+        aName = theName + "_" + aStr.ToCString();
+        buildName(myFreePrimitiveTag, aName);
+        ++myFreePrimitiveTag;
       }
     }
     TopTools_IndexedDataMapOfShapeListOfShape anEdgeAndNeighbourFaces;
@@ -851,21 +795,21 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
       if (aLL.Extent() < 2) {
         if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeAndNeighbourFaces.FindKey(i))))
           continue;
-        builder(theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
-        TCollection_AsciiString aStr(theTag);
-        aName = theName + aStr.ToCString();
-        buildName(theTag, aName);
-        theTag++;
+        builder(myFreePrimitiveTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
+        TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+        aName = theName + "_" + aStr.ToCString();
+        buildName(myFreePrimitiveTag, aName);
+        ++myFreePrimitiveTag;
       } else {
         TopTools_ListIteratorOfListOfShape anIter(aLL);
         const TopoDS_Face& aFace = TopoDS::Face(anIter.Value());
         anIter.Next();
         if(aFace.IsEqual(anIter.Value())) {
-          builder(theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
-          TCollection_AsciiString aStr(theTag);
-          aName = theName + aStr.ToCString();
-          buildName(theTag, aName);
-          theTag++;
+          builder(myFreePrimitiveTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
+          TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+          aName = theName + "_" + aStr.ToCString();
+          buildName(myFreePrimitiveTag, aName);
+          ++myFreePrimitiveTag;
         }
       }
     }
@@ -873,40 +817,40 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
     TopTools_IndexedMapOfShape Edges;
     BRepTools::Map3DEdges(aShape, Edges);
     if (Edges.Extent() == 1) {
-      builder(theTag++)->Generated(Edges.FindKey(1));
+      builder(myFreePrimitiveTag++)->Generated(Edges.FindKey(1));
       TopExp_Explorer expl(aShape, TopAbs_VERTEX);
       for (; expl.More(); expl.Next()) {
-        builder(theTag)->Generated(expl.Current());
-        TCollection_AsciiString aStr(theTag);
-        aName = theName + aStr.ToCString();
-        buildName(theTag, aName);
-        theTag++;
+        builder(myFreePrimitiveTag)->Generated(expl.Current());
+        TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+        aName = theName + "_" + aStr.ToCString();
+        buildName(myFreePrimitiveTag, aName);
+        ++myFreePrimitiveTag;
       }
     } else {
       TopExp_Explorer expl(aShape, TopAbs_EDGE);
       for (; expl.More(); expl.Next()) {
-        builder(theTag)->Generated(expl.Current());
-        TCollection_AsciiString aStr(theTag);
-        aName = theName + aStr.ToCString();
-        buildName(theTag, aName);
-        theTag++;
+        builder(myFreePrimitiveTag)->Generated(expl.Current());
+        TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+        aName = theName + "_" + aStr.ToCString();
+        buildName(myFreePrimitiveTag, aName);
+        ++myFreePrimitiveTag;
       }
       // and load generated vertices.
       TopTools_DataMapOfShapeShape generated;
       if (getDangleShapes(aShape, TopAbs_EDGE, generated))
       {
-        TNaming_Builder* pBuilder = builder(theTag++);
+        TNaming_Builder* pBuilder = builder(myFreePrimitiveTag++);
         loadGeneratedDangleShapes(aShape, TopAbs_EDGE, pBuilder);
       }
     }
   } else if (aShape.ShapeType() == TopAbs_EDGE) {
     TopExp_Explorer expl(aShape, TopAbs_VERTEX);
     for (; expl.More(); expl.Next()) {
-      builder(theTag)->Generated(expl.Current());
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-      theTag++;
+      builder(myFreePrimitiveTag)->Generated(expl.Current());
+      TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+      aName = theName + "_" + aStr.ToCString();
+      buildName(myFreePrimitiveTag, aName);
+      ++myFreePrimitiveTag;
     }
   }
 }
@@ -969,8 +913,7 @@ int findAmbiguities(const TopoDS_Shape&           theShapeIn,
 }
 
 //=======================================================================
-void Model_BodyBuilder::loadFirstLevel(
-  std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag)
+void Model_BodyBuilder::loadFirstLevel(GeomShapePtr theShape, const std::string& theName)
 {
   if(theShape->isNull()) return;
   TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
@@ -978,158 +921,41 @@ void Model_BodyBuilder::loadFirstLevel(
   if (aShape.ShapeType() == TopAbs_COMPOUND || aShape.ShapeType() == TopAbs_COMPSOLID) {
     TopoDS_Iterator itr(aShape);
     for (; itr.More(); itr.Next()) {
-      builder(theTag)->Generated(itr.Value());
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-      if(!theName.empty()) buildName(theTag, aName);
-      theTag++;
+      builder(myFreePrimitiveTag)->Generated(itr.Value());
+      TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+      aName = theName + "_" + aStr.ToCString();
+      buildName(myFreePrimitiveTag, aName);
+      ++myFreePrimitiveTag;
       if (itr.Value().ShapeType() == TopAbs_COMPOUND ||
         itr.Value().ShapeType() == TopAbs_COMPSOLID)
       {
-        std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
+        GeomShapePtr itrShape(new GeomAPI_Shape());
         itrShape->setImpl(new TopoDS_Shape(itr.Value()));
-        loadFirstLevel(itrShape, theName, theTag);
+        loadFirstLevel(itrShape, theName);
       } else {
-        std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
+        GeomShapePtr itrShape(new GeomAPI_Shape());
         itrShape->setImpl(new TopoDS_Shape(itr.Value()));
-        loadNextLevels(itrShape, theName, theTag);
+        loadNextLevels(itrShape, theName);
       }
     }
   } else {
-    std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
+    GeomShapePtr itrShape(new GeomAPI_Shape());
     itrShape->setImpl(new TopoDS_Shape(aShape));
-    loadNextLevels(itrShape, theName, theTag);
+    loadNextLevels(itrShape, theName);
   }
   TopTools_ListOfShape   aList;
   if(findAmbiguities(aShape, aList)) {
     TopTools_ListIteratorOfListOfShape it(aList);
-    for (; it.More(); it.Next(),theTag++) {
-      builder(theTag)->Generated(it.Value());
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-    }
-  }
-}
-
-//=======================================================================
-void Model_BodyBuilder::loadDisconnectedEdges(
-  std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int&  theTag)
-{
-  if(theShape->isNull()) return;
-  TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
-  TopTools_DataMapOfShapeListOfShape edgeNaborFaces;
-  TopTools_ListOfShape empty;
-  TopExp_Explorer explF(aShape, TopAbs_FACE);
-  for (; explF.More(); explF.Next()) {
-    const TopoDS_Shape& aFace = explF.Current();
-    TopExp_Explorer explV(aFace, TopAbs_EDGE);
-    for (; explV.More(); explV.Next()) {
-      const TopoDS_Shape& anEdge = explV.Current();
-      if (!edgeNaborFaces.IsBound(anEdge)) edgeNaborFaces.Bind(anEdge, empty);
-      Standard_Boolean faceIsNew = Standard_True;
-      TopTools_ListIteratorOfListOfShape itrF(edgeNaborFaces.Find(anEdge));
-      for (; itrF.More(); itrF.Next()) {
-        if (itrF.Value().IsSame(aFace)) {
-          faceIsNew = Standard_False;
-          break;
-        }
-      }
-      if (faceIsNew)
-        edgeNaborFaces.ChangeFind(anEdge).Append(aFace);
-    }
-  }
-
-  TopTools_MapOfShape anEdgesToDelete;
-  TopExp_Explorer anEx(aShape,TopAbs_EDGE);
-  std::string aName;
-  for(;anEx.More();anEx.Next()) {
-    Standard_Boolean aC0 = Standard_False;
-    TopoDS_Shape anEdge1 = anEx.Current();
-    if (edgeNaborFaces.IsBound(anEdge1)) {
-      const TopTools_ListOfShape& aList1 = edgeNaborFaces.Find(anEdge1);
-      if (aList1.Extent()<2) continue;
-      TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(edgeNaborFaces);
-      for (; itr.More(); itr.Next()) {
-        TopoDS_Shape anEdge2 = itr.Key();
-        if(anEdgesToDelete.Contains(anEdge2)) continue;
-        if (anEdge1.IsSame(anEdge2)) continue;
-        const TopTools_ListOfShape& aList2 = itr.Value();
-        // compare lists of the neighbour faces of edge1 and edge2
-        if (aList1.Extent() == aList2.Extent()) {
-          Standard_Integer aMatches = 0;
-          for(TopTools_ListIteratorOfListOfShape aLIter1(aList1);aLIter1.More();aLIter1.Next())
-            for(TopTools_ListIteratorOfListOfShape aLIter2(aList2);aLIter2.More();aLIter2.Next())
-              if (aLIter1.Value().IsSame(aLIter2.Value())) aMatches++;
-          if (aMatches == aList1.Extent()) {
-            aC0=Standard_True;
-            builder(theTag)->Generated(anEdge2);
-            anEdgesToDelete.Add(anEdge2);
-            TCollection_AsciiString aStr(theTag);
-            aName = theName + aStr.ToCString();
-            buildName(theTag, aName);
-            theTag++;
-          }
-        }
-      }
-      TopTools_MapIteratorOfMapOfShape itDelete(anEdgesToDelete);
-      for(;itDelete.More();itDelete.Next())
-        edgeNaborFaces.UnBind(itDelete.Key());
-      edgeNaborFaces.UnBind(anEdge1);
-    }
-    if (aC0) {
-      builder(theTag)->Generated(anEdge1);
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-      theTag++;
-    }
-  }
-}
-
-void Model_BodyBuilder::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
-                                                 const std::string& theName, int&  theTag)
-{
-  if(theShape->isNull()) return;
-  TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
-  TopTools_DataMapOfShapeListOfShape vertexNaborEdges;
-  TopTools_ListOfShape empty;
-  TopExp_Explorer explF(aShape, TopAbs_EDGE);
-  for (; explF.More(); explF.Next()) {
-    const TopoDS_Shape& anEdge = explF.Current();
-    TopExp_Explorer explV(anEdge, TopAbs_VERTEX);
-    for (; explV.More(); explV.Next()) {
-      const TopoDS_Shape& aVertex = explV.Current();
-      if (!vertexNaborEdges.IsBound(aVertex)) vertexNaborEdges.Bind(aVertex, empty);
-      Standard_Boolean faceIsNew = Standard_True;
-      TopTools_ListIteratorOfListOfShape itrF(vertexNaborEdges.Find(aVertex));
-      for (; itrF.More(); itrF.Next()) {
-        if (itrF.Value().IsSame(anEdge)) {
-          faceIsNew = Standard_False;
-          break;
-        }
-      }
-      if (faceIsNew) {
-        vertexNaborEdges.ChangeFind(aVertex).Append(anEdge);
-      }
-    }
-  }
-  std::string aName;
-  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(vertexNaborEdges);
-  for (; itr.More(); itr.Next()) {
-    const TopTools_ListOfShape& naborEdges = itr.Value();
-    if (naborEdges.Extent() < 2) {
-      builder(theTag)->Generated(itr.Key());
-      TCollection_AsciiString aStr(theTag);
-      aName = theName + aStr.ToCString();
-      buildName(theTag, aName);
-      theTag++;
+    for (; it.More(); it.Next(), ++myFreePrimitiveTag) {
+      builder(myFreePrimitiveTag)->Generated(it.Value());
+      TCollection_AsciiString aStr(myFreePrimitiveTag - PRIMITIVES_START_TAG + 1);
+      aName = theName + "_" + aStr.ToCString();
+      buildName(myFreePrimitiveTag, aName);
     }
   }
 }
 
-std::shared_ptr<GeomAPI_Shape> Model_BodyBuilder::shape()
+GeomShapePtr Model_BodyBuilder::shape()
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
   if (aData && aData->isValid()) {
@@ -1142,36 +968,11 @@ std::shared_ptr<GeomAPI_Shape> Model_BodyBuilder::shape()
     if (aShapeLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
       TopoDS_Shape aShape = aName->Get();
       if (!aShape.IsNull()) {
-        std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
+        GeomShapePtr aRes(new GeomAPI_Shape);
         aRes->setImpl(new TopoDS_Shape(aShape));
         return aRes;
       }
     }
   }
-  return std::shared_ptr<GeomAPI_Shape>();
-}
-
-bool Model_BodyBuilder::isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape)
-{
-  if (theShape.get()) {
-    TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
-    std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-    if (aData) {
-      TDF_Label& aShapeLab = aData->shapeLab();
-      Handle(TNaming_NamedShape) aName;
-      if (aShapeLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
-        TopoDS_Shape aLatest = TNaming_Tool::CurrentShape(aName);
-        if (aLatest.IsNull())
-          return false;
-        if (aLatest.IsEqual(aShape))
-          return true;
-        // check sub-shapes for comp-solids:
-        for (TopExp_Explorer anExp(aShape, aLatest.ShapeType()); anExp.More(); anExp.Next()) {
-          if (aLatest.IsEqual(anExp.Current()))
-            return true;
-        }
-      }
-    }
-  }
-  return false;
+  return GeomShapePtr();
 }
old mode 100755 (executable)
new mode 100644 (file)
index d34fb0b..08e7979
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_BodyBuilder_H_
@@ -41,101 +40,89 @@ class Model_BodyBuilder : public ModelAPI_BodyBuilder
   std::map<int, TNaming_Builder*> myBuilders;
 public:
   /// Stores the shape (called by the execution method).
-  MODEL_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape,
-                                  const bool theIsStoreSameShapes = true);
+  MODEL_EXPORT virtual void store(const GeomShapePtr& theShape,
+                                  const bool theIsStoreSameShapes = true) override;
 
   /// Stores the generated shape (called by the execution method).
-  MODEL_EXPORT virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-                                              const std::shared_ptr<GeomAPI_Shape>& theToShape);
+  MODEL_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape,
+                                           const GeomShapePtr& theToShape,
+                                           const bool theIsCleanStored = true) override;
+
+  /// Stores the root generated shapes (called by the execution method).
+  MODEL_EXPORT virtual void storeGenerated(const std::list<GeomShapePtr>& theFromShapes,
+    const GeomShapePtr& theToShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape) override;
 
   /// Stores the modified shape (called by the execution method).
   /// \param theOldShape shape that produces result
   /// \param theNewShape resulting shape
-  /// \param theDecomposeSolidsTag tag for starting of solids sub-elements placement in case
-  ///          theNewShape is compound of solids, if zero it is not used
-  MODEL_EXPORT virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-                                               const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-                                          const int theDecomposeSolidsTag = 0);
+  /// \param theIsCleanStored erases all previous data structure of this body if true
+  MODEL_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape,
+                                          const GeomShapePtr& theNewShape,
+                                          const bool theIsCleanStored = true) override;
 
-  /// Stores the shape without naming support
-  /// \param theShape shape to store
-  MODEL_EXPORT virtual void storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape);
+  /// Stores the root modified shape (called by the execution method).
+  /// \param theOldShapes all shapes that produce result
+  /// \param theNewShape resulting shape
+  /// \param theIsCleanStored erases all previous data structure of this body if true
+  MODEL_EXPORT virtual void storeModified(const std::list<GeomShapePtr>& theOldShapes,
+    const GeomShapePtr& theNewShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape) override;
 
   /// Returns the shape-result produced by this feature
-  MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
+  MODEL_EXPORT virtual GeomShapePtr shape();
 
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
-  MODEL_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-    const std::string& theName, const int theTag = 1);
+  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
+  MODEL_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) override;
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological
   /// construction. As an example, consider the case of a face generated from an edge in
   /// construction of a prism.
-  MODEL_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-    const std::string& theName, const int theTag = 1);
+  MODEL_EXPORT virtual void generated(const GeomShapePtr& theOldShape,
+                                      const GeomShapePtr& theNewShape,
+                                      const std::string& theName = "") override;
 
 
   /// Records the shape newShape which is a modification of the shape oldShape.
   /// As an example, consider the case of a face split or merged in a Boolean operation.
-  MODEL_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-    const std::string& theName, const int theTag = 1);
-
-  /// Records the shape oldShape which was deleted from the current label.
-  /// As an example, consider the case of a face removed by a Boolean operation.
-  MODEL_EXPORT virtual void deleted(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const int theTag = 1);
+  MODEL_EXPORT virtual void modified(const GeomShapePtr& theOldShape,
+                                     const GeomShapePtr& theNewShape,
+                                     const std::string& theName = "") override;
 
   /// load deleted shapes
-  MODEL_EXPORT virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                               const GeomShapePtr theShapes = GeomShapePtr());
+  MODEL_EXPORT
+  virtual void loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
+                                 const GeomShapePtr& theOldShape,
+                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                 const GeomShapePtr& theShapesToExclude = GeomShapePtr()) override;
+
   /// load and orient modified shapes
-  MODEL_EXPORT virtual void loadAndOrientModifiedShapes (
-                                                  GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                                                                          const std::string& theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes,
-                                               const bool theIsStoreSeparate = false,
-                                               const bool theIsStoreAsGenerated = false);
-   /// load and orient generated shapes
-  MODEL_EXPORT virtual void loadAndOrientGeneratedShapes (
-                                                  GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                                                                          const std::string& theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes);
+  MODEL_EXPORT
+  virtual void loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
+                                  const GeomShapePtr& theOldShape,
+                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                  const std::string& theName = "") override;
+
+  /// load and orient generated shapes
+  MODEL_EXPORT
+  virtual void loadGeneratedShapes(const GeomMakeShapePtr& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "",
+                                   const bool theSaveOldIfNotInTree = false) override;
 
   /// Loads shapes of the first level (to be used during shape import)
-  MODEL_EXPORT virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
-                                           const std::string& theName, int&  theTag);
-
-  /// Loads disconnected edges
-  MODEL_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
-                                                  const std::string& theName, int&  theTag);
-
-  /// Loads disconnected vetexes
-  MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
-                                                     const std::string& theName, int&  theTag);
+  MODEL_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
+                                           const std::string& theName) override;
 
   /// Removes the stored builders
   MODEL_EXPORT virtual ~Model_BodyBuilder();
 
-  /// Converts evolution of sub-shapes stored in naming structure to selection
-  /// (theFlag = true) and back (theFlag = false)
-  MODEL_EXPORT virtual void evolutionToSelection(const bool theFlag);
-
-  /// Returns true if the latest modification of this body in the naming history
-  // is equal to the given shape
-  MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
-
+  /// Cleans cash related to the already stored elements
+  MODEL_EXPORT virtual void cleanCash() override;
 protected:
   /// Default constructor accessible only by Model_Objects
   Model_BodyBuilder(ModelAPI_Object* theOwner);
@@ -148,17 +135,21 @@ protected:
 
 private:
   /// Loads shapes of the next level (to be used during shape import)
-  void loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
-                      const std::string& theName, int&  theTag);
+  void loadNextLevels(GeomShapePtr theShape,
+                      const std::string& theName);
 
   /// builds name for the shape kept at the specified tag
   void buildName(const int theTag, const std::string& theName);
 
 private:
-  int myDividedIndex;
-  int myVIndex;
-  int myEIndex;
-  int myFIndex;
+  struct IndexTags {
+    int index;
+    std::vector<int> tags;
+  };
+
+private:
+  int myFreePrimitiveTag;
+  std::map<std::string, IndexTags> myPrimitivesNamesIndexMap;
 
 private:
   friend class Model_ResultBody;
index d7d14ad8cae6bea66468270675810de020136356..6c2f34378d67bb1c628076d1149ed058fd3d9f0d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Data.h>
@@ -96,22 +95,13 @@ void Model_Data::setLabel(TDF_Label theLab)
     myFlags->SetValue(kFlagInHistory, Standard_True); // is in history by default is true
     myFlags->SetValue(kFlagDisplayed, Standard_True); // is displayed by default is true
     myFlags->SetValue(kFlagDeleted, Standard_False); // is deleted by default is false
-  } else if (myFlags->Length() != 3) { // for old formats support
-    Standard_Boolean aFlag0 = myFlags->Upper() >= 0 ? myFlags->Value(0) : Standard_True;
-    Standard_Boolean aFlag1 = myFlags->Upper() >= 1 ? myFlags->Value(1) : Standard_True;
-    Standard_Boolean aFlag2 = myFlags->Upper() >= 2 ? myFlags->Value(2) : Standard_True;
-    Handle(TColStd_HArray1OfByte) aNewArray = new TColStd_HArray1OfByte(0, 2);
-    myFlags->SetInternalArray(aNewArray);
-    myFlags->SetValue(0, aFlag0);
-    myFlags->SetValue(1, aFlag1);
-    myFlags->SetValue(2, aFlag2);
   }
 }
 
 std::string Model_Data::name()
 {
   Handle(TDataStd_Name) aName;
-  if (myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
+  if (shapeLab().FindAttribute(TDataStd_Name::GetID(), aName)) {
 #ifdef DEBUG_NAMES
     myObject->myName = TCollection_AsciiString(aName->Get()).ToCString();
 #endif
@@ -125,8 +115,8 @@ void Model_Data::setName(const std::string& theName)
   bool isModified = false;
   std::string anOldName = name();
   Handle(TDataStd_Name) aName;
-  if (!myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
-    TDataStd_Name::Set(myLab, theName.c_str());
+  if (!shapeLab().FindAttribute(TDataStd_Name::GetID(), aName)) {
+    TDataStd_Name::Set(shapeLab(), theName.c_str());
     isModified = true;
   } else {
     isModified = !aName->Get().IsEqual(theName.c_str());
@@ -143,7 +133,7 @@ void Model_Data::setName(const std::string& theName)
       }
       if (isUserDefined) {
         // name is user-defined, thus special attribute is set
-        TDataStd_UAttribute::Set(myLab, kUSER_DEFINED_NAME);
+        TDataStd_UAttribute::Set(shapeLab(), kUSER_DEFINED_NAME);
       }
     }
   }
@@ -151,7 +141,7 @@ void Model_Data::setName(const std::string& theName)
     ModelAPI_ObjectRenamedMessage::send(myObject, anOldName, theName, this);
   if (isModified && myObject && myObject->document()) {
     std::dynamic_pointer_cast<Model_Document>(myObject->document())->
-      changeNamingName(anOldName, theName, myLab);
+      changeNamingName(anOldName, theName, shapeLab());
   }
 #ifdef DEBUG_NAMES
   myObject->myName = theName;
@@ -160,7 +150,7 @@ void Model_Data::setName(const std::string& theName)
 
 bool Model_Data::hasUserDefinedName() const
 {
-  return myLab.IsAttribute(kUSER_DEFINED_NAME);
+  return shapeLab().IsAttribute(kUSER_DEFINED_NAME);
 }
 
 AttributePtr Model_Data::addAttribute(const std::string& theID, const std::string theAttrType)
@@ -346,7 +336,7 @@ void Model_Data::sendAttributeUpdated(ModelAPI_Attribute* theAttr)
     }
   } else {
     // trim: need to redisplay
-    if (myObject) {
+    if (myObject && theAttr->attributeType() == "Point2D") {
       static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
       ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);
     }
@@ -417,7 +407,7 @@ enum StatesIndexes {
   STATE_INDEX_TRANSACTION = 2, // transaction ID
 };
 
-/// Returns the label array, initialises it by default values if not exists
+/// Returns the label array, initializes it by default values if not exists
 static Handle(TDataStd_IntegerArray) stateArray(TDF_Label& theLab)
 {
   Handle(TDataStd_IntegerArray) aStateArray;
@@ -481,15 +471,6 @@ int Model_Data::featureId() const
   return myLab.Father().Tag(); // tag of the feature label
 }
 
-void Model_Data::eraseBackReferences()
-{
-  myRefsToMe.clear();
-  std::shared_ptr<ModelAPI_Result> aRes = std::dynamic_pointer_cast<ModelAPI_Result>(myObject);
-  if (aRes) {
-    aRes->setIsConcealed(false);
-  }
-}
-
 void Model_Data::removeBackReference(ObjectPtr theObject, std::string theAttrID)
 {
   AttributePtr anAttribute = theObject->data()->attribute(theAttrID);
@@ -503,7 +484,7 @@ void Model_Data::removeBackReference(AttributePtr theAttr)
 
   myRefsToMe.erase(theAttr);
 
-  // remove concealment immideately: on deselection it must be posible to reselect in GUI the same
+  // remove concealment immediately: on deselection it must be possible to reselect in GUI the same
   FeaturePtr aFeatureOwner = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttr->owner());
   if (aFeatureOwner.get() &&
     ModelAPI_Session::get()->validators()->isConcealed(aFeatureOwner->getKind(), theAttr->id())) {
@@ -741,7 +722,7 @@ void Model_Data::copyTo(std::shared_ptr<ModelAPI_Data> theTarget)
   // reinitialize Model_Attributes by TDF_Attributes set
   std::shared_ptr<Model_Data> aTData = std::dynamic_pointer_cast<Model_Data>(theTarget);
   aTData->myAttrs.clear();
-  theTarget->owner()->initAttributes(); // reinit feature attributes
+  theTarget->owner()->initAttributes(); // reinitialize feature attributes
 }
 
 bool Model_Data::isInHistory()
index 598193cb8903bc6eae4ed0b44601ca727bd94e46..48ec4faae8d0607d7c9c836d0c9b59f98de2cf1e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Data_H_
@@ -168,13 +167,13 @@ class Model_Data : public ModelAPI_Data
   MODEL_EXPORT virtual const std::string& id(const std::shared_ptr<ModelAPI_Attribute>& theAttr);
   /// Returns true if data belongs to same features
   MODEL_EXPORT virtual bool isEqual(const std::shared_ptr<ModelAPI_Data>& theData);
-  /// Returns true if it is correctly connected t othe data model
+  /// Returns true if it is correctly connected tthe data model
   MODEL_EXPORT virtual bool isValid();
 
   /// Returns the label where the shape must be stored (used in ResultBody)
-  TDF_Label& shapeLab()
+  TDF_Label shapeLab() const
   {
-    return myLab;
+    return myLab.IsNull() ? myLab : myLab.Father().FindChild(2);
   }
 
   /// Initializes object by the attributes: must be called just after the object is created
@@ -236,10 +235,10 @@ class Model_Data : public ModelAPI_Data
   MODEL_EXPORT virtual void referencesToObjects(
     std::list<std::pair<std::string, std::list<ObjectPtr> > >& theRefs);
 
-  /// Copies all atributes content into theTarget data
+  /// Copies all attributes content into theTarget data
   MODEL_EXPORT virtual void copyTo(std::shared_ptr<ModelAPI_Data> theTarget);
 
-  /// Returns the invalid data pointer (to avoid working with NULL shared ptrs in swig)
+  /// Returns the invalid data pointer (to avoid working with NULL shared pointers in swig)
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Data> invalidPtr();
 
   /// Returns the invalid data pointer: static method
@@ -263,15 +262,13 @@ protected:
   /// Defines the custom "is in history" behavior
   MODEL_EXPORT virtual void setIsInHistory(const bool theFlag);
 
-  /// Returns true if the object is deleted, but some data is still keept in memory
+  /// Returns true if the object is deleted, but some data is still kept in memory
   MODEL_EXPORT virtual bool isDeleted();
 
-  /// Sets true if the object is deleted, but some data is still keept in memory
+  /// Sets true if the object is deleted, but some data is still kept in memory
   MODEL_EXPORT virtual void setIsDeleted(const bool theFlag);
 
 private:
-  /// Removes all information about back references
-  void eraseBackReferences();
   /// Removes a back reference (with identifier which attribute references to this object)
   /// \param theFeature feature referenced to this
   /// \param theAttrID identifier of the attribute that is references from theFeature to this
@@ -282,7 +279,7 @@ private:
   /// Adds a back reference (with identifier which attribute references to this object
   /// \param theFeature feature referenced to this
   /// \param theAttrID identifier of the attribute that is references from theFeature to this
-  /// \param theApplyConcealment applies consealment flag changes
+  /// \param theApplyConcealment applies concealment flag changes
   void addBackReference(FeaturePtr theFeature, std::string theAttrID,
     const bool theApplyConcealment = true);
   /// Adds a back reference to an object
@@ -295,7 +292,7 @@ private:
 
   /// Returns true if object must be displayed in the viewer: flag is stored in the
   /// data model, so on undo/redo, open/save or recreation of object by history-playing it keeps
-  /// the original state i nthe current transaction.
+  /// the original state ithe current transaction.
   MODEL_EXPORT virtual bool isDisplayed();
 
   /// Sets the displayed/hidden state of the object. If it is changed, sends the "redisplay"
old mode 100755 (executable)
new mode 100644 (file)
index 7acdecd..8b26c6a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Document.h>
@@ -32,6 +31,7 @@
 #include <ModelAPI_ResultBody.h>
 #include <Events_Loop.h>
 #include <Events_InfoMessage.h>
+#include <GeomAPI_Tools.h>
 
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_Comment.hxx>
 #include <TDataStd_AsciiString.hxx>
 #include <TDF_Reference.hxx>
 #include <TDF_ChildIDIterator.hxx>
-#include <TDF_LabelMapHasher.hxx>
 #include <TDF_Delta.hxx>
 #include <TDF_AttributeDelta.hxx>
 #include <TDF_AttributeDeltaList.hxx>
 #include <TDF_ListIteratorOfAttributeDeltaList.hxx>
 #include <TDF_ListIteratorOfLabelList.hxx>
 #include <TDF_LabelMap.hxx>
+#include <TDF_Tool.hxx>
 #include <TDF_DeltaOnAddition.hxx>
+#include <TDataStd_ExtStringList.hxx>
 #include <TDataStd_UAttribute.hxx>
 #include <TNaming_Builder.hxx>
 #include <TNaming_SameShapeIterator.hxx>
 #include <TNaming_Iterator.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Tool.hxx>
+#include<TNaming_OldShapeIterator.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_ListOfShape.hxx>
 
 #include <TopExp_Explorer.hxx>
 #include <TopoDS_Shape.hxx>
@@ -85,13 +89,16 @@ static const int TAG_GENERAL = 1;  // general properties tag
 // general sub-labels
 /// where the reference to the current feature label is located (or no attribute if null feature)
 static const int TAG_CURRENT_FEATURE = 1; ///< reference to the current feature
-/// integer, index of the transaction + GUID for auto recomutation blocking
+/// integer, index of the transaction + GUID for auto recomputation blocking
 static const int TAG_CURRENT_TRANSACTION = 2;
 static const int TAG_SELECTION_FEATURE = 3; ///< integer, tag of the selection feature label
 static const int TAG_NODES_STATE = 4; ///< array, tag of the Object Browser nodes states
 ///< naming structures constructions selected from other document
 static const int TAG_EXTERNAL_CONSTRUCTIONS = 5;
 
+/// reference to the shape in external document: sting list attribute identifier
+static const Standard_GUID kEXTERNAL_SHAPE_REF("9aa5dd14-6d34-4a8d-8786-05842fd7bbbd");
+
 Model_Document::Model_Document(const int theID, const std::string theKind)
     : myID(theID), myKind(theKind), myIsActive(false), myIsSetCurrentFeature(false),
       myDoc(new TDocStd_Document("BinOcaf"))  // binary OCAF format
@@ -136,6 +143,84 @@ bool Model_Document::isRoot() const
   return this == Model_Session::get()->moduleDocument().get();
 }
 
+// LCOV_EXCL_START
+/// Makes all modification and generation naming shapes that have old shapes corresponding to
+/// shapes in a root document be equal to this root document
+static void updateShapesFromRoot(const TDF_Label theThisAccess, const TDF_Label theRootAccess)
+{
+  TopTools_DataMapOfShapeShape aCurrentToRoot; // shapes that must be updated: from this to root
+  TDF_ChildIDIterator aThisIter(theThisAccess.Root(), kEXTERNAL_SHAPE_REF, true);
+  for(; aThisIter.More(); aThisIter.Next()) {
+    aCurrentToRoot.Clear();
+    Handle(TNaming_NamedShape) aNS;
+    if (!aThisIter.Value()->Label().FindAttribute(TNaming_NamedShape::GetID(), aNS))
+      continue;
+    if (aNS->Evolution() != TNaming_GENERATED && aNS->Evolution() != TNaming_MODIFY)
+      continue;
+    for (TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next()) {
+      const TopoDS_Shape& anOld = aNSIter.OldShape();
+      if (anOld.IsNull())
+        continue;
+      TNaming_OldShapeIterator aNewIter(anOld, theThisAccess);
+      for (; aNewIter.More(); aNewIter.Next()) {
+        TNaming_Evolution anEvolution = aNewIter.NamedShape()->Evolution();
+        if (anEvolution != TNaming_SELECTED && anEvolution != TNaming_DELETE)
+          break;
+      }
+      if (aNewIter.More())
+        continue;
+      GeomShapePtr anOldShape(new GeomAPI_Shape), aRootShape(new GeomAPI_Shape);
+      anOldShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(anOld));
+      anOldShape = GeomAPI_Tools::getTypedShape(anOldShape);
+
+      // search the same shape in the root document
+      Handle(TDataStd_ExtStringList) anEntries =
+        Handle(TDataStd_ExtStringList)::DownCast(aThisIter.Value());
+      TDataStd_ListOfExtendedString::Iterator anIter(anEntries->List());
+      for (; anIter.More(); anIter.Next()) {
+        TDF_Label aRootLab;
+        TDF_Tool::Label(theRootAccess.Data(), anIter.Value(), aRootLab);
+        if (aRootLab.IsNull())
+          continue;
+        Handle(TNaming_NamedShape) aRootNS;
+        if (!aRootLab.FindAttribute(TNaming_NamedShape::GetID(), aRootNS))
+          continue;
+        TNaming_Iterator aRootShapes(aRootNS);
+        for (; aRootShapes.More(); aRootShapes.Next()) {
+          if (aRootShapes.NewShape().IsNull())
+            continue;
+          aRootShape->setImpl(new TopoDS_Shape(aRootShapes.NewShape()));
+          aRootShape = GeomAPI_Tools::getTypedShape(aRootShape);
+          if (!anOldShape->isEqual(aRootShape)) // special checking by geometry
+            continue;
+          // found a good corresponded shape
+          if (!anOld.IsEqual(aRootShapes.NewShape()))
+            aCurrentToRoot.Bind(anOld, aRootShapes.NewShape());
+        }
+      }
+    }
+    if (!aCurrentToRoot.IsEmpty()) { // update the whole named shape content
+      TopTools_ListOfShape anOld, aNew;
+      TNaming_Evolution anEvol = aNS->Evolution();
+      for(TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next()) {
+        anOld.Prepend(aCurrentToRoot.IsBound(aNSIter.OldShape()) ?
+          aCurrentToRoot.Find(aNSIter.OldShape()) : aNSIter.OldShape());
+        aNew.Prepend(aNSIter.NewShape());
+      }
+      TNaming_Builder aBuilder(aNS->Label());
+      TopTools_ListOfShape::Iterator anOldIter(anOld), aNewIter(aNew);
+      for(; anOldIter.More(); anOldIter.Next(), aNewIter.Next()) {
+        if (anEvol == TNaming_GENERATED) {
+          aBuilder.Generated(anOldIter.Value(), aNewIter.Value());
+        } else if (anEvol == TNaming_MODIFY) {
+          aBuilder.Modify(anOldIter.Value(), aNewIter.Value());
+        }
+      }
+    }
+  }
+}
+// LCOV_EXCL_STOP
+
 bool Model_Document::load(const char* theDirName, const char* theFileName, DocumentPtr theThis)
 {
   Handle(Model_Application) anApp = Model_Application::getApplication();
@@ -154,6 +239,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
   }
   bool isError = aStatus != PCDM_RS_OK;
   if (isError) {
+    // LCOV_EXCL_START
     switch (aStatus) {
       case PCDM_RS_UnknownDocument:
         Events_InfoMessage("Model_Document", "Can not open document").send();
@@ -208,6 +294,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
         Events_InfoMessage("Model_Document", "Can not open document: unknown error").send();
         break;
     }
+    // LCOV_EXCL_STOP
   }
   std::shared_ptr<Model_Session> aSession =
     std::dynamic_pointer_cast<Model_Session>(Model_Session::get());
@@ -220,12 +307,12 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
     aSession->setCheckTransactions(false);
     if (myObjs)
       delete myObjs;
-    myObjs = new Model_Objects(myDoc->Main()); // synchronisation is inside
+    myObjs = new Model_Objects(myDoc->Main()); // synchronization is inside
     myObjs->setOwner(theThis);
     // update the current features status
     setCurrentFeature(currentFeature(false), false);
     aSession->setCheckTransactions(true);
-    aSession->setActiveDocument(Model_Session::get()->moduleDocument(), false);
+    aSession->setActiveDocument(aSession->moduleDocument(), false);
     // this is done in Part result "activate", so no needed here. Causes not-blue active part.
     // aSession->setActiveDocument(anApp->getDocument(myID), true);
 
@@ -239,8 +326,11 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
         anApp->setLoadByDemand(aPart->data()->name(),
           aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->docId());
     }
-
-  } else { // open failed, but new documnet was created to work with it: inform the model
+    if (!isRoot()) {
+      updateShapesFromRoot(myDoc->Main(),
+        std::dynamic_pointer_cast<Model_Document>(aSession->moduleDocument())->generalLabel());
+    }
+  } else { // open failed, but new document was created to work with it: inform the model
     aSession->setActiveDocument(Model_Session::get()->moduleDocument(), false);
   }
   return !isError;
@@ -274,7 +364,10 @@ bool Model_Document::save(
   Handle(Model_Application) anApp = Model_Application::getApplication();
   if (isRoot()) {
 #ifdef WIN32
-    CreateDirectory((LPTSTR) theDirName, NULL);
+    size_t aDirLen = strlen(theDirName);
+    std::wstring aWStr(aDirLen, L'#');
+    mbstowcs(&aWStr[0], theDirName, aDirLen);
+    CreateDirectory(aWStr.c_str(), NULL);
 #else
     mkdir(theDirName, 0x1ff);
 #endif
@@ -369,10 +462,10 @@ void Model_Document::close(const bool theForever)
       aSub->close(theForever);
   }
 
-  // close for thid document needs no transaction in this document
+  // close for this document needs no transaction in this document
   std::static_pointer_cast<Model_Session>(Model_Session::get())->setCheckTransactions(false);
 
-  // close all only if it is really asked, otherwise it can be undoed/redoed
+  // close all only if it is really asked, otherwise it can be undone/redone
   if (theForever) {
     // flush everything to avoid messages with bad objects
     delete myObjs;
@@ -425,7 +518,7 @@ void Model_Document::compactNested()
       aSumOfTransaction += myTransactions.rbegin()->myOCAFNum;
       myTransactions.pop_back();
     }
-    // the latest transaction is the start of lower-level operation which startes the nested
+    // the latest transaction is the start of lower-level operation which starts the nested
     myTransactions.rbegin()->myOCAFNum += aSumOfTransaction;
     myNestedNum.pop_back();
   }
@@ -521,7 +614,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute)
   return false;
 }
 
-/// Returns true if the last transaction is actually empty: modification to te same values
+/// Returns true if the last transaction is actually empty: modification to the same values
 /// were performed only
 static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) {
   Handle(TDF_Delta) aDelta;
@@ -568,7 +661,7 @@ bool Model_Document::finishOperation()
   // do it before flashes to enable and recompute nesting features correctly
   if (myNestedNum.empty() || (isNestedClosed && myNestedNum.size() == 1)) {
     // if all nested operations are closed, make current the higher level objects (to perform
-    // it in the python scripts correctly): sketch become current after creation ofsub-elements
+    // it in the python scripts correctly): sketch become current after creation of sub-elements
     FeaturePtr aCurrent = currentFeature(false);
     CompositeFeaturePtr aMain, aNext = ModelAPI_Tools::compositeOwner(aCurrent);
     while(aNext.get()) {
@@ -580,10 +673,10 @@ bool Model_Document::finishOperation()
   }
   myObjs->synchronizeBackRefs();
   Events_Loop* aLoop = Events_Loop::loop();
-  static const Events_ID kCreatedEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED);
-  static const Events_ID kUpdatedEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED);
-  static const Events_ID kRedispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const Events_ID kDeletedEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED);
+  static const Events_ID kCreatedEvent = aLoop->eventByName(EVENT_OBJECT_CREATED);
+  static const Events_ID kUpdatedEvent = aLoop->eventByName(EVENT_OBJECT_UPDATED);
+  static const Events_ID kRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const Events_ID kDeletedEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
   aLoop->flush(kCreatedEvent);
   aLoop->flush(kUpdatedEvent);
   aLoop->flush(kRedispEvent);
@@ -627,7 +720,7 @@ bool Model_Document::finishOperation()
 
   // transaction may be empty if this document was created during this transaction (create part)
   if (!myTransactions.empty() && myDoc->CommitCommand()) {
-    // if commit is successfull, just increment counters
+    // if commit is successful, just increment counters
     if (isEmptyTransaction(myDoc)) { // erase this transaction
       myDoc->Undo();
       myDoc->ClearRedos();
@@ -647,7 +740,7 @@ bool Model_Document::finishOperation()
     // nothing inside in all documents, so remove this transaction from the transactions list
     undoInternal(true, false);
   }
-  // on finish clear redos in any case (issue 446) and for all subs (issue 408)
+  // on finish clear redo in any case (issue 446) and for all subs (issue 408)
   myDoc->ClearRedos();
   myRedos.clear();
   for (aSubIter = aSubs.begin(); aSubIter != aSubs.end(); aSubIter++) {
@@ -683,7 +776,7 @@ static void modifiedLabels(const Handle(TDocStd_Document)& theDoc, TDF_LabelList
     if (anAttr.Value()->Attribute()->ID() == TNaming_NamedShape::GetID()) {
       anExcludedInt.Add(anAttr.Value()->Label());
       // named shape evolution is changed in history update => skip them,
-      // they are not the features arguents
+      // they are not the features arguments
       continue;
     }
     if (anAttr.Value()->Attribute()->ID() == TDataStd_Integer::GetID()) {
@@ -755,7 +848,7 @@ bool Model_Document::isOperation() const
 
 bool Model_Document::isModified()
 {
-  // is modified if at least one operation was commited and not undoed
+  // is modified if at least one operation was committed and not undone
   return myTransactions.size() != myTransactionSave || isOperation();
 }
 
@@ -768,7 +861,7 @@ bool Model_Document::canUndo()
       (myNestedNum.empty() || *myNestedNum.rbegin() - aCurrentNum > 0) &&
       myTransactions.size() - aCurrentNum > 0 /* for omitting the first useless transaction */)
     return true;
-  // check other subs contains operation that can be undoed
+  // check other subs contains operation that can be undone
   const std::set<int> aSubs = subDocuments();
   std::set<int>::iterator aSubIter = aSubs.begin();
   for (; aSubIter != aSubs.end(); aSubIter++) {
@@ -826,7 +919,7 @@ bool Model_Document::canRedo()
 {
   if (!myRedos.empty())
     return true;
-  // check other subs contains operation that can be redoed
+  // check other subs contains operation that can be redone
   const std::set<int> aSubs = subDocuments();
   std::set<int>::iterator aSubIter = aSubs.begin();
   for (; aSubIter != aSubs.end(); aSubIter++) {
@@ -862,7 +955,8 @@ void Model_Document::redo()
   // update the current features status
   setCurrentFeature(currentFeature(false), false);
 }
-
+// this is used for creation of undo/redo1-list by GUI
+// LCOV_EXCL_START
 std::list<std::string> Model_Document::undoList() const
 {
   std::list<std::string> aResult;
@@ -888,6 +982,7 @@ std::list<std::string> Model_Document::redoList() const
   }
   return aResult;
 }
+// LCOV_EXCL_STOP
 
 void Model_Document::operationId(const std::string& theId)
 {
@@ -929,6 +1024,15 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre
           aCurrent = aSub;
         }
       }
+      // #2861: if the parameter is added, add it after parameters existing in the list
+      if (aCurrent.get() &&
+          (aFeature->getKind() == "Parameter" || aFeature->getKind() == "ParametersMgr")) {
+        int anIndex = kUNDEFINED_FEATURE_INDEX;
+        for(FeaturePtr aNextFeat = myObjs->nextFeature(aCurrent, anIndex);
+            aNextFeat.get() && aNextFeat->getKind() == "Parameter";
+            aNextFeat = myObjs->nextFeature(aCurrent, anIndex))
+          aCurrent = aNextFeat;
+      }
     }
     aDocToAdd->myObjs->addFeature(aFeature, aCurrent);
     if (!aFeature->isAction()) {  // do not add action to the data model
@@ -942,7 +1046,6 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre
   return aFeature;
 }
 
-
 void Model_Document::refsToFeature(FeaturePtr theFeature,
   std::set<std::shared_ptr<ModelAPI_Feature> >& theRefs, const bool isSendError)
 {
@@ -952,6 +1055,22 @@ void Model_Document::refsToFeature(FeaturePtr theFeature,
 void Model_Document::removeFeature(FeaturePtr theFeature)
 {
   myObjs->removeFeature(theFeature);
+  // fix for #2723: send signal that part is updated
+  if (!isRoot() && isOperation()) {
+    std::shared_ptr<Model_Document> aRoot =
+      std::dynamic_pointer_cast<Model_Document>(ModelAPI_Session::get()->moduleDocument());
+    std::list<ResultPtr> allParts;
+    aRoot->objects()->allResults(ModelAPI_ResultPart::group(), allParts);
+    std::list<ResultPtr>::iterator aParts = allParts.begin();
+    for(; aParts != allParts.end(); aParts++) {
+      ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aParts);
+      if (aPart->partDoc().get() == this) {
+        static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+        ModelAPI_EventCreator::get()->sendUpdated(aRoot->feature(aPart), anEvent);
+        break;
+      }
+    }
+  }
 }
 
 // recursive function to check if theSub is a child of theMain composite feature
@@ -965,7 +1084,6 @@ static bool isSub(const CompositeFeaturePtr theMain, const FeaturePtr theSub) {
   return isSub(theMain, aParent);
 }
 
-
 void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
 {
   bool aCurrentUp = theMoved == currentFeature(false);
@@ -979,8 +1097,9 @@ void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
   FeaturePtr anAfterThisSub = theAfterThis;
   if (aCompositeAfter.get()) {
     FeaturePtr aSub = aCompositeAfter;
+    int anIndex = kUNDEFINED_FEATURE_INDEX;
     do {
-      FeaturePtr aNext = myObjs->nextFeature(aSub);
+      FeaturePtr aNext = myObjs->nextFeature(aSub, anIndex);
       if (!isSub(aCompositeAfter, aNext)) {
         anAfterThisSub = aSub;
         break;
@@ -1000,12 +1119,14 @@ void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
 
 void Model_Document::updateHistory(const std::shared_ptr<ModelAPI_Object> theObject)
 {
-  myObjs->updateHistory(theObject);
+  if (myObjs)
+    myObjs->updateHistory(theObject);
 }
 
 void Model_Document::updateHistory(const std::string theGroup)
 {
-  myObjs->updateHistory(theGroup);
+  if (myObjs)
+    myObjs->updateHistory(theGroup);
 }
 
 const std::set<int> Model_Document::subDocuments() const
@@ -1074,8 +1195,9 @@ std::shared_ptr<ModelAPI_Feature> Model_Document::currentFeature(const bool theV
     TDF_Label aLab = aRef->Get();
     FeaturePtr aResult = myObjs->feature(aLab);
     if (theVisible) { // get nearest visible (in history) going up
+      int anIndex = kUNDEFINED_FEATURE_INDEX;
       while(aResult.get() &&  !aResult->isInHistory()) {
-        aResult = myObjs->nextFeature(aResult, true);
+        aResult = myObjs->nextFeature(aResult, anIndex, true);
       }
     }
     return aResult;
@@ -1111,9 +1233,10 @@ void Model_Document::setCurrentFeature(
 
   if (theVisible && !theCurrent.get()) {
     // needed to avoid disabling of PartSet initial constructions
+    int anIndex = kUNDEFINED_FEATURE_INDEX;
     FeaturePtr aNext =
-      theCurrent.get() ? myObjs->nextFeature(theCurrent) : myObjs->firstFeature();
-    for (; aNext.get(); aNext = myObjs->nextFeature(theCurrent)) {
+      theCurrent.get() ? myObjs->nextFeature(theCurrent, anIndex, false) : myObjs->firstFeature();
+    for (; aNext.get(); aNext = myObjs->nextFeature(theCurrent, anIndex, false)) {
       if (aNext->isInHistory()) {
         break; // next in history is not needed
       } else { // next not in history is good for making current
@@ -1140,14 +1263,15 @@ void Model_Document::setCurrentFeature(
     aRefLab.ForgetAttribute(TDF_Reference::GetID());
   }
   // make all features after this feature disabled in reversed order
-  // (to remove results without deps)
+  // (to remove results without dependencies)
   static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
 
   bool aPassed = false; // flag that the current object is already passed in cycle
   FeaturePtr anIter = myObjs->lastFeature();
   bool aWasChanged = false;
   bool isCurrentParameter = theCurrent.get() && theCurrent->getKind() == "Parameter";
-  for(; anIter.get(); anIter = myObjs->nextFeature(anIter, true)) {
+  int anIndex = kUNDEFINED_FEATURE_INDEX;
+  for(; anIter.get(); anIter = myObjs->nextFeature(anIter, anIndex, true)) {
     // check this before passed become enabled: the current feature is enabled!
     if (anIter == theCurrent) aPassed = true;
 
@@ -1167,7 +1291,7 @@ void Model_Document::setCurrentFeature(
       //if (!isCurrentParameter)
         aDisabledFlag = false;
     } else if (isCurrentParameter) {
-      // if paramater is active, all other features become enabled (issue 1307)
+      // if parameter is active, all other features become enabled (issue 1307)
       aDisabledFlag = false;
     }
 
@@ -1182,7 +1306,7 @@ void Model_Document::setCurrentFeature(
       ModelAPI_EventCreator::get()->sendUpdated(anIter, aRedispEvent /*, false*/);
       aWasChanged = true;
     }
-    // update for everyone the concealment flag immideately: on edit feature in the midle of history
+    // update for everyone concealment flag immediately: on edit feature in the middle of history
     if (aWasChanged) {
       std::list<ResultPtr> aResults;
       ModelAPI_Tools::allResults(anIter, aResults);
@@ -1191,7 +1315,7 @@ void Model_Document::setCurrentFeature(
         if ((*aRes).get() && (*aRes)->data()->isValid() && !(*aRes)->isDisabled())
           std::dynamic_pointer_cast<Model_Data>((*aRes)->data())->updateConcealmentFlag();
       }
-      // update the concealment status for disply in isConcealed of ResultBody
+      // update the concealment status for display in isConcealed of ResultBody
       for(aRes = aResults.begin(); aRes != aResults.end(); aRes++) {
         if ((*aRes).get() && (*aRes)->data()->isValid() && !(*aRes)->isDisabled())
           (*aRes)->isConcealed();
@@ -1209,12 +1333,13 @@ void Model_Document::setCurrentFeatureUp()
   // problems if it is true: here and in "setCurrentFeature"
   FeaturePtr aCurrent = currentFeature(false);
   if (aCurrent.get()) { // if not, do nothing because null is the upper
-    FeaturePtr aPrev = myObjs->nextFeature(aCurrent, true);
+    int anIndex = kUNDEFINED_FEATURE_INDEX;
+    FeaturePtr aPrev = myObjs->nextFeature(aCurrent, anIndex, true);
     // make the higher level composite as current (sketch becomes disabled if line is enabled)
     if (aPrev.get()) {
       FeaturePtr aComp = ModelAPI_Tools::compositeOwner(aPrev);
       // without cycle (issue 1555): otherwise extrusion fuse
-      // will be enabled and displayed whaen inside sketch
+      // will be enabled and displayed when inside sketch
       if (aComp.get())
           aPrev = aComp;
     }
@@ -1324,17 +1449,6 @@ std::shared_ptr<ModelAPI_Feature> Model_Document::feature(
   return myObjs->feature(theResult);
 }
 
-Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper)
-{
-  return TDF_LabelMapHasher::HashCode(theLab, theUpper);
-
-}
-Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2)
-{
-  return TDF_LabelMapHasher::IsEqual(theLab1, theLab2);
-}
-
-// searches in this document feature that contains this label
 FeaturePtr Model_Document::featureByLab(const TDF_Label& theLab) {
   TDF_Label aCurrentLab = theLab;
   while(aCurrentLab.Depth() > 3)
@@ -1342,12 +1456,25 @@ FeaturePtr Model_Document::featureByLab(const TDF_Label& theLab) {
   return myObjs->feature(aCurrentLab);
 }
 
+ResultPtr Model_Document::resultByLab(const TDF_Label& theLab)
+{
+  TDF_Label aCurrentLab = theLab;
+  while(aCurrentLab.Depth() > 3) {
+    ObjectPtr aResultObj = myObjs->object(aCurrentLab);
+    if (aResultObj.get()) {
+      return std::dynamic_pointer_cast<ModelAPI_Result>(aResultObj); // this may be null if feature
+    }
+    aCurrentLab = aCurrentLab.Father();
+  }
+  return ResultPtr(); // not found
+}
+
 void Model_Document::addNamingName(const TDF_Label theLabel, std::string theName)
 {
   std::map<std::string, std::list<TDF_Label> >::iterator aFind = myNamingNames.find(theName);
 
   if (aFind != myNamingNames.end()) { // to avoid duplicate-labels
-    // to keep correct order inspite of history line management
+    // to keep correct order in spite of history line management
     std::list<TDF_Label>::iterator anAddAfterThis = aFind->second.end();
     FeaturePtr anAddedFeature = featureByLab(theLabel);
     std::list<TDF_Label>::iterator aLabIter = aFind->second.begin();
@@ -1391,6 +1518,17 @@ void Model_Document::changeNamingName(const std::string theOldName,
         } else { // remove from the list
           aFind->second.erase(aLabIter);
         }
+        // check the sketch vertex name located under renamed sketch line
+        TDF_ChildIDIterator aChild(theLabel, TDataStd_Name::GetID());
+        for(; aChild.More(); aChild.Next()) {
+          Handle(TDataStd_Name) aSubName = Handle(TDataStd_Name)::DownCast(aChild.Value());
+          std::string aName = TCollection_AsciiString(aSubName->Get()).ToCString();
+          if (aName.find(theOldName) == 0) { // started from parent name
+            std::string aNewSubName = theNewName + aName.substr(theOldName.size());
+            changeNamingName(aName, aNewSubName, aSubName->Label());
+            aSubName->Set(aNewSubName.c_str());
+          }
+        }
         return;
       }
     }
@@ -1409,7 +1547,7 @@ TDF_Label Model_Document::findNamingName(std::string theName, ResultPtr theConte
             return *aLabIter;
         }
       }
-      return *(aFind->second.rbegin()); // no more variannts, so, return the last
+      return *(aFind->second.rbegin()); // no more variants, so, return the last
   }
   // not found exact name, try to find by sub-components
   std::string::size_type aSlash = theName.rfind('/');
@@ -1480,12 +1618,24 @@ bool Model_Document::isLaterByDep(FeaturePtr theThis, FeaturePtr theOther) {
         if (!aRefFeat.get()) { // take feature of the result
           aRefFeat = feature(std::dynamic_pointer_cast<ModelAPI_Result>(aRefObj));
         }
-        if (aRefFeat.get() && aRefFeat == theThis) {
-          return false; // other references to this, so this later than other
+        if (aRefFeat.get()) {
+          if (aRefFeat == theThis)
+            return false; // other references to this, so other later than this
+          //if (std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aRefFeat)) {
+          //  if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion
+          //    return false;
+          //}
         }
       }
     }
   }
+  FeaturePtr aThisOwner = ModelAPI_Tools::compositeOwner(theThis);
+  if (aThisOwner.get()) {
+    if (aThisOwner == theOther)
+      return true; // composite owner is later that its sub
+    if (!isLaterByDep(aThisOwner, theOther))
+      return false;
+  }
   return myObjs->isLater(theThis, theOther);
 }
 
@@ -1536,7 +1686,7 @@ ResultPtr Model_Document::findByName(
   std::string aName = theName;
   ResultPtr aRes = myObjs->findByName(aName);
   theUniqueContext = !(aRes.get() && myNamingNames.find(aName) != myNamingNames.end());
-  while(!aRes.get() && aName[0] == '_') { // this may be thecontext with the history index
+  while(!aRes.get() && aName[0] == '_') { // this may be theContext with the history index
     aNumInHistory++;
     aName = aName.substr(1);
     aRes = myObjs->findByName(aName);
@@ -1612,11 +1762,6 @@ void Model_Document::incrementTransactionID()
   int aNewVal = transactionID() + 1;
   TDataStd_Integer::Set(generalLabel().FindChild(TAG_CURRENT_TRANSACTION), aNewVal);
 }
-void Model_Document::decrementTransactionID()
-{
-  int aNewVal = transactionID() - 1;
-  TDataStd_Integer::Set(generalLabel().FindChild(TAG_CURRENT_TRANSACTION), aNewVal);
-}
 
 TDF_Label Model_Document::extConstructionsLabel() const
 {
@@ -1638,27 +1783,22 @@ std::shared_ptr<ModelAPI_Feature> Model_Document::internalFeature(const int theI
   return myObjs->internalFeature(theIndex);
 }
 
-std::shared_ptr<ModelAPI_Feature> Model_Document::featureById(const int theId)
-{
-  return myObjs->featureById(theId);
-}
-
 void Model_Document::synchronizeTransactions()
 {
   Model_Document* aRoot =
     std::dynamic_pointer_cast<Model_Document>(ModelAPI_Session::get()->moduleDocument()).get();
   if (aRoot == this)
-    return; // don't need to synchronise root with root
+    return; // don't need to synchronize root with root
 
   std::shared_ptr<Model_Session> aSession =
     std::dynamic_pointer_cast<Model_Session>(Model_Session::get());
-  while(myRedos.size() > aRoot->myRedos.size()) { // remove redos in this
+  while(myRedos.size() > aRoot->myRedos.size()) { // remove redo in this
     aSession->setCheckTransactions(false);
     redo();
     aSession->setCheckTransactions(true);
   }
   /* this case can not be reproduced in any known case for the current moment, so, just comment
-  while(myRedos.size() < aRoot->myRedos.size()) { // add more redos in this
+  while(myRedos.size() < aRoot->myRedos.size()) { // add more redo in this
     undoInternal(false, true);
   }*/
 }
@@ -1778,11 +1918,11 @@ std::shared_ptr<ModelAPI_Feature> Model_Document::producedByFeature(
   if (!aBodyData.get() || !aBodyData->isValid())
     return FeaturePtr();
 
-  TopoDS_Shape anOldShape; // old shape in the pair oldshape->theShape in the named shape
+  TopoDS_Shape anOldShape; // old shape in the pair old shape->theShape in the named shape
   TopoDS_Shape aShapeContainer; // old shape of the shape that contains aShape as sub-element
   Handle(TNaming_NamedShape) aCandidatInThis, aCandidatContainer;
-  TDF_Label aBodyLab = aBodyData->label();
-  // use childs and this label (the lowest priority)
+  TDF_Label aBodyLab = aBodyData->shapeLab();
+  // use child and this label (the lowest priority)
   TDF_ChildIDIterator aNSIter(aBodyLab, TNaming_NamedShape::GetID(), Standard_True);
   bool aUseThis = !aNSIter.More();
   while(anOldShape.IsNull() && (aNSIter.More() || aUseThis)) {
@@ -1862,6 +2002,8 @@ bool Model_Document::isLater(FeaturePtr theLater, FeaturePtr theCurrent) const
   return myObjs->isLater(theLater, theCurrent);
 }
 
+// Object Browser nodes states
+// LCOV_EXCL_START
 void Model_Document::storeNodesState(const std::list<bool>& theStates)
 {
   TDF_Label aLab = generalLabel().FindChild(TAG_NODES_STATE);
@@ -1887,6 +2029,7 @@ void Model_Document::restoreNodesState(std::list<bool>& theStates) const
     }
   }
 }
+// LCOV_EXCL_STOP
 
 void Model_Document::eraseAllFeatures()
 {
index 0842d3d326b5b53fdf16b85cb584f0c060cb0efa..8778402e0d3d8df692d5035e6ee7a1e624bf17e3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Document_H_
@@ -38,8 +37,8 @@ class ModelAPI_AttributeSelectionList;
 /**\class Model_Document
  * \ingroup DataModel
  * \brief Document for internal data structure of any object storage.
- * Document contains all data that must be stored/retrived in the file.
- * Also it provides acces to this data: open/save, transactions management etc.
+ * Document contains all data that must be stored/retrieved in the file.
+ * Also it provides access to this data: open/save, transactions management etc.
  */
 class Model_Document : public ModelAPI_Document
 {
@@ -66,11 +65,11 @@ class Model_Document : public ModelAPI_Document
     const char* theDirName, const char* theFileName, std::list<std::string>& theResults);
 
   //! Removes document data
-  //! \param theForever if it is false, document is just hiden
+  //! \param theForever if it is false, document is just hidden
   //!                   (to keep possibility make it back on Undo/Redo)
   MODEL_EXPORT virtual void close(const bool theForever = false);
 
-  //! Starts a new operation (opens a tansaction)
+  //! Starts a new operation (opens a transaction)
   MODEL_EXPORT virtual void startOperation();
   //! Finishes the previously started operation (closes the transaction)
   //! \returns true if transaction in this document is not empty and really was performed
@@ -82,11 +81,11 @@ class Model_Document : public ModelAPI_Document
   //! Returns true if document was modified (since creation/opening)
   MODEL_EXPORT virtual bool isModified();
 
-  //! Returns True if there are available Undos
+  //! Returns True if there are available Undo-s
   MODEL_EXPORT virtual bool canUndo();
   //! Undoes last operation
   MODEL_EXPORT virtual void undo();
-  //! Returns True if there are available Redos
+  //! Returns True if there are available Redo-s
   MODEL_EXPORT virtual bool canRedo();
   //! Redoes last operation
   MODEL_EXPORT virtual void redo();
@@ -176,15 +175,11 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex);
   //! Performs synchronization of transactions with the module document:
   //! If some document is not active (by undo of activation) but in memory,
-  //! on activation the transactions must be synchronised because all redos performed
-  //! wihtout this participation
+  //! on activation the transactions must be synchronized because all redo-s performed
+  //! without this participation
   MODEL_EXPORT virtual void synchronizeTransactions();
 
-  //! Returns feature by the id of the feature (produced by the Data "featureId" method)
-  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> featureById(const int theId);
-
-
-  /// Creates a construction cresults
+  /// Creates construction results
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a body results
@@ -229,7 +224,7 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Folder> findFolderBelow(
       const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
   //! Search a folder containing the given feature.
-  //! Addtionally calculates a zero-based index of the feature in this folder.
+  //! Additionally calculates a zero-based index of the feature in this folder.
   //! \param theFeature feature to search
   //! \param theIndexInFolder zero-based index in the folder or -1 if the feature is top-level.
   //! \return the folder containing the feature or empty pointer if the feature is top-level.
@@ -238,7 +233,7 @@ class Model_Document : public ModelAPI_Document
       int& theIndexInFolder);
   //! Add a list of features to the folder. The correctness of the adding is not performed
   //! (such checks have been done in corresponding find.. method).
-  //! \return \c true if the movement is successfull
+  //! \return \c true if the movement is successful
   MODEL_EXPORT virtual bool moveToFolder(
       const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
       const std::shared_ptr<ModelAPI_Folder>& theFolder);
@@ -252,7 +247,7 @@ class Model_Document : public ModelAPI_Document
       const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
       const bool theBefore = true);
 
-  ///! Returns true if parametric updater need to execute feature on recomputartion
+  ///! Returns true if parametric updater need to execute feature on recomputation
   ///! On abort, undo or redo it is not necessary: results in document are updated automatically
   bool executeFeatures() {return myExecuteFeatures;}
 
@@ -285,8 +280,6 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual int transactionID();
   /// Increases the transaction ID
   MODEL_EXPORT virtual void incrementTransactionID();
-  /// Decreases the transaction ID
-  MODEL_EXPORT virtual void decrementTransactionID();
 
   /// Returns true if document is opened and valid
   MODEL_EXPORT virtual bool isOpened();
@@ -321,22 +314,22 @@ class Model_Document : public ModelAPI_Document
   }
 
   //! performs compactification of all nested operations into one
-  //! \returns true if resulting transaction is not empty and can be undoed
+  //! \returns true if resulting transaction is not empty and can be undone
   void compactNested();
 
   //! Returns all loaded sub documents
   const std::set<int> subDocuments() const;
 
-  //! The implementation of undo: with or without recoursive calls in the sub-documents
+  //! The implementation of undo: with or without recursive calls in the sub-documents
   void undoInternal(const bool theWithSubs, const bool theSynchronize);
 
   //! Stores the Id of the current operation (normally is called for the root document)
   void operationId(const std::string& theId);
 
-  //! Returns the list of Ids of the operations that can be undoed (called for the root document)
+  //! Returns the list of Ids of the operations that can be undone (called for the root document)
   std::list<std::string> undoList() const;
 
-  //! Returns the list of Ids of the operations that can be redoed (called for the root document)
+  //! Returns the list of Ids of the operations that can be redone (called for the root document)
   std::list<std::string> redoList() const;
 
   //! Internally makes document know that feature was removed or added in history after creation
@@ -366,25 +359,27 @@ class Model_Document : public ModelAPI_Document
   /// Normally is called outside of the transaction, just before "save".
   virtual void storeNodesState(const std::list<bool>& theStates);
 
-  /// Returns the stored nodes states. Normally it is calles just after "open".
+  /// Returns the stored nodes states. Normally it is called just after "open".
   /// Appends the values to theStates list.
   virtual void restoreNodesState(std::list<bool>& theStates) const;
 
-  /// Label that constains structures for selection of constructions of another document
+  /// Label that contains structures for selection of constructions of another document
   TDF_Label extConstructionsLabel() const;
 
   /// searches in this document feature that contains this label
   FeaturePtr featureByLab(const TDF_Label& theLab);
+  /// searches in this document result that contains this label
+  ResultPtr resultByLab(const TDF_Label& theLab);
 
-  /// returns true if theThis is later in the features trre and dependencies than theOther
+  /// returns true if theThis is later in the features tree and dependencies than theOther
   bool isLaterByDep(FeaturePtr theThis, FeaturePtr theOther);
 
   /// appends the latest transaction to the previous one (used for AutoUpdate enabling transaction)
   void appendTransactionToPrevious();
 
-  /// Sets the automatic recomutation flag: true means enabled
+  /// Sets the automatic recomputation flag: true means enabled
   void setAutoRecomutationState(const bool theState);
-  /// Returns the current automatic recomutation flag: true means enabled
+  /// Returns the current automatic recomputation flag: true means enabled
   bool autoRecomutationState() const;
 
   friend class Model_Application;
@@ -399,6 +394,7 @@ class Model_Document : public ModelAPI_Document
   friend class Model_ResultBody;
   friend class Model_ResultConstruction;
   friend class Model_SelectionNaming;
+  friend class Model_BodyBuilder;
   friend class DFBrowser;
 
  private:
@@ -410,7 +406,7 @@ class Model_Document : public ModelAPI_Document
 
   //! counter value of transaction on the last "save" call, used for "IsModified" method
   int myTransactionSave;
-  //! number of nested transactions performed (list becasue may be nested inside of nested)
+  //! number of nested transactions performed (list because may be nested inside of nested)
   //! the list is empty if not nested transaction is performed
   std::list<int> myNestedNum;
 
index e113d3ae7f73b1cbcd66bce97a8dc37b41ff8172..ee80aabcc5f04b0d5eb9a6b31cf6cdf914c13269 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Events.h>
@@ -33,6 +32,22 @@ void Model_EventCreator::sendUpdated(const ObjectPtr& theObject, const Events_ID
   Events_Loop::loop()->send(aMsg, isGroupped);
 }
 
+void Model_EventCreator::sendUpdated(const std::list<ObjectPtr>& theObjects,
+  const Events_ID& theEvent, const bool isGroupped) const
+{
+  if (theObjects.empty())
+    return;
+  std::list<ObjectPtr>::const_iterator anObj = theObjects.cbegin();
+  std::shared_ptr<Model_ObjectUpdatedMessage> aMsg(
+    new Model_ObjectUpdatedMessage(*anObj, theEvent));
+  for(anObj++; anObj != theObjects.cend(); anObj++) {
+    std::shared_ptr<Model_ObjectUpdatedMessage> aJoined(
+      new Model_ObjectUpdatedMessage(*anObj, theEvent));
+    aMsg->Join(aJoined);
+  }
+  Events_Loop::loop()->send(aMsg, isGroupped);
+}
+
 void Model_EventCreator::sendDeleted(const std::shared_ptr<ModelAPI_Document>& theDoc,
                                      const std::string& theGroup) const
 {
index c0ed012542e2d581b7ad723f2d70aa8ef789b500..258ae335289859cab518a4b173c6889640302435 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Events_H_
 
 #include <memory>
 
-/// Allovs to create ModelAPI messages
+/// Allows to create ModelAPI messages
 class Model_EventCreator : public ModelAPI_EventCreator
 {
  public:
   /// creates created, updated or moved messages and sends to the loop
   virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
                            const bool isGroupped = true) const;
+
+  /// creates created, updated or moved messages with the objects collection and sends to the loop
+  virtual void sendUpdated(const std::list<ObjectPtr>& theObjects, const Events_ID& theEvent,
+    const bool isGroupped = true) const;
   /// creates deleted message and sends to the loop
   virtual void sendDeleted(const std::shared_ptr<ModelAPI_Document>& theDoc,
                            const std::string& theGroup) const;
index 2696e6c2d75f0dc8ec7ea8e538c1403dcf58a8b6..5780e98e14465cefa0c850f683c8b7be1c9b3fae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_Expression.h"
index f54ed1d747e8631f658da6ee6e3b9d0b9e11a5a6..d335d12f8f9b274705fa02ad8932139dbd18003c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Expression_H_
index b729662089530ed58c44f0903bf0ac11919e7aad..885259852ee090b8061e310eac6597de176cb7fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_FeatureValidator.h>
index 11f2127b6b50c11eb420d8500ef69f961a57b466..fd6d09529d456f50eb94c60e3354456cd406fc89 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_FeatureValidator_H
index 6fc21e71e26da169c55bb0d31f06d3667d879b7c..971f8a3051da67e66a5be5758220243b815f44e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Objects.h>
@@ -29,6 +28,7 @@
 #include <Model_ResultGroup.h>
 #include <Model_ResultField.h>
 #include <Model_ResultParameter.h>
+#include <Model_AttributeRefList.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Tools.h>
 #include <TDF_ChildIDIterator.hxx>
 #include <TDataStd_ReferenceArray.hxx>
 #include <TDataStd_HLabelArray1.hxx>
-#include <TDataStd_Name.hxx>
 #include <TDF_Reference.hxx>
 #include <TDF_ChildIDIterator.hxx>
 #include <TDF_LabelMapHasher.hxx>
 #include <TDF_LabelMap.hxx>
 #include <TDF_ListIteratorOfLabelList.hxx>
 
+int kUNDEFINED_FEATURE_INDEX = -1;
+
 static const std::string& groupNameFoldering(const std::string& theGroupID,
                                              const bool theAllowFolder)
 {
@@ -149,7 +150,7 @@ static void AddToRefArray(TDF_Label& theArrayLab, TDF_Label& theReferenced, TDF_
   } else {  // extend array by one more element
     Handle(TDataStd_HLabelArray1) aNewArray = new TDataStd_HLabelArray1(aRefs->Lower(),
                                                                         aRefs->Upper() + 1);
-    int aPassedPrev = 0; // prev feature is found and passed
+    int aPassedPrev = 0; // previous feature is found and passed
     if (thePrevLab.IsNull()) { // null means that inserted feature must be the first
       aNewArray->SetValue(aRefs->Lower(), theReferenced);
       aPassedPrev = 1;
@@ -310,7 +311,7 @@ void Model_Objects::removeFeature(FeaturePtr theFeature)
     for(; aRefIter != aRefs.end(); aRefIter++) {
       std::shared_ptr<ModelAPI_CompositeFeature> aComposite =
         std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(*aRefIter);
-      if (aComposite.get() && aComposite->isSub(theFeature)) {
+      if (aComposite.get() && aComposite->data()->isValid() && aComposite->isSub(theFeature)) {
         aComposite->removeFeature(theFeature);
       }
     }
@@ -383,7 +384,7 @@ void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
 
   Handle(TDataStd_HLabelArray1) aNewArray =
     new TDataStd_HLabelArray1(aRefs->Lower(), aRefs->Upper());
-  int aPassedMovedFrom = 0; // the prev feature location is found and passed
+  int aPassedMovedFrom = 0; // the previous feature location is found and passed
   int aPassedMovedTo = 0; // the feature is added and this location is passed
   if (!theAfterThis.get()) { // null means that inserted feature must be the first
     aNewArray->SetValue(aRefs->Lower(), aMovedLab);
@@ -628,15 +629,17 @@ std::shared_ptr<ModelAPI_Object> Model_Objects::objectByName(
   createHistory(theGroupID);
   if (theGroupID == ModelAPI_Feature::group()) { // searching among features (in history or not)
     std::list<std::shared_ptr<ModelAPI_Feature> > allObjs = allFeatures();
-    std::list<std::shared_ptr<ModelAPI_Feature> >::iterator anObjIter = allObjs.begin();
-    for(; anObjIter != allObjs.end(); anObjIter++) {
+    // from the end to find the latest result with such name
+    std::list<std::shared_ptr<ModelAPI_Feature> >::reverse_iterator anObjIter = allObjs.rbegin();
+    for(; anObjIter != allObjs.rend(); anObjIter++) {
       if ((*anObjIter)->data()->name() == theName)
         return *anObjIter;
     }
   } else { // searching among results (concealed or not)
     std::list<std::shared_ptr<ModelAPI_Feature> > allObjs = allFeatures();
-    std::list<std::shared_ptr<ModelAPI_Feature> >::iterator anObjIter = allObjs.begin();
-    for(; anObjIter != allObjs.end(); anObjIter++) {
+    // from the end to find the latest result with such name
+    std::list<std::shared_ptr<ModelAPI_Feature> >::reverse_iterator anObjIter = allObjs.rbegin();
+    for(; anObjIter != allObjs.rend(); anObjIter++) {
       std::list<ResultPtr> allRes;
       ModelAPI_Tools::allResults(*anObjIter, allRes);
       for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
@@ -740,31 +743,17 @@ void Model_Objects::setUniqueName(FeaturePtr theFeature)
   // first count all features of such kind to start with index = count + 1
   int aNumObjects = -1; // this feature is already in this map
   NCollection_DataMap<TDF_Label, FeaturePtr>::Iterator aFIter(myFeatures);
+  std::set<std::string> allNames;
   for (; aFIter.More(); aFIter.Next()) {
     if (aFIter.Value()->getKind() == theFeature->getKind())
       aNumObjects++;
+    allNames.insert(aFIter.Value()->data()->name());
   }
   // generate candidate name
   aName = composeName(theFeature->getKind(), aNumObjects + 1);
   // check this is unique, if not, increase index by 1
-  for (aFIter.Initialize(myFeatures); aFIter.More();) {
-    FeaturePtr aFeature = aFIter.Value();
-    bool isSameName = aFeature->data()->name() == aName;
-    if (!isSameName) {  // check also results to avoid same results names (actual for Parts)
-      const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aFeature->results();
-      std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
-      for (; aRIter != aResults.cend(); aRIter++) {
-        isSameName = (*aRIter)->data()->name() == aName;
-      }
-    }
-
-    if (isSameName) {
-      aNumObjects++;
-      aName = composeName(theFeature->getKind(), aNumObjects + 1);
-      // reinitialize iterator to make sure a new name is unique
-      aFIter.Initialize(myFeatures);
-    } else
-      aFIter.Next();
+  for(aNumObjects++; allNames.find(aName) != allNames.end(); aNumObjects++) {
+    aName = composeName(theFeature->getKind(), aNumObjects + 1);
   }
   theFeature->data()->setName(aName);
 }
@@ -781,7 +770,7 @@ void Model_Objects::setUniqueName(FolderPtr theFolder)
   NCollection_DataMap<TDF_Label, ObjectPtr>::Iterator anIt(myFolders);
   while (anIt.More()) {
     if (anIt.Value()->data()->name() == aName) {
-      aName = composeName(ModelAPI_Folder::ID(), aNbFolders);
+      aName = composeName(ModelAPI_Folder::ID(), ++aNbFolders);
       // reinitialize iterator to make sure a new name is unique
       anIt.Initialize(myFolders);
     } else
@@ -809,15 +798,6 @@ void Model_Objects::initData(ObjectPtr theObj, TDF_Label theLab, const int theTa
   theObj->initAttributes();
 }
 
-std::shared_ptr<ModelAPI_Feature> Model_Objects::featureById(const int theId)
-{
-  if (theId > 0) {
-    TDF_Label aLab = featuresLabel().FindChild(theId, Standard_False);
-    return feature(aLab);
-  }
-  return std::shared_ptr<ModelAPI_Feature>(); // not found
-}
-
 void Model_Objects::synchronizeFeatures(
   const TDF_LabelList& theUpdated, const bool theUpdateReferences,
   const bool theExecuteFeatures, const bool theOpen, const bool theFlush)
@@ -865,7 +845,7 @@ void Model_Objects::synchronizeFeatures(
       ObjectPtr aFeature = isFolder ? ObjectPtr(new ModelAPI_Folder)
                                     : ObjectPtr(aSession->createFeature(aFeatureID, anOwner));
       if (!aFeature.get()) {
-        // somethig is wrong, most probably, the opened document has invalid structure
+        // something is wrong, most probably, the opened document has invalid structure
         Events_InfoMessage("Model_Objects", "Invalid type of object in the document").send();
         aLabIter.Value()->Label().ForgetAllAttributes();
         continue;
@@ -966,7 +946,7 @@ void Model_Objects::synchronizeFeatures(
   }
   // update results of the features (after features created because
   // they may be connected, like sketch and sub elements)
-  // After synchronisation of back references because sketch
+  // After synchronization of back references because sketch
   // must be set in sub-elements before "execute" by updateResults
   std::set<FeaturePtr> aProcessed; // composites must be updated after their subs (issue 360)
   TDF_ChildIDIterator aLabIter2(featuresLabel(), TDataStd_Comment::GetID());
@@ -1005,16 +985,22 @@ void Model_Objects::synchronizeFeatures(
     anOwner->setExecuteFeatures(true);
 }
 
-/// synchronises back references for the given object basing on the collected data
+/// synchronizes back references for the given object basing on the collected data
 void Model_Objects::synchronizeBackRefsForObject(const std::set<AttributePtr>& theNewRefs,
   ObjectPtr theObject)
 {
   if (!theObject.get() || !theObject->data()->isValid())
     return; // invalid
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theObject->data());
-  // iterate new list to compare with curent
+  // iterate new list to compare with current
   std::set<AttributePtr>::iterator aNewIter = theNewRefs.begin();
   for(; aNewIter != theNewRefs.end(); aNewIter++) {
+    // for the Model_AttributeRefList erase cash (issue #2819)
+    std::shared_ptr<Model_AttributeRefList> aRefList =
+      std::dynamic_pointer_cast<Model_AttributeRefList>(*aNewIter);
+    if (aRefList)
+      aRefList->eraseHash();
+
     if (aData->refsToMe().find(*aNewIter) == aData->refsToMe().end()) {
       FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aNewIter)->owner());
       if (aRefFeat)
@@ -1114,9 +1100,9 @@ static void collectReferences(std::shared_ptr<ModelAPI_Data> theData,
 void Model_Objects::synchronizeBackRefs()
 {
   // collect all back references in the separated container: to update everything at once,
-  // without additional Concealment switchin on and off: only the final modification
+  // without additional Concealment switching on and off: only the final modification
 
-  // referenced (slave) objects to referencing attirbutes
+  // referenced (slave) objects to referencing attributes
   std::map<ObjectPtr, std::set<AttributePtr> > allRefs;
   NCollection_DataMap<TDF_Label, FeaturePtr>::Iterator aFeatures(myFeatures);
   for(; aFeatures.More(); aFeatures.Next()) {
@@ -1157,7 +1143,7 @@ void Model_Objects::synchronizeBackRefs()
     FeaturePtr aFeature = aFeatures.Value();
     std::list<ResultPtr> aResults;
     ModelAPI_Tools::allResults(aFeature, aResults);
-    // update the concealment status for disply in isConcealed of ResultBody
+    // update the concealment status for display in isConcealed of ResultBody
     std::list<ResultPtr>::iterator aRIter = aResults.begin();
     for(; aRIter != aResults.cend(); aRIter++) {
       (*aRIter)->isConcealed();
@@ -1370,7 +1356,8 @@ std::shared_ptr<ModelAPI_Folder> Model_Objects::createFolder(
     std::shared_ptr<Model_Data> aPrevData =
         std::dynamic_pointer_cast<Model_Data>(theBeforeThis->data());
     if (aPrevData.get()) {
-      aPrevFeatureLab = nextLabel(aPrevData->label().Father(), true);
+      int anIndex = kUNDEFINED_FEATURE_INDEX;
+      aPrevFeatureLab = nextLabel(aPrevData->label().Father(), anIndex, true);
     }
   } else { // find the label of the last feature
     Handle(TDataStd_ReferenceArray) aRefs;
@@ -1489,7 +1476,7 @@ std::shared_ptr<ModelAPI_Folder> Model_Objects::findFolder(
 
     if (!aLastFeatureInFolder.IsNull()) {
       if (IsEqual(aCurLabel, aLastFeatureInFolder))
-        aLastFeatureInFolder.Nullify(); // the last feature in the folder is achived
+        aLastFeatureInFolder.Nullify(); // the last feature in the folder is achieved
       continue;
     }
 
@@ -1796,7 +1783,7 @@ std::shared_ptr<ModelAPI_Feature> Model_Objects::feature(
     const std::shared_ptr<ModelAPI_Result>& theResult)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(theResult->data());
-  if (aData.get()) {
+  if (aData.get() && aData->isValid()) {
     TDF_Label aFeatureLab = aData->label().Father().Father().Father();
     FeaturePtr aFeature = feature(aFeatureLab);
     while(!aFeature.get() && aFeatureLab.Depth() > 1) { // this may be sub-result of result
@@ -1840,8 +1827,6 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set<FeaturePtr>& t
     }
   }
 
-  // for not persistent is will be done by parametric updater automatically
-  //if (!theFeature->isPersistentResult()) return;
   // check the existing results and remove them if there is nothing on the label
   std::list<ResultPtr>::const_iterator aResIter = theFeature->results().cbegin();
   while(aResIter != theFeature->results().cend()) {
@@ -1875,16 +1860,20 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set<FeaturePtr>& t
         if (aGroup->Get() == ModelAPI_ResultBody::group().c_str()) {
           aNewBody = createBody(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultPart::group().c_str()) {
-          std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex);
-          theFeature->setResult(aNewP, aResIndex);
-          if (!aNewP->partDoc().get())
-            // create the part result: it is better to restore the previous result if it is possible
-            theFeature->execute();
+          if (aResIndex <= theFeature->results().size()) { // to avoid crash if previous execute
+            // for index = 0 erases result
+            std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex);
+            theFeature->setResult(aNewP, aResIndex);
+            if (!aNewP->partDoc().get())
+              // create the part result: it is better to restore the previous result if possible
+              theFeature->execute();
+          }
         } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
-          theFeature->execute(); // construction shapes are needed for sketch solver
-          if (!theFeature->results().empty()) // to fix #2640 : update sketch, but not naming
-            std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theFeature->firstResult())
-              ->facesNum(false);
+          ResultConstructionPtr aConstr = createConstruction(theFeature->data(), aResIndex);
+          if (!aConstr->updateShape())
+            theFeature->execute(); // not stored shape in the data structure, execute to have it
+          else
+            theFeature->setResult(aConstr, aResIndex); // result is ready without execution
         } else if (aGroup->Get() == ModelAPI_ResultGroup::group().c_str()) {
           aNewBody = createGroup(theFeature->data(), aResIndex);
         } else if (aGroup->Get() == ModelAPI_ResultField::group().c_str()) {
@@ -1904,9 +1893,16 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set<FeaturePtr>& t
   if (aResSize > 0) { // check there exist a body that must be updated
     std::list<ResultPtr>::const_iterator aRes = theFeature->results().cbegin();
     for (; aResSize && aRes != theFeature->results().cend(); aRes++, aResSize++) {
-      if ((*aRes)->data()->isValid() && (*aRes)->groupName() == ModelAPI_ResultBody::group()) {
-        ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
-        aBody->updateSubs(aBody->shape(), false);
+      if ((*aRes)->data()->isValid()) {
+        if ((*aRes)->groupName() == ModelAPI_ResultBody::group()) {
+          ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(*aRes);
+          aBody->updateSubs(aBody->shape(), false);
+        } else if ((*aRes)->groupName() == ModelAPI_ResultConstruction::group()) {
+          // update the cashed myShape presented in construction
+          ResultConstructionPtr aConstr =
+            std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
+          aConstr->updateShape();
+        }
       }
     }
   }
@@ -1939,32 +1935,35 @@ ResultPtr Model_Objects::findByName(const std::string theName)
   return aResult;
 }
 
-TDF_Label Model_Objects::nextLabel(TDF_Label theCurrent, const bool theReverse)
+TDF_Label Model_Objects::nextLabel(TDF_Label theCurrent, int& theIndex, const bool theReverse)
 {
   Handle(TDataStd_ReferenceArray) aRefs;
   if (featuresLabel().FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
-    for(int a = aRefs->Lower(); a <= aRefs->Upper(); a++) { // iterate all existing features
+    int aStart = theIndex == kUNDEFINED_FEATURE_INDEX ? aRefs->Lower() : theIndex;
+    for(int a = aStart; a <= aRefs->Upper(); a++) { // iterate all existing features
       TDF_Label aCurLab = aRefs->Value(a);
       if (aCurLab.IsEqual(theCurrent)) {
         a += theReverse ? -1 : 1;
-        if (a >= aRefs->Lower() && a <= aRefs->Upper())
+        if (a >= aRefs->Lower() && a <= aRefs->Upper()) {
+          theIndex = a;
           return aRefs->Value(a);
-        break; // finish iiteration: it's last feature
+        }
+        break; // finish iteration: it's last feature
       }
     }
   }
   return TDF_Label();
 }
 
-FeaturePtr Model_Objects::nextFeature(FeaturePtr theCurrent, const bool theReverse)
+FeaturePtr Model_Objects::nextFeature(FeaturePtr theCurrent, int& theIndex, const bool theReverse)
 {
   std::shared_ptr<Model_Data> aData = std::static_pointer_cast<Model_Data>(theCurrent->data());
   if (aData.get() && aData->isValid()) {
     TDF_Label aFeatureLabel = aData->label().Father();
     do {
-      TDF_Label aNextLabel = nextLabel(aFeatureLabel, theReverse);
+      TDF_Label aNextLabel = nextLabel(aFeatureLabel, theIndex, theReverse);
       if (aNextLabel.IsNull())
-        break; // last or something is wrong
+        break; // the last or something is wrong
       FeaturePtr aFound = feature(aNextLabel);
       if (aFound)
         return aFound; // the feature is found
index 0991cf21077dba0fe2b3bcc38a0caafd91f4ebbf..b9b8d7f181b7af15719cb4ff689895a943358567 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Objects_H_
@@ -40,6 +39,8 @@
 static Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper);
 static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2);
 
+extern int kUNDEFINED_FEATURE_INDEX;
+
 /**\class Model_Objects
  * \ingroup DataModel
  * \brief Manager of objects of the document. Normally one this class corresponds to
@@ -49,7 +50,7 @@ static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLa
 class Model_Objects
 {
  public:
-  //! Registers the fieature in the data structure
+  //! Registers the feature in the data structure
   //! \param theFeature feature that must be added to the data structure
   //! \param theAfterThis the feature will be added after this feature;
   //!        if it is null, the added feature will be the first
@@ -122,10 +123,6 @@ class Model_Objects
   //! Returns the feature by zero-based index: features in the history or not
   std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex);
 
-  //! Returns feature by the id of the feature (produced by the Data "featureId" method)
-  std::shared_ptr<ModelAPI_Feature> featureById(const int theId);
-
-
   /// Creates a construction result
   std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
@@ -167,7 +164,7 @@ class Model_Objects
       const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
       const bool theBelow);
   //! Search a folder containing the given feature.
-  //! Addtionally calculates a zero-based index of the feature in this folder.
+  //! Additionally calculates a zero-based index of the feature in this folder.
   //! \param theFeature feature to search
   //! \param theIndexInFolder zero-based index in the folder or -1 if the feature is top-level.
   //! \return the folder containing the feature or empty pointer if the feature is top-level.
@@ -176,7 +173,7 @@ class Model_Objects
       int& theIndexInFolder);
   //! Add a list of features to the folder. The correctness of the adding is not performed
   //! (such checks have been done in corresponding find.. method).
-  //! \return \c true if the movement is successfull
+  //! \return \c true if the movement is successful
   bool moveToFolder(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
                     const std::shared_ptr<ModelAPI_Folder>& theFolder);
   //! Remove features from the folder
@@ -194,7 +191,7 @@ class Model_Objects
   //! Returns the owner of this manager
   DocumentPtr owner() {return myDoc;}
 
-  //! Deletes all managed features wit hemmitting of corresponded signal
+  //! Deletes all managed features with emitting of corresponded signal
   ~Model_Objects();
 
  protected:
@@ -206,15 +203,15 @@ class Model_Objects
   //! feature type + "_" + index
   void setUniqueName(FeaturePtr theFeature);
 
-  //! Initializes the foldet with an unique name ("Folder_" + index)
+  //! Initializes the folder with an unique name ("Folder_" + index)
   void setUniqueName(FolderPtr theFolder);
 
   //! Synchronizes myFeatures list with the updated document
-  //! \param theUpdated list of labels that are marked as modified, so featrues must be also
+  //! \param theUpdated list of labels that are marked as modified, so features must be also
   //! \param theUpdateReferences causes the update of back-references
   //! \param theExecuteFeatures requires re-execute modified persistent features
   //!            (not needed on undo/redo/abort/open)
-  //! \param theOpen - on open nothing must be reexecuted, except not persistent results
+  //! \param theOpen - on open nothing must be re-executed, except not persistent results
   //! \param theFlush makes flush all events in the end of all modifications of this method
   void synchronizeFeatures(const TDF_LabelList& theUpdated, const bool theUpdateReferences,
     const bool theOpen, const bool theExecuteFeatures, const bool theFlush);
@@ -255,8 +252,9 @@ class Model_Objects
 
   /// Returns the next (from the history point of view) feature, any: invisible or disabled
   /// \param theCurrent previous to the resulting feature
-  /// \param theReverse if it is true, iterates in reverced order (next becomes previous)
-  FeaturePtr nextFeature(FeaturePtr theCurrent, const bool theReverse = false);
+  /// \param theReverse if it is true, iterates in reversed order (next becomes previous)
+  /// \param theIndex may be used for optimization: index of theCurrent in references array
+  FeaturePtr nextFeature(FeaturePtr theCurrent, int& theIndex, const bool theReverse = false);
   /// Returns to the first (from the history point of view) feature, any: invisible or disabled
   FeaturePtr firstFeature();
   /// Returns to the last (from the history point of view) feature, any: invisible or disabled
@@ -266,8 +264,8 @@ class Model_Objects
 
   /// Returns the next or previous label
   /// \param theCurrent given label
-  /// \param theReverse if it is true, iterates in reverced order (next becomes previous)
-  TDF_Label nextLabel(TDF_Label theCurrent, const bool theReverse = false);
+  /// \param theReverse if it is true, iterates in reversed order (next becomes previous)
+  TDF_Label nextLabel(TDF_Label theCurrent, int& theIndex, const bool theReverse = false);
 
   /// Returns the result group identifier of the given feature (for this at least one result must
   /// be created before)
@@ -281,14 +279,14 @@ class Model_Objects
   //! history. Not very fast method, for calling once, not in big cycles.
   std::list<std::shared_ptr<ModelAPI_Object> > allObjects();
 
-  //! synchronises back references for the given object basing on the collected data
+  //! synchronizes back references for the given object basing on the collected data
   void synchronizeBackRefsForObject(
     const std::set<std::shared_ptr<ModelAPI_Attribute>>& theNewRefs, ObjectPtr theObject);
 
   /// Just removes all features without touching the document data (to be able undo)
   virtual void eraseAllFeatures();
 
-  // Check whether the pre-image of the result had user-defined name.
+  // Check whether the predefined-image of the result had user-defined name.
   // If yes, return this name.
   bool hasCustomName(DataPtr theFeatureData,
                      ResultPtr theResult,
@@ -301,7 +299,7 @@ class Model_Objects
  private:
   TDF_Label myMain; ///< main label of the data storage
 
-  DocumentPtr myDoc; ///< doc,ument, owner of this objects manager: needed for events creation
+  DocumentPtr myDoc; ///< document, owner of this objects manager: needed for events creation
 
   /// All managed features (not only in history of OB)
   /// For optimization mapped by labels
@@ -311,7 +309,7 @@ class Model_Objects
   NCollection_DataMap<TDF_Label, ObjectPtr> myFolders;
 
   /// Map from group id to the array that contains all objects located in history.
-  /// Each array is updated by demand from scratch, by browing all the features in the history.
+  /// Each array is updated by demand from scratch, by browsing all the features in the history.
   std::map<std::string, std::vector<ObjectPtr> > myHistory;
 
   friend class Model_Document;
index eaee3ac1e01df37a144fb4e18d3fde829dd745fa..4f442842e795195bbbd0763b7e8d3c2986ae9523 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_ResultBody.h>
 #include <ModelAPI_Tools.h>
 #include <Model_Data.h>
 #include <Events_Loop.h>
+#include <GeomAPI_ShapeIterator.h>
+#include <GeomAPI_ShapeExplorer.h>
 
 #include <TopoDS_Shape.hxx>
 #include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
 #include <TDataStd_UAttribute.hxx>
 
 // if this attribute exists, the shape is connected topology
@@ -52,46 +54,62 @@ Model_ResultBody::~Model_ResultBody()
   delete myBuilder;
 }
 
-void Model_ResultBody::loadAndOrientModifiedShapes(GeomAlgoAPI_MakeShape* theMS,
-    std::shared_ptr<GeomAPI_Shape> theShapeIn, const int  theKindOfShape, const int  theTag,
-    const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
-    const bool theIsStoreSeparate,
-    const bool theIsStoreAsGenerated,
-    const bool theSplitInSubs)
+bool Model_ResultBody::generated(const GeomShapePtr& theNewShape,
+  const std::string& theName, const bool theCheckIsInResult)
 {
-  if (theSplitInSubs && mySubs.size()) { // consists of subs
+  bool aResult = false;
+  if (mySubs.size()) { // consists of subs
+    for (std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
+         aSubIter != mySubs.cend();
+         ++aSubIter)
+    {
+      const ResultBodyPtr& aSub = *aSubIter;
+      if (aSub->generated(theNewShape, theName, theCheckIsInResult))
+        aResult = true;
+    }
+  } else { // do for this directly
+    if (myBuilder->generated(theNewShape, theName, theCheckIsInResult))
+      aResult = true;
+  }
+  return aResult;
+}
+
+void Model_ResultBody::loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                           const GeomShapePtr& theOldShape,
+                                           const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                           const std::string& theName,
+                                           const bool theSaveOldIfNotInTree)
+{
+  if (mySubs.size()) { // consists of subs
+    for (std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
+         aSubIter != mySubs.cend();
+         ++aSubIter)
+    {
+      const ResultBodyPtr& aSub = *aSubIter;
+      aSub->loadGeneratedShapes(
+        theAlgo, theOldShape, theShapeTypeToExplore, theName, theSaveOldIfNotInTree);
+    }
+  } else { // do for this directly
+    myBuilder->loadGeneratedShapes(
+      theAlgo, theOldShape, theShapeTypeToExplore, theName, theSaveOldIfNotInTree);
+  }
+}
+
+void Model_ResultBody::loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                          const GeomShapePtr& theOldShape,
+                                          const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                          const std::string& theName)
+{
+  if (mySubs.size()) { // consists of subs
     // optimization of getting of new shapes for specific sub-result
-    if (!theMS->newShapesCollected(theShapeIn, theKindOfShape))
-      theMS->collectNewShapes(theShapeIn, theKindOfShape);
+    if (!theAlgo->isNewShapesCollected(theOldShape, theShapeTypeToExplore))
+      theAlgo->collectNewShapes(theOldShape, theShapeTypeToExplore);
     std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
     for(; aSubIter != mySubs.cend(); aSubIter++) {
-      // check that sub-shape was also created as modification of ShapeIn
-      /* to find when it is needed later to enable: to store modification of sub-bodies not only as primitives
-      GeomShapePtr aSubGeomShape = (*aSubIter)->shape();
-      if (!theIsStoreAsGenerated && aSubGeomShape.get() && !aSubGeomShape->isNull()) {
-        TopoDS_Shape aSubShape = aSubGeomShape->impl<TopoDS_Shape>();
-        TopoDS_Shape aWholeIn = theShapeIn->impl<TopoDS_Shape>();
-        for(TopExp_Explorer anExp(aWholeIn, aSubShape.ShapeType()); anExp.More(); anExp.Next()) {
-          ListOfShape aHistory;
-          std::shared_ptr<GeomAPI_Shape> aSubIn(new GeomAPI_Shape());
-          aSubIn->setImpl((new TopoDS_Shape(anExp.Current())));
-          theMS->modified(aSubIn, aHistory);
-          std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = aHistory.begin();
-          for (; anIt != aHistory.end(); anIt++) {
-            if ((*anIt)->isSame(aSubGeomShape)) {
-              (*aSubIter)->storeModified(aSubIn, aSubGeomShape, -2); // -2 is to avoid clearing
-            }
-          }
-        }
-      }*/
-      (*aSubIter)->loadAndOrientModifiedShapes(
-        theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
-        theIsStoreAsGenerated, theSplitInSubs);
+      (*aSubIter)->loadModifiedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName);
     }
   } else { // do for this directly
-    myBuilder->loadAndOrientModifiedShapes(
-      theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
-        theIsStoreAsGenerated);
+    myBuilder->loadModifiedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName);
   }
 }
 
@@ -129,7 +147,6 @@ bool Model_ResultBody::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, con
 {
   bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
   if (aChanged) { // state is changed, so modifications are needed
-    myBuilder->evolutionToSelection(theFlag);
     updateSubs(shape(), false); // to set disabled/enabled
   }
   return aChanged;
@@ -213,6 +230,7 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
     TDF_Label aDataLab = std::dynamic_pointer_cast<Model_Data>(data())->label();
     if (!aDataLab.IsNull()) {
       TDataStd_UAttribute::Set(aDataLab, kUpdateConnectedTopology);
+      isConnectedTopology(); // to store this flag in transaction, #2630
     }
   }
   // iterate all sub-solids of compsolid to make sub-results synchronized with them
@@ -239,8 +257,16 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
       } else { // just update shape of this result
         aSub = mySubs[aSubIndex];
       }
-      if (!aShape->isEqual(aSub->shape())) {
-        aSub->store(aShape, false);
+      GeomShapePtr anOldSubShape = aSub->shape();
+      if (!aShape->isEqual(anOldSubShape)) {
+        if (myAlgo.get()) {
+          std::list<GeomShapePtr> anOldForSub;
+          computeOldForSub(aShape, myOlds, anOldForSub);
+          myIsGenerated ? aSub->storeGenerated(anOldForSub, aShape, myAlgo) :
+            aSub->storeModified(anOldForSub, aShape, myAlgo);
+        } else {
+          aSub->store(aShape, false);
+        }
         aECreator->sendUpdated(aSub, EVENT_DISP);
         aECreator->sendUpdated(aSub, EVENT_UPD);
       }
@@ -261,6 +287,7 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
       // redisplay this because result with and without subs are displayed differently
       aECreator->sendUpdated(data()->owner(), EVENT_DISP);
     }
+    cleanCash();
   } else if (!mySubs.empty()) { // erase all subs
     while(!mySubs.empty()) {
       ResultBodyPtr anErased = *(mySubs.rbegin());
@@ -277,20 +304,23 @@ void Model_ResultBody::updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisS
   }
 }
 
-bool Model_ResultBody::isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape)
+void Model_ResultBody::updateSubs(
+  const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated)
 {
-  if (myBuilder->isLatestEqual(theShape))
-    return true;
-  // also check that it is asked for sub-elements
-  std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
-  for(; aSubIter != mySubs.cend(); aSubIter++) {
-    if (aSubIter->get() && (*aSubIter)->isLatestEqual(theShape)) {
-      return true;
-    }
-  }
-  return false;
+  myAlgo = theMakeShape;
+  myOlds = theOlds;
+  myIsGenerated = isGenerated;
+  // to avoid changing of "isDisabled" flag in the "updateSubs" cycle
+  isDisabled();
+
+  updateSubs(theThisShape, true);
+  myAlgo.reset();
+  myOlds.clear();
+  myHistoryCash.Clear();
 }
 
+
 bool Model_ResultBody::isConnectedTopology()
 {
   TDF_Label aDataLab = std::dynamic_pointer_cast<Model_Data>(data())->label();
@@ -308,3 +338,99 @@ bool Model_ResultBody::isConnectedTopology()
   }
   return false; // invalid case
 }
+
+void Model_ResultBody::cleanCash()
+{
+  myBuilder->cleanCash();
+  for (std::vector<ResultBodyPtr>::const_iterator aSubIter = mySubs.cbegin();
+    aSubIter != mySubs.cend(); ++aSubIter)
+  {
+    const ResultBodyPtr& aSub = *aSubIter;
+    aSub->cleanCash();
+  }
+}
+
+// adds to the theSubSubs map all sub-shapes of theSub if it is compound of compsolid
+static void collectSubs(
+  const GeomShapePtr theSub, TopTools_MapOfShape& theSubSubs, const bool theOneLevelMore)
+{
+  if (theSub->isNull())
+    return;
+  if (theSubSubs.Add(theSub->impl<TopoDS_Shape>()))  {
+    bool aIsComp = theSub->isCompound() || theSub->isCompSolid();
+    if (aIsComp) {
+      for(GeomAPI_ShapeIterator anIter(theSub); anIter.more(); anIter.next())
+        collectSubs(anIter.current(), theSubSubs, theOneLevelMore);
+    } else if (theOneLevelMore) {
+      GeomAPI_Shape::ShapeType aSubType = GeomAPI_Shape::ShapeType(int(theSub->shapeType()) + 1);
+      if (aSubType == GeomAPI_Shape::SHAPE)
+        return;
+      if (aSubType == GeomAPI_Shape::SHELL)
+        aSubType = GeomAPI_Shape::FACE;
+      if (aSubType == GeomAPI_Shape::WIRE)
+        aSubType = GeomAPI_Shape::EDGE;
+
+      for(GeomAPI_ShapeExplorer anExp(theSub, aSubType); anExp.more(); anExp.next()) {
+        collectSubs(anExp.current(), theSubSubs, false);
+      }
+    }
+  }
+}
+
+void Model_ResultBody::computeOldForSub(const GeomShapePtr& theSub,
+  const std::list<GeomShapePtr>& theAllOlds, std::list<GeomShapePtr>& theOldForSub)
+{
+  // the old can be also used for sub-shape of theSub; collect all subs of compound or compsolid
+  TopTools_MapOfShape aSubSubs;
+  collectSubs(theSub, aSubSubs, false);
+
+  std::list<GeomShapePtr>::const_iterator aRootOlds = theAllOlds.cbegin();
+  for (; aRootOlds != theAllOlds.cend(); aRootOlds++) {
+    // use sub-shapes of olds too if they are compounds or compsolids
+    TopTools_MapOfShape anOldSubs;
+    // iterate one level more (for intersection of solids this is face)
+    collectSubs(*aRootOlds, anOldSubs, true);
+    for (TopTools_MapOfShape::Iterator anOldIter(anOldSubs); anOldIter.More(); anOldIter.Next()) {
+      TopoDS_Shape anOldShape = anOldIter.Value();
+      if (anOldShape.ShapeType() == TopAbs_COMPOUND || anOldShape.ShapeType() == TopAbs_SHELL ||
+          anOldShape.ShapeType() == TopAbs_WIRE)
+        continue; // container old-shapes are not supported by the history, may cause crash
+      GeomShapePtr anOldSub(new GeomAPI_Shape);
+      anOldSub->setImpl<TopoDS_Shape>(new TopoDS_Shape(anOldShape));
+
+      ListOfShape aNews;
+      if (myHistoryCash.IsBound(anOldShape)) {
+        const TopTools_ListOfShape& aList = myHistoryCash.Find(anOldShape);
+        for(TopTools_ListIteratorOfListOfShape anIter(aList); anIter.More(); anIter.Next()) {
+          GeomShapePtr aShape(new GeomAPI_Shape);
+          aShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(anIter.Value()));
+          aNews.push_back(aShape);
+        }
+      } else {
+        myIsGenerated ? myAlgo->generated(anOldSub, aNews) : myAlgo->modified(anOldSub, aNews);
+        // MakeShape may return alone old shape if there is no history information for this input
+        if (aNews.size() == 1 && aNews.front()->isEqual(anOldSub))
+          aNews.clear();
+        // store result in the history
+        TopTools_ListOfShape aList;
+        for (ListOfShape::iterator aNewIter = aNews.begin(); aNewIter != aNews.end(); aNewIter++) {
+          aList.Append((*aNewIter)->impl<TopoDS_Shape>());
+        }
+        myHistoryCash.Bind(anOldShape, aList);
+      }
+
+      for (ListOfShape::iterator aNewIter = aNews.begin(); aNewIter != aNews.end(); aNewIter++) {
+        if (aSubSubs.Contains((*aNewIter)->impl<TopoDS_Shape>())) {
+          // check list already contains this sub
+          std::list<GeomShapePtr>::iterator aResIter = theOldForSub.begin();
+          for(; aResIter != theOldForSub.end(); aResIter++)
+            if ((*aResIter)->isSame(anOldSub))
+              break;
+          if (aResIter == theOldForSub.end())
+            theOldForSub.push_back(anOldSub); // found old used for new theSubShape creation
+          break;
+        }
+      }
+    }
+  }
+}
index 6047bc059c71ea4e56f277b0bea1c4c6e561f5eb..8abd4408965588dccb07a882fdb07258f53156ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_ResultBody_H_
@@ -26,6 +25,8 @@
 #include <vector>
 #include <map>
 
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+
 /**\class Model_ResultBody
 * \ingroup DataModel
 * \brief The body (shape) result of a feature.
@@ -33,7 +34,7 @@
 * Provides a shape that may be displayed in the viewer.
 * May provide really huge results, so, working with this kind
 * of result must be optimized.
-* Also provides a conainer of sub-body result in case it is compound or compsolid.
+* Also provides a container of sub-body result in case it is compound or compsolid.
 */
 class Model_ResultBody : public ModelAPI_ResultBody
 {
@@ -43,18 +44,39 @@ class Model_ResultBody : public ModelAPI_ResultBody
   std::map<ObjectPtr, int> mySubsMap;
   /// Keeps the last state of the concealment flag in order to update it when needed.
   bool myLastConcealed;
+  /// History information for update subs
+  std::shared_ptr<GeomAlgoAPI_MakeShape> myAlgo;
+  /// All old shapes used for the root result construction
+  std::list<GeomShapePtr> myOlds;
+  /// Information about the kind of the history information: modified or generated
+  bool myIsGenerated;
+  /// Map from old shape to list of new shapes, cash for computeOldForSub method
+  TopTools_DataMapOfShapeListOfShape myHistoryCash;
 
 public:
 
   /// Removes the stored builders
   MODEL_EXPORT virtual ~Model_ResultBody();
 
-  /// load and orient modified shapes for sub-objects
-  MODEL_EXPORT virtual void loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
-    std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape, const int  theTag,
-    const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
-    const bool theIsStoreSeparate = false, const bool theIsStoreAsGenerated = false,
-    const bool theSplitInSubs = false);
+  /// Records the subshape newShape which was generated during a topological construction.
+  /// As an example, consider the case of a face generated in construction of a box.
+  MODEL_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) override;
+
+  /// load generated shapes
+  MODEL_EXPORT
+  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "",
+                                   const bool theSaveOldIfNotInTree = false) override;
+
+  /// load modified shapes for sub-objects
+  MODEL_EXPORT
+  virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                  const GeomShapePtr& theOldShape,
+                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                  const std::string& theName = "") override;
 
 
   /// Returns the number of sub-elements
@@ -64,11 +86,11 @@ public:
   MODEL_EXPORT virtual ResultBodyPtr subResult(const int theIndex,
     bool forTree = false) const;
 
-  /// Returns true if feature or reuslt belong to this composite feature as subs
+  /// Returns true if feature or result belong to this composite feature as subs
   /// Returns theIndex - zero based index of sub if found
   MODEL_EXPORT virtual bool isSub(ObjectPtr theObject, int& theIndex) const;
 
-  /// Returns the parameters of color definition in the resources config manager
+  /// Returns the parameters of color definition in the resources configuration manager
   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
                                             std::string& theDefault);
 
@@ -83,13 +105,12 @@ public:
   /// Sets all subs as concealed in the data tree (referenced by other objects)
   MODEL_EXPORT virtual void setIsConcealed(const bool theValue);
 
-  /// Returns true if the latest modification of this body in the naming history
-  // is equal to the given shape
-  MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
-
   /// Returns true is the topology is connected.
   MODEL_EXPORT virtual bool isConnectedTopology();
 
+  /// Cleans cash related to the already stored elements
+  MODEL_EXPORT virtual void cleanCash() override;
+
 protected:
   /// Makes a body on the given feature
   Model_ResultBody();
@@ -98,9 +119,18 @@ protected:
   void updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisShape,
                   const bool theShapeChanged = true);
 
-  // Checks the state of children and partents to send events of creation/erase when needed
+  /// Updates the sub-bodies in accordance to the algorithm history information
+  void updateSubs(
+    const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated);
+
+  // Checks the state of children and parents to send events of creation/erase when needed
   void updateConcealment();
 
+  /// Adds to theOldForSub only old shapes that where used for theSub creation
+  void computeOldForSub(const GeomShapePtr& theSub,
+    const std::list<GeomShapePtr>& theAllOlds, std::list<GeomShapePtr>& theOldForSub);
+
   friend class Model_Objects;
 };
 
index 1d0c715c7914bbd2db94fdb03782a8554dcc1d7f..041e8f226d34a769e6e4ccf23110d04d99a55ace 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_ResultConstruction.h>
 
 #include <Model_Data.h>
 #include <ModelAPI_CompositeFeature.h>
-#include <Model_SelectionNaming.h>
+#include <GeomAlgoAPI_SketchBuilder.h>
+#include <GeomAPI_Tools.h>
 #include <ModelAPI_Events.h>
-#include <Config_PropManager.h>
+#include <Model_Document.h>
 #include <GeomAPI_PlanarEdges.h>
 #include <GeomAPI_Shape.h>
-#include <GeomAlgoAPI_SketchBuilder.h>
 #include <Events_Loop.h>
+#include <GeomDataAPI_Point.h>
+#include <GeomDataAPI_Dir.h>
 
-#include <TDF_Reference.hxx>
-#include <TDF_ChildIterator.hxx>
+#include <TDF_ChildIDIterator.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Builder.hxx>
-#include <TDataStd_Integer.hxx>
 #include <TDataStd_IntPackedMap.hxx>
 #include <TDataStd_Name.hxx>
 #include <TDataStd_UAttribute.hxx>
-#include <TColStd_MapOfTransient.hxx>
-#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
-#include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 #include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Vertex.hxx>
+#include <TopoDS_ListOfShape.hxx>
 #include <TopExp_Explorer.hxx>
-#include <TNaming_Tool.hxx>
-#include <Precision.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+
+#include <algorithm>
 
-// identifier that it is full result selected, but in external document (for internal index is 0)
-Standard_GUID kFULL_RESULT_ID("ee87e529-da6f-46af-be25-5e0fefde52f7");
 
+// identifier of the infinite result
+Standard_GUID kIS_INFINITE("dea8cc5a-53f2-49c1-94e8-a947bed20a9f");
+// identifier of the result not in history
+Standard_GUID kIS_IN_HISTORY("a9aec01c-805e-44d1-b5d2-a63f06522f8a");
 
 void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::string& theName,
                                        std::string& theDefault)
@@ -65,13 +65,10 @@ void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::str
 void Model_ResultConstruction::setShape(std::shared_ptr<GeomAPI_Shape> theShape)
 {
   if (myShape != theShape) {
+    storeShape(theShape);
     if (!theShape.get() || !theShape->isEqual(myShape)) {
-        static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
-        ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent);
-        if (theShape.get()) {
-          myFacesUpToDate = false;
-          myFaces.clear();
-        }
+      static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+      ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent);
     }
     myShape = theShape;
   }
@@ -82,803 +79,387 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultConstruction::shape()
   return myShape;
 }
 
-Model_ResultConstruction::Model_ResultConstruction()
-{
-  myIsInHistory = true;
-  myIsInfinite = false;
-  myFacesUpToDate = false;
-}
-
-void Model_ResultConstruction::setIsInHistory(const bool isInHistory)
+static std::string shortName(
+  std::shared_ptr<ModelAPI_ResultConstruction>& theConstr)
 {
-  myIsInHistory = isInHistory;
+  std::string aName = theConstr->data()->name();
+  // remove "-", "/" and "&" command-symbols
+  aName.erase(std::remove(aName.begin(), aName.end(), '-'), aName.end());
+  aName.erase(std::remove(aName.begin(), aName.end(), '/'), aName.end());
+  aName.erase(std::remove(aName.begin(), aName.end(), '&'), aName.end());
+  // remove the last 's', 'e', 'f' and 'r' symbols:
+  // they are used as markers of start/end/forward/reversed indicators
+  static const std::string aSyms("sefr");
+  std::string::iterator aSuffix = aName.end() - 1;
+  while(aSyms.find(*aSuffix) != std::string::npos) {
+    --aSuffix;
+  }
+  aName.erase(aSuffix + 1, aName.end());
+  return aName;
 }
 
-int Model_ResultConstruction::facesNum(const bool theUpdateNaming)
+bool Model_ResultConstruction::updateShape()
 {
-  if (!myFacesUpToDate) {
-    std::shared_ptr<GeomAPI_PlanarEdges> aWirePtr =
-      std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(myShape);
-    if (aWirePtr.get()) {
-      std::list<std::shared_ptr<GeomAPI_Shape> > aFaces;
-      GeomAlgoAPI_SketchBuilder::createFaces(aWirePtr->origin(), aWirePtr->dirX(),
-        aWirePtr->norm(), aWirePtr, aFaces);
-      std::list<std::shared_ptr<GeomAPI_Shape> >::iterator aFIter = aFaces.begin();
-      for(; aFIter != aFaces.end(); aFIter++) {
-        std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(*aFIter));
-        if (aFace.get() && !aFace->isNull())
-          myFaces.push_back(aFace);
-      }
-    }
-    myFacesUpToDate = true;
-
-    // update all the faces and sub-elements in the naming structure
-    if (theUpdateNaming) {
-      DocumentPtr anEmptyExt;
-      bool aNotExt = false;
-      TDF_Label aDataLab = startLabel(anEmptyExt, aNotExt);
-      TDF_ChildIterator aSubsIter(aDataLab, Standard_False);
-      for(; aSubsIter.More(); aSubsIter.Next()) {
-        const TDF_Label aLab = aSubsIter.Value();
-        if (aLab.Tag() == 1) // skip the root shape label
-          continue;
-        Handle(TNaming_NamedShape) aNS;
-        if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-          update(aLab.Tag() - 1, anEmptyExt, aNotExt);
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData && aData->isValid()) {
+    TDF_Label aShapeLab = aData->shapeLab();
+    Handle(TNaming_NamedShape) aNS;
+    if (aShapeLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+      TopoDS_Shape aShape = aNS->Get();
+      if (!aShape.IsNull()) {
+        if (aShape.ShapeType() == TopAbs_COMPOUND) {
+          // restore the sketch planar edges object
+          std::shared_ptr<GeomAPI_PlanarEdges> aBigWire(new GeomAPI_PlanarEdges);
+          aBigWire->setImpl<TopoDS_Shape>(new TopoDS_Shape(aShape));
+          FeaturePtr aSketch =
+            document()->feature(std::dynamic_pointer_cast<ModelAPI_Result>(data()->owner()));
+          std::shared_ptr<GeomDataAPI_Point> anOrigin =
+            std::dynamic_pointer_cast<GeomDataAPI_Point>(aSketch->data()->attribute("Origin"));
+          std::shared_ptr<GeomDataAPI_Dir> aDirX =
+            std::dynamic_pointer_cast<GeomDataAPI_Dir>(aSketch->data()->attribute("DirX"));
+          std::shared_ptr<GeomDataAPI_Dir> aNorm =
+            std::dynamic_pointer_cast<GeomDataAPI_Dir>(aSketch->data()->attribute("Norm"));
+          if (anOrigin.get() && aDirX.get() && aNorm.get()) {
+            aBigWire->setPlane(anOrigin->pnt(), aDirX->dir(), aNorm->dir());
+            myShape = aBigWire;
+            return true;
+          }
         }
+        // just restore shape
+        GeomShapePtr aGShape(new GeomAPI_Shape);
+        aGShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(aShape));
+        myShape = GeomAPI_Tools::getTypedShape(aGShape); // restore the sketch sub-components
+        return true;
       }
     }
   }
-  return int(myFaces.size());
+  return false;
 }
 
-std::shared_ptr<GeomAPI_Face> Model_ResultConstruction::face(const int theIndex)
+Model_ResultConstruction::Model_ResultConstruction()
 {
-  return myFaces[theIndex];
 }
 
-bool Model_ResultConstruction::isInfinite()
+bool Model_ResultConstruction::isInHistory()
 {
-  return myIsInfinite;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    return !aData->label().IsAttribute(kIS_IN_HISTORY); // by default no attribute, but in history
+  }
+  return true;  // unknown case
 }
 
-void Model_ResultConstruction::setInfinite(const bool theInfinite)
+void Model_ResultConstruction::setIsInHistory(const bool isInHistory)
 {
-  myIsInfinite = theInfinite;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    if (!isInHistory)
+      TDataStd_UAttribute::Set(aData->label(), kIS_IN_HISTORY);
+    else
+      aData->label().ForgetAttribute(kIS_IN_HISTORY);
+  }
 }
 
-void Model_ResultConstruction::setIsConcealed(const bool theValue)
+bool Model_ResultConstruction::isInfinite()
 {
-  // do nothing: the construction element is never concealed
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    return aData->label().IsAttribute(kIS_INFINITE);
+  }
+  return false;  // unknown case
 }
 
-static const int kSTART_VERTEX_DELTA = 1000000;
-
-static void registerSubShape(TDF_Label theMainLabel, TopoDS_Shape theShape, std::string theFullName,
-  const int theID, std::shared_ptr<Model_Document> theDoc,
-  bool theSelectionMode)
+void Model_ResultConstruction::setInfinite(const bool theInfinite)
 {
-  TDF_Label aLab = theID == 0 ? theMainLabel : theMainLabel.FindChild(theID);
-  TNaming_Builder aBuilder(aLab);
-  // wire never happens as sub, it must be generated to be found
-  // by SelectionNaming TNaming_Tool::NamedShape
-  if (theSelectionMode && theShape.ShapeType() != TopAbs_WIRE)
-    aBuilder.Select(theShape, theShape);
-  else
-    aBuilder.Generated(theShape);
-
-  theDoc->addNamingName(aLab, theFullName);
-  TDataStd_Name::Set(aLab, theFullName.c_str());
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    if (theInfinite)
+      TDataStd_UAttribute::Set(aData->label(), kIS_INFINITE);
+    else
+      aData->label().ForgetAttribute(kIS_INFINITE);
+  }
 }
 
-#include <TopTools_OrientedShapeMapHasher.hxx>
-
-// generates a full-name for sub-element of the composite feature (sketch)
-std::string fullName(CompositeFeaturePtr theComposite, const TopoDS_Shape& theSubShape,
-  Handle(TDataStd_IntPackedMap) theRefs = Handle(TDataStd_IntPackedMap)())
+int Model_ResultConstruction::facesNum(const bool theUpdateNaming)
 {
-  TopAbs_ShapeEnum aShapeType = theSubShape.ShapeType();
-  gp_Pnt aVertexPos;
-  NCollection_Map<TopoDS_Edge> allExactEdges;
-  NCollection_DataMap<TopoDS_Edge, TopoDS_Edge, Model_EdgesHasher> allEdges;
-  NCollection_DataMap<Handle(Geom_Curve), TopoDS_Edge, Model_CurvesHasher> allCurves;
-  /// map from edges from theSubShape to the found corresponded indices of the sub-components
-  NCollection_DataMap<TopoDS_Edge, NCollection_List<int>, TopTools_OrientedShapeMapHasher>
-    anEdgesCorrespondence;
-  if (aShapeType == TopAbs_VERTEX) { // compare positions
-    aVertexPos = BRep_Tool::Pnt(TopoDS::Vertex(theSubShape));
-  } else {
-    for(TopExp_Explorer anEdgeExp(theSubShape, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) {
-      TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExp.Current());
-      allExactEdges.Add(anEdge);
-      allEdges.Bind(anEdge, anEdge);
-      Standard_Real aFirst, aLast;
-      Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-      allCurves.Bind(aCurve, anEdge);
-      anEdgesCorrespondence.Bind(anEdge, NCollection_List<int>());
-    }
-  }
-  std::map<int, int> anOrientations; //map from edges IDs to orientations of these edges in face
-  std::map<int, std::string> aSubNames; //map from edges IDs to names of edges
-  TColStd_PackedMapOfInteger aRefs; // indixes of sub-elements in composite
-
-
-  const int aSubNum = theComposite->numberOfSubs();
-  for(int a = 0; a < aSubNum; a++) {
-    FeaturePtr aSub = theComposite->subFeature(a);
-    const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-    std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
-    // there may be many shapes (circle and center): register if at least one is in selection
-    for(; aRes != aResults.cend(); aRes++) {
-      ResultConstructionPtr aConstr =
-        std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-      if (!aConstr->shape()) {
-        continue;
-      }
-      if (aShapeType == TopAbs_VERTEX) {
-        if (aConstr->shape()->isVertex()) { // compare vertices positions
-          const TopoDS_Shape& aVertex = aConstr->shape()->impl<TopoDS_Shape>();
-          gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aVertex));
-          if (aPnt.IsEqual(aVertexPos, Precision::Confusion())) {
-            aRefs.Add(theComposite->subFeatureId(a));
-            aSubNames[theComposite->subFeatureId(a)] = Model_SelectionNaming::shortName(aConstr);
-          }
-        } else { // get first or last vertex of the edge: last is stored with additional delta
-          const TopoDS_Shape& anEdge = aConstr->shape()->impl<TopoDS_Shape>();
-          int aDelta = kSTART_VERTEX_DELTA;
-          for(TopExp_Explorer aVExp(anEdge, TopAbs_VERTEX); aVExp.More(); aVExp.Next()) {
-            gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aVExp.Current()));
-            if (aPnt.IsEqual(aVertexPos, Precision::Confusion())) {
-              aRefs.Add(aDelta + theComposite->subFeatureId(a));
-              aSubNames[aDelta + theComposite->subFeatureId(a)] =
-                Model_SelectionNaming::shortName(aConstr, aDelta / kSTART_VERTEX_DELTA);
-              break;
-            }
-            aDelta += kSTART_VERTEX_DELTA;
-          }
-        }
-      } else {
-        if (aConstr->shape()->isEdge()) {
-          const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-          TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-          if (anEdge.IsNull())
-            continue;
-          if (allEdges.IsBound(anEdge)) {
-            anEdgesCorrespondence.ChangeFind(allEdges.Find(anEdge)).Append(a);
-          } else {
-            Standard_Real aFirst, aLast;
-            Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-            if (allCurves.IsBound(aCurve)) {
-              anEdgesCorrespondence.ChangeFind(allCurves.Find(aCurve)).Append(a);
-            }
-          }
-        }
-      }
-    }
-  }
-
-  if (aShapeType != TopAbs_VERTEX) { // get best candidates from the correspondances
-    NCollection_DataMap<TopoDS_Edge, NCollection_List<int>, TopTools_OrientedShapeMapHasher>
-      ::Iterator aCorIter(anEdgesCorrespondence);
-    for(; aCorIter.More(); aCorIter.Next()) {
-      TopoDS_Edge anOrig = aCorIter.Key();
-      NCollection_List<int>::Iterator aCandidate(aCorIter.Value());
-      int aBestScore = 0;
-      int aBestIndex = -1;
-      ResultConstructionPtr aBestConstr;
-      for(; aCandidate.More(); aCandidate.Next()) {
-        FeaturePtr aSub = theComposite->subFeature(aCandidate.Value());
-        const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-        std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
-        // there may be many shapes (circle and center): register if at least one is in selection
-        for(; aRes != aResults.cend(); aRes++) {
-          ResultConstructionPtr aConstr =
-            std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-          if (!aConstr->shape() || !aConstr->shape()->isEdge())
-            continue;
-          const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-          TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-          if (anEdge.IsNull())
-            continue;
-          // detect score of the candidate
-          int aScore = 0;
-          if (anEdge.IsEqual(anOrig))
-            aScore = 10;
-          else if (anEdge.IsSame(anOrig))
-            aScore = 9;
-          else {
-            Standard_Real aFirst, aLast;
-            Handle(Geom_Curve) anOrigCurve = BRep_Tool::Curve(anOrig, aFirst, aLast);
-            Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-            if (anOrigCurve == aCurve) {
-              if (Model_EdgesHasher::IsEqual(anEdge, anOrig)) {
-                aScore = 8;
-              } else {
-                aScore = 6;
-              }
-            } else {
-              if (Model_EdgesHasher::IsEqual(anEdge, anOrig)) {
-                aScore = 7;
-              } else if (Model_CurvesHasher::IsEqual(aCurve, anOrigCurve)) {
-                aScore = 5;
-              }
-            }
-          }
-          if (aScore > aBestScore) {
-            aBestIndex = aCandidate.Value();
-            aBestScore = aScore;
-            aBestConstr = aConstr;
-          }
-        }
-      }
-      if (aBestIndex >= 0) {
-        int anID = theComposite->subFeatureId(aBestIndex);
-        aRefs.Add(anID);
-        aSubNames[anID] = Model_SelectionNaming::shortName(aBestConstr);
-        if (aShapeType != TopAbs_EDGE) { // face needs the sub-edges on sub-labels
-          // add edges to sub-label to support naming for edges selection
-          int anOrient = Model_SelectionNaming::edgeOrientation(theSubShape, anOrig);
-          anOrientations[anID] = anOrient;
-        }
-      }
-    }
-  }
-  std::stringstream aName;
-  // #1839 : do not store name of the feature in the tree, since this name could be changed
-  if (theSubShape.ShapeType() != TopAbs_COMPOUND) { // compound means the whole construction result
-    if (theSubShape.ShapeType() == TopAbs_FACE) aName<<"Face";
-    else if (theSubShape.ShapeType() == TopAbs_WIRE) aName<<"Wire";
-    else if (theSubShape.ShapeType() == TopAbs_EDGE) aName<<"Edge";
-    else if (theSubShape.ShapeType() == TopAbs_VERTEX) aName<<"Vertex";
-
-    // make a composite name from all sub-elements indexes: "1_2_3_4"
-    TColStd_MapIteratorOfPackedMapOfInteger aRef(aRefs);
-    for(; aRef.More(); aRef.Next()) {
-      aName<<"-"<<aSubNames[aRef.Key()];
-      if (anOrientations.find(aRef.Key()) != anOrientations.end()) {
-        if (anOrientations[aRef.Key()] == 1)
-          aName<<"f";
-        else if (anOrientations[aRef.Key()] == -1)
-          aName<<"r";
-      }
+  int aResult = 0;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    TDF_Label aShapeLab = aData->shapeLab();
+    TDF_ChildIDIterator anOldIter(aShapeLab, TDataStd_IntPackedMap::GetID());
+    for (; anOldIter.More(); anOldIter.Next()) {
+      aResult++;
     }
   }
-  if (!theRefs.IsNull()) {
-    Handle(TColStd_HPackedMapOfInteger) aMap = new TColStd_HPackedMapOfInteger(aRefs);
-    theRefs->ChangeMap(aMap);
-  }
-  return aName.str();
+  return aResult;
 }
 
-// stores shape and name on sub-label of the main stored shape
-static void saveSubName(CompositeFeaturePtr theComposite,
-  TDF_Label& theLab, const bool isSelectionMode, TopoDS_Shape aSub,
-  std::shared_ptr<Model_Document> theDoc, std::string theFullName)
+std::shared_ptr<GeomAPI_Face> Model_ResultConstruction::face(const int theIndex)
 {
-  // trying to store the edge of composite result, not sketch sub as it is
-  if (aSub.ShapeType() == TopAbs_EDGE) {
-    ResultPtr aRes = theComposite->firstResult();
-    ResultConstructionPtr aConstr = std::dynamic_pointer_cast<Model_ResultConstruction>(aRes);
-    if (aConstr.get()) {
-      Standard_Real aSubFirst, aSubLast;
-      TopoDS_Edge aSubEdge = TopoDS::Edge(aSub);
-      Handle(Geom_Curve) aSubCurve = BRep_Tool::Curve(aSubEdge, aSubFirst, aSubLast);
-      for(int aFaceIndex = 0; aFaceIndex < aConstr->facesNum(); aFaceIndex++) {
-        GeomShapePtr aGFace = aConstr->face(aFaceIndex);
-        TopoDS_Shape aFace = aGFace->impl<TopoDS_Shape>();
-        for(TopExp_Explorer anExp(aFace, TopAbs_EDGE); anExp.More(); anExp.Next()) {
-          TopoDS_Edge anEdge = TopoDS::Edge(anExp.Current());
-          Standard_Real aFirst, aLast;
-          Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-          if (Model_CurvesHasher::IsEqual(aCurve, aSubCurve) &&
-              ((fabs(aFirst - aSubFirst) < 1.e-9 &&  fabs(aLast - aSubLast) < 1.e-9)) ||
-              (fabs(aFirst - aSubLast) < 1.e-9 &&  fabs(aLast - aSubFirst) < 1.e-9)) {
-            aSub = anEdge;
-            break;
-          }
-        }
+  std::shared_ptr<GeomAPI_Face> aResult;
+  int anIndex = 0;
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData.get() && aData->isValid()) {
+    TDF_Label aShapeLab = aData->shapeLab();
+    TDF_ChildIDIterator anOldIter(aShapeLab, TDataStd_IntPackedMap::GetID());
+    for (; anOldIter.More(); anOldIter.Next()) {
+      if (anIndex == theIndex) {
+        Handle(TNaming_NamedShape) aNS;
+        anOldIter.Value()->Label().FindAttribute(TNaming_NamedShape::GetID(), aNS);
+        aResult.reset(new GeomAPI_Face);
+        aResult->setImpl(new TopoDS_Shape(aNS->Get()));
+        break;
       }
+      anIndex++;
     }
   }
-
-  TNaming_Builder aBuilder(theLab);
-  if (isSelectionMode)
-    aBuilder.Select(aSub, aSub);
-  else
-    aBuilder.Generated(aSub);
-  theDoc->addNamingName(theLab, theFullName.c_str());
-  TDataStd_Name::Set(theLab, theFullName.c_str());
+  return aResult;
 }
 
-
-TDF_Label Model_ResultConstruction::startLabel(
-  const std::shared_ptr<ModelAPI_Document> theExtDoc, bool& theExternal)
+void Model_ResultConstruction::setIsConcealed(const bool theValue)
 {
-  theExternal = theExtDoc.get() && theExtDoc != document();
-  if (theExternal) { // external document is used
-    std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theExtDoc);
-    return aDoc->extConstructionsLabel();
-  }
-  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
-  return aData->label();
+  // do nothing: the construction element is never concealed
 }
 
-int Model_ResultConstruction::select(const std::shared_ptr<GeomAPI_Shape>& theSubShape,
-  const std::shared_ptr<ModelAPI_Document> theExtDoc, const int theIndex)
+void Model_ResultConstruction::storeShape(std::shared_ptr<GeomAPI_Shape> theShape)
 {
-  int anIndex; // resulting index of the sub-label
-  TopoDS_Shape aSubShape;
-  if (theSubShape.get()) {
-    aSubShape = theSubShape->impl<TopoDS_Shape>();
-  } else if (shape().get()) {
-    aSubShape = shape()->impl<TopoDS_Shape>();
-  }
-  // if external document requires this selection, put the naming structures to this doc
-  // to support the naming mechanism in this document correctly
-  bool anExternal;
-  TDF_Label aDataLab = startLabel(theExtDoc, anExternal);
-  if (theIndex == -1) {
-    anIndex = anExternal ? 2 : 1; // for the external doc don't mind about the main shape
-
-    if (theSubShape.get() || anExternal) { // searching for already selected sub (or whole for ext)
-      // iterate all the already presented shapes to see the same
-      TDF_ChildIterator aSubsIter(aDataLab, Standard_False);
-      for(; aSubsIter.More(); aSubsIter.Next()) {
-        const TDF_Label aLab = aSubsIter.Value();
-        if (aLab.Tag() == 1) // skip the root shape label
-          continue;
-        Handle(TNaming_NamedShape) aNS;
-        if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-          if (aNS->Get().IsSame(aSubShape)) {
-            return aLab.Tag() - 1; // found exactly the needed shape, nothing else to do
-          }
-        }
-        anIndex = aLab.Tag(); // searching for the latest index
-      }
-      anIndex = (anIndex == 1) ? 2 : (anIndex + 1); // next after 1-root, or next after all
+  std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
+  if (aData && aData->isValid()) {
+    std::string aMyName = data()->name();
+    TDF_Label aShapeLab = aData->shapeLab();
+    if (!theShape.get() || theShape->isNull()) {
+      aShapeLab.ForgetAllAttributes();
+      TDataStd_Name::Set(aShapeLab, aMyName.c_str()); // restore name forgotten
+      return;
     }
-  } else {
-    anIndex = theIndex + 1;
-  }
-
-  // set the naming structure at index
-  TDF_Label aLab = aDataLab.FindChild(anIndex, Standard_True);
-
-  // if the subshape is part of a result face, select the whole face (#1997)
-  bool isSelectionMode = false; // and other don't set shapes - all the naming is in face label
-  if (!aSubShape.IsNull() && aSubShape.ShapeType() > TopAbs_FACE) {
-    // but before check that sub-vertex correctly detected as intersection of sketch edges (#2389)
-    int anEdgesNum = 2;
-    if (aSubShape.ShapeType() == TopAbs_VERTEX) {
-      anEdgesNum = 0;
+    std::shared_ptr<Model_Document> aMyDoc =
+      std::dynamic_pointer_cast<Model_Document>(document());
+    const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
+    if (isInfinite() || aShape.ShapeType() == TopAbs_VERTEX) {
+      aShapeLab.ForgetAllAttributes(); // clear all previously stored
+      TNaming_Builder aBuilder(aShapeLab);
+      aBuilder.Generated(aShape);
+      TDataStd_Name::Set(aShapeLab, aMyName.c_str());
+      aMyDoc->addNamingName(aShapeLab, aMyName);
+    } else if (aShape.ShapeType() == TopAbs_EDGE) { // store sub-vertices on sub-labels
+      aShapeLab.ForgetAllAttributes(); // clear all previously stored
+      TNaming_Builder aBuilder(aShapeLab);
+      aBuilder.Generated(aShape);
+
+      TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
+      for(int anIndex = 1; anExp.More(); anExp.Next(), anIndex++) {
+        TDF_Label aSubLab = aShapeLab.FindChild(anIndex);
+        TNaming_Builder aBuilder(aSubLab);
+        aBuilder.Generated(anExp.Current());
+        std::string aVertexName = aMyName + "_" + (anIndex == 1 ? "StartVertex" : "EndVertex");
+        TDataStd_Name::Set(aSubLab, aVertexName.c_str());
+        aMyDoc->addNamingName(aSubLab, aVertexName);
+      }
+      TDataStd_Name::Set(aShapeLab, aMyName.c_str());
+      aMyDoc->addNamingName(aShapeLab, aMyName);
+    } else { // this is probably sketch, so, work with it as with composite
+      std::shared_ptr<GeomAPI_PlanarEdges> aWirePtr =
+        std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(theShape);
+      if (!aWirePtr.get())
+        return; // unknown case
       ResultPtr aThisPtr = std::dynamic_pointer_cast<ModelAPI_Result>(data()->owner());
-      FeaturePtr aThisFeature = document()->feature(aThisPtr);
+      FeaturePtr aThisFeature = aMyDoc->feature(aThisPtr);
       CompositeFeaturePtr aComposite =
         std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aThisFeature);
-      if (aComposite.get()) {
-        const int aSubNum = aComposite->numberOfSubs();
-        for(int a = 0; a < aSubNum; a++) {
-          int aSubID = aComposite->subFeatureId(a);
-          FeaturePtr aSub = aComposite->subFeature(a);
-          const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-          std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes;
-          for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) {
-            ResultConstructionPtr aConstr =
-              std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-            if (aConstr->shape() && aConstr->shape()->isEdge()) {
-              TopoDS_Shape aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-              for(TopExp_Explorer anExp(aResShape, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
-                if (aSubShape.IsSame(anExp.Current())) {
-                  anEdgesNum++;
-                  break;
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-    if (anEdgesNum > 1) {
-      for(int aFaceIndex = 0; aFaceIndex < facesNum(); aFaceIndex++) {
-        TopExp_Explorer anExp(face(aFaceIndex)->impl<TopoDS_Shape>(), aSubShape.ShapeType());
-        for(; anExp.More(); anExp.Next()) {
-          if (aSubShape.IsSame(anExp.Current())) { // this is the case: select the whole face
-            // here just store the face index (to update face if update of edge is needed)
-            TNaming_Builder aBuilder(aLab);
-            aBuilder.Select(aSubShape, aSubShape);
-            int aFaceSelID = select(face(aFaceIndex), theExtDoc, -1);
-            TDF_Reference::Set(aLab, aLab.Father().FindChild(aFaceSelID));
-            isSelectionMode = true;
-            break;
+      if (!aComposite || aComposite->numberOfSubs() == 0)
+        return; // unknown case
+      // collect indices of curves of current composite
+      NCollection_DataMap<Handle(Geom_Curve), int> aCurvesIndices;
+      NCollection_DataMap<int, TopoDS_Edge> anEdgeIndices;
+      std::map<int, std::string> aComponentsNames; // names of components that lay on index
+      const int aSubNum = aComposite->numberOfSubs();
+      for (int a = 0; a < aSubNum; a++) {
+        FeaturePtr aSub = aComposite->subFeature(a);
+        const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
+        std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
+        for (; aRes != aResults.cend(); aRes++) {
+          ResultConstructionPtr aConstr =
+            std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
+          if (aConstr->shape() && aConstr->shape()->isEdge()) {
+            TopoDS_Edge anEdge = TopoDS::Edge(aConstr->shape()->impl<TopoDS_Shape>());
+            Standard_Real aFirst, aLast;
+            Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
+            aCurvesIndices.Bind(aCurve, a);
+            anEdgeIndices.Bind(a, anEdge);
+            aComponentsNames[a] = shortName(aConstr);
           }
         }
       }
-    }
-  }
-
-  // external full result is not identified by index == 0, so, add here the ID
-  if (!theSubShape.get()) {
-    TDataStd_UAttribute::Set(aLab, kFULL_RESULT_ID);
-    // empty NS
-    TNaming_Builder aBuilder(aLab);
-    // store all sub-faces naming since faces may be used for extrusion, where all edges are needed
-    Handle(TDataStd_IntPackedMap) anIndices = TDataStd_IntPackedMap::Set(aLab);
-    std::list<int> aFacesIndexes;
-    for(int a = 0; a < facesNum(); a++) {
-      anIndices->Add(select(face(a), theExtDoc, -1));
-    }
-    return anIndex - 1;
-  }
-
-  { // this to have erased Builder after the shape was generated (NS on this label may be changed)
-    TNaming_Builder aBuilder(aLab);
-    if (aSubShape.IsNull()) {
-      return anIndex - 1; // just keep empty named shape
-    }
-    // wire never happens as sub, it must be generated to be found
-    // by SelectionNaming TNaming_Tool::NamedShape
-    if (isSelectionMode && aSubShape.ShapeType() != TopAbs_WIRE) {
-      aBuilder.Select(aSubShape, aSubShape);
-    } else {
-      aBuilder.Generated(aSubShape);
-    }
-  }
 
-  if (anIndex == 1 && isInfinite()) { // infinitive results has no sub-selection
-    return anIndex - 1;
-  }
-  ResultPtr aThisPtr = std::dynamic_pointer_cast<ModelAPI_Result>(data()->owner());
-  FeaturePtr aThisFeature = document()->feature(aThisPtr);
-  CompositeFeaturePtr aComposite =
-    std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aThisFeature);
-  if (!aComposite || aComposite->numberOfSubs() == 0) {
-    // saving of context is enough: result construction contains exactly the needed shape
-    return anIndex - 1;
-  }
-
-  // identify the results of sub-object of the composite by edges
-  // save type of the selected shape in integer attribute
-  TopAbs_ShapeEnum aShapeType = aSubShape.ShapeType();
-  TDataStd_Integer::Set(aLab, (int)aShapeType);
-  gp_Pnt aVertexPos;
-  // curves of the sketch sub-elements are used, so, edges are not equal
-  TColStd_MapOfTransient allCurves;
-  if (aShapeType == TopAbs_VERTEX) { // compare positions
-    aVertexPos = BRep_Tool::Pnt(TopoDS::Vertex(aSubShape));
-  } else {
-    for(TopExp_Explorer anEdgeExp(aSubShape, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) {
-      TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExp.Current());
-      Standard_Real aFirst, aLast;
-      Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-      allCurves.Add(aCurve);
-    }
-  }
-  std::shared_ptr<Model_Document> aMyDoc =
-    std::dynamic_pointer_cast<Model_Document>(document());
-  // iterate and store the result ids of sub-elements and sub-elements to sub-labels
-  Handle(TDataStd_IntPackedMap) aRefs = TDataStd_IntPackedMap::Set(aLab);
-  const int aSubNum = aComposite->numberOfSubs();
-  // subs are placed on unique labels because of #2248: sketch curve may produce several edges,
-  // but #2401 - on stable labels
-  NCollection_Map<int> aUsedIDMap; // already used lab tags for placement of shapes
-
-  for(int a = 0; a < aSubNum; a++) {
-    FeaturePtr aSub = aComposite->subFeature(a);
-    const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-    std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
-    // there may be many shapes (circle and center): register if at least one is in selection
-    for(; aRes != aResults.cend(); aRes++) {
-      ResultConstructionPtr aConstr =
-        std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-      if (!aConstr->shape()) {
-        continue;
-      }
-      if (aShapeType != TopAbs_VERTEX) {
-        if (aConstr->shape()->isEdge()) {
-          const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-          TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-          if (!anEdge.IsNull()) {
+      GeomAlgoAPI_SketchBuilder aSketchBuilder(aWirePtr->origin(), aWirePtr->dirX(),
+                                               aWirePtr->norm(), aWirePtr);
+      const ListOfShape& aFaces = aSketchBuilder.faces();
+      // order is important to store faces in the same order if sketch is created from scratch
+      NCollection_IndexedDataMap<TopoDS_Face, TColStd_ListOfInteger> aNewIndices; // edges indices
+      std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator aFIter = aFaces.begin();
+      for (; aFIter != aFaces.end(); aFIter++) {
+        std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(*aFIter));
+        // put them to a label, trying to keep the same faces on the same labels
+        if (aFace.get() && !aFace->isNull()) {
+          TopoDS_Face aTopoFace = TopoDS::Face(aFace->impl<TopoDS_Shape>());
+          aNewIndices.Add(aTopoFace, TColStd_ListOfInteger());
+          // keep new indices of sub-elements used in this face
+          for (TopExp_Explorer anEdges(aTopoFace, TopAbs_EDGE); anEdges.More(); anEdges.Next()) {
+            TopoDS_Edge anEdge = TopoDS::Edge(anEdges.Current());
             Standard_Real aFirst, aLast;
             Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-            if (allCurves.Contains(aCurve)) {
-              int anID = aComposite->subFeatureId(a);
-              if (aShapeType != TopAbs_EDGE) { // face needs the sub-edges on sub-labels
-                // add edges to sub-label to support naming for edges selection
-                TopExp_Explorer anEdgeExp(aSubShape, TopAbs_EDGE);
-                for(; anEdgeExp.More(); anEdgeExp.Next()) {
-                  TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExp.Current());
-                  Standard_Real aFirst, aLast;
-                  Handle(Geom_Curve) aFaceCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-                  if (Model_CurvesHasher::IsEqual(aFaceCurve, aCurve)) {
-                    while(aUsedIDMap.Contains(anID))
-                      anID += 100000;
-                    aUsedIDMap.Add(anID);
-                    TDF_Label aSubLab = aLab.FindChild(anID);
-                    std::string aFullNameSub = fullName(aComposite, anEdge);
-                    saveSubName(aComposite, aSubLab, isSelectionMode, anEdge, aMyDoc, aFullNameSub);
-
-                    int anOrient = Model_SelectionNaming::edgeOrientation(aSubShape, anEdge);
-                    if (anOrient != 0) {
-                      // store the orientation of edge relatively to face if needed
-                      TDataStd_Integer::Set(aSubLab, anOrient);
-                    }
-                  }
-                }
-              } else { // put vertices of the selected edge to sub-labels
-                // add edges to sub-label to support naming for edges selection
-                for(TopExp_Explorer anEdgeExp(aSubShape, TopAbs_VERTEX);
-                      anEdgeExp.More(); anEdgeExp.Next()) {
-                    TopoDS_Vertex aV = TopoDS::Vertex(anEdgeExp.Current());
-                    while(aUsedIDMap.Contains(anID))
-                      anID += 100000;
-                    aUsedIDMap.Add(anID);
-                    TDF_Label aSubLab = aLab.FindChild(anID);
-                    std::string aFullNameSub = fullName(aComposite, aV);
-                    saveSubName(aComposite, aSubLab, isSelectionMode, aV, aMyDoc, aFullNameSub);
-                }
-              }
+            if (aCurvesIndices.IsBound(aCurve)) {
+              int anIndex = aCurvesIndices.Find(aCurve);
+              if ((aFirst > aLast) != (anEdge.Orientation() == TopAbs_REVERSED))
+                anIndex = -anIndex;
+              aNewIndices.ChangeFromKey(aTopoFace).Append(anIndex);
             }
           }
         }
       }
-    }
-  }
-  std::string aFullName = fullName(aComposite, aSubShape, aRefs);
-  // store the selected as primitive
-  registerSubShape(aLab, aSubShape, aFullName, 0, aMyDoc, isSelectionMode);
-  return anIndex - 1;
-}
-
-std::shared_ptr<GeomAPI_Shape> Model_ResultConstruction::shape(const int theIndex,
-  const std::shared_ptr<ModelAPI_Document> theExtDoc)
-{
-  std::shared_ptr<GeomAPI_Shape> aResult;
-  if (theIndex == 0)
-    return aResult; // the whole shape, so, NULL
-
-  bool isExt;
-  TDF_Label aLab = startLabel(theExtDoc, isExt).FindChild(theIndex + 1);
-  if (!aLab.IsNull()) { // index is not bad
-    Handle(TNaming_NamedShape) aSelection;
-    if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aSelection)) {
-      TopoDS_Shape aSelShape = aSelection->Get();
-      if (aSelShape.IsNull())
-        return aResult; // shape equal to context => null
-      aResult = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape);
-      aResult->setImpl(new TopoDS_Shape(aSelShape));
-    }
-  }
-
-  return aResult;
-}
-
-bool Model_ResultConstruction::update(const int theIndex,
-  const std::shared_ptr<ModelAPI_Document> theExtDoc, bool& theModified)
-{
-  theModified = false;
-  bool anExt;
-  TDF_Label aLab = startLabel(theExtDoc, anExt).FindChild(theIndex + 1, Standard_True);
-  if (theIndex == 0 || aLab.IsAttribute(kFULL_RESULT_ID)) { // full for external same as index == 0
-    // it is just reference to construction, not sub-shape
-    // if there is a sketch, the sketch-naming must be updated
-    if (!isInfinite()) {
-      // update all faces named by the whole result
-      bool aRes = true;
-      Handle(TDataStd_IntPackedMap) anIndices;
-      if (aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), anIndices)) {
-        NCollection_Map<TopoDS_Shape> aFaces; // collect faces, updated in the tree
-        TColStd_MapIteratorOfPackedMapOfInteger anIndexIter(anIndices->GetMap());
-        Handle(TColStd_HPackedMapOfInteger) aNewPackedMap =
-          new TColStd_HPackedMapOfInteger; // with only faces that are ok
-        // iterate to find existing faces, updated
-        for(; anIndexIter.More(); anIndexIter.Next()) {
-          if (update(anIndexIter.Key(), theExtDoc, theModified)) {
-            GeomShapePtr aFace = shape(anIndexIter.Key(), theExtDoc);
-            if (!aFaces.Contains(aFace->impl<TopoDS_Shape>())) {
-              aNewPackedMap->ChangeMap().Add(anIndexIter.Key());
-              aFaces.Add(aFace->impl<TopoDS_Shape>());
+      NCollection_DataMap<int, TopoDS_Face> aFacesOrder; // faces -> tag where they must be set
+      NCollection_List<TopoDS_Face> anUnorderedFaces; // faces that may be located at any index
+      // searching for the best new candidate to old location
+      NCollection_IndexedDataMap<TopoDS_Face, TColStd_ListOfInteger>::Iterator
+        aNewIter(aNewIndices);
+      for (; aNewIter.More(); aNewIter.Next()) {
+        double aBestFound = 0, aBestNotFound = 1.e+100;
+        int aBestTag = 0;
+        const TColStd_ListOfInteger& aNewInd = aNewIter.Value();
+        // old faces indices where they where located
+        TDF_ChildIDIterator anOldIter(aShapeLab, TDataStd_IntPackedMap::GetID());
+        for (; anOldIter.More(); anOldIter.Next()) {
+          int aTag = anOldIter.Value()->Label().Tag();
+          if (aFacesOrder.IsBound(aTag))
+            continue; // already found a best candidate
+          Handle(TDataStd_IntPackedMap) anOldIndices =
+            Handle(TDataStd_IntPackedMap)::DownCast(anOldIter.Value());
+          double aFound = 0, aNotFound = 0;
+          TColStd_ListOfInteger::Iterator aNewIndIter(aNewInd);
+          for (; aNewIndIter.More(); aNewIndIter.Next()) {
+            if (anOldIndices->Contains(aNewIndIter.Value())) {
+              aFound += 1.;
+            }
+            else if (anOldIndices->Contains(-aNewIndIter.Value())) { // different orientation
+              aFound += 0.001;
+            }
+            else {
+              aNotFound += 1.;
             }
           }
-        }
-        // then iterate all existing faces to find new faces
-        int aCurrentFacesNum = facesNum();
-        for(int a = 0; a < aCurrentFacesNum; a++) {
-          GeomShapePtr aFace = face(a);
-          if (!aFaces.Contains(aFace->impl<TopoDS_Shape>())) {
-            // add this one
-            int aNewFaceIndex = select(aFace, theExtDoc, -1);
-            if (aNewFaceIndex > 0) {
-              aNewPackedMap->ChangeMap().Add(aNewFaceIndex);
+          if (aNotFound <= aBestNotFound) { // less and equal to find better "found": #2859
+            if (aFound > aBestFound) {
+              aBestNotFound = aNotFound;
+              aBestFound = aFound;
+              aBestTag = aTag;
             }
           }
         }
-        anIndices->ChangeMap(aNewPackedMap);
-      }
-      return aRes;
-    } else {
-      // check is this modified or not
-      std::shared_ptr<GeomAPI_Shape> aNewShape = shape();
-      TopoDS_Shape anOldSh;
-      Handle(TNaming_NamedShape) aNS;
-      if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-        anOldSh = aNS->Get();
-      }
-      if (aNewShape.get()) {
-        if (anOldSh.IsNull())
-          theModified = true;
-        else {
-          std::shared_ptr<GeomAPI_Shape> anOldShape(new GeomAPI_Shape);
-          anOldShape->setImpl<TopoDS_Shape>(new TopoDS_Shape(anOldSh));
-          theModified = !anOldShape->isEqual(aNewShape);
+        if (aBestTag != 0) { // found an appropriate face
+          aFacesOrder.Bind(aBestTag, aNewIter.Key());
+        } else {
+          anUnorderedFaces.Append(aNewIter.Key());
         }
       }
-      else if (!anOldSh.IsNull()) {
-        theModified = true;
-      }
-
-      // For correct naming selection, put the shape into the naming structure.
-      // It seems sub-shapes are not needed: only this shape is (and can be ) selected.
-      TNaming_Builder aBuilder(aLab);
-      aBuilder.Generated(aNewShape->impl<TopoDS_Shape>());
-    }
-    return shape() && !shape()->isNull();
-  }
-  // construction: identification by the results indexes, recompute faces and
-  // take the face that more close by the indexes
-  ResultPtr aThisPtr = std::dynamic_pointer_cast<ModelAPI_Result>(data()->owner());
-  FeaturePtr aContextFeature = document()->feature(aThisPtr);
+      aShapeLab.ForgetAllAttributes(); // clear all previously stored
+      TDataStd_Name::Set(aShapeLab, aMyName.c_str()); // restore name forgotten
+      TNaming_Builder aBuilder(aShapeLab); // store the compound to get it ready on open of document
+      aBuilder.Generated(aShape);
+      aMyDoc->addNamingName(aShapeLab, aMyName);
+      // set new faces to the labels
+      int aCurrentTag = 1;
+      NCollection_List<TopoDS_Face>::Iterator anUnordered(anUnorderedFaces);
+      for(int aCurrentTag = 1; !aFacesOrder.IsEmpty() || anUnordered.More(); aCurrentTag++) {
+        TopoDS_Face aFaceToPut;
+        if (aFacesOrder.IsBound(aCurrentTag)) {
+          aFaceToPut = aFacesOrder.Find(aCurrentTag);
+          aFacesOrder.UnBind(aCurrentTag);
+        } else if (anUnordered.More()){
+          aFaceToPut = anUnordered.Value();
+          anUnordered.Next();
+        }
 
-  // sketch sub-element
-  if (std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature).get())
-  {
-    // update the referenced object if it is sub
-    Handle(TDF_Reference) aRef;
-    if (aLab.FindAttribute(TDF_Reference::GetID(), aRef)) {
-      int aFaceIndex = aRef->Get().Tag();
-      // don't check selection since face may disappear, but the shape stays correct
-      Model_ResultConstruction::update(aFaceIndex, theExtDoc, theModified);
-    }
-    // getting a type of selected shape
-    Handle(TDataStd_Integer) aTypeAttr;
-    if (!aLab.FindAttribute(TDataStd_Integer::GetID(), aTypeAttr)) {
-      return false;
-    }
-    TopAbs_ShapeEnum aShapeType = (TopAbs_ShapeEnum)(aTypeAttr->Get());
-    // selected indexes will be needed in each "if"
-    Handle(TDataStd_IntPackedMap) aSubIds;
-    std::shared_ptr<GeomAPI_Shape> aNewSelected;
-    bool aNoIndexes =
-      !aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0;
-    // for now working only with composite features
-    CompositeFeaturePtr aComposite =
-      std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature);
-    if (!aComposite.get() || aComposite->numberOfSubs() == 0) {
-      return false;
-    }
+        if (!aFaceToPut.IsNull()) {
+          TopTools_MapOfShape aFaceEdges;
+          for(TopExp_Explorer anEdges(aFaceToPut, TopAbs_EDGE); anEdges.More(); anEdges.Next()) {
+            aFaceEdges.Add(anEdges.Current());
+          }
 
-    if (aShapeType == TopAbs_FACE || aShapeType == TopAbs_WIRE) {
-      // compound is for the whole sketch selection
-      // If this is a wire with plane defined then it is a sketch-like object
-      if (!facesNum()) // no faces, update can not work correctly
-        return false;
-      // if there is no edges indexes, any face can be used: take the first
-      std::shared_ptr<GeomAPI_Shape> aNewSelected;
-      if (aNoIndexes) {
-        aNewSelected = face(0);
-      } else { // searching for most looks-like initial face by the indexes
-        // prepare edges of the current result for the fast searching
-        // curves and orientations of edges
-        NCollection_DataMap<Handle(Geom_Curve), int, Model_CurvesHasher> allCurves;
-        const int aSubNum = aComposite->numberOfSubs();
-        for(int a = 0; a < aSubNum; a++) {
-          int aSubID = aComposite->subFeatureId(a);
-          if (aSubIds->Contains(aSubID)) {
-            FeaturePtr aSub = aComposite->subFeature(a);
-            const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-            std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes;
-            for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) {
-              ResultConstructionPtr aConstr =
-                std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-              if (aConstr->shape() && aConstr->shape()->isEdge()) {
-                const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-                TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-                if (!anEdge.IsNull()) {
-                  Standard_Real aFirst, aLast;
-                  Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-                  // searching for orientation information
-                  int anOrient = 0;
-                  Handle(TDataStd_Integer) anInt;
-                  if (aLab.FindChild(aSubID).FindAttribute(TDataStd_Integer::GetID(), anInt)) {
-                    anOrient = anInt->Get();
-                  }
-                  allCurves.Bind(aCurve, anOrient);
-                }
+          TDF_Label aLab = aShapeLab.FindChild(aCurrentTag);
+          TNaming_Builder aFaceBuilder(aLab);
+          aFaceBuilder.Generated(aFaceToPut);
+          // store also indices of the new face edges
+          Handle(TDataStd_IntPackedMap) aNewMap = TDataStd_IntPackedMap::Set(aLab);
+          const TColStd_ListOfInteger& aNewInd = aNewIndices.FindFromKey(aFaceToPut);
+          std::stringstream aName;
+          aName<<"Face";
+          TopExp_Explorer aPutEdges(aFaceToPut, TopAbs_EDGE);
+          TNaming_Builder *anEdgesBuilder = 0, *aVerticesBuilder = 0;
+          for(TColStd_ListOfInteger::Iterator anIter(aNewInd); anIter.More(); anIter.Next()) {
+            int anIndex = anIter.Value();
+            int aModIndex = anIndex > 0 ? anIndex : -anIndex;
+            aNewMap->Add(anIndex);
+            aName<<"-"<<aComponentsNames[aModIndex];
+            if (anIter.Value() > 0)
+              aName<<"f";
+            else
+              aName<<"r";
+            // collect all edges of the face which are modified in sub-label of the face
+            if (anEdgeIndices.IsBound(aModIndex) &&
+                !aFaceEdges.Contains(anEdgeIndices.Find(aModIndex))) {
+              if (!anEdgesBuilder) {
+                TDF_Label anEdgesLabel = aLab.FindChild(1);
+                anEdgesBuilder = new TNaming_Builder(anEdgesLabel);
+                std::ostringstream aSubName;
+                // tag is needed for Test1922 to distinguish sub-edges of different faces
+                aSubName<<"SubEdge_"<<aCurrentTag;
+                TDataStd_Name::Set(anEdgesLabel, aSubName.str().c_str());
               }
+              anEdgesBuilder->Modify(anEdgeIndices.Find(aModIndex), aPutEdges.Current());
             }
-          }
-        }
-        aNewSelected = Model_SelectionNaming::findAppropriateFace(
-          aThisPtr, allCurves, aShapeType == TopAbs_WIRE);
-      }
-      if (aNewSelected) { // store this new selection
-        select(aNewSelected, theExtDoc, theIndex);
-        theModified = true;
-        return true;
-      } else {
-        // if the selection is not found, put the empty shape:
-        // it's better to have disappeared shape, than the old, the lost one
-        TNaming_Builder anEmptyBuilder(aLab);
-        return false;
-      }
-    } else if (aShapeType == TopAbs_EDGE) {
-      // just reselect the edge by the id
-      const int aSubNum = aComposite->numberOfSubs();
-      for(int a = 0; a < aSubNum; a++) {
-        // if aSubIds take any, the first appropriate
-        if (aSubIds->IsEmpty() || aSubIds->Contains(aComposite->subFeatureId(a))) {
-          // found the appropriate feature
-          FeaturePtr aFeature = aComposite->subFeature(a);
-          std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aResIter =
-            aFeature->results().cbegin();
-          for(;aResIter != aFeature->results().cend(); aResIter++) {
-            ResultConstructionPtr aRes =
-              std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aResIter);
-            if (aRes && aRes->shape() && aRes->shape()->isEdge()) { // found!
-              select(aRes->shape(), theExtDoc, theIndex);
-              theModified = true;
-              return true;
-            }
-          }
-        }
-      }
-    } else if (aShapeType == TopAbs_VERTEX) {
-      // just reselect the vertex by the id of edge
-      const int aSubNum = aComposite->numberOfSubs();
-      for(int a = 0; a < aSubNum; a++) {
-        // if aSubIds take any, the first appropriate
-        int aFeatureID = aComposite->subFeatureId(a);
-        if (aSubIds->IsEmpty() || aSubIds->Contains(aFeatureID) ||
-          aSubIds->Contains(aFeatureID + kSTART_VERTEX_DELTA) ||
-          aSubIds->Contains(aFeatureID + kSTART_VERTEX_DELTA * 2)) {
-            // searching for deltas
-            int aVertexNum = 0;
-            if (aSubIds->Contains(aFeatureID + kSTART_VERTEX_DELTA)) aVertexNum = 1;
-            else if (aSubIds->Contains(aFeatureID + kSTART_VERTEX_DELTA * 2)) aVertexNum = 2;
-            // found the feature with appropriate edge
-            FeaturePtr aFeature = aComposite->subFeature(a);
-            std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aResIter =
-              aFeature->results().cbegin();
-            for(;aResIter != aFeature->results().cend(); aResIter++) {
-              ResultConstructionPtr aRes =
-                std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aResIter);
-              if (aRes && aRes->shape()) {
-                if (aRes->shape()->isVertex() && aVertexNum == 0) { // found!
-                  select(aRes->shape(), theExtDoc, theIndex);
-                  theModified = true;
-                  return true;
-                } else if (aRes->shape()->isEdge() && aVertexNum > 0) {
-                  const TopoDS_Shape& anEdge = aRes->shape()->impl<TopoDS_Shape>();
-                  int aVIndex = 1;
-                  for(TopExp_Explorer aVExp(anEdge, TopAbs_VERTEX); aVExp.More(); aVExp.Next()) {
-                    if (aVIndex == aVertexNum) { // found!
-                      std::shared_ptr<GeomAPI_Shape> aVertex(new GeomAPI_Shape);
-                      aVertex->setImpl(new TopoDS_Shape(aVExp.Current()));
-                      select(aVertex, theExtDoc, theIndex);
-                      theModified = true;
-                      return true;
-                    }
-                    aVIndex++;
+            // put also modified vertices, otherwise vertex of original edge has no history
+            if (anEdgeIndices.IsBound(aModIndex)) {
+              TopExp_Explorer aVExpOld(anEdgeIndices.Find(aModIndex), TopAbs_VERTEX);
+              TopExp_Explorer aVExpNew(aPutEdges.Current(), TopAbs_VERTEX);
+              for(; aVExpNew.More() && aVExpOld.More(); aVExpNew.Next(), aVExpOld.Next()) {
+                if (!aVExpOld.Current().IsSame(aVExpNew.Current())) {
+                  if (!aVerticesBuilder) {
+                    TDF_Label aVertLabel = aLab.FindChild(2);
+                    aVerticesBuilder = new TNaming_Builder(aVertLabel);
+                    std::ostringstream aSubName;
+                    // tag is needed for Test1922 to distinguish sub-edges of different faces
+                    aSubName<<"SubVertex_"<<aCurrentTag;
+                    TDataStd_Name::Set(aVertLabel, aSubName.str().c_str());
                   }
+                  aVerticesBuilder->Modify(aVExpOld.Current(), aVExpNew.Current());
+
                 }
               }
             }
+            aPutEdges.Next();
+          }
+          if (anEdgesBuilder)
+            delete anEdgesBuilder;
+          if (aVerticesBuilder)
+            delete aVerticesBuilder;
+          TDataStd_Name::Set(aLab, TCollection_ExtendedString(aName.str().c_str()));
+          aMyDoc->addNamingName(aLab, aName.str());
+          // put also wires to sub-labels to correctly select them instead of collection by edges
+          int aWireTag = 3; // first tag is for SubEdge-s, second - for vertices
+          for(TopExp_Explorer aWires(aFaceToPut, TopAbs_WIRE); aWires.More(); aWires.Next()) {
+            TDF_Label aWireLab = aLab.FindChild(aWireTag);
+            TNaming_Builder aWireBuilder(aWireLab);
+            aWireBuilder.Generated(aWires.Current());
+            std::ostringstream aWireName;
+            aWireName<<aName.str()<<"_wire";
+            if (aWireTag > 3)
+              aWireName<<"_"<<aWireTag - 2;
+            TDataStd_Name::Set(aWireLab, aWireName.str().c_str());
+            aMyDoc->addNamingName(aWireLab, aWireName.str());
+            aWireTag++;
+          }
         }
       }
     }
-  } else { // simple construction element: the selected is that needed
-    select(shape(), theExtDoc, theIndex);
-    theModified = true;
-    return true;
   }
-  return false; // unknown case
 }
index b5ea41cd985bb9589aa74b3c07ceae5ef82d6174..8f7670158072cf0c2917720eb3b979dd3d9d5b3c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_ResultConstruction_H_
@@ -39,22 +38,13 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
 {
   std::shared_ptr<ModelAPI_Feature> myOwner;  ///< owner of this result
   std::shared_ptr<GeomAPI_Shape> myShape;  ///< shape of this result created "on the fly"
-  bool myFacesUpToDate; ///< is true if faces in myuFaces are computed and up to date
-  /// stores the up to date faces if they exist
-  std::vector<std::shared_ptr<GeomAPI_Face> > myFaces;
-  bool myIsInHistory;
-  bool myIsInfinite;
  public:
   /// Retuns the parameters of color definition in the resources config manager
   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
                                             std::string& theDefault);
 
   /// By default object is displayed in the object browser.
-  MODEL_EXPORT virtual bool isInHistory()
-  {
-    return myIsInHistory;
-  }
-
+  MODEL_EXPORT virtual bool isInHistory();
   /// Sets the result
   MODEL_EXPORT virtual void setShape(std::shared_ptr<GeomAPI_Shape> theShape);
   /// Returns the shape-result produced by this feature
@@ -76,39 +66,16 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
   /// The construction element is never concealed
   MODEL_EXPORT virtual void setIsConcealed(const bool theValue);
 
-  // methods related to selection of sub-shapes in construction, used by SelectionAttribute
-
-  /// Selects theSubShape in the construction. Returns an index of the selected sub-shape.
-  /// Puts the selected shape with a needed BRepNaming sub-structure to the data tree of result.
-  /// If theSubShape is null, it selects the whole construction and returns zero index.
-  /// If theIndex is not -1, it re-selects over the existing data (used for update selection).
-  /// If theExtDoc is document where this selection is needed, if it differs from this,
-  /// naming structures will be located there.
-  int select(const std::shared_ptr<GeomAPI_Shape>& theSubShape,
-    const std::shared_ptr<ModelAPI_Document> theExtDoc, const int theIndex = -1);
-
-  /// Returns already selected shape by the given index. Zero index means the whole construction,
-  /// so, the returned shape in this case is null.
-  /// If theExtDoc is document where this selection is needed, if it differs from this,
-  /// naming structures will be located there.
-  std::shared_ptr<GeomAPI_Shape> shape(const int theIndex,
-    const std::shared_ptr<ModelAPI_Document> theExtDoc);
-
-  /// Updates the existing selection by the index.
-  /// Returns false if update is failed. Returns theModified true if the selection was updated.
-  /// If theExtDoc is document where this selection is needed, if it differs from this,
-  /// naming structures will be updated there.
-  bool update(const int theIndex, const std::shared_ptr<ModelAPI_Document> theExtDoc,
-    bool& theModified);
+  /// Updates the shape taking the current value from the data structure, returns true
+  /// if update has been correctly done
+  MODEL_EXPORT virtual bool updateShape();
 
  protected:
   /// Makes a body on the given feature
   Model_ResultConstruction();
 
-  /// Searchies for the working label selection/update will start from
-  /// Returns true if this is label of the external document.
-  /// theExtDoc is document where this selection is required
-  TDF_Label startLabel(const std::shared_ptr<ModelAPI_Document> theExtDoc, bool& theExternal);
+  /// Stores shape in the data structure to allow identification it by the naming
+  void storeShape(std::shared_ptr<GeomAPI_Shape> theShape);
 
   friend class Model_Objects;
 };
index 40f7aa5a48ce26ca99e6ff8c6dd73ee3189eb488..7eaa8b2b47a65364aa87b2705d42ea7795798d2b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_ResultField.h>
@@ -43,6 +42,7 @@ Model_ResultField::~Model_ResultField()
   }
 }
 
+// LCOV_EXCL_START
 void Model_ResultField::colorConfigInfo(std::string& theSection, std::string& theName,
                                        std::string& theDefault)
 {
@@ -50,6 +50,7 @@ void Model_ResultField::colorConfigInfo(std::string& theSection, std::string& th
   theName = "result_field_color";
   theDefault = DEFAULT_COLOR();
 }
+// LCOV_EXCL_STOP
 
 std::shared_ptr<GeomAPI_Shape> Model_ResultField::shape()
 {
@@ -140,7 +141,8 @@ std::string Model_ResultField::textLine(int theLine) const
   return "";
 }
 
-
+// used by GUI only
+// LCOV_EXCL_START
 ModelAPI_ResultField::ModelAPI_FieldStep* Model_ResultField::step(int theId) const
 {
   if (theId < mySteps.size()) {
@@ -148,3 +150,4 @@ ModelAPI_ResultField::ModelAPI_FieldStep* Model_ResultField::step(int theId) con
   }
   return NULL;
 }
+// LCOV_EXCL_STOP
index 2226e5672c64d8b98d9bb95ea60cffe2a19bfea0..52d0b82aac4a3e87df59b928066c8ad24d27b16c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_ResultField_H_
index dcdce0b95f718015b0e4fae18afaf7d7076aff28..7a4c5cfaf740f12e177ec415a201f3c356e1ab05 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_ResultGroup.h>
index baa004d29a8f158e21e2853459920b47c78c3836..aa0c068dd5014ad09ab6e7cfb5cd101d1afee0d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_ResultGroup_H_
index 953e22bac921b3bd8e2f5fcea146f6a44d856c26..7bbd6968de018ff86297b740908104ad29bf713b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_ResultParameter.h"
index 036935d9d849f1f3ccc5f7bcd81b0972d06cf1e0..d35f36d8b18bfe65947e448bfbacac5894ce2058 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODEL_RESULTPARAMETER_H_
index 255f5e3802ce81352513e45182dd92b5dad70178..f70deecced5c8d4c89507ed48eca4a85f4652cdf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_ResultPart.h>
@@ -56,7 +55,7 @@ void Model_ResultPart::initAttributes()
   data()->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
   data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId());
 
-  if (aDocRef->isInitialized() && // initialized immideately means already exist and will be loaded
+  if (aDocRef->isInitialized() && // initialized immediately means already exist and will be loaded
       !Model_Application::getApplication()->hasDocument(aDocRef->docId()))
     Model_Application::getApplication()->setLoadByDemand(data()->name(), aDocRef->docId());
 }
@@ -66,6 +65,8 @@ std::shared_ptr<ModelAPI_Document> Model_ResultPart::partDoc()
   if (myTrsf.get() && baseRef().get()) { // the second condition is due to #2035
     return baseRef()->partDoc();
   }
+  if (!data()->isValid())
+    return DocumentPtr();
   DocumentPtr aRes = data()->document(DOC_REF())->value();
   return aRes;
 }
@@ -139,7 +140,7 @@ bool Model_ResultPart::setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
     if (!myTrsf.get()) { // disable of base result part
       DocumentPtr aDoc = Model_ResultPart::partDoc();
       if (aDoc.get() && aDoc->isOpened()) {
-        // make the current feature the last in any case: to update shapes defore deactivation too
+        // make the current feature the last in any case: to update shapes before deactivation too
         int aSize = aDoc->size(ModelAPI_Feature::group());
         FeaturePtr aLastFeature;
         if (aSize)
@@ -169,6 +170,8 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultPart::shape()
 {
   std::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape);
   if (myShape.IsNull()) { // shape is not produced yet, create it
+    SessionPtr aMgr = ModelAPI_Session::get();
+    bool aToSendUpdate = aMgr->isOperation(); // inside of operation may send an update event
     if (myTrsf.get()) { // get shape of the base result and apply the transformation
       ResultPtr anOrigResult = baseRef();
       std::shared_ptr<GeomAPI_Shape> anOrigShape = anOrigResult->shape();
@@ -180,6 +183,10 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultPart::shape()
           aResult->setImpl(new TopoDS_Shape(aShape));
         }
       }
+      if (!myShape.IsNull() && aToSendUpdate) {
+        static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+        ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent);
+      }
       return aResult;
     } else {
       DocumentPtr aDoc = Model_ResultPart::partDoc();
@@ -205,9 +212,14 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultPart::shape()
         }
       }
     }
+    if (!myShape.IsNull() && aToSendUpdate) {
+      static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+      ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent);
+    }
   }
-  if (!myShape.IsNull())
+  if (!myShape.IsNull()) {
     aResult->setImpl(new TopoDS_Shape(myShape));
+  }
   return aResult;
 }
 
@@ -312,6 +324,24 @@ gp_Trsf Model_ResultPart::sumTrsf() {
   return aResult;
 }
 
+bool Model_ResultPart::combineGeometrical(const int theIndex, std::string& theNewName)
+{
+  std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(partDoc());
+  if (aDoc.get()) {
+    AttributeSelectionListPtr aSelAttr = aDoc->selectionInPartFeature();
+    AttributeSelectionPtr aThisAttr = aSelAttr->value(theIndex - 1);
+    if (aThisAttr.get()) {
+      aThisAttr->combineGeometrical();
+      if (aThisAttr->value().get()) {
+        int anIndex;
+        theNewName = nameInPart(aThisAttr->value(), anIndex);
+        return true;
+      }
+    }
+  }
+  return false; // something is wrong
+}
+
 std::shared_ptr<GeomAPI_Shape> Model_ResultPart::shapeInPart(
   const std::string& theName, const std::string& theType, int& theIndex)
 {
index b6a1305115ef082accb27186ce9e4342fec6dd2c..4be75fc07dfe526c190a045b383ab313a02f0b62 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_ResultPart_H_
@@ -79,6 +78,8 @@ class Model_ResultPart : public ModelAPI_ResultPart
   /// Returns the shape by the name in the part
   MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shapeInPart(
     const std::string& theName, const std::string& theType, int& theIndex);
+  /// Updates the selection inside of the part as a geometrical selection
+  MODEL_EXPORT virtual bool combineGeometrical(const int theIndex, std::string& theNewName);
   /// Updates the shape-result of the part (called on Part feature execution)
   MODEL_EXPORT virtual void updateShape();
   /// Applies the additional transformation of the part
diff --git a/src/Model/Model_SelectionNaming.cpp b/src/Model/Model_SelectionNaming.cpp
deleted file mode 100644 (file)
index 802b13c..0000000
+++ /dev/null
@@ -1,1218 +0,0 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-//
-// 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<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "Model_SelectionNaming.h"
-#include "Model_Document.h"
-#include "Model_Objects.h"
-#include "Model_Data.h"
-#include <ModelAPI_Feature.h>
-#include <Events_InfoMessage.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_ResultConstruction.h>
-#include <ModelAPI_CompositeFeature.h>
-#include <ModelAPI_ResultBody.h>
-#include <GeomAPI_Wire.h>
-#include <GeomAPI_Edge.h>
-
-#include <TopoDS_Iterator.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <BRep_Builder.hxx>
-#include <TNaming_Iterator.hxx>
-#include <TNaming_Tool.hxx>
-#include <TNaming_NamedShape.hxx>
-#include <TNaming_Localizer.hxx>
-#include <TNaming_SameShapeIterator.hxx>
-#include <TDataStd_Name.hxx>
-#include <TColStd_MapOfTransient.hxx>
-#include <Precision.hxx>
-#include <algorithm>
-#include <stdexcept>
-
-#ifdef DEB_NAMING
-#include <BRepTools.hxx>
-#endif
-
-Model_SelectionNaming::Model_SelectionNaming(TDF_Label theSelectionLab)
-{
-  myLab = theSelectionLab;
-}
-
-// searches named shape by the shape in the given document (identified by the label)
-// tries to find s shape nearest to the context-label
-static Handle(TNaming_NamedShape) shapeToNS(const TDF_Label theLabAccess,
-  const TopoDS_Shape& theShape, const TDF_Label& theContextLab)
-{
-  Handle(TNaming_NamedShape) aResult;
-  if (!TNaming_Tool::HasLabel(theLabAccess, theShape)) // no shape in the document
-    return aResult;
-  int aContextLabDepth = theContextLab.IsNull() ? 100 : theContextLab.Depth();
-  TNaming_SameShapeIterator aNSIter(theShape, theLabAccess);
-  for(; aNSIter.More(); aNSIter.Next()) {
-    TDF_Label aLabel = aNSIter.Label();
-    Handle(TNaming_NamedShape) aNS;
-    if (aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-      if (aNS->Evolution() != TNaming_SELECTED && aNS->Evolution() != TNaming_DELETE) {
-        // check this is new shape in this named shape
-        bool aIsNew = false;
-        for(TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next())
-          if (!aNSIter.NewShape().IsNull() && aNSIter.NewShape().IsSame(theShape))
-            aIsNew = true;
-        if (!aIsNew)
-          continue;
-        // check this is the context-shape
-        while(aLabel.Depth() > aContextLabDepth)
-          aLabel = aLabel.Father();
-        if (aLabel.IsEqual(theContextLab))
-          return aNS;
-        if (aResult.IsNull()) // take the first, otherwise it will get shapes from results, etc
-          aResult = aNS; // keep some result anyway - if there are no context labels return any
-      }
-    }
-  }
-  return aResult;
-}
-
-std::string Model_SelectionNaming::getShapeName(
-  std::shared_ptr<Model_Document> theDoc, const TopoDS_Shape& theShape,
-  ResultPtr& theContext, const bool theAnotherDoc, const bool theWholeContext)
-{
-  std::string aName;
-  // add the result name to the name of the shape
-  // (it was in BodyBuilder, but did not work on Result rename)
-  bool isNeedContextName = theContext->shape().get() != NULL;
-  // check if the subShape is already in DF
-  std::shared_ptr<Model_Data> aData =
-    std::dynamic_pointer_cast<Model_Data>(theContext->data());
-  TDF_Label aContextDataLab(aData.get() && aData->isValid() ? aData->label() : TDF_Label());
-  Handle(TNaming_NamedShape) aNS = shapeToNS(myLab, theShape, aContextDataLab);
-  Handle(TDataStd_Name) anAttr;
-  if(!aNS.IsNull() && !aNS->IsEmpty()) { // in the document
-    if(aNS->Label().FindAttribute(TDataStd_Name::GetID(), anAttr)) {
-      if (isNeedContextName && aData && aContextDataLab.IsEqual(aNS->Label())) {
-        // do nothing because this context name will be added later in this method
-      } else {
-        aName = TCollection_AsciiString(anAttr->Get()).ToCString();
-        // indexes are added to sub-shapes not primitives
-        // (primitives must not be located at the same label)
-        if(!aName.empty() && aNS->Evolution() != TNaming_PRIMITIVE && isNeedContextName) {
-          const TDF_Label& aLabel = aNS->Label();
-          static const std::string aPostFix("_");
-          TNaming_Iterator anItL(aNS);
-          for(int i = 1; anItL.More(); anItL.Next(), i++) {
-            // in #1766 IsEqual produced no index of the face
-            if(anItL.NewShape().IsSame(theShape)) {
-              aName += aPostFix;
-              aName += TCollection_AsciiString (i).ToCString();
-              break;
-            }
-          }
-        }
-        // if a shape is under another context, use this name, not theContext
-        std::shared_ptr<Model_Data> aContextData =
-          std::dynamic_pointer_cast<Model_Data>(theContext->data());
-        // for constructions the naming is in arguments and has no evolution, so, apply this only
-        // for bodies
-        if (isNeedContextName && theContext->groupName() == ModelAPI_ResultBody::group() &&
-            !aNS->Label().IsDescendant(aContextData->label())) {
-          isNeedContextName = false;
-          TDF_Label aNSDataLab = aNS->Label();
-          if (aNSDataLab.Depth() % 2 == 0)
-            aNSDataLab = aNSDataLab.Father();
-          ObjectPtr aNewContext = theDoc->objects()->object(aNSDataLab);
-          while(!aNewContext.get() && aNSDataLab.Depth() > 5) {
-            aNSDataLab = aNSDataLab.Father().Father();
-            aNewContext = theDoc->objects()->object(aNSDataLab);
-          }
-          if (aNewContext.get()) {
-            // this is to avoid duplicated names of results problem
-            std::string aContextName = aNewContext->data()->name();
-            // myLab corresponds to the current time
-            TDF_Label aCurrentLab = myLab;
-            while(aCurrentLab.Depth() > 3)
-              aCurrentLab = aCurrentLab.Father();
-
-            int aNumInHistoryNames =
-              theDoc->numberOfNameInHistory(aNewContext, aCurrentLab);
-            while(aNumInHistoryNames > 1) { // add "_" before name the needed number of times
-              aContextName = "_" + aContextName;
-              aNumInHistoryNames--;
-            }
-
-            aName = aContextName + "/" + aName;
-          }
-        }
-      }
-    }
-  }
-
-  // Name is empty and this is full context, it just add the whole context name that must be added
-  bool isEmptyName = aName.empty();
-  if (isNeedContextName && (!isEmptyName || theWholeContext)) {
-    aName = theContext->data()->name() + (isEmptyName ? "" : ("/" + aName));
-    if (theAnotherDoc)
-      aName = theContext->document()->kind() + "/" + aName; // PartSet
-  }
-  return aName;
-}
-
-bool isTrivial (const TopTools_ListOfShape& theAncestors, TopTools_IndexedMapOfShape& theSMap)
-{
-  // a trivial case: F1 & F2,  aNumber = 1, i.e. intersection gives 1 edge.
-  TopoDS_Compound aCmp;
-  BRep_Builder BB;
-  BB.MakeCompound(aCmp);
-  TopTools_ListIteratorOfListOfShape it(theAncestors);
-  for(;it.More();it.Next()) {
-    if (theSMap.Contains(it.Value()))
-      continue;
-    BB.Add(aCmp, it.Value());
-    theSMap.Add(it.Value());
-  }
-  int aNumber(0);
-  TopTools_IndexedDataMapOfShapeListOfShape aMap2;
-  TopExp::MapShapesAndAncestors(aCmp, TopAbs_EDGE, TopAbs_FACE, aMap2);
-  for (int i = 1; i <= aMap2.Extent(); i++) {
-    const TopoDS_Shape& aKey = aMap2.FindKey(i);
-    const TopTools_ListOfShape& anAncestors = aMap2.FindFromIndex(i);
-    if(anAncestors.Extent() > 1) aNumber++;
-  }
-  if(aNumber > 1) return false;
-  return true;
-}
-
-const TopoDS_Shape findCommonShape(
-  const TopAbs_ShapeEnum theType, const TopTools_ListOfShape& theList)
-{
-  if(theList.Extent() < 1) {
-    return TopoDS_Shape();
-  } else if (theList.Extent() == 1) { // check that sub-shape is bounded by this alone shape
-    TopTools_MapOfShape aSubsInShape;
-    TopExp_Explorer anExp(theList.First(), theType);
-    for(; anExp.More(); anExp.Next()) {
-      if (aSubsInShape.Contains(anExp.Current())) { // found duplicate
-        return anExp.Current();
-      }
-      aSubsInShape.Add(anExp.Current());
-    }
-  }
-
-  // Store in maps sub-shapes from each face.
-  std::vector<TopTools_MapOfShape> aVec;
-  for(TopTools_ListIteratorOfListOfShape anIt(theList); anIt.More(); anIt.Next()) {
-    const TopoDS_Shape aFace = anIt.Value();
-    TopTools_MapOfShape aMap;
-    for(TopExp_Explorer anExp(aFace, theType); anExp.More(); anExp.Next()) {
-      const TopoDS_Shape& aSubShape = anExp.Current();
-      aMap.Add(anExp.Current());
-    }
-    aVec.push_back(aMap);
-  }
-
-  // Find sub-shape shared between all faces.
-  TopoDS_Shape aSharedShape;
-  for(TopTools_MapIteratorOfMapOfShape anIt(aVec[0]); anIt.More(); anIt.Next()) {
-    const TopoDS_Shape& aSubShape = anIt.Value();
-    int aSharedNb = 1;
-    for(int anIndex = 1; anIndex < aVec.size(); ++anIndex) {
-      if(aVec[anIndex].Contains(aSubShape)) {
-        ++aSharedNb;
-      }
-    }
-    if(aSharedNb == theList.Extent()) {
-      if(aSharedShape.IsNull()) {
-        aSharedShape = aSubShape;
-      } else {
-        // More than one shape shared between all faces, return null shape in this case.
-        return TopoDS_Shape();
-      }
-    }
-  }
-
-  return aSharedShape;
-}
-
-// searches theType shape that contains theConnectionType sub-shapes in each shape from the List,
-// so, implements the neighbours searching
-/*
-const TopoDS_Shape findCommonShapeByNB(const TopAbs_ShapeEnum theType,
-  const TopAbs_ShapeEnum theConnectionType, const TopTools_ListOfShape& theList)
-{
-TopTools_MapOfShape aCheckedShapes; // already checked shapes of type theType
-  TopoDS_Shape aResult; // theType result shape
-  for(TopTools_ListIteratorOfListOfShape anIt(theList); anIt.More(); anIt.Next()) { // iterate all
-    for(TopExp_Explorer anExp(anIt.ChangeValue(), theType); anExp.More(); anExp.Next()) {
-      if (aCheckedShapes.Contains(anExp.Current()))
-        continue; // already checked
-      aCheckedShapes.Add(anExp.Current());
-      TopTools_MapOfShape aConnectors; // all connectors of the checked theType shape
-      for(TopExp_Explorer aCExp(anExp.Current(), theConnectionType); aCExp.More(); aCExp.Next()) {
-        aConnectors.Add(aCExp.Current());
-      }
-      // check that all shapes from the List contain the connector sub-shapes
-      bool aFound = true;
-      for(TopTools_ListIteratorOfListOfShape anIt2(theList); anIt2.More() && aFound; anIt2.Next()) {
-        if (anIt2.Value().IsSame(anIt.Value()))
-          continue;
-        aFound = false;
-        for(TopExp_Explorer anE(anIt2.ChangeValue(), theConnectionType); anE.More(); anE.Next()) {
-          if (aConnectors.Contains(anE.Current())) {
-            aFound = true;
-            break;
-          }
-        }
-      }
-      if (aFound) {
-        if (!aResult.IsNull()) // more than one result
-          return TopoDS_Shape();
-        aResult = anExp.Current();
-      }
-    }
-  }
-  return aResult;
-}*/
-
-std::string Model_SelectionNaming::vertexNameByEdges(TopoDS_Shape theContext, TopoDS_Shape theSub,
-  std::shared_ptr<Model_Document> theDoc, ResultPtr& theContextRes, const bool theAnotherDoc)
-{
-  std::string aResult;
-  TopTools_IndexedDataMapOfShapeListOfShape aMap;
-  TopExp::MapShapesAndAncestors(theContext, TopAbs_VERTEX, TopAbs_EDGE, aMap);
-  const TopTools_ListOfShape& aList22  = aMap.FindFromKey(theSub);
-  if(aList22.Extent() >= 2)  { // regular solution
-    TopTools_MapOfShape aFMap;
-    TopTools_ListOfShape aListE;
-    TopTools_ListIteratorOfListOfShape itl2(aList22);
-    for (int i = 1;itl2.More();itl2.Next(),i++) {
-      if(aFMap.Add(itl2.Value()))
-        aListE.Append(itl2.Value());
-    }
-    TopTools_ListIteratorOfListOfShape itl(aListE);
-    for (int i = 1;itl.More();itl.Next(),i++) {
-      const TopoDS_Shape& anEdge = itl.Value();
-      std::string anEdgeName = getShapeName(theDoc, anEdge, theContextRes, theAnotherDoc, false);
-      if (anEdgeName.empty()) { // edge is not in DS
-        aResult.clear();
-        return aResult;
-      }
-      if(i == 1)
-        aResult = anEdgeName;
-      else
-        aResult += "&" + anEdgeName;
-    }
-  }
-  return aResult;
-}
-
-std::string Model_SelectionNaming::namingName(ResultPtr& theContext,
-  std::shared_ptr<GeomAPI_Shape> theSubSh, const std::string& theDefaultName,
-  const bool theAnotherDoc)
-{
-  std::string aName("Undefined name");
-  if(!theContext.get()
-      || !theContext->shape().get()
-      || theContext->shape()->isNull()) {
-    return !theDefaultName.empty() ? theDefaultName : aName;
-  }
-
-  // if it is in result of another part
-  std::shared_ptr<Model_Document> aDoc =
-    std::dynamic_pointer_cast<Model_Document>(theContext->document());
-  if (theContext->groupName() == ModelAPI_ResultPart::group()) {
-    ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(theContext);
-    int anIndex;
-    if (theSubSh.get())
-      return aPart->data()->name() + "/" + aPart->nameInPart(theSubSh, anIndex);
-    else
-      return aPart->data()->name();
-  }
-
-  if (!theSubSh.get() || theSubSh->isNull()) { // no subshape, so just the whole feature name
-    // but if it is in another Part, add this part name
-    std::string aPartName;
-    if (theAnotherDoc)
-      aPartName = theContext->document()->kind() + "/"; // PartSet
-    return aPartName + theContext->data()->name();
-  }
-  TopoDS_Shape aSubShape = theSubSh->impl<TopoDS_Shape>();
-  TopoDS_Shape aContext  = theContext->shape()->impl<TopoDS_Shape>();
-#ifdef DEB_NAMING
-  if(aSubShape.ShapeType() == TopAbs_COMPOUND) {
-    BRepTools::Write(aSubShape, "Selection.brep");
-    BRepTools::Write(aContext, "Context.brep");
-  }
-#endif
-  aName = getShapeName(aDoc, aSubShape, theContext, theAnotherDoc,
-    theContext->shape()->isEqual(theSubSh));
-
-  if(aName.empty() ) { // not in the document!
-    TopAbs_ShapeEnum aType = aSubShape.ShapeType();
-    switch (aType) {
-    case TopAbs_FACE:
-      // the Face should be in DF. If it is not the case, it is an error ==> to be debugged
-      break;
-    case TopAbs_EDGE:
-      {
-        // name structure: F1 & F2 [& F3 & F4],
-        // where F1 & F2 the faces which gives the Edge in trivial case
-        // if it is not atrivial case we use localization by neighbours. F3 & F4 - neighbour faces
-        if (BRep_Tool::Degenerated(TopoDS::Edge(aSubShape))) {
-          aName = "Degenerated_Edge";
-          break;
-        }
-        TopTools_IndexedDataMapOfShapeListOfShape aMap;
-        TopExp::MapShapesAndAncestors(aContext, TopAbs_EDGE, TopAbs_FACE, aMap);
-        TopTools_IndexedMapOfShape aSMap; // map for ancestors of the sub-shape
-        bool isTrivialCase(true);
-        if(aMap.Contains(aSubShape)) {
-          const TopTools_ListOfShape& anAncestors = aMap.FindFromKey(aSubShape);
-          // check that it is not a trivial case (F1 & F2: aNumber = 1)
-          isTrivialCase = isTrivial(anAncestors, aSMap);
-          if (!isTrivialCase) { // another try: check that common shape can be processed anyway
-            isTrivialCase = !findCommonShape(TopAbs_EDGE, anAncestors).IsNull();
-          }
-        } else
-          break;
-        TopTools_MapOfShape aNbs;
-        if(!isTrivialCase) { // find Neighbors
-          TNaming_Localizer aLocalizer;
-          TopTools_MapOfShape aMap3;
-          aLocalizer.FindNeighbourg(aContext, aSubShape, aMap3);
-          //int n = aMap3.Extent();
-          TopTools_MapIteratorOfMapOfShape it(aMap3);
-          for(;it.More();it.Next()) {
-            const TopoDS_Shape& aNbShape = it.Key(); // neighbor edge
-            //TopAbs_ShapeEnum aType = aNbShape.ShapeType();
-            const TopTools_ListOfShape& aList  = aMap.FindFromKey(aNbShape);
-            TopTools_ListIteratorOfListOfShape it2(aList);
-            for(;it2.More();it2.Next()) {
-              if(aSMap.Contains(it2.Value())) continue; // skip this Face
-              aNbs.Add(it2.Value());
-            }
-          }
-        }  // else a trivial case
-
-        // build name of the sub-shape Edge
-        // iterate faces of the context to get stable order, not map-order
-        TopTools_MapOfShape aStoredFaces; // to avoid duplicates
-        for(TopExp_Explorer aContExp(aContext, TopAbs_FACE); aContExp.More(); aContExp.Next()) {
-          const TopoDS_Shape& aFace = aContExp.Current();
-          if (aStoredFaces.Contains(aFace) || !(aSMap.Contains(aFace) || aNbs.Contains(aFace)))
-            continue;
-          aStoredFaces.Add(aFace);
-          std::string aFaceName = getShapeName(aDoc, aFace, theContext, theAnotherDoc, false);
-          if(aName.empty())
-            aName = aFaceName;
-          else
-            aName += "&" + aFaceName;
-        }
-      }
-      break;
-
-    case TopAbs_VERTEX:
-      // name structure (Monifold Topology):
-      // 1) F1 | F2 | F3 - intersection of 3 faces defines a vertex - trivial case.
-      // 2) F1 | F2 | F3 [|F4 [|Fn]] - redundant definition,
-      //                               but it should be kept as is to obtain safe recomputation
-      // 2) F1 | F2      - intersection of 2 faces definses a vertex - applicable for case
-      //                   when 1 faces is cylindrical, conical, spherical or revolution and etc.
-      // 3) E1 | E2 | E3 - intersection of 3 edges defines a vertex - when we have case of a shell
-      //                   or compound of 2 open faces.
-      // 4) E1 | E2      - intesection of 2 edges defines a vertex - when we have a case of
-      //                   two independent edges (wire or compound)
-      // implemented 2 first cases
-      {
-        TopTools_IndexedDataMapOfShapeListOfShape aMap;
-        TopExp::MapShapesAndAncestors(aContext, TopAbs_VERTEX, TopAbs_FACE, aMap);
-        TopTools_ListOfShape aList;
-        TopTools_MapOfShape aFMap;
-        // simetimes when group is moved in history, naming may be badly updated, so
-        // avoid crash in FindFromKey (issue 1842)
-        if (aMap.Contains(aSubShape)) {
-          const TopTools_ListOfShape& aList2  = aMap.FindFromKey(aSubShape);
-          // fix is below
-          TopTools_ListIteratorOfListOfShape itl2(aList2);
-          for (int i = 1;itl2.More();itl2.Next(),i++) {
-            if(aFMap.Add(itl2.Value()))
-              aList.Append(itl2.Value());
-          }
-        } else
-          break;
-        int n = aList.Extent();
-        bool isByFaces = n >= 3;
-        if (isByFaces) { // check that by faces vertex is identified uniquly (2317)
-          TopoDS_Shape aVertex = findCommonShape(TopAbs_VERTEX, aList);
-          isByFaces = !aVertex.IsNull() && aVertex.ShapeType() == TopAbs_VERTEX;
-        }
-
-        if(!isByFaces) { // open topology case or Compound case => via edges
-          aName = vertexNameByEdges(aContext, aSubShape, aDoc, theContext, theAnotherDoc);
-          isByFaces = aName.empty();
-          if (isByFaces) { // try to find a vertex in sketch faces
-            ResultConstructionPtr aConstr =
-              std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theContext);
-            if (aConstr.get() && aConstr->facesNum()) {
-              for(int aFace = aConstr->facesNum() - 1; isByFaces && aFace >= 0; aFace--) {
-                std::shared_ptr<GeomAPI_Face> aGFace = aConstr->face(aFace);
-                aName = vertexNameByEdges(aGFace->impl<TopoDS_Face>(), aSubShape,
-                  aDoc, theContext, theAnotherDoc);
-                isByFaces = aName.empty();
-              }
-            }
-          }
-        }
-
-        if (isByFaces) {
-          TopTools_ListIteratorOfListOfShape itl(aList);
-          for (int i = 1;itl.More();itl.Next(),i++) {
-            const TopoDS_Shape& aFace = itl.Value();
-            std::string aFaceName = getShapeName(aDoc, aFace, theContext, theAnotherDoc, false);
-            if(i == 1)
-              aName = aFaceName;
-            else
-              aName += "&" + aFaceName;
-          }
-        }
-      }
-      break;
-    }
-  }
-  return aName;
-}
-
-TopAbs_ShapeEnum translateType (const std::string& theType)
-{
-  // map from the textual shape types to OCCT enumeration
-  static std::map<std::string, TopAbs_ShapeEnum> aShapeTypes;
-
-  if(aShapeTypes.size() == 0) {
-    aShapeTypes["compound"]   = TopAbs_COMPOUND;
-    aShapeTypes["compounds"]  = TopAbs_COMPOUND;
-    aShapeTypes["compsolid"]  = TopAbs_COMPSOLID;
-    aShapeTypes["compsolids"] = TopAbs_COMPSOLID;
-    aShapeTypes["solid"]      = TopAbs_SOLID;
-    aShapeTypes["solids"]     = TopAbs_SOLID;
-    aShapeTypes["shell"]      = TopAbs_SHELL;
-    aShapeTypes["shells"]     = TopAbs_SHELL;
-    aShapeTypes["face"]       = TopAbs_FACE;
-    aShapeTypes["faces"]      = TopAbs_FACE;
-    aShapeTypes["wire"]       = TopAbs_WIRE;
-    aShapeTypes["wires"]      = TopAbs_WIRE;
-    aShapeTypes["edge"]       = TopAbs_EDGE;
-    aShapeTypes["edges"]      = TopAbs_EDGE;
-    aShapeTypes["vertex"]     = TopAbs_VERTEX;
-    aShapeTypes["vertices"]   = TopAbs_VERTEX;
-    aShapeTypes["COMPOUND"]   = TopAbs_COMPOUND;
-    aShapeTypes["COMPOUNDS"]  = TopAbs_COMPOUND;
-    aShapeTypes["COMPSOLID"]  = TopAbs_COMPSOLID;
-    aShapeTypes["COMPSOLIDS"] = TopAbs_COMPSOLID;
-    aShapeTypes["SOLID"]      = TopAbs_SOLID;
-    aShapeTypes["SOLIDS"]     = TopAbs_SOLID;
-    aShapeTypes["SHELL"]      = TopAbs_SHELL;
-    aShapeTypes["SHELLS"]     = TopAbs_SHELL;
-    aShapeTypes["FACE"]       = TopAbs_FACE;
-    aShapeTypes["FACES"]      = TopAbs_FACE;
-    aShapeTypes["WIRE"]       = TopAbs_WIRE;
-    aShapeTypes["WIRES"]      = TopAbs_WIRE;
-    aShapeTypes["EDGE"]       = TopAbs_EDGE;
-    aShapeTypes["EDGES"]      = TopAbs_EDGE;
-    aShapeTypes["VERTEX"]     = TopAbs_VERTEX;
-    aShapeTypes["VERTICES"]   = TopAbs_VERTEX;
-  }
-  if (aShapeTypes.find(theType) != aShapeTypes.end())
-    return aShapeTypes[theType];
-  Events_InfoMessage("Model_SelectionNaming",
-    "Shape type defined in XML is not implemented!").send();
-  return TopAbs_SHAPE;
-}
-
-const TopoDS_Shape getShapeFromNS(
-  const std::string& theSubShapeName, Handle(TNaming_NamedShape) theNS)
-{
-  TopoDS_Shape aSelection;
-  std::string::size_type n = theSubShapeName.rfind('/');
-  if (n == std::string::npos) n = -1;
-  std::string aSubString = theSubShapeName.substr(n + 1);
-  n = aSubString.rfind('_');
-  int indx = 1;
-  if (n != std::string::npos) {// for primitives this is a first
-    // if we have here the same name as theSubShapeName, there is no index in compound, it is whole
-    Handle(TDataStd_Name) aName;
-    if (!theNS->Label().FindAttribute(TDataStd_Name::GetID(), aName) ||
-        aName->Get() != aSubString.c_str()) {
-      aSubString = aSubString.substr(n+1);
-      indx = atoi(aSubString.c_str());
-    }
-  }
-
-  TNaming_Iterator anItL(theNS);
-  for(int i = 1; anItL.More(); anItL.Next(), i++) {
-    if (i == indx) {
-      return anItL.NewShape();
-    }
-  }
-  return aSelection;
-}
-
-const TopoDS_Shape findFaceByName(
-  const std::string& theSubShapeName, std::shared_ptr<Model_Document> theDoc,
-  const ResultPtr theDetectedContext, bool theContextIsUnique)
-{
-  TopoDS_Shape aFace;
-  std::string aSubString = theSubShapeName;
-
-  static const ResultPtr anEmpty;
-  TDF_Label aLabel = theDoc->findNamingName(aSubString,
-    theContextIsUnique ? theDetectedContext : anEmpty);
-  if (aLabel.IsNull()) { // try to remove additional artificial suffix
-    std::string::size_type n = aSubString.rfind('_');
-    if (n != std::string::npos) {
-      aSubString = aSubString.substr(0, n);
-      aLabel = theDoc->findNamingName(aSubString,
-        theContextIsUnique ? theDetectedContext : anEmpty);
-    }
-  }
-  if(aLabel.IsNull()) return aFace;
-  Handle(TNaming_NamedShape) aNS;
-  if(aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-    aFace = getShapeFromNS(theSubShapeName, aNS);
-  }
-  return aFace;
-}
-
-size_t ParseName(const std::string& theSubShapeName,   std::list<std::string>& theList)
-{
-  std::string aName = theSubShapeName;
-  std::string aLastName = aName;
-  size_t n1(0), n2(0); // n1 - start position, n2 - position of the delimiter
-  while ((n2 = aName.find('&', n1)) != std::string::npos) {
-    const std::string aName1 = aName.substr(n1, n2 - n1); //name of face
-    theList.push_back(aName1);
-    n1 = n2 + 1;
-    aLastName = aName.substr(n1);
-  }
-  if(!aLastName.empty())
-    theList.push_back(aLastName);
-  return theList.size();
-}
-
-std::string getContextName(const std::string& theSubShapeName)
-{
-  std::string aName;
-  std::string::size_type n = theSubShapeName.find('/');
-  if (n == std::string::npos) return theSubShapeName;
-  aName = theSubShapeName.substr(0, n);
-  return aName;
-}
-
-/// Parses naming name of sketch sub-elements: takes indices and orientation
-/// (if theOriented = true) from this name. Map theIDs constains indices ->
-/// orientations and start/end vertices: negative is reversed, 2 - start, 3 - end
-bool parseSubIndices(CompositeFeaturePtr theComp, //< to iterate names
-  const std::string& theName, const char* theShapeType,
-  std::map<int, int>& theIDs, const bool theOriented = false)
-{
-  // collect all IDs in the name
-  std::map<std::string, int> aNames; // short name of sub -> ID of sub of theComp
-  const int aSubNum = theComp->numberOfSubs();
-  for(int a = 0; a < aSubNum; a++) {
-    FeaturePtr aSub = theComp->subFeature(a);
-    const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-    std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes = aResults.cbegin();
-    // there may be many shapes (circle and center)
-    for(; aRes != aResults.cend(); aRes++) {
-      ResultConstructionPtr aConstr =
-        std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-      if (aConstr.get()) {
-        aNames[Model_SelectionNaming::shortName(aConstr)] = theComp->subFeatureId(a);
-      }
-    }
-  }
-
-  size_t aPrevPos = theName.find("/") + 1, aLastNamePos;
-  bool isShape = false; // anyway the first world must be 'Vertex'
-  do {
-    aLastNamePos = theName.find('-', aPrevPos);
-    std::string anID = theName.substr(aPrevPos, aLastNamePos - aPrevPos);
-    if (!isShape) {
-      if (anID != theShapeType)
-        return false;
-      isShape = true;
-    } else {
-      int anOrientation = 1; // default
-      if (theOriented) { // here must be a symbol in the end of digit 'f' or 'r'
-        std::string::iterator aSymbol = anID.end() - 1;
-        if (*aSymbol == 'r') anOrientation = -1;
-        anID.erase(aSymbol); // remove last symbol
-      }
-      // check start/end symbols
-      std::string::iterator aBack = anID.end() - 1;
-      if (*aBack == 's') {
-        anOrientation *= 2;
-        anID.erase(aBack); // remove last symbol
-      } else if (*aBack == 'e') {
-        anOrientation *= 3;
-        anID.erase(aBack); // remove last symbol
-      }
-
-      if (aNames.find(anID) != aNames.end()) {
-        theIDs[aNames[anID]] = anOrientation;
-      }
-    }
-    aPrevPos = aLastNamePos + 1;
-  } while (aLastNamePos != std::string::npos);
-  return true;
-}
-
-/// produces theEdge orientation relatively to theContext face
-int Model_SelectionNaming::edgeOrientation(const TopoDS_Shape& theContext, TopoDS_Edge& theEdge)
-{
-  if (theContext.ShapeType() != TopAbs_FACE && theContext.ShapeType() != TopAbs_WIRE)
-    return 0;
-  if (theEdge.Orientation() == TopAbs_FORWARD)
-    return 1;
-  if (theEdge.Orientation() == TopAbs_REVERSED)
-    return -1;
-  return 0; // unknown
-}
-
-int Model_CurvesHasher::HashCode(const Handle(Geom_Curve)& theCurve, const Standard_Integer Upper)
-{
-  double aFirstParam = theCurve->FirstParameter();
-  if (aFirstParam < -1.e+100 || aFirstParam > 1.e+100)
-    aFirstParam = 0;
-  double aLastParam = theCurve->LastParameter();
-  if (aLastParam < -1.e+100 || aLastParam > 1.e+100)
-    aLastParam = 2;
-  else aLastParam = (aLastParam + aFirstParam) / 2.; // to avoid in periodic same first and last
-
-  gp_XYZ aCoordSum = theCurve->Value(aFirstParam).XYZ() + theCurve->Value(aLastParam).XYZ();
-  return ::HashCode(aCoordSum.X() + aCoordSum.Y() / 123. + aCoordSum.Z() / 123456., Upper);
-}
-bool Model_CurvesHasher::IsEqual(const Handle(Geom_Curve)& theC1, const Handle(Geom_Curve)& theC2)
-{
-  if (theC1->DynamicType() != theC2->DynamicType())
-    return false;
-  double aFirstParam1 = theC1->FirstParameter();
-  if (aFirstParam1 < -1.e+100 || aFirstParam1 > 1.e+100)
-    aFirstParam1 = 0;
-  double aFirstParam2 = theC2->FirstParameter();
-  if (aFirstParam2 < -1.e+100 || aFirstParam2 > 1.e+100)
-    aFirstParam2 = 0;
-  if (fabs(aFirstParam1 - aFirstParam2) > 1.e-9)
-    return false;
-
-  double aLastParam1 = theC1->LastParameter();
-  if (aLastParam1 < -1.e+100 || aLastParam1 > 1.e+100)
-    aLastParam1 = 2.;
-  else aLastParam1 = (aLastParam1 + aFirstParam1) / 2.; // to avoid in periodic same first and last
-  double aLastParam2 = theC2->LastParameter();
-  if (aLastParam2 < -1.e+100 || aLastParam2 > 1.e+100)
-    aLastParam2 = 2.;
-  else aLastParam2 = (aLastParam2 + aFirstParam2) / 2.; // to avoid in periodic same first and last
-
-  if (fabs(aLastParam1 - aLastParam2) > 1.e-9)
-    return false;
-
-  return theC1->Value(aFirstParam1).IsEqual(theC2->Value(aFirstParam2), Precision::Confusion()) &&
-    theC1->Value(aLastParam1).IsEqual(theC2->Value(aLastParam2), Precision::Confusion());
-}
-
-int Model_EdgesHasher::HashCode(const TopoDS_Edge& theEdge, const Standard_Integer Upper)
-{
-  Standard_Real aFirst, aLast;
-  Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
-  return Model_CurvesHasher::HashCode(aCurve, Upper);
-}
-
-bool Model_EdgesHasher::IsEqual(const TopoDS_Edge& theE1, const TopoDS_Edge& theE2)
-{
-  GeomEdgePtr aSh1(new GeomAPI_Edge);
-  aSh1->setImpl(new TopoDS_Shape(theE1));
-  GeomEdgePtr aSh2(new GeomAPI_Edge);
-  aSh2->setImpl(new TopoDS_Shape(theE2));
-  return aSh1->isEqual(aSh2);
-}
-
-std::shared_ptr<GeomAPI_Shape> Model_SelectionNaming::findAppropriateFace(
-  std::shared_ptr<ModelAPI_Result>& theConstr,
-  NCollection_DataMap<Handle(Geom_Curve), int, Model_CurvesHasher>& theCurves, const bool theIsWire)
-{
-  int aBestFound = 0; // best number of found edges (not percentage: issue 1019)
-  int aBestNotFound = 1000000; // best number of not found edges (must be minimum)
-  int aBestOrient = 0; // for the equal "BestFound" additional parameter is orientation
-  std::shared_ptr<GeomAPI_Shape> aResult;
-  ResultConstructionPtr aConstructionContext =
-      std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theConstr);
-  if (!aConstructionContext.get())
-    return aResult;
-  for(int aFaceIndex = 0; aFaceIndex < aConstructionContext->facesNum(); aFaceIndex++) {
-    int aFound = 0, aNotFound = 0, aSameOrientation = 0;
-    TopoDS_Face aFace =
-      TopoDS::Face(aConstructionContext->face(aFaceIndex)->impl<TopoDS_Shape>());
-    std::list<TopoDS_Shape> aFacesWires; // faces or wires to iterate
-    if (theIsWire) {
-      for(TopExp_Explorer aWires(aFace, TopAbs_WIRE); aWires.More(); aWires.Next()) {
-        aFacesWires.push_back(aWires.Current());
-      }
-    } else {
-      aFacesWires.push_back(aFace);
-    }
-    std::list<TopoDS_Shape>::iterator aFW = aFacesWires.begin();
-    for(; aFW != aFacesWires.end(); aFW++) {
-      TopExp_Explorer anEdgesExp(*aFW, TopAbs_EDGE);
-      TColStd_MapOfTransient alreadyProcessed; // to avoid counting edges with same curves (841)
-      for(; anEdgesExp.More(); anEdgesExp.Next()) {
-        TopoDS_Edge anEdge = TopoDS::Edge(anEdgesExp.Current());
-        if (!anEdge.IsNull()) {
-          Standard_Real aFirst, aLast;
-          Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-          if (alreadyProcessed.Contains(aCurve))
-            continue;
-          alreadyProcessed.Add(aCurve);
-          if (theCurves.IsBound(aCurve)) {
-            aFound++;
-            int anOrient = theCurves.Find(aCurve);
-            if (anOrient != 0) {  // extra comparision score is orientation
-              if (edgeOrientation(aFace, anEdge) == anOrient)
-                aSameOrientation++;
-            }
-          } else {
-            aNotFound++;
-          }
-        }
-      }
-      if (theIsWire && aFound + aNotFound != 0) {
-        if (aBestNotFound > aNotFound || (aBestNotFound == aNotFound && aFound > aBestFound) ||
-          (aBestNotFound == aNotFound && aFound == aBestFound && aSameOrientation > aBestOrient)) {
-          aBestFound = aFound;
-          aBestOrient = aSameOrientation;
-          aBestNotFound = aNotFound;
-          std::shared_ptr<GeomAPI_Wire> aWire(new GeomAPI_Wire);
-          aWire->setImpl(new TopoDS_Shape(*aFW));
-          aResult = aWire;
-        }
-        aFound = 0;
-        aNotFound = 0;
-        aSameOrientation = 0;
-      }
-    }
-    if (!theIsWire) {
-      if (aFound + aNotFound != 0) {
-        if (aBestNotFound > aNotFound || (aBestNotFound == aNotFound && aFound > aBestFound) ||
-          (aBestNotFound == aNotFound && aFound == aBestFound && aSameOrientation > aBestOrient)) {
-          aBestFound = aFound;
-          aBestOrient = aSameOrientation;
-          aBestNotFound = aNotFound;
-          aResult = aConstructionContext->face(aFaceIndex);
-        }
-      }
-    }
-  }
-  return aResult;
-}
-
-std::string Model_SelectionNaming::shortName(
-  std::shared_ptr<ModelAPI_ResultConstruction>& theConstr, const int theEdgeVertexPos)
-{
-  std::string aName = theConstr->data()->name();
-  // remove "-", "/" and "&" command-symbols
-  aName.erase(std::remove(aName.begin(), aName.end(), '-'), aName.end());
-  aName.erase(std::remove(aName.begin(), aName.end(), '/'), aName.end());
-  aName.erase(std::remove(aName.begin(), aName.end(), '&'), aName.end());
-  // remove the last 's', 'e', 'f' and 'r' symbols:
-  // they are used as markers of start/end/forward/rewersed indicators
-  static const std::string aSyms("sefr");
-  std::string::iterator aSuffix = aName.end() - 1;
-  while(aSyms.find(*aSuffix) != std::string::npos) {
-    --aSuffix;
-  }
-  aName.erase(aSuffix + 1, aName.end());
-
-  if (theEdgeVertexPos == 1) {
-    aName += "s"; // start
-  } else if (theEdgeVertexPos == 2) {
-    aName += "e"; // end
-  }
-  return aName;
-}
-
-// type ::= COMP | COMS | SOLD | SHEL | FACE | WIRE | EDGE | VERT
-bool Model_SelectionNaming::selectSubShape(const std::string& theType,
-  const std::string& theSubShapeName, std::shared_ptr<Model_Document> theDoc,
-  std::shared_ptr<GeomAPI_Shape>& theShapeToBeSelected, std::shared_ptr<ModelAPI_Result>& theCont)
-{
-  if(theSubShapeName.empty() || theType.empty()) return false;
-  TopAbs_ShapeEnum aType = translateType(theType);
-
-  // check that it was selected in another document
-  size_t aSlash = theSubShapeName.find("/");
-  std::string aSubShapeName = theSubShapeName;
-  std::shared_ptr<Model_Document> aDoc = theDoc;
-  if (aSlash != std::string::npos) {
-    std::string aDocName = theSubShapeName.substr(0, aSlash);
-    ResultPartPtr aFoundPart;
-    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    if (aDocName == aRootDoc->kind()) {
-      aDoc = std::dynamic_pointer_cast<Model_Document>(aRootDoc);
-    } else {
-      for (int a = aRootDoc->size(ModelAPI_ResultPart::group()) - 1; a >= 0; a--) {
-        ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(
-            aRootDoc->object(ModelAPI_ResultPart::group(), a));
-        if (aPart.get() && aPart->isActivated() && aPart->data()->name() == aDocName) {
-          aDoc = std::dynamic_pointer_cast<Model_Document>(aPart->partDoc());
-          aFoundPart = aPart;
-          break;
-        }
-      }
-    }
-    if (aDoc != theDoc) {
-      // so, the first word is the document name => reduce the string for the next manips
-      aSubShapeName = theSubShapeName.substr(aSlash + 1);
-      if (aSubShapeName.empty() && aFoundPart.get()) { // the whole Part result
-        theCont = aFoundPart;
-        return true;
-      }
-    }
-  }
-
-  std::string aContName = getContextName(aSubShapeName);
-  if(aContName.empty()) return false;
-  bool anUniqueContext = false;
-  ResultPtr aCont = aDoc->findByName(aContName, aSubShapeName, anUniqueContext);
-   // possible this is body where postfix is added to distinguish several shapes on the same label
-  int aSubShapeId = -1; // -1 means sub shape not found
-  // for result body the name wihtout "_" has higher priority than with it: it is always added
-  if ((!aCont.get()/* || (aCont->groupName() == ModelAPI_ResultBody::group())*/) &&
-       aContName == aSubShapeName) {
-    size_t aPostIndex = aContName.rfind('_');
-    if (aPostIndex != std::string::npos) {
-      std::string anEmpty, aSubContName = aContName.substr(0, aPostIndex);
-      ResultPtr aSubCont = aDoc->findByName(aSubContName, anEmpty, anUniqueContext);
-      if (aSubCont.get()) {
-        try {
-          std::string aNum = aContName.substr(aPostIndex + 1);
-          aSubShapeId = std::stoi(aNum);
-        } catch (std::invalid_argument&) {
-          aSubShapeId = -1;
-        }
-        if (aSubShapeId > 0) {
-          aContName = aSubContName;
-          aCont = aSubCont;
-        }
-      }
-    }
-  }
-
-
-  static const ResultPtr anEmpty;
-  TopoDS_Shape aSelection;
-  switch (aType)
-  {
-  case TopAbs_FACE:
-  case TopAbs_WIRE:
-    {
-      aSelection = findFaceByName(aSubShapeName, aDoc, aCont, anUniqueContext);
-    }
-    break;
-  case TopAbs_EDGE:
-    {
-      const TDF_Label& aLabel =
-        aDoc->findNamingName(aSubShapeName, anUniqueContext ? aCont : anEmpty);
-      if(!aLabel.IsNull()) {
-        Handle(TNaming_NamedShape) aNS;
-        if(aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-          aSelection = getShapeFromNS(aSubShapeName, aNS);
-        }
-      }
-    }
-    break;
-  case TopAbs_VERTEX:
-    {
-      const TDF_Label& aLabel =
-        aDoc->findNamingName(aSubShapeName, anUniqueContext ? aCont : anEmpty);
-      if(!aLabel.IsNull()) {
-        Handle(TNaming_NamedShape) aNS;
-        if(aLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
-          aSelection = getShapeFromNS(aSubShapeName, aNS);
-        }
-      }
-    }
-    break;
-  case TopAbs_COMPOUND:
-  case TopAbs_COMPSOLID:
-  case TopAbs_SOLID:
-  case TopAbs_SHELL:
-  default: {//TopAbs_SHAPE
-    /// case when the whole sketch is selected, so,
-    /// selection type is compound, but there is no value
-    if (aCont.get() && aCont->shape().get()) {
-      if (aCont->shape()->impl<TopoDS_Shape>().ShapeType() == aType) {
-        theCont = aCont;
-        return true;
-      } else if (aSubShapeId > 0) { // try to find sub-shape by the index
-        TopExp_Explorer anExp(aCont->shape()->impl<TopoDS_Shape>(), aType);
-        for(; aSubShapeId > 1 && anExp.More(); aSubShapeId--) {
-          anExp.Next();
-        }
-        if (anExp.More()) {
-          std::shared_ptr<GeomAPI_Shape> aShapeToBeSelected(new GeomAPI_Shape());
-          aShapeToBeSelected->setImpl(new TopoDS_Shape(anExp.Current()));
-          theShapeToBeSelected = aShapeToBeSelected;
-          theCont = aCont;
-          return true;
-        }
-      }
-    }
-    return false;
-    }
-  }
-  if (!aSelection.IsNull() &&
-      aSelection.ShapeType() != aType && aSelection.ShapeType() != TopAbs_COMPOUND)
-      aSelection.Nullify(); // to avoid selection of face instead of edge that is described by face
-  // another try to find edge or vertex by faces
-  std::list<std::string> aListofNames;
-  size_t aN = aSelection.IsNull() ? ParseName(aSubShapeName, aListofNames) : 0;
-  if ((aSelection.IsNull() && (aType == TopAbs_EDGE || aType == TopAbs_VERTEX)) ||
-      (!aSelection.IsNull() && aSelection.ShapeType() != aType)) { // edge by one face as example
-    if(aN >= 1) {
-      TopTools_ListOfShape aList;
-      std::list<std::string>::iterator it = aListofNames.begin();
-      for(; it != aListofNames.end(); it++) {
-        ResultPtr aFaceContext = aCont;
-        if (it != aListofNames.begin()) { // there may be other context for different sub-faces
-          std::string aContName = getContextName(*it);
-          if(!aContName.empty()) {
-            aFaceContext = aDoc->findByName(aContName, *it, anUniqueContext);
-          }
-        }
-        TopoDS_Shape aFace = findFaceByName(*it, aDoc, aFaceContext, anUniqueContext);
-        if (aFace.IsNull() && aFaceContext.get() &&
-            aFaceContext->groupName() == ModelAPI_ResultConstruction::group() ) {
-          // search the construction sub-elements for the intersection if they are in the tree
-          size_t aSlash = it->find("/");
-          if (aSlash != std::string::npos) {
-            std::string aSubShapeName = it->substr(aSlash + 1);
-            aFace = findFaceByName(aSubShapeName, aDoc, aFaceContext, true);
-          }
-        }
-        if(!aFace.IsNull())
-          aList.Append(aFace);
-      }
-      aSelection = findCommonShape(aType, aList);
-      //if (aSelection.IsNull() && aType == TopAbs_EDGE) { // try to find selection by neighbours
-      //  aSelection = findCommonShapeByNB(aType, TopAbs_VERTEX, aList);
-      //}
-    }
-  }
-  // in case of construction, there is no registered names for all sub-elements,
-  // even for the main element; so, trying to find them by name (without "&" intersections)
-  if (aSelection.IsNull() && aN < 2) {
-    size_t aConstrNamePos = aSubShapeName.find("/");
-    bool isFullName = aConstrNamePos == std::string::npos;
-    std::string anEmpty, aContrName = aContName;
-    ResultPtr aConstr = aDoc->findByName(aContrName, anEmpty, anUniqueContext);
-    if (aConstr.get() && aConstr->groupName() == ModelAPI_ResultConstruction::group()) {
-      theCont = aConstr;
-      if (isFullName) {
-        // For the full construction selection shape must be empty.
-        //theShapeToBeSelected = aConstr->shape();
-        return true;
-      }
-      // for sketch sub-elements selected
-      CompositeFeaturePtr aComposite =
-        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aDoc->feature(aConstr));
-      if (aComposite.get()) {
-        if (aType == TopAbs_VERTEX || aType == TopAbs_EDGE) {
-          // collect all IDs in the name
-          bool isVertexByEdge = false;
-          std::map<int, int> anIDs;
-          if (!parseSubIndices(aComposite, aSubShapeName,
-              aType == TopAbs_EDGE ? "Edge" : "Vertex", anIDs)) {
-            // there is a case when vertex is identified by one circle-edge (2253)
-            if (aType == TopAbs_VERTEX &&
-                parseSubIndices(aComposite, aSubShapeName, "Edge", anIDs))
-              isVertexByEdge = true;
-            else
-              return false;
-          }
-
-          const int aSubNum = aComposite->numberOfSubs();
-          for(int a = 0; a < aSubNum; a++) {
-            int aCompID = aComposite->subFeatureId(a);
-            if (anIDs.find(aCompID) != anIDs.end()) { // found the vertex/edge shape
-              FeaturePtr aSub = aComposite->subFeature(a);
-              const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-              std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIt = aResults.cbegin();
-              // there may be many shapes (circle and center)
-              for(; aRIt != aResults.cend(); aRIt++) {
-                ResultConstructionPtr aRes =
-                  std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRIt);
-                if (aRes) {
-                  int anOrientation = abs(anIDs[aCompID]);
-                  TopoDS_Shape aShape = aRes->shape()->impl<TopoDS_Shape>();
-                  if (anOrientation == 1) {
-                    if (!isVertexByEdge && aType == aShape.ShapeType()) {
-                      theShapeToBeSelected = aRes->shape();
-                      return true;
-                    } else if (isVertexByEdge && aType != aShape.ShapeType()) {
-                      // check that there is only one vertex produces by and circular edge
-                      TopoDS_Shape aShape = aRes->shape()->impl<TopoDS_Shape>();
-                      TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
-                      if (anExp.More())
-                        aShape = anExp.Current();
-                      anExp.Next();
-                      if (!anExp.More() || anExp.Current().IsSame(aShape)) {
-                        std::shared_ptr<GeomAPI_Shape> aShapeToBeSelected(new GeomAPI_Shape());
-                        aShapeToBeSelected->setImpl(new TopoDS_Shape(aShape));
-                        theShapeToBeSelected = aShapeToBeSelected;
-                        return true;
-                      }
-                    }
-                  } else { // take first or second vertex of the edge
-                    TopoDS_Shape aShape = aRes->shape()->impl<TopoDS_Shape>();
-                    if (aShape.ShapeType() == TopAbs_VERTEX) continue;
-                    TopExp_Explorer anExp(aShape, aType);
-                    for(; anExp.More() && anOrientation != 2; anOrientation--)
-                      anExp.Next();
-                    if (anExp.More()) {
-                      std::shared_ptr<GeomAPI_Shape> aShapeToBeSelected(new GeomAPI_Shape());
-                      aShapeToBeSelected->setImpl(new TopoDS_Shape(anExp.Current()));
-                      theShapeToBeSelected = aShapeToBeSelected;
-                      return true;
-                    }
-                  }
-                }
-              }
-            }
-          }
-          // sketch faces is identified by format "Sketch_1/Face-2f-8f-11r"
-        } else if (aType == TopAbs_FACE || aType == TopAbs_WIRE) {
-          std::map<int, int> anIDs;
-          if (!parseSubIndices(aComposite, aSubShapeName,
-              aType == TopAbs_FACE ? "Face" : "Wire", anIDs, true))
-            return false;
-
-          // curves and orientations of edges
-          NCollection_DataMap<Handle(Geom_Curve), int, Model_CurvesHasher> allCurves;
-          const int aSubNum = aComposite->numberOfSubs();
-          for(int a = 0; a < aSubNum; a++) {
-            int aSubID = aComposite->subFeatureId(a);
-            if (anIDs.find(aSubID) != anIDs.end()) {
-              FeaturePtr aSub = aComposite->subFeature(a);
-              const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-              std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes;
-              for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) {
-                ResultConstructionPtr aConstr =
-                  std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-                if (aConstr->shape() && aConstr->shape()->isEdge()) {
-                  const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-                  TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-                  if (!anEdge.IsNull()) {
-                    Standard_Real aFirst, aLast;
-                    Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-                    allCurves.Bind(aCurve, anIDs[aSubID] > 0 ? 1 : -1);
-                  }
-                }
-              }
-            }
-          }
-          std::shared_ptr<GeomAPI_Shape> aFoundFW =
-            findAppropriateFace(aConstr, allCurves, aType == TopAbs_WIRE);
-          if (aFoundFW.get()) {
-            theShapeToBeSelected = aFoundFW;
-            return true;
-          }
-        } else if (aType == TopAbs_WIRE) {
-          // sketch faces is identified by format "Sketch_1/Face-2f-8f-11r"
-          std::map<int, int> anIDs;
-          if (!parseSubIndices(aComposite, aSubShapeName, "Wire", anIDs))
-            return false;
-
-           // curves and orientations of edges
-          NCollection_DataMap<Handle(Geom_Curve), int, Model_CurvesHasher> allCurves;
-          const int aSubNum = aComposite->numberOfSubs();
-          for(int a = 0; a < aSubNum; a++) {
-            int aSubID = aComposite->subFeatureId(a);
-            if (anIDs.find(aSubID) != anIDs.end()) {
-              FeaturePtr aSub = aComposite->subFeature(a);
-              const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aSub->results();
-              std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRes;
-              for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) {
-                ResultConstructionPtr aConstr =
-                  std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aRes);
-                if (aConstr->shape() && aConstr->shape()->isEdge()) {
-                  const TopoDS_Shape& aResShape = aConstr->shape()->impl<TopoDS_Shape>();
-                  TopoDS_Edge anEdge = TopoDS::Edge(aResShape);
-                  if (!anEdge.IsNull()) {
-                    Standard_Real aFirst, aLast;
-                    Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFirst, aLast);
-                    allCurves.Bind(aCurve, anIDs[aSubID] > 0 ? 1 : -1);
-                  }
-                }
-              }
-            }
-          }
-          std::shared_ptr<GeomAPI_Shape> aFoundFW =
-            findAppropriateFace(aConstr, allCurves, aType == TopAbs_WIRE);
-          if (aFoundFW.get()) {
-            theShapeToBeSelected = aFoundFW;
-            return true;
-          }
-        }
-      }
-    }
-  } else if (aSelection.IsNull() && aN >= 2 && aType == TopAbs_VERTEX) {
-    // support of shape name as intersection separated by "&"
-    static std::string anEdgeType = "edge"; // for now it works only with su-edges
-    std::list<std::string>::iterator aSubNames = aListofNames.begin();
-    TopTools_ListOfShape aSubsList;
-    for(; aSubNames != aListofNames.end(); aSubNames++) {
-      std::string aSubName = *aSubNames;
-      std::shared_ptr<GeomAPI_Shape> aSubShapeFound;
-      std::shared_ptr<ModelAPI_Result> aContextFound;
-      if (selectSubShape(anEdgeType, aSubName, theDoc, aSubShapeFound, aContextFound)) {
-        if (aSubShapeFound.get())
-          aSubsList.Append(aSubShapeFound->impl<TopoDS_Shape>());
-      }
-    }
-    aSelection = findCommonShape(TopAbs_VERTEX, aSubsList);
-  }
-  if (!aSelection.IsNull()) {
-    // Select it (must be after N=0 checking,
-    // since for simple constructions the shape must be null)
-    std::shared_ptr<GeomAPI_Shape> aShapeToBeSelected(new GeomAPI_Shape());
-    aShapeToBeSelected->setImpl(new TopoDS_Shape(aSelection));
-    theShapeToBeSelected = aShapeToBeSelected;
-    theCont = aCont;
-    return true;
-  }
-
-  return false;
-}
diff --git a/src/Model/Model_SelectionNaming.h b/src/Model/Model_SelectionNaming.h
deleted file mode 100644 (file)
index 3494369..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-//
-// 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<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef Model_SelectionNaming_H_
-#define Model_SelectionNaming_H_
-
-#include <ModelAPI_Result.h>
-#include <GeomAPI_Shape.h>
-#include <Model_Document.h>
-#include <TDF_Label.hxx>
-#include <TopoDS_Shape.hxx>
-#include <NCollection_DataMap.hxx>
-#include <Geom_Curve.hxx>
-#include <TopoDS_Edge.hxx>
-
-// class to compare curves in the same way as in GeomAPI_Edge
-class Model_CurvesHasher
-{
-public:
-  DEFINE_STANDARD_ALLOC
-  /// standard hash code
-  static int HashCode (const Handle(Geom_Curve)& theCurve, const Standard_Integer Upper);
-  /// comapre curves by parameters and points on them
-  static bool IsEqual (const Handle(Geom_Curve)& theC1, const Handle(Geom_Curve)& theC2);
-};
-
-// class to compare edges in the same way as in GeomAPI_Edge
-class Model_EdgesHasher
-{
-public:
-  DEFINE_STANDARD_ALLOC
-  /// standard hash code
-  static int HashCode (const TopoDS_Edge& theEdge, const Standard_Integer Upper);
-  /// comapre curves by parameters and points on them
-  static bool IsEqual (const TopoDS_Edge& theE1, const TopoDS_Edge& theE2);
-};
-
-
-/**\class Model_SelectionNaming
- * \ingroup DataModel
- * \brief The set of methods that allow to generate a string-name for the selection attribute.
- */
-class Model_SelectionNaming
-{
-  TDF_Label myLab; ///< Selection label of the selection attribute
-public:
-  /// Constructor for the selection attribute by the selection label
-  Model_SelectionNaming(TDF_Label theSelectionLab);
-
-  /// Produces the string-name for the selected shape
-  std::string namingName(ResultPtr& theContext, std::shared_ptr<GeomAPI_Shape> theSubSh,
-    const std::string& theDefaultName, const bool theAnotherDoc);
-
-  /// Makes a selection by the string-name
-  /// \param theType string of the type of the shape
-  /// \param theSubShapeName string-identifier of the selected shape
-  /// \param theDoc document where the selected shape is searched
-  /// \param theShapeToBeSelected resulting selected shape
-  /// \param theCont the selection context of the resulting selected shape
-  bool selectSubShape(const std::string& theType, const std::string& theSubShapeName,
-    std::shared_ptr<Model_Document> theDoc, std::shared_ptr<GeomAPI_Shape>& theShapeToBeSelected,
-    std::shared_ptr<ModelAPI_Result>& theCont);
-
-  /// Searches the face more appropriate to the given curves
-  /// (with higher level of matched parameters)
-  /// \param theConstr construction result that contains one or several  faces
-  /// \param theCurves map from the face edges curves to orientation
-  ///                  (-1 reversed, 0 unknown, 1 forward)
-  /// \param theIsWire for wire algorithm isquite the same,
-  ///                  but if in face several wires, it returns the needed wire
-  /// \returns faces fron this construction if found
-  static std::shared_ptr<GeomAPI_Shape> findAppropriateFace(
-    std::shared_ptr<ModelAPI_Result>& theConstr,
-    NCollection_DataMap<Handle(Geom_Curve), int, Model_CurvesHasher>& theCurves,
-    const bool theIsWire);
-
-  /// Returns orientation of the edge in the context shape
-  static int edgeOrientation(const TopoDS_Shape& theContext, TopoDS_Edge& theEdge);
-
-  /// Returns the name of sketch sub-element, shortened by exclusion of some symbols and with added
-  /// the vertex position (if needed)
-  /// \param theConstr result with name - basis for the name
-  /// \param theEdgeVertexPos position of the vertex on edge: 1 - first , 2 - second
-  /// \returns the generated name
-  static std::string shortName(std::shared_ptr<ModelAPI_ResultConstruction>& theConstr,
-    const int theEdgeVertexPos = 0);
-
-protected:
-  /// Gets the stored name from the document
-  std::string getShapeName(std::shared_ptr<Model_Document> theDoc, const TopoDS_Shape& theShape,
-    ResultPtr& theContext, const bool theAnotherDoc, const bool theWholeContext);
-
-  /// Tries to find the name of the context sub-shape as combination of edges in context
-  std::string vertexNameByEdges(TopoDS_Shape theContext, TopoDS_Shape theSub,
-    std::shared_ptr<Model_Document> theDoc, ResultPtr& theContextRes, const bool theAnotherDoc);
-};
-
-#endif
index a22db3780ba50741c258ef66f0e94007c4118420..16f55677b2dc611a97f2c905fe3cf7b942295e4a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Session.h>
@@ -55,7 +54,7 @@
 
 static Model_Session* myImpl = new Model_Session();
 
-// t oredirect all calls to the root document
+// tredirect all calls to the root document
 #define ROOT_DOC std::dynamic_pointer_cast<Model_Document>(moduleDocument())
 
 bool Model_Session::load(const char* theFileName)
@@ -114,7 +113,7 @@ void Model_Session::abortOperation()
     myOperationAttachedToNext = false;
   }
   setCheckTransactions(true);
-  // here the update mechanism may work after abort, so, supress the warnings about
+  // here the update mechanism may work after abort, so, suppress the warnings about
   // modifications outside of the transactions
   bool aWasCheck = myCheckTransactions;
   myCheckTransactions = false;
@@ -294,7 +293,7 @@ void Model_Session::setActiveDocument(
     std::shared_ptr<ModelAPI_Document> aPrevious = myCurrentDoc;
     myCurrentDoc = theDoc;
     if (theDoc.get() && theSendSignal) {
-      // this must be before the synchronisation call because features in PartSet lower than this
+      // this must be before the synchronization call because features in PartSet lower than this
       // part feature must be disabled and don't recomputed anymore (issue 1156,
       // translation feature is failed on activation of Part 2)
       if (isOperation()) { // do it only in transaction, not on opening of document
@@ -306,7 +305,7 @@ void Model_Session::setActiveDocument(
           }
         }
       }
-      // syncronize the document: it may be just opened or opened but removed before
+      // synchronize the document: it may be just opened or opened but removed before
       std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theDoc);
       if (aDoc.get()) {
         bool aWasChecked = myCheckTransactions;
@@ -320,7 +319,7 @@ void Model_Session::setActiveDocument(
           new Events_Message(Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED)));
       Events_Loop::loop()->send(aMsg);
     }
-    // make the current state correct and synchronised in the module and sub-documents
+    // make the current state correct and synchronized in the module and sub-documents
     if (isOperation()) { // do it only in transaction, not on opening of document
       if (myCurrentDoc == moduleDocument()) {
         // make the current feature the latest in root, in previous root current become also last
@@ -475,6 +474,10 @@ void Model_Session::processEvent(const std::shared_ptr<Events_Message>& theMessa
         if (!aCases.empty()) {
           validators()->registerCase(aMsgAttr->featureId(), aMsgAttr->attributeId(), aCases);
         }
+        if (aMsgAttr->isGeometricalSelection()) {
+          validators()->registerGeometricalSelection(aMsgAttr->featureId(),
+                                                     aMsgAttr->attributeId());
+        }
       }
     }
     // plugins information was started to load, so, it will be loaded
@@ -615,7 +618,7 @@ void Model_Session::blockAutoUpdate(const bool theBlock)
     }
     if (!isOperation) {
       finishOperation();
-      // append this transaction to the previous one: ne don't need this separated operation in list
+      // append this transaction to the previous one: don't need this separated operation in list
       ROOT_DOC->appendTransactionToPrevious();
     }
   }
index 7b7afe2b585f72703359e20e3d4c0d9d3809b129..82e6065e77735631f5c596e817ef536ae5a675d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Session_H_
old mode 100755 (executable)
new mode 100644 (file)
index 60b2c72..bfd0bc3
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Model_Update.h>
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_ResultConstruction.h>
 #include <GeomAPI_Shape.h>
 #include <GeomDataAPI_Point.h>
+#include <GeomDataAPI_Dir.h>
 #include <GeomDataAPI_Point2D.h>
 #include <Events_Loop.h>
 #include <Events_LongOp.h>
@@ -76,10 +77,8 @@ Model_Update::Model_Update()
   aLoop->registerListener(this, kReorderEvent);
   static const Events_ID kUpdatedSel = aLoop->eventByName(EVENT_UPDATE_SELECTION);
   aLoop->registerListener(this, kUpdatedSel);
-  static const Events_ID kAutomaticOff = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE);
-  aLoop->registerListener(this, kAutomaticOff);
-  static const Events_ID kAutomaticOn = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE);
-  aLoop->registerListener(this, kAutomaticOn);
+  static const Events_ID kAutoRecomp = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE);
+  aLoop->registerListener(this, kAutoRecomp);
 
   //  Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true";
   myIsParamUpdated = false;
@@ -198,7 +197,7 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) {
       }
     }
   }
-  // proccess also results
+  // process also results
   std::list<ResultPtr> allResults; // list of this feature and results
   ModelAPI_Tools::allResults(theFeature, allResults);
   std::list<ResultPtr>::iterator aRes = allResults.begin();
@@ -240,8 +239,6 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
   static const Events_ID kReorderEvent = aLoop->eventByName(EVENT_ORDER_UPDATED);
   static const Events_ID kRedisplayEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
   static const Events_ID kUpdatedSel = aLoop->eventByName(EVENT_UPDATE_SELECTION);
-  static const Events_ID kAutomaticOff = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_DISABLE);
-  static const Events_ID kAutomaticOn = aLoop->eventByName(EVENT_AUTOMATIC_RECOMPUTATION_ENABLE);
 
 #ifdef DEB_UPDATE
   std::cout<<"****** Event "<<theMessage->eventID().eventText()<<std::endl;
@@ -253,7 +250,7 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
     if (!myUpdateBlocked) { // process all modified features, even if preview is blocked
       bool aPreviewBlockedState = myIsPreviewBlocked; // to update the selected arguments
       myIsPreviewBlocked = false;
-      // iterate everything and add efatures in state "MustBeUpdated" into modified
+      // iterate everything and add features in state "MustBeUpdated" into modified
       std::list<std::shared_ptr<ModelAPI_Document> > allDocs =
         ModelAPI_Session::get()->allOpenedDocuments();
       std::list<std::shared_ptr<ModelAPI_Document> >::iterator aDoc = allDocs.begin();
@@ -303,16 +300,19 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
         std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
     const std::set<ObjectPtr>& anObjs = aMsg->objects();
     std::set<ObjectPtr>::const_iterator anObjIter = anObjs.cbegin();
+    std::list<ObjectPtr> aFeatures, aResults;
     for(; anObjIter != anObjs.cend(); anObjIter++) {
       if (std::dynamic_pointer_cast<Model_Document>((*anObjIter)->document())->executeFeatures()) {
         if ((*anObjIter)->groupName() == ModelAPI_Feature::group()) {
           // results creation means enabling, not update
-          ModelAPI_EventCreator::get()->sendUpdated(*anObjIter, kUpdatedEvent);
+          aFeatures.push_back(*anObjIter);
         } else {
-          ModelAPI_EventCreator::get()->sendUpdated(*anObjIter, kRedisplayEvent);
+          aResults.push_back(*anObjIter);
         }
       }
     }
+    ModelAPI_EventCreator::get()->sendUpdated(aFeatures, kUpdatedEvent);
+    ModelAPI_EventCreator::get()->sendUpdated(aResults, kRedisplayEvent);
     return;
   }
   if (theMessage->eventID() == kUpdatedEvent) {
@@ -331,7 +331,7 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
       if ((*anObjIter)->groupName() == ModelAPI_ResultParameter::group()) {
         myIsParamUpdated = true;
       }
-      // on undo/redo, abort do not update persisten features
+      // on undo/redo, abort do not update persistent features
       FeaturePtr anUpdated = std::dynamic_pointer_cast<ModelAPI_Feature>(*anObjIter);
       if (anUpdated.get()) {
         if (addModified(anUpdated, FeaturePtr()))
@@ -395,7 +395,7 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
       }
       myIsFinish = false;
     }
-    // processed features must be only on finish, so clear anyway (to avoid reimport on load)
+    // processed features must be only on finish, so clear anyway (to avoid re-import on load)
     myProcessOnFinish.clear();
 
     // #2156: current must be sketch, left after the macro execution
@@ -409,7 +409,8 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
     }
 
     if (anActiveDoc.get() && aCurrent.get() && aCurrent->data()->isValid()) {
-      if (anActiveDoc->currentFeature(false) != aCurrent)
+      if (anActiveDoc->currentFeature(false) != aCurrent &&
+          ModelAPI_Tools::compositeOwner(anActiveDoc->currentFeature(false)) == aCurrent)
         anActiveDoc->setCurrentFeature(aCurrent, false); // #2156 make the current feature back
     }
 
@@ -440,7 +441,7 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
     Events_Loop::loop()->flush(kRedisplayEvent);
 
     // in the end of transaction everything is updated, so clear the old objects
-    myIsParamUpdated = false;
+    //myIsParamUpdated = false; // to avoid problems in sprocket.py parameter update
     myWaitForFinish.clear();
   } else if (theMessage->eventID() == kReorderEvent) {
     std::shared_ptr<ModelAPI_OrderUpdatedMessage> aMsg =
@@ -483,7 +484,7 @@ void Model_Update::processFeatures(const bool theFlushRedisplay)
   }
 }
 
-// collects all the feautres this feature depends on: reasons
+// collects all the features this feature depends on: reasons
 static void allReasons(FeaturePtr theFeature, std::set<FeaturePtr>& theReasons) {
   std::list<std::pair<std::string, std::list<std::shared_ptr<ModelAPI_Object> > > > aDeps;
   theFeature->data()->referencesToObjects(aDeps);
@@ -567,36 +568,46 @@ bool Model_Update::processFeature(FeaturePtr theFeature)
 
   // update the sketch plane before the sketch sub-elements are recomputed
   // (otherwise sketch will update plane, modify subs, after executed, but with old subs edges)
-  if (aIsModified && theFeature->getKind() == "Sketch") {
+    if (aIsModified && theFeature->getKind() == "Sketch") {
 #ifdef DEB_UPDATE
-    std::cout<<"****** Update sketch args "<<theFeature->name()<<std::endl;
+      std::cout << "****** Update sketch args " << theFeature->name() << std::endl;
 #endif
-    AttributeSelectionPtr anExtSel = theFeature->selection("External");
-    if (anExtSel.get()) {
-      ResultPtr aContext = anExtSel->context();
-      if (aContext.get() && aContext->document().get()) {
-        FeaturePtr anExtBase = aContext->document()->feature(aContext);
-        if (anExtBase.get()) {
-          processFeature(anExtBase);
+      AttributeSelectionPtr anExtSel = theFeature->selection("External");
+      if (anExtSel.get()) {
+        ResultPtr aContext = anExtSel->context();
+        if (aContext.get() && aContext->document().get()) {
+          FeaturePtr anExtBase = aContext->document()->feature(aContext);
+          if (anExtBase.get()) {
+            processFeature(anExtBase);
+          }
+          std::shared_ptr<GeomDataAPI_Point> anOrigin =
+            std::dynamic_pointer_cast<GeomDataAPI_Point>(theFeature->attribute("Origin"));
+          double anOX = anOrigin->x(), anOY = anOrigin->y(), anOZ = anOrigin->z();
+          std::shared_ptr<GeomDataAPI_Dir> aDir =
+            std::dynamic_pointer_cast<GeomDataAPI_Dir>(theFeature->attribute("DirX"));
+          double aDX = aDir->x(), aDY = aDir->y(), aDZ = aDir->z();
+          std::shared_ptr<GeomDataAPI_Dir> aNorm =
+            std::dynamic_pointer_cast<GeomDataAPI_Dir>(theFeature->attribute("Norm"));
+          double aNX = aNorm->x(), aNY = aNorm->y(), aNZ = aNorm->z();
+          // update sketch plane
+          updateArguments(theFeature);
+          theFeature->attributeChanged("External"); // to recompute origin, direction and normal
+          // check it is updated, so all must be changed
+          if (anOrigin->x() != anOX || anOrigin->y() != anOY || anOrigin->z() != anOZ ||
+              aDir->x() != aDX || aDir->y() != aDY || aDir->z() != aDZ ||
+              aNorm->x() != aNX || aNorm->y() != aNY || aNorm->z() != aNZ)
+          {
+            std::set<FeaturePtr> aWholeR;
+            allReasons(theFeature, aWholeR);
+            std::set<FeaturePtr>::iterator aRIter = aWholeR.begin();
+            for (; aRIter != aWholeR.end(); aRIter++) {
+              if ((*aRIter)->data()->selection("External").get())
+                (*aRIter)->attributeChanged("External");
+            }
+          }
         }
       }
     }
-    std::shared_ptr<GeomAPI_Shape> aShapeBefore = anExtSel->value();
-    if (!aShapeBefore.get() && anExtSel->context()) aShapeBefore = anExtSel->context()->shape();
-    updateArguments(theFeature);
-    std::shared_ptr<GeomAPI_Shape> aShapeAfter = anExtSel->value();
-    if (!aShapeAfter.get() && anExtSel->context()) aShapeAfter = anExtSel->context()->shape();
-    // if selected plane is changed, try to re-take external references of all subs of the sketch
-    if (aShapeBefore.get() && !aShapeBefore->isEqual(aShapeAfter)) {
-      std::set<FeaturePtr> aWholeR;
-      allReasons(theFeature, aWholeR);
-      std::set<FeaturePtr>::iterator aRIter = aWholeR.begin();
-      for(; aRIter != aWholeR.end(); aRIter++) {
-        if ((*aRIter)->data()->selection("External"))
-          (*aRIter)->attributeChanged("External");
-      }
-    }
-  }
 
   if (!aIsModified) { // no modification is needed
     return false;
@@ -690,7 +701,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature)
     theFeature->data()->execState(ModelAPI_StateDone);
 
   // this checking must be after the composite feature sub-elements processing:
-  // composite feature status may depend on it's subelements
+  // composite feature status may depend on it's sub-elements
   if ((theFeature->data()->execState() == ModelAPI_StateInvalidArgument || isReferencedInvalid) &&
     theFeature->getKind() != "Part") {
       // don't disable Part because it will make disabled all the features
@@ -713,7 +724,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature)
           aDoExecute = true;
         } else if (theFeature->results().size()) { // execute only not-results features
           aDoExecute = !(theFeature->firstResult()->groupName() == ModelAPI_ResultBody::group() ||
-                         theFeature->firstResult()->groupName() == ModelAPI_ResultPart::group());
+            theFeature->firstResult()->groupName() == ModelAPI_ResultPart::group() ||
+            theFeature->getKind() == "Sketch");
         } else {
           aDoExecute = aState != ModelAPI_StateInvalidArgument;
         }
@@ -902,7 +914,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
       if (aSelAttr) {
         ObjectPtr aContext = aSelAttr->context();
         // update argument only if the referenced object is ready to use
-        if (aContext.get() && !aContext->isDisabled() && !aSelAttr->isInvalid()) {
+        if (aContext.get() && !aContext->isDisabled()) {
           if (isReason(theFeature, aContext)) {
             if (!aSelAttr->update()) {
               bool isObligatory = !aFactory->isNotObligatory(
@@ -912,7 +924,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
                 aState = ModelAPI_StateInvalidArgument;
             }
           }
-        } else if (aContext.get() || aSelAttr->isInvalid()) {
+        } else if (aContext.get()) {
           // here it may be not obligatory, but if the reference is wrong, it should not be correct
           bool isObligatory = aFactory->isCase(theFeature, theFeature->data()->id(aSel));
           if (isObligatory)
@@ -990,6 +1002,8 @@ void Model_Update::executeFeature(FeaturePtr theFeature)
   redisplayWithResults(theFeature, aState);
 }
 
+// it is called on GUI edit of feature start
+// LCOV_EXCL_START
 void Model_Update::updateStability(void* theSender)
 {
   static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
@@ -1042,6 +1056,7 @@ void Model_Update::updateStability(void* theSender)
     }
   }
 }
+// LCOV_EXCL_STOP
 
 void Model_Update::updateSelection(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects)
 {
@@ -1053,19 +1068,27 @@ void Model_Update::updateSelection(const std::set<std::shared_ptr<ModelAPI_Objec
     for (; aRefsIter != aRefs.end(); aRefsIter++) {
       std::shared_ptr<Model_AttributeSelection> aSel =
         std::dynamic_pointer_cast<Model_AttributeSelection>(*aRefsIter);
-      aSel->updateInHistory();
+      bool aRemove = false;
+      aSel->updateInHistory(aRemove);
     }
     // update the selection list attributes if any
     aRefs = (*anObj)->data()->attributes(ModelAPI_AttributeSelectionList::typeId());
     for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) {
+      std::set<int> aRemoveSet;
       std::shared_ptr<ModelAPI_AttributeSelectionList> aSel =
         std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*aRefsIter);
       for(int a = aSel->size() - 1; a >= 0; a--) {
         std::shared_ptr<Model_AttributeSelection> aSelAttr =
           std::dynamic_pointer_cast<Model_AttributeSelection>(aSel->value(a));
-        if (aSelAttr.get())
-          aSelAttr->updateInHistory();
+        if (aSelAttr.get()) {
+          bool theRemove = false;
+          aSelAttr->updateInHistory(theRemove);
+          if (theRemove) {
+            aRemoveSet.insert(a);
+          }
+        }
       }
+      aSel->remove(aRemoveSet);
     }
   }
 }
index 9ca9045450b8b16ae19f63833e4b8038ee925017..f211eac4dfc6edf48e6c8b44f23ad70789028d04 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Update_H_
index 41fa0f7014a03e24137734cbd4bc447925905271..3059ea572df8226c088604be4a3cad0d1350a518 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "Model_Validator.h"
@@ -377,3 +376,27 @@ bool Model_ValidatorsFactory::isMainArgument(std::string theFeature, std::string
   std::map<std::string, std::string>::iterator aFound = myMainArgument.find(theFeature);
   return aFound != myMainArgument.end() && aFound->second == theAttribute;
 }
+
+void Model_ValidatorsFactory::registerGeometricalSelection(std::string theFeature,
+                                                           std::string theAttribute)
+{
+  std::map<std::string, std::set<std::string> >::iterator aFind =
+    myGeometricalSelection.find(theFeature);
+  if (aFind == myGeometricalSelection.end()) {
+    std::set<std::string> aNewSet;
+    aNewSet.insert(theAttribute);
+    myGeometricalSelection[theFeature] = aNewSet;
+  }
+  else {
+    aFind->second.insert(theAttribute);
+  }
+}
+
+bool Model_ValidatorsFactory::isGeometricalSelection(std::string theFeature,
+                                                     std::string theAttribute)
+{
+  std::map<std::string, std::set<std::string> >::iterator aFind =
+    myGeometricalSelection.find(theFeature);
+  return aFind != myGeometricalSelection.end()
+         && aFind->second.find(theAttribute) != aFind->second.end();
+}
index 939cdf21390017aebd1c22b3bc2de2de5e62e94e..df2357bb787c3e8ed4e8428c67976cf2093f7601 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef Model_Validator_H_
@@ -58,6 +57,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory
           std::map<std::string, std::set<std::string> > > > myCases;
   /// Stores main attribute for each feature
   std::map<std::string, std::string> myMainArgument;
+  std::map<std::string, std::set<std::string> > myGeometricalSelection;
 
  public:
   /// Registers the instance of the validator by the ID
@@ -123,6 +123,12 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory
   /// Returns true is the attribute is a main argument of the feature
   virtual bool isMainArgument(std::string theFeature, std::string theAttribute);
 
+  /// Register the selection attribute as geometrical selection
+  virtual void registerGeometricalSelection(std::string theFeature, std::string theAttribute);
+
+  /// Returns true if the attribute is a geometrical selection
+  virtual bool isGeometricalSelection(std::string theFeature, std::string theAttribute);
+
 
 protected:
   /// Adds the defualt validators that are usefull for all features.
index 14148d04694b8d586a00cf2126519d4dadf11d59..174b814046fc1a37ef5a98cac1f0ef79dafb9c07 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
@@ -166,6 +165,7 @@ ADD_UNIT_TESTS(TestConstants.py
                TestResults.py
                TestIntArray.py
                Test1512.py
+               Test1562.py
                TestDoubleArray.py
                Test1757.py
                Test1998.py
@@ -198,6 +198,8 @@ ADD_UNIT_TESTS(TestConstants.py
                TestFolder_Remove.py
                TestFolder_Stability.py
                TestFolder_CustomName.py
+               TestFolder_Empty.py
+               TestFolder_Sketch.py
                Test2358_1.py
                Test2358_2.py
                Test2396.py
@@ -210,6 +212,7 @@ ADD_UNIT_TESTS(TestConstants.py
                Test2607.py
                TestBlockRecalculation.py
                TestSelectionScope.py
+               TestSelectorShell.py
                TestWeakNaming2125.py
                TestWeakNaming2222.py
                TestWeakNaming2245.py
@@ -223,4 +226,22 @@ ADD_UNIT_TESTS(TestConstants.py
                TestWeakNaming2445.py
                TestWeakNaming2446.py
                TestWeakNaming2452.py
+               TestWeakNamingSortOrder.py
+               Test2685.py
+               TestGeomNamingPlacement.py
+               TestGeomNamingRevolution.py
+               TestGeomNamingEdgeByFilter.py
+               TestGeomNamingSketchPlane.py
+               TestGeomNamingBoxWithFillet.py
+               TestContainerSelector.py
+               TestSaveOpen1.py
+               TestSaveOpen2.py
+               TestSelectionInitialization.py
+               Test2828.py
+               TestSelectionRestore.py
+               Test2491.py
+               Test2493.py
+               Test2627.py
+               Test2859.py
+               Test2873.py
 )
index ec53df0b6e2b264ccf76f1fc12f722dd3d041684..c9bbb7b54edafe125e1a77bcc7669dc69f8101e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_H
index e5113a5c2fea4df2c8dcad75153abfaab8196014..b08f5daf1a1a63a4b598c5e8e266e9585babec26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ModelAPI.i */
@@ -182,8 +181,8 @@ template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr
 %template(modelAPI_ResultBody) shared_ptr_cast<ModelAPI_ResultBody, ModelAPI_Result>;
 %template(modelAPI_ResultPart) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_Result>;
 %template(modelAPI_ResultParameter) shared_ptr_cast<ModelAPI_ResultParameter, ModelAPI_Result>;
-%template(modelAPI_ResultGroup) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultGroup>;
-%template(modelAPI_ResultField) shared_ptr_cast<ModelAPI_ResultPart, ModelAPI_ResultField>;
+%template(modelAPI_ResultGroup) shared_ptr_cast<ModelAPI_ResultGroup, ModelAPI_Result>;
+%template(modelAPI_ResultField) shared_ptr_cast<ModelAPI_ResultField, ModelAPI_Result>;
 
 // Attribute casts
 %template(modelAPI_AttributeDocRef)        shared_ptr_cast<ModelAPI_AttributeDocRef, ModelAPI_Attribute>;
@@ -207,3 +206,6 @@ template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr
 
 // Geometry casts
 %template(shapeToEdge) shared_ptr_cast<GeomAPI_Edge, GeomAPI_Shape>;
+
+template<class T1, class T2> std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject);
+%template(featureToPresentation) shared_ptr_cast<GeomAPI_IPresentable, ModelAPI_Feature>;
index a823a28e6fe612853e76c88f026b0d1b03a76907..f1b43e323b9c142b026bd706b8c61cffa5bae9cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Attribute.h>
index 54e1a70dbff1608ef1707b5258b98411dc33a07c..f40397e44cd1f91d09a30c65ec3ca0698d5107ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Attribute_H_
index 2e2b71e597aed05400642382483acae63d81b6e4..be67c6d655d9cc8e340264a6efc1102480ecba43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeBoolean.h"
index 977087cd3353c96daeb69cde49ecd16ac146d506..43f74f27087dfdde08504c3f3cc2fdf7b51c42ed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_ATTRIBUTEBOOLEAN_H_
index 38a19a52941cfbcc3ef8127f6b5985f157c042c9..e1a975a041bda8ad7afafb69045d7ccb0a6d8ddb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeDocRef.h"
index 1a9d5abc074f369764b0ac8e910692b12443412d..7a32b7671ab2ec2bc72fa21e2b582399e76c672a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeDocRef_H_
@@ -38,7 +37,7 @@ class ModelAPI_AttributeDocRef : public ModelAPI_Attribute
   /// Returns document referenced from this attribute
   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> value() = 0;
 
-  /// Returns the persisten ID of the document
+  /// Returns the persistent ID of the document
   MODELAPI_EXPORT virtual int docId() = 0;
 
   /// Returns the type of this class of attributes
index 6a9acc1fb2625c6207e90aeb8c0820aaf33c5432..f98fd2be54020a2784d52acc1dc7f97562aa3c4f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeDouble.h"
index b20b678cf9b8d18e12ec8dba89598764dc49cc1c..4033b8b75a1dfb23614bec9d7c5e2b34c83437b3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeDouble_H_
index 5b5e164b01caa83c2d6ec453733fb1e124014efb..3008b96b620e8cc276f1aebc5405c9db9dc1c44e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeDoubleArray.h"
index 8dc14a088b4e3e384b6b4b665ac19f48b15178bc..fa62480d96428febd71cb6efaf34fe8213913022 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeDoubleArray_H_
index db12e4fbb476bad677c2371777fbd31189066df9..b6548d48ee9d0464e49ca8b9afd3655883165a22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_AttributeIntArray.h>
index 1843f638301c556fab7833794e610d0aea423e15..d0fd38c50a84dfc32a45b10039d34d1e3b4984d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeIntArray_H_
index 6410e4daa6f41aec4da0cc719741cd4052c78b82..7019baa3e6f2731c2e6453c0cf81c314bfd30708 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_AttributeInteger.h>
index de83e0b4b19872b5ddc5d7cdf283075b6e417c26..0be5cff7389a74800629cd8967e80ba75686f698 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_ATTRIBUTEINTEGER_H_
index 44c3c6de859e8874f5f59b5f39809f68c42ff7d9..ff281fe9d5c7ba69852f299f2c5dc2171fedd826 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeRefAttr.h"
index 3fc5010c79dbf4b86ded605bf4c2b771d183249a..4c9fc16f997c7002a2d5917118118273e199b93b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeRefAttr_H_
old mode 100755 (executable)
new mode 100644 (file)
index 55e154f..593019a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeRefAttrList.h"
old mode 100755 (executable)
new mode 100644 (file)
index 6ac910f..d4ca1bc
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeRefAttrList_H_
index 244fda98b7bf3bc185c1eac75e3d209d84127971..8e34f999fb11826e0081e14ac323ba598e0a6076 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeRefList.h"
index 78d8ba769dfce1ccaa620fe49605ab0f8b849990..93f3e44d2e8e60fa103222baab76fca69f0c9719 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeRefList_H_
@@ -64,14 +63,11 @@ class ModelAPI_AttributeRefList : public ModelAPI_Attribute
   /// Returns the referenced object by the zero-based index
   ///\param theIndex zero-based index in the list
   ///\param theWithEmpty if it is false, counts the not-empty referenced objects only
-  virtual ObjectPtr object(const int theIndex, const bool theWithEmpty = true) const = 0;
+  virtual ObjectPtr object(const int theIndex, const bool theWithEmpty = true) = 0;
 
   /// Substitutes the object by another one. Does nothing if such object is not found.
   virtual void substitute(const ObjectPtr& theCurrent, const ObjectPtr& theNew) = 0;
 
-  /// Substitutes the object by another one and back. So, features wil become exchanged in the list
-  virtual void exchange(const ObjectPtr& theObject1, const ObjectPtr& theObject2) = 0;
-
   /// Removes the last element in the list.
   virtual void removeLast() = 0;
 
index 16199fb1cb7cf11a384832476fa7fa5edf008760..fb23d0791b622931e5f2bbd2b9a17c916d08fb54 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeReference.h"
index 84a93622329f017c5e7b5e93cce8ef1c12fea51b..45156af2c6e3cffa928b7171a9be4f16c36b00b9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeReference_H_
index 564f446571a909d26af0b815787bf3c948e73828..cf4fb9edc8229a0b219263e95453de575c104ae1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeSelection.h"
index 212e83be9941a605b78cd7c69ee5c9903eef3403..0f44acb010c7399b7ec31a293868b51a752e81f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeSelection_H_
@@ -47,7 +46,7 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute
   /// \param theContext object where the sub-shape was selected
   /// \param theSubShape selected sub-shape (if null, the whole context is selected)
   /// \param theTemporarily if it is true, do not store and name the added in the data framework
-  ///           (used to remove immideately, without the following updates)
+  ///           (used to remove immediately, without the following updates)
   /// \returns true if attribute was updated
   virtual bool setValue(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
@@ -78,7 +77,7 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute
   /// Returns the context of the selection : result or feature
   virtual std::shared_ptr<ModelAPI_Object> contextObject() = 0;
 
-  /// Updates the underlied selection due to the changes in the referenced objects
+  /// Updates the selection due to the changes in the referenced objects
   /// \returns false if update is failed
   virtual bool update() = 0;
 
@@ -95,9 +94,6 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute
   /// \param theDefaultValue a value, which is used if the naming name can not be obtained
   virtual std::string namingName(const std::string& theDefaultValue = "") = 0;
 
-  /// Returns an id of the selection
-  virtual int Id() = 0;
-
   /// Defines an id of the selection
   virtual void setId(int theID) = 0;
 
@@ -115,12 +111,17 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute
   /// Returns true if recompute of selection become impossible
   virtual bool isInvalid() = 0;
 
-  /// Returns true if the name was stored using weak naming principle
-  MODELAPI_EXPORT virtual bool isWeakNaming() = 0;
+  /// Returns true if is geometrical selection.
+  virtual bool isGeometricalSelection() const = 0;
 
   /// To virtually destroy the fields of successors
   MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelection();
 
+  /// Returns the name by context. Adds the part name if the context is located in other document
+  MODELAPI_EXPORT virtual std::string contextName(const ResultPtr& theContext) const = 0;
+
+  /// Makes the current local selection becomes all sub-shapes with same base geometry.
+  MODELAPI_EXPORT virtual void combineGeometrical() = 0;
 
  protected:
   /// Objects are created for features automatically
index 5df2ad7ce561b718f35c3843533c3a6f198341ab..820d33baf99953578c573a0e04fa2fea909549a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeSelectionList.h"
index fe432944a2f7efe47803c52b3320300c797e8077..819634fe5216acc85d7b2fa736a264ed56a7b2db 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeSelectionList_H_
@@ -74,7 +73,7 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute
   /// \param theContext object where the sub-shape was selected
   /// \param theSubShape selected sub-shape (if null, the whole context is selected)
   /// \param theTemporarily if it is true, it checks also the temporary added item
-  /// \returns true if the pair is found in the attirbute
+  /// \returns true if the pair is found in the attribute
   virtual bool isInList(
     const ObjectPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape,
     const bool theTemporarily = false) = 0;
@@ -98,6 +97,11 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute
   /// during non-modification operations with this attribute)
   virtual void cashValues(const bool theEnabled) = 0;
 
+  virtual void setGeometricalSelection(const bool theIsGeometricalSelection) = 0;
+
+  /// Returns true if is geometrical selection.
+  virtual bool isGeometricalSelection() const = 0;
+
   /// Returns the type of this class of attributes
   static std::string typeId()
   {
index 660c60fb2f98b7c945744fc8ce815057dc7e6ade..a8b948469ce32fe2564682eb8ff9916a10801fb2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeString.h"
index 93c7ca9c7c6c0b2be565de9d6d84c6bb4637afd0..d753784c40bf8a37cfd3094e57cd59300393848f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_ATTRIBUTESTRING_H_
@@ -35,9 +34,13 @@ class ModelAPI_AttributeString : public ModelAPI_Attribute
  public:
   /// Defines the string value
   MODELAPI_EXPORT virtual void setValue(const std::string& theValue) = 0;
+  /// Defines the wstring value
+  MODELAPI_EXPORT virtual void setValue(const std::wstring& theValue) = 0;
 
   /// Returns the string value
   MODELAPI_EXPORT virtual std::string value() = 0;
+  /// Returns a pointer to Unicode string
+  MODELAPI_EXPORT virtual char16_t* valueU() = 0;
 
   /// Returns the type of this class of attributes
   MODELAPI_EXPORT static std::string typeId()
index 2a80a96e3699c68733235bf1cb326535b3a67da7..06610a49c9f58301408200f9c74edcbcae921713 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeStringArray.h"
index 2ab6b05b452e4dc8b06e80ef0b349d72e8b7336a..e6fd2e23295b4b55bd9e15d0aa6221a88d1244aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeStringArray_H_
index ce17f75e839615e7bfa0a70bff7e0a05d6601af1..5b9c4cf33a1c4bdef809b9d405626a76a13ae72e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_AttributeTables.h"
index e1a4f5f4a40a655ece8d06546cdb353ffcfc04c7..f863cdec5639b8769c42a480a18fb58a13ee817a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeTables_H_
index 6dbccdb32e87a01e95b11eca7d1958882e91a574..0e503fbf829f74f1046db1e0d72bce8765c8a942 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_AttributeValidator.h>
index d63aebf584436a12334135d21ff50a9f048c0ac1..ec7a62d2e23782018342b29fbf2258e311d1994c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_AttributeValidator_H
old mode 100755 (executable)
new mode 100644 (file)
index 4a99b58..258ac7b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_BodyBuilder.h"
old mode 100755 (executable)
new mode 100644 (file)
index 8da3d21..ecf3137
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_BodyBuilder_H_
@@ -42,92 +41,74 @@ public:
   MODELAPI_EXPORT virtual ~ModelAPI_BodyBuilder() {};
 
   /// Stores the shape (called by the execution method).
-  virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape,
+  virtual void store(const GeomShapePtr& theShape,
                      const bool theIsStoreSameShapes = true) = 0;
 
   /// Stores the generated shape (called by the execution method).
-  virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-                                 const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
+  virtual void storeGenerated(const GeomShapePtr& theFromShape,
+                              const GeomShapePtr& theToShape,
+                              const bool theIsCleanStored = true) = 0;
+
+  /// Stores the root generated shapes (called by the execution method).
+  virtual void storeGenerated(const std::list<GeomShapePtr>& theFromShapes,
+    const GeomShapePtr& theToShape, const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape) = 0;
 
   /// Stores the modified shape (called by the execution method).
-  virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-                                 const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-                            const int theDecomposeSolidsTag = 0) = 0;
+  virtual void storeModified(const GeomShapePtr& theOldShape,
+                             const GeomShapePtr& theNewShape,
+                             const bool theIsCleanStored = true) = 0;
 
-  /// Stores the shape without naming support
-  virtual void storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
+  /// Stores the root modified shapes (called by the execution method).
+  virtual void storeModified(const std::list<GeomShapePtr>& theOldShapes,
+    const GeomShapePtr& theNewShape, const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)=0;
 
   /// Returns the shape-result produced by this feature
-  virtual std::shared_ptr<GeomAPI_Shape> shape() = 0;
+  virtual GeomShapePtr shape() = 0;
 
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
-  virtual void generated(
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-    const int theTag = 1) = 0;
+  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
+  virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) = 0;
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological
   /// construction. As an example, consider the case of a face generated from an edge in
   /// construction of a prism.
-  virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-    const int theTag = 1) = 0;
+  virtual void generated(const GeomShapePtr& theOldShape,
+                         const GeomShapePtr& theNewShape,
+                         const std::string& theName = "") = 0;
 
   /// Records the shape newShape which is a modification of the shape oldShape.
   /// As an example, consider the case of a face split or merged in a Boolean operation.
-  virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-    const int theTag = 1) = 0;
-
-  /// Records the shape oldShape which was deleted from the current label.
-  /// As an example, consider the case of a face removed by a Boolean operation.
-  virtual void deleted(
-    const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
+  virtual void modified(const GeomShapePtr& theOldShape,
+                        const GeomShapePtr& theNewShape,
+                        const std::string& theName = "") = 0;
 
   /// load deleted shapes
-  virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                               const GeomShapePtr theShapes = GeomShapePtr()) = 0;
+  virtual void loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
+                                 const GeomShapePtr& theOldShape,
+                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                 const GeomShapePtr& theShapesToAvoid = GeomShapePtr()) = 0;
+
   /// load and orient modified shapes
-  virtual void loadAndOrientModifiedShapes (
-                                                  GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                                                                          const std::string& theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes,
-                                               const bool theIsStoreSeparate = false,
-                                               const bool theIsStoreAsGenerated = false) = 0;
+  virtual void loadModifiedShapes(const GeomMakeShapePtr& theAlgo,
+                                  const GeomShapePtr& theOldShape,
+                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                  const std::string& theName = "") = 0;
+
   /// load and orient generated shapes
-  virtual void loadAndOrientGeneratedShapes (
-                                                  GeomAlgoAPI_MakeShape* theMS,
-                                               std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-                                               const int  theKindOfShape,
-                                               const int  theTag,
-                                                                                          const std::string& theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
+  virtual void loadGeneratedShapes(const GeomMakeShapePtr& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "",
+                                   const bool theSaveOldIfNotInTree = false) = 0;
 
   /// load shapes of the first level (to be used during shape import)
-  virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
-                              const std::string& theName, int&  theTag) = 0;
-
-  /// load disconnected edges
-  virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
-                                     const std::string& theName, int&  theTag) = 0;
-
-  /// load disconnected vetexes
-  virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
-                                        const std::string& theName,int&  theTag) = 0;
-
-  /// Converts evolution of sub-shapes stored in naming structure to selection
-  /// (theFlag = true) and back (theFlag = false)
-  virtual void evolutionToSelection(const bool theFlag) = 0;
+  virtual void loadFirstLevel(GeomShapePtr theShape,
+                              const std::string& theName) = 0;
 
-  /// Returns true if the latest modification of this body in the naming history
-  // is equal to the given shape
-  virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
+  /// Cleans cash related to the already stored elements
+  MODELAPI_EXPORT virtual void cleanCash() = 0;
 
 protected:
   /// Returns the data manager of this object: attributes
@@ -137,7 +118,7 @@ protected:
   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> document() const;
 
 protected:
-  /// Deafult constructor accessible only from Model_Object
+  /// Default constructor accessible only from Model_Object
   MODELAPI_EXPORT ModelAPI_BodyBuilder(ModelAPI_Object* theOwner);
 
   ModelAPI_Object* myOwner; ///< the owner object this builder belongs to
index 8fc0c819a87fc355761c57f14465e86881911740..ddeaa5a1780cfee03a6144816781fda3b2d82aaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_CompositeFeature.h>
@@ -25,12 +24,6 @@ ModelAPI_CompositeFeature::~ModelAPI_CompositeFeature()
 
 }
 
-void ModelAPI_CompositeFeature::exchangeIDs(
-  std::shared_ptr<ModelAPI_Feature> theFeature1, std::shared_ptr<ModelAPI_Feature> theFeature2)
-{
-  // by default nothing is in the implementation
-}
-
 void ModelAPI_CompositeFeature::erase()
 {
   // erase all sub-features
index 1011b350b9272fe6fb185582fa7af3e32a48de25..57c5e050128f0d9e55534afa5d107b7d32b3b138 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_COMPOSITEFEATURE_H_
@@ -55,10 +54,6 @@ public:
   /// structures of the owner (the remove from the document will be done outside just after)
   virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) = 0;
 
-  /// Exchanges IDs of two given features: needed for more correct naming in some cases (issue 769)
-  MODELAPI_EXPORT virtual void exchangeIDs(std::shared_ptr<ModelAPI_Feature> theFeature1,
-    std::shared_ptr<ModelAPI_Feature> theFeature2);
-
   /// in addition removes all subs
   MODELAPI_EXPORT virtual void erase();
 };
index 2e7d2e03f42b39e6ee9a76808e462a868779d379..658722691510d36b114def5222756e78ec3bf903 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Data.h>
index 2fc8fbfc8fec35a6997faf2119930bcc8b9885fc..8ce3e9133a6cbb030bdbaac592096e8cdfe201ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Data_H_
@@ -181,7 +180,7 @@ class MODELAPI_EXPORT ModelAPI_Data
   /// Copies all attributes content into theTarget data
   virtual void copyTo(std::shared_ptr<ModelAPI_Data> theTarget) = 0;
 
-  /// Returns the invalid data pointer (to avoid working with NULL shared ptrs in swig)
+  /// Returns the invalid data pointer (to avoid working with NULL shared pointers in swig)
   virtual std::shared_ptr<ModelAPI_Data> invalidPtr() = 0;
 
   /// Identifier of the transaction when object (feature or result) was updated last time.
@@ -191,13 +190,13 @@ class MODELAPI_EXPORT ModelAPI_Data
   /// This method is called by the updater.
   virtual void setUpdateID(const int theID) = 0;
 
-  /// Returns the owner of htis data
+  /// Returns the owner of this data
   virtual std::shared_ptr<ModelAPI_Object> owner() = 0;
 
-  /// Returns true if the object is deleted, but some data is still keept in memory
+  /// Returns true if the object is deleted, but some data is still kept in memory
   virtual bool isDeleted() = 0;
 
-  /// Sets true if the object is deleted, but some data is still keept in memory
+  /// Sets true if the object is deleted, but some data is still kept in memory
   virtual void setIsDeleted(const bool theFlag) = 0;
 
   /// Returns \c true if theAttribute1 is going earlier than theAttribute2 in the data
@@ -216,7 +215,7 @@ class MODELAPI_EXPORT ModelAPI_Data
 
   /// Returns true if object must be displayed in the viewer: flag is stored in the
   /// data model, so on undo/redo, open/save or recreation of object by history-playing it keeps
-  /// the original state i nthe current transaction.
+  /// the original state ithe current transaction.
   virtual bool isDisplayed() = 0;
 
   /// Sets the displayed/hidden state of the object. If it is changed, sends the "redisplay"
index cdc80286961a1c24b676f829f894e97446c6d681..43bcdd003096a5a1f34d531923a4a69a3f6c0de0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Document.h>
index be23056ae6cae47231bd735fdae8a451234b2757..6e368d7e4e3003e9b53a4dea28cc64e93bb1536a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Document_H_
@@ -46,8 +45,8 @@ class GeomAPI_Shape;
 /**\class ModelAPI_Document
  * \ingroup DataModel
  * \brief Document for internal data structure of any object storage.
- * Document contains all data that must be stored/retrived in the file.
- * Also it provides acces to this data: open/save, transactions management etc.
+ * Document contains all data that must be stored/retrieved in the file.
+ * Also it provides access to this data: open/save, transactions management etc.
  */
 class ModelAPI_Document: public ModelAPI_Entity
 {
@@ -58,7 +57,7 @@ public:
   virtual const std::string& kind() const = 0;
 
   //! Removes document data
-  //! \param theForever if it is false, document is just hiden
+  //! \param theForever if it is false, document is just hidden
   //!                   (to keep possibility make it back on Undo/Redo)
   virtual void close(const bool theForever = false) = 0;
 
@@ -128,7 +127,7 @@ public:
   //! Sets the current feature: all features below will be disabled, new features
   //! will be appended after this one. This method does not flushes the events appeared:
   //! it will be done by the finishOperation, or direct flushes
-  //! \param theCurrent the selected feature as current: blow it everythin become disabled
+  //! \param theCurrent the selected feature as current: blow it everything become disabled
   //! \param theVisible use visible features only: flag is true for Object Browser functionality
   virtual void setCurrentFeature(std::shared_ptr<ModelAPI_Feature> theCurrent,
     const bool theVisible) = 0;
@@ -141,13 +140,10 @@ public:
   virtual std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex) = 0;
   //! Performs synchronization of transactions with the module document:
   //! If some document is not active (by undo of activation) but in memory,
-  //! on activation the transactions must be synchronised because all redos performed
-  //! wihtout this participation
+  //! on activation the transactions must be synchronized because all redo-s performed
+  //! without this participation
   virtual void synchronizeTransactions() = 0;
 
-  //! Returns feature by the id of the feature (produced by the Data "featureId" method)
-  virtual std::shared_ptr<ModelAPI_Feature> featureById(const int theId) = 0;
-
   //! To virtually destroy the fields of successors
   MODELAPI_EXPORT virtual ~ModelAPI_Document();
 
@@ -204,7 +200,7 @@ public:
   virtual std::shared_ptr<ModelAPI_Folder> findFolderBelow(
       const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures) = 0;
   //! Search a folder containing the given feature.
-  //! Addtionally calculates a zero-based index of the feature in this folder.
+  //! Additionally calculates a zero-based index of the feature in this folder.
   //! \param theFeature feature to search
   //! \param theIndexInFolder zero-based index in the folder or -1 if the feature is top-level.
   //! \return the folder containing the feature or empty pointer if the feature is top-level.
@@ -213,7 +209,7 @@ public:
       int& theIndexInFolder) = 0;
   //! Add a list of features to the folder. The correctness of the adding is not performed
   //! (such checks have been done in corresponding find.. method).
-  //! \return \c true if the movement is successfull
+  //! \return \c true if the movement is successful
   virtual bool moveToFolder(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
                             const std::shared_ptr<ModelAPI_Folder>& theFolder) = 0;
   //! Remove features from the folder
@@ -250,7 +246,7 @@ public:
   /// Normally is called outside of the transaction, just before "save".
   MODELAPI_EXPORT virtual void storeNodesState(const std::list<bool>& theStates) = 0;
 
-  /// Returns the stored nodes states. Normally it is calles just after "open".
+  /// Returns the stored nodes states. Normally it is calls just after "open".
   /// Appends the values to theStates list.
   MODELAPI_EXPORT virtual void restoreNodesState(std::list<bool>& theStates) const = 0;
 
index 7ae044132ce7ebabe75b36f91fa8af0fe67786b0..a9d0ff8a32f60c5f9bf7354c62c5b95f5b2494fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Entity_H_
index f700ba16200cfef391f281f8ecdb7255fbbf13d6..cdafe34d9cb6be3b9d28ab636a2ff271a67af601 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_EventReentrantMessage.h>
index 75832c4cca89cf3299e9f69022af14a62fd49e7b..607eaf2857cc3cb68372f192c8153aa16366207f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_EventReentrantMessage_H_
index 0a425d8c2eb5e67a4e558c2c9759ce6667633009..f1bcd1e26707e11949f962c8a4b94f87c7236da8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI.h>
 ModelAPI_ObjectUpdatedMessage::ModelAPI_ObjectUpdatedMessage(const Events_ID theID,
                                                              const void* theSender)
     : Events_MessageGroup(theID, theSender)
-{
-
-}
+{}
 
 ModelAPI_ObjectUpdatedMessage::~ModelAPI_ObjectUpdatedMessage()
-{
-
-}
+{}
 
 ModelAPI_ObjectDeletedMessage::ModelAPI_ObjectDeletedMessage(const Events_ID theID,
                                                              const void* theSender)
     : Events_MessageGroup(theID, theSender)
-{
-
-}
+{}
 
 ModelAPI_ObjectDeletedMessage::~ModelAPI_ObjectDeletedMessage()
-{
-
-}
+{}
 
 ModelAPI_OrderUpdatedMessage::ModelAPI_OrderUpdatedMessage(const Events_ID theID,
                                                            const void* theSender)
     : Events_Message(theID, theSender)
-{
-
-}
+{}
 
 ModelAPI_OrderUpdatedMessage::~ModelAPI_OrderUpdatedMessage()
-{
-
-}
+{}
 
+// used by GUI only
+// LCOV_EXCL_START
 ModelAPI_FeatureStateMessage::ModelAPI_FeatureStateMessage(const Events_ID theID,
                                                            const void* theSender)
  : Events_Message(theID, theSender)
@@ -72,9 +61,7 @@ ModelAPI_FeatureStateMessage::ModelAPI_FeatureStateMessage(const Events_ID theID
 }
 
 ModelAPI_FeatureStateMessage::~ModelAPI_FeatureStateMessage()
-{
-
-}
+{}
 
 std::shared_ptr<ModelAPI_Feature> ModelAPI_FeatureStateMessage::feature() const
 {
@@ -113,7 +100,7 @@ std::list<std::string> ModelAPI_FeatureStateMessage::features() const
   }
   return result;
 }
-
+// LCOV_EXCL_STOP
 
 ModelAPI_DocumentCreatedMessage::ModelAPI_DocumentCreatedMessage(
   const Events_ID theID, const void* theSender)
@@ -240,14 +227,10 @@ const std::list<std::pair<int, int> >& ModelAPI_ComputePositionsMessage::positio
 ModelAPI_ObjectRenamedMessage::ModelAPI_ObjectRenamedMessage(const Events_ID theID,
                                                              const void* theSender)
 : Events_Message(theID, theSender)
-{
-
-}
+{}
 
 ModelAPI_ObjectRenamedMessage::~ModelAPI_ObjectRenamedMessage()
-{
-
-}
+{}
 
 void ModelAPI_ObjectRenamedMessage::send(ObjectPtr theObject,
                                          const std::string& theOldName,
@@ -295,14 +278,10 @@ void ModelAPI_ObjectRenamedMessage::setNewName(const std::string& theNewName)
 ModelAPI_ReplaceParameterMessage::ModelAPI_ReplaceParameterMessage(const Events_ID theID,
                                                                    const void* theSender)
 : Events_Message(theID, theSender)
-{
-
-}
+{}
 
 ModelAPI_ReplaceParameterMessage::~ModelAPI_ReplaceParameterMessage()
-{
-
-}
+{}
 
 void ModelAPI_ReplaceParameterMessage::send(ObjectPtr theObject,
                                             const void* theSender)
@@ -329,12 +308,10 @@ ModelAPI_SolverFailedMessage::ModelAPI_SolverFailedMessage(const Events_ID theID
                                                            const void* theSender)
   : Events_Message(theID, theSender),
     myDOF(-1)
-{
-}
+{}
 
 ModelAPI_SolverFailedMessage::~ModelAPI_SolverFailedMessage()
-{
-}
+{}
 
 void ModelAPI_SolverFailedMessage::setObjects(const std::set<ObjectPtr>& theObjects)
 {
@@ -350,8 +327,7 @@ const std::set<ObjectPtr>& ModelAPI_SolverFailedMessage::objects() const
 // =====   ModelAPI_ObjectMovedMessage   =====
 ModelAPI_ObjectMovedMessage::ModelAPI_ObjectMovedMessage(const void* theSender)
   : Events_Message(Events_Loop::eventByName(EVENT_OBJECT_MOVED), theSender)
-{
-}
+{}
 
 void ModelAPI_ObjectMovedMessage::setMovedObject(const ObjectPtr& theMovedObject)
 {
index ddef5a2d328221689f787381f81ba17adf83d93a..042c06a41d040c82902eb7c1d3bfda56037e454f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_EVENTS_H_
@@ -56,7 +55,7 @@ static const char * EVENT_PLUGIN_LOADED = "PluginLoaded";
 static const char * EVENT_DOCUMENT_CHANGED = "CurrentDocumentChanged";
 
 /// Event ID that order of objects in group is changed,
-/// so, tree must be fully rectreated (movement of feature)
+/// so, tree must be fully recreated (movement of feature)
 static const char * EVENT_ORDER_UPDATED = "OrderUpdated";
 /// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed
 static const char * EVENT_UPDATE_SELECTION = "UpdateSelection";
@@ -142,7 +141,7 @@ public:
   /// Returns the identifier of the kind of a message
   virtual const Events_ID messageId() = 0;
 
-  /// Appenad to this message the given one.
+  /// Appends to this message the given one.
   virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined) = 0;
 };
 
@@ -170,6 +169,9 @@ public:
   /// creates created, updated or moved messages and sends to the loop
   virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
                            const bool isGroupped = true) const = 0;
+  /// creates created, updated or moved messages with the objects collection and sends to the loop
+  virtual void sendUpdated(const std::list<ObjectPtr>& theObjects, const Events_ID& theEvent,
+    const bool isGroupped = true) const = 0;
   /// creates deleted message and sends to the loop
   virtual void sendDeleted(const std::shared_ptr<ModelAPI_Document>& theDoc,
                            const std::string& theGroup) const = 0;
@@ -183,7 +185,6 @@ public:
   static void set(const ModelAPI_EventCreator* theCreator);
 };
 
-// TODO(sbh): Move this message into a separate package, like "GuiAPI"
 /// Contains the state information about the feature: is it enabled or disabled.
 class ModelAPI_FeatureStateMessage : public Events_Message
 {
@@ -470,7 +471,7 @@ private:
   int myDOF;
 };
 
-/// Message sent when feature or attrubute has been moved.
+/// Message sent when feature or attribute has been moved.
 /// Stores the moving object/attribute, original and new positions of mouse.
 class ModelAPI_ObjectMovedMessage : public Events_Message
 {
index c0ffdf16d67b6061157d3c22df960ab129b1e1c2..6410f049a9c24098c9fa26de6cd0222f83932cb2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Expression.h"
@@ -54,14 +53,18 @@ bool ModelAPI_Expression::isVariable(const std::string& theString)
 {
   if (theString.empty())
     return false;
-  std::string::const_iterator it = theString.begin();
-  if (!(isalpha(*it) || (*it) == '_') || it == theString.end())
-    return false;
-  it++;
-  for ( ; it != theString.end(); ++it ) {
-    if(!(isalnum(*it) || (*it) == '_')) {
+  try {
+    std::string::const_iterator it = theString.begin();
+    if (!(isalpha(*it) || (*it) == '_') || it == theString.end())
       return false;
+    it++;
+    for ( ; it != theString.end(); ++it ) {
+      if(!(isalnum(*it) || (*it) == '_')) {
+        return false;
+      }
     }
+  } catch(...) {
+    return false;
   }
   return true;
 }
index 6708c7011147a87bf09b96f5bfb4b5eeb5c55305..6b7c8839e99ddc1d6cd4c4374aa52aeed90b9d24 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Expression_H_
index 236ee3dffae018b4abd0b3d589a3f5ede79e74b2..6eacd88767ff741bde1d1766ab8487f852cb14ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Feature.h"
@@ -88,15 +87,6 @@ void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResu
   theResult->setDisabled(theResult, false);
 }
 
-void ModelAPI_Feature::removeResult(const std::shared_ptr<ModelAPI_Result>& theResult)
-{
-  theResult->setDisabled(theResult, true);
-  // flush visualisation changes
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  aLoop->flush(aRedispEvent);
-}
-
 void ModelAPI_Feature::eraseResultFromList(const std::shared_ptr<ModelAPI_Result>& theResult)
 {
   std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myResults.begin();
@@ -138,7 +128,7 @@ void ModelAPI_Feature::removeResults(
     }
   }
   if (!aGroup.empty() && theFlush) {
-    // flush visualisation changes
+    // flush visualization changes
     static Events_Loop* aLoop = Events_Loop::loop();
     static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
     aLoop->flush(aRedispEvent);
@@ -173,8 +163,10 @@ void ModelAPI_Feature::erase()
   while (!myResults.empty()) {  // remove one by one with messages
     std::shared_ptr<ModelAPI_Result> aRes = *(myResults.begin());
     aRes->setDisabled(aRes, true); // to avoid activation of the Part result
-    if (!myResults.empty()) // disabling result may erase the list (on undo of Part, issue 665)
+    if (!myResults.empty()) {// disabling result may erase the list (on undo of Part, issue 665)
       myResults.erase(myResults.begin());
+      aRes->erase();
+    }
   }
   ModelAPI_Object::erase();
 }
@@ -232,6 +224,7 @@ bool ModelAPI_Feature::isDisabled()
   return myIsDisabled;
 }
 
+// LCOV_EXCL_START
 bool ModelAPI_Feature::setStable(const bool theFlag)
 {
   if (myIsStable != theFlag) {
@@ -245,6 +238,7 @@ bool ModelAPI_Feature::setStable(const bool theFlag)
   }
   return false;
 }
+// LCOV_EXCL_STOP
 
 bool ModelAPI_Feature::isStable()
 {
index 1e44a2b9e434929e175269311d3a50c5b16c3210..fe7cc35e872465e157331fc81353a5416ecfb5ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Feature_H_
@@ -97,8 +96,6 @@ class ModelAPI_Feature : public ModelAPI_Object
   /// sets the result by index (zero based), results before this must be set before
   MODELAPI_EXPORT void setResult(const std::shared_ptr<ModelAPI_Result>& theResult,
                                  const int theIndex);
-  /// removes the result from the feature
-  MODELAPI_EXPORT void removeResult(const std::shared_ptr<ModelAPI_Result>& theResult);
   /// removes all results starting from the given index (zero-based)
   /// \param theSinceIndex - index of the deleted result and all after also will be deleted
   /// \param theForever - removes results for long period (not just because of feature disabling)
index 1f679054bf73b49ec1c5239c547ec3a945788738..ee7ea3afbb052c0eecb4d4864d603b2e285ad124 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_FeatureValidator.h"
index 2d87158b7ec881ecb1908c90fe7227addd99a831..627575345d1974d6a882a9105c8587735c29f7c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_FeatureValidator_H
index 1cc97cb366036f7aa5648ec91b0fdd6b14e34594..df1ac82a6fa30a73ddfde683ec3660d97286a796 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Folder.h"
index b89fd8704bfc75e6a01f6c13c84468ec63618246..7945ff12d1917d13ec3080dc07b63e4f1e30cbf6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Folder_H_
index 823774dd36e5d8e684f028b237767f90682bdd9e..ff65b41e8b7380418b0911e1f4a76e4fb2394e97 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_IReentrant.h>
index baaab234ccbb0333d35afbc056fb8b85a4d198ff..553cfb0980ecc9a98d2ce576ed34f80b2dd19d65 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_IReentrant_H
index 7ac3149efe54ac969691a1d87c71c3d5f21c76ea..3aee97e8b8728e4d41a0fc64a1c47b7a72e7897d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Object.h"
index 1f09fb2becbbd7805c565e2e895bc18a628a21dc..52b7bffa0b4fe5196d9dde79bbf8a10bf6184481 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Object_H_
@@ -30,7 +29,7 @@
 class ModelAPI_Data;
 class ModelAPI_Document;
 
-// sometimes it is usefull for debug to see name of each object (bad for memory and performance)
+// sometimes it is useful for debug to see name of each object (bad for memory and performance)
 //#define DEBUG_NAMES
 
 /**\class ModelAPI_Object
@@ -115,6 +114,7 @@ class ModelAPI_Object: public ModelAPI_Entity
   MODELAPI_EXPORT virtual void erase();
 
   friend class Model_Objects;
+  friend class ModelAPI_Feature;
   friend class Model_Document;
 
 };
index f3fcb7837677f12b2cb51cdfa608a1585fc1fcd5..309e629f37ba9c98335b21ddc89df6161c256ec5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Plugin.h"
index 29953b3a8ed4df8aa859c04f474614836c961be3..27959513efa2a47e5e1893696e90b5063e34bb36 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Plugin_H_
index 588d138bf17cb447927b3273fed0f6fdfbeb1988..c92a8ea3ba59e72cb826373876de674093503b6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Result.h"
@@ -35,9 +34,9 @@ void ModelAPI_Result::initAttributes()
 {
   // append the color attribute. It is empty, the attribute will be filled by a request
   DataPtr aData = data();
-  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
-  aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
-  aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId());
+  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
+  aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
+  aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
 }
 
 bool ModelAPI_Result::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
index c418e7ac70c85286387f7b407f6d17f24089cbb9..aee93eed670997a353381b42c18358d56873d8dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Result_H_
index 0ee6696c2e4d28b6c8e8b79eb1d020d618e449ba..603aaac4df93d98a740c804eefbafa7a4928d40d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_ResultBody.h"
@@ -39,8 +38,8 @@ std::string ModelAPI_ResultBody::groupName()
   return group();
 }
 
-void ModelAPI_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
-  const bool theIsStoreSameShapes)
+void ModelAPI_ResultBody::store(const GeomShapePtr& theShape,
+                                const bool theIsStoreSameShapes)
 {
   myBuilder->store(theShape, theIsStoreSameShapes);
   myConnect = ConnectionNotComputed;
@@ -53,8 +52,8 @@ void ModelAPI_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
   updateSubs(theShape);
 }
 
-void ModelAPI_ResultBody::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-  const std::shared_ptr<GeomAPI_Shape>& theToShape)
+void ModelAPI_ResultBody::storeGenerated(const GeomShapePtr& theFromShape,
+                                         const GeomShapePtr& theToShape)
 {
   myBuilder->storeGenerated(theFromShape, theToShape);
   myConnect = ConnectionNotComputed;
@@ -67,11 +66,11 @@ void ModelAPI_ResultBody::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& t
   updateSubs(theToShape);
 }
 
-void ModelAPI_ResultBody::storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-  const int theDecomposeSolidsTag)
+void ModelAPI_ResultBody::storeGenerated(
+  const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  myBuilder->storeModified(theOldShape, theNewShape, theDecomposeSolidsTag);
+  myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape);
   myConnect = ConnectionNotComputed;
 
   static Events_Loop* aLoop = Events_Loop::loop();
@@ -79,99 +78,74 @@ void ModelAPI_ResultBody::storeModified(const std::shared_ptr<GeomAPI_Shape>& th
   static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
   aECreator->sendUpdated(data()->owner(), aRedispEvent);
 
-  updateSubs(theNewShape);
+  updateSubs(theToShape, theFromShapes, theMakeShape, true);
 }
 
-void ModelAPI_ResultBody::storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape)
+void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape,
+                                        const GeomShapePtr& theNewShape,
+                                        const bool theIsCleanStored)
 {
-  myBuilder->storeWithoutNaming(theShape);
+  myBuilder->storeModified(theOldShape, theNewShape, theIsCleanStored);
   myConnect = ConnectionNotComputed;
 
   static Events_Loop* aLoop = Events_Loop::loop();
   static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
   static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
   aECreator->sendUpdated(data()->owner(), aRedispEvent);
-}
-
-std::shared_ptr<GeomAPI_Shape> ModelAPI_ResultBody::shape()
-{
-  return myBuilder->shape();
-}
 
-void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-  const std::string& theName, const int theTag)
-{
-  myBuilder->generated(theNewShape, theName, theTag);
-}
-
-void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-  const int theTag)
-{
-  myBuilder->generated(theOldShape, theNewShape, theName, theTag);
+  updateSubs(theNewShape);
 }
 
-void ModelAPI_ResultBody::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-  const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-  const int theTag)
+void ModelAPI_ResultBody::storeModified(
+  const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
 {
-  myBuilder->modified(theOldShape, theNewShape, theName, theTag);
-}
+  myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape);
+  myConnect = ConnectionNotComputed;
 
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
 
-void ModelAPI_ResultBody::deleted(
-  const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag)
-{
-  myBuilder->deleted(theOldShape, theTag);
+  updateSubs(theNewShape, theOldShapes, theMakeShape, false);
 }
 
-void ModelAPI_ResultBody::loadDeletedShapes(GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-  const int  theKindOfShape,
-  const int  theTag,
-  const GeomShapePtr theShapes)
+GeomShapePtr ModelAPI_ResultBody::shape()
 {
-  myBuilder->loadDeletedShapes(theMS, theShapeIn, theKindOfShape, theTag, theShapes);
+  return myBuilder->shape();
 }
 
-void ModelAPI_ResultBody::loadAndOrientModifiedShapes(GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape, const int  theTag,
-  const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
-  const bool theIsStoreSeparate,
-  const bool theIsStoreAsGenerated,
-  const bool /*theSplitInSubs*/)
+void ModelAPI_ResultBody::generated(const GeomShapePtr& theOldShape,
+                                    const GeomShapePtr& theNewShape,
+                                    const std::string& theName)
 {
-  myBuilder->loadAndOrientModifiedShapes(
-    theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
-    theIsStoreAsGenerated);
+  myBuilder->generated(theOldShape, theNewShape, theName);
 }
 
-void ModelAPI_ResultBody::loadAndOrientGeneratedShapes(GeomAlgoAPI_MakeShape* theMS,
-  std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape,
-  const int  theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes)
+void ModelAPI_ResultBody::modified(const GeomShapePtr& theOldShape,
+                                   const GeomShapePtr& theNewShape,
+                                   const std::string& theName)
 {
-  myBuilder->loadAndOrientGeneratedShapes(
-    theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes);
+  myBuilder->modified(theOldShape, theNewShape, theName);
 }
 
-void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
-  const std::string& theName, int&  theTag)
-{
-  myBuilder->loadFirstLevel(theShape, theName, theTag);
-}
 
-void ModelAPI_ResultBody::loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
-  const std::string& theName, int&  theTag)
+void ModelAPI_ResultBody::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
+                                            const GeomShapePtr& theOldShape,
+                                            const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                            const GeomShapePtr& theShapesToExclude)
 {
-  myBuilder->loadDisconnectedEdges(theShape, theName, theTag);
+  myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude);
 }
 
-void ModelAPI_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
-  const std::string& theName, int&  theTag)
+void ModelAPI_ResultBody::loadFirstLevel(GeomShapePtr theShape,
+                                         const std::string& theName)
 {
-  myBuilder->loadDisconnectedVertexes(theShape, theName, theTag);
+  myBuilder->loadFirstLevel(theShape, theName);
 }
 
+// LCOV_EXCL_START
 bool ModelAPI_ResultBody::isConnectedTopology()
 {
   if (myConnect == ConnectionNotComputed) {
@@ -186,3 +160,4 @@ void ModelAPI_ResultBody::setDisplayed(const bool theDisplay)
   for (int i = 0; i < numberOfSubs(); i++)
     subResult(i)->setDisplayed(theDisplay);
 }
+// LCOV_EXCL_STOP
index b934744c6a93e15336f28d498dc8c5f912b1012f..0991119bd56c931ed13a666172efc1fe8e2ed15d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_ResultBody_H_
@@ -36,12 +35,12 @@ class GeomAlgoAPI_MakeShape;
 * Provides a shape that may be displayed in the viewer.
 * May provide really huge results, so, working with this kind
 * of result must be optimized.
-* Also provides a conainer of sub-body result in case it is compound or compsolid.
+* Also provides a container of sub-body result in case it is compound or compsolid.
 */
 class ModelAPI_ResultBody : public ModelAPI_Result
 {
 public:
-  /// Iternal enumeration for storage the information of connected topology flag
+  /// Internal enumeration for storage the information of connected topology flag
   enum ConnectedTopologyFlag {
     ConnectionNotComputed, ///< not yet computed
     IsConnected,           ///< the topology is connected
@@ -87,7 +86,7 @@ public:
   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultBody> subResult(
     const int theIndex, bool forTree = false) const = 0;
 
-  /// Returns true if feature or reuslt belong to this composite feature as subs
+  /// Returns true if feature or result belong to this composite feature as subs
   /// Returns theIndex - zero based index of sub if found
   MODELAPI_EXPORT virtual bool isSub(ObjectPtr theObject, int& theIndex) const = 0;
 
@@ -95,81 +94,75 @@ public:
   /// param[in] theShape shape to store.
   /// param[in] theIsStoreSameShapes if false stores reference to the same shape
   ///                                if it is already in document.
-  MODELAPI_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape,
-    const bool theIsStoreSameShapes = true);
+  MODELAPI_EXPORT virtual void store(const GeomShapePtr& theShape,
+                                     const bool theIsStoreSameShapes = true);
 
   /// Stores the generated shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-    const std::shared_ptr<GeomAPI_Shape>& theToShape);
+  MODELAPI_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape,
+                                              const GeomShapePtr& theToShape);
+
+  /// Stores the root modified shapes (called by the execution method).
+  MODELAPI_EXPORT virtual void storeGenerated(
+    const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 
   /// Stores the modified shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theDecomposeSolidsTag = 0);
+  MODELAPI_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape,
+                                             const GeomShapePtr& theNewShape,
+                                             const bool theIsCleanStored = true);
 
-  /// Stores the shape without naming support
-  MODELAPI_EXPORT virtual void storeWithoutNaming(
-    const std::shared_ptr<GeomAPI_Shape>& theShape);
+  /// Stores the root modified shapes (called by the execution method).
+  MODELAPI_EXPORT virtual void storeModified(
+    const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
 
   /// Returns the shape-result produced by this feature
-  MODELAPI_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
+  MODELAPI_EXPORT virtual GeomShapePtr shape();
 
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
-  MODELAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape,
-    const std::string& theName, const int theTag = 1);
+  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
+  MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) = 0;
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological
   /// construction. As an example, consider the case of a face generated from an edge in
   /// construction of a prism.
-  MODELAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-    const int theTag = 1);
+  MODELAPI_EXPORT virtual void generated(const GeomShapePtr& theOldShape,
+                                         const GeomShapePtr& theNewShape,
+                                         const std::string& theName = "");
 
   /// Records the shape newShape which is a modification of the shape oldShape.
   /// As an example, consider the case of a face split or merged in a Boolean operation.
-  MODELAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
-    const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
-    const int theTag = 1);
-
-  /// Records the shape oldShape which was deleted from the current label.
-  /// As an example, consider the case of a face removed by a Boolean operation.
-  MODELAPI_EXPORT virtual void deleted(
-    const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1);
+  MODELAPI_EXPORT virtual void modified(const GeomShapePtr& theOldShape,
+                                        const GeomShapePtr& theNewShape,
+                                        const std::string& theName = "");
 
   /// load deleted shapes
-  MODELAPI_EXPORT virtual void loadDeletedShapes(GeomAlgoAPI_MakeShape* theMS,
-    std::shared_ptr<GeomAPI_Shape>  theShapeIn,
-    const int  theKindOfShape,
-    const int  theTag,
-    const GeomShapePtr theShapes = GeomShapePtr());
+  MODELAPI_EXPORT
+  virtual void loadDeletedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                 const GeomShapePtr& theOldShape,
+                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                 const GeomShapePtr& theShapesToExclude = GeomShapePtr());
 
   /// load and orient modified shapes
-  MODELAPI_EXPORT virtual void loadAndOrientModifiedShapes(GeomAlgoAPI_MakeShape* theMS,
-    std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape, const int  theTag,
-    const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
-    const bool theIsStoreSeparate = false, const bool theIsStoreAsGenerated = false,
-    const bool theSplitInSubs = false);
+  MODELAPI_EXPORT
+  virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                  const GeomShapePtr& theOldShape,
+                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                  const std::string& theName = "") = 0;
 
   /// load and orient generated shapes
-  MODELAPI_EXPORT virtual void loadAndOrientGeneratedShapes(GeomAlgoAPI_MakeShape* theMS,
-    std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape,
-    const int  theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes);
+  MODELAPI_EXPORT
+  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "",
+                                   const bool theSaveOldIfNotInTree = false) = 0;
 
   /// load shapes of the first level (to be used during shape import)
-  MODELAPI_EXPORT virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
-    const std::string& theName, int&  theTag);
-
-  /// load disconnected edges
-  MODELAPI_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
-    const std::string& theName, int&  theTag);
-
-  /// load disconnected vetexes
-  MODELAPI_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
-    const std::string& theName, int&  theTag);
-
-  /// Returns true if the latest modification of this body in the naming history
-  // is equal to the given shape
-  MODELAPI_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
+  MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
+                                              const std::string& theName);
 
   /// Returns true is the topology is connected.
   MODELAPI_EXPORT virtual bool isConnectedTopology() = 0;
@@ -179,9 +172,17 @@ public:
   MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
 
   /// Updates the sub-bodies if shape of this object is compsolid or compound
-  MODELAPI_EXPORT virtual void updateSubs(const std::shared_ptr<GeomAPI_Shape>& theThisShape,
+  MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape,
     const bool theShapeChanged = true) = 0;
 
+  /// Updates the sub-bodies in accordance to the algorithm history information
+  MODELAPI_EXPORT virtual void updateSubs(
+    const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated) = 0;
+
+  /// Cleans cash related to the already stored elements
+  MODELAPI_EXPORT virtual void cleanCash() = 0;
+
 protected:
   /// Default constructor accessible only from Model_Objects
   MODELAPI_EXPORT ModelAPI_ResultBody();
index 328d9cbabecec33d80a91e0ff07a16e06471df86..f647553f33c895236375b634d649b807bde43649 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_ResultConstruction.h"
index ff637277d5d1c72940ae44e7714b1c85e0aadb9a..0f24b3829ab8584f33db216d8182656334b1f2e5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_ResultConstruction_H_
@@ -63,6 +62,10 @@ class ModelAPI_ResultConstruction : public ModelAPI_Result
   /// Sets the result
   virtual void setShape(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
 
+  /// Updates the shape taking the current value from the data structure, returns true
+  /// if update has been correctly done
+  virtual bool updateShape() = 0;
+
   /// Sets the flag that it must be displayed in history (default is true)
   virtual void setIsInHistory(const bool isInHistory) = 0;
 
index 7eda1aa47121cf9f295fa84cbc43a6a1ce08e080..760887376fbac9b4462f4abef223ce1d9c00931b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_ResultField.h"
index bdb75e83f78e10114f9d966a3d80137ecbd26b79..eb9d4a7b61931ffe2fba531025efe8a701ad5325 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_ResultField_H_
index e18497a3c86e6b0a34fca8ade951c7cb9a6b274a..1c392ed43c3f69d1a9dcdd351261abf662df8867 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_ResultGroup.h"
index a2ca77e472fe3766bb137b1ee1c960986b927d9f..8644fc1cfda754e909db316bf36c11e9f54c4eee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_ResultGroup_H_
index b0bf13ebaa28afb377fd83846e822de0c3db0168..b8366e05d7b97343c9a4993b585f5dbeba9a8ede 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_ResultParameter.h"
index 195d2fac9b4a2e78da887f2963f7f36e35bef701..a3627e09fccfef837cc724ad5cb5df97ac887c83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELAPI_RESULTPARAMETER_H_
index e48dc9eda70b405a1eaa20aa3c1688e5948c21b6..304c2ac7c622154e8771b4b6f0516cd4edd1ab54 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_ResultPart.h>
index bd8a697f8529060f2e3249b01bf9d3534b13171e..bb49d51881de73ff435cd2a90bd7cd38784dcc7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_ResultPart_H_
@@ -63,7 +62,7 @@ class ModelAPI_ResultPart : public ModelAPI_Result
   /// Returns the part-document of this result
   virtual std::shared_ptr<ModelAPI_Document> partDoc() = 0;
 
-  /// Returns the original part result: for transfomration features results this is
+  /// Returns the original part result: for transformation features results this is
   /// the original Part feature result
   virtual std::shared_ptr<ModelAPI_ResultPart> original() = 0;
 
@@ -87,6 +86,9 @@ class ModelAPI_ResultPart : public ModelAPI_Result
   virtual std::shared_ptr<GeomAPI_Shape> shapeInPart(
     const std::string& theName, const std::string& theType, int& theIndex) = 0;
 
+  /// Updates the selection inside of the part as a geometrical selection
+  virtual bool combineGeometrical(const int theIndex, std::string& theNewName) = 0;
+
   /// Returns the shape selected in the selection index
   virtual std::shared_ptr<GeomAPI_Shape> selectionValue(const int theIndex) = 0;
 
index 3d5a9591799236facb99edc59e218d634f4367de..b085ed52c36efbe6713c1d052bf13a11c751edcb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Session.h>
index 546108c956de92a937b143418edecf02064f6d7e..87d2350fda3f68c09be67158a4c08bc44412b21f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Session_H_
old mode 100755 (executable)
new mode 100644 (file)
index 0b58e55..074b903
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Tools.h"
@@ -119,6 +118,7 @@ const char* toString(ModelAPI_ExecState theExecState)
   }
 }
 
+// LCOV_EXCL_START
 std::string getFeatureError(const FeaturePtr& theFeature)
 {
   std::string anError;
@@ -159,6 +159,7 @@ std::string getFeatureError(const FeaturePtr& theFeature)
 
   return anError;
 }
+// LCOV_EXCL_STOP
 
 ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGroup,
                        const std::string& theName)
old mode 100755 (executable)
new mode 100644 (file)
index 0b21a3c..d566822
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Tools_HeaderFile
index a2c8af67abe69d060c96f75bcb140f12376753e4..b37a16d719f5efb3ef46f08730285a9f2b402798 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelAPI_Validator_H_
@@ -128,6 +127,12 @@ class MODELAPI_EXPORT ModelAPI_ValidatorsFactory
  /// Returns true if the attribute must be checked (the case is selected)
   virtual bool isCase(FeaturePtr theFeature, std::string theAttribute) = 0;
 
+  /// Register the selection attribute as geometrical selection
+  virtual void registerGeometricalSelection(std::string theFeature, std::string theAttribute) = 0;
+
+  /// Returns true if the attribute is a geometrical selection
+  virtual bool isGeometricalSelection(std::string theFeature, std::string theAttribute) = 0;
+
  protected:
   /// Get instance from Session
   ModelAPI_ValidatorsFactory()
index 320d3771ae7c656321630ab8ef716c52a68c6f0f..243359d684a5b228939fed03baa5a9cec24312fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELAPI_MODELAPI_SWIG_H_
index bd2599e08c9ca09a496b8c57848ff9458289c8a2..b404f65a0c3e0f3a42485e1ac5b291b34de46856 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       Test1064.py
@@ -71,14 +70,10 @@ aPart = aSession.activeDocument()
 #=========================================================================
 # Make extrusion on triangle
 #=========================================================================
-aSketchResult = aSketchFeature.firstResult()
-aSketchEdges = modelAPI_ResultConstruction(aSketchResult).shape()
-aSketchFaces = ShapeList()
-GeomAlgoAPI_SketchBuilder.createFaces(
-    origin.pnt(), dirx.dir(), norm.dir(), aSketchEdges, aSketchFaces)
+aSketchResult = modelAPI_ResultConstruction(aSketchFeature.firstResult())
 aSession.startOperation()
 anExtrusionFt = aPart.addFeature("Extrusion")
-anExtrusionFt.selectionList("base").append(aSketchResult, aSketchFaces[0])
+anExtrusionFt.selectionList("base").append(aSketchResult, aSketchResult.face(0))
 anExtrusionFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFt.real("to_size").setValue(50)
 anExtrusionFt.real("from_size").setValue(0)
@@ -93,7 +88,7 @@ aSession.setActiveDocument(aPartSet)
 aPlane = aPartSet.addFeature("Plane")
 aPlane.string("creation_method").setValue("by_other_plane")
 aPlane.string("by_other_plane_option").setValue("by_distance_from_other")
-aPlane.selection("plane").selectSubShape("face", "Part_1/Extrusion_1_1/Generated_Face_2")
+aPlane.selection("plane").selectSubShape("face", "Part_1/_weak_name_5_Extrusion_1_1")
 aPlane.real("distance").setValue(0.001)
 aPlane.boolean("reverse").setValue(False)
 aSession.finishOperation()
old mode 100755 (executable)
new mode 100644 (file)
index 5a8182c..2a80f89
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       Test1512.py
@@ -155,13 +154,13 @@ def check_owner(selection, topology_type, feature):
   aSession.abortOperation()
 
 # check faces
-check_owner("Extrusion_1_1/Generated_Face_1", "face", aBox)
-check_owner("Fuse_1_1/Modified_Face_2", "face", aBox)
-check_owner("Cut_1_1/Modified_Face_1", "face", aHoleExt)
-check_owner("Fuse_1_1/Modified_Face_1", "face", aTower)
+check_owner("Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4", "face", aBox)
+check_owner("Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face", "face", aBox)
+check_owner("Cut_1_1/Modified_Face&Sketch_2/SketchCircle_1_2", "face", aHoleExt)
+check_owner("Fuse_1_1/Modified_Face&Sketch_3/SketchCircle_2_2", "face", aTower)
 # check edges without ambiguity
-check_owner("Fuse_1_1/Modified_Face_2&Extrusion_1_1/Generated_Face_2", "edge", aBox)
-check_owner("Fuse_1_1/Modified_Face_1&Extrusion_3_1/To_Face_1", "edge", aTower)
+check_owner("[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", "edge", aBox)
+check_owner("[Fuse_1_1/Modified_Face&Sketch_3/SketchCircle_2_2][Extrusion_3_1/To_Face]", "edge", aTower)
 
 # check the connected topology method: solid is not a compound of connected topology
 assert(aFuse.firstResult().shape().isConnectedTopology() == False)
diff --git a/src/ModelAPI/Test/Test1562.py b/src/ModelAPI/Test/Test1562.py
new file mode 100644 (file)
index 0000000..f5ab514
--- /dev/null
@@ -0,0 +1,81 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+lenParam = model.addParameter(Part_1_doc, "len", "45")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(63.23267137124048, -31.30105453337777, -32.56343706523536, -31.30105453337777)
+SketchLine_2 = Sketch_1.addLine(-32.56343706523536, -31.30105453337777, -32.56343706523536, -163.6364723017416)
+SketchLine_3 = Sketch_1.addLine(-32.56343706523536, -163.6364723017416, 63.23267137124048, -163.6364723017416)
+SketchLine_4 = Sketch_1.addLine(63.23267137124048, -163.6364723017416, 63.23267137124048, -31.30105453337777)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"))
+SketchLine_5 = Sketch_2.addLine(43.23267137124047, 69.97394590606471, -1.767328628759523, 69.97394590606471)
+SketchLine_6 = Sketch_2.addLine(-1.767328628759523, 69.97394590606471, -1.767328628759523, 20.8583125692591)
+SketchLine_7 = Sketch_2.addLine(-1.767328628759523, 20.8583125692591, 43.23267137124047, 20.8583125692591)
+SketchLine_8 = Sketch_2.addLine(43.23267137124047, 20.8583125692591, 43.23267137124047, 69.97394590606471)
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"), False)
+SketchLine_9 = SketchProjection_1.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_9.result(), SketchLine_7.endPoint(), 20, True)
+SketchConstraintLength_1 = Sketch_2.setLength(SketchLine_7.result(), "len")
+model.do()
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), 0, model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_8"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_8"))
+SketchCircle_1 = Sketch_3.addCircle(-89.76476373103716, -34.76230113958862, 5.223553090716001)
+ExtrusionCut_2.setNestedSketch(Sketch_3)
+model.do()
+# on increase of parameter selected part of extrusion is increased and selected face is removed (U becomes L)
+# so, check that selection is still correct and cut from not existing part produces correct shape anyway
+lenParam.setValue(100)
+model.do()
+
+# check the result validity
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(ExtrusionCut_2.feature()))
+
+# set the value back to avoid changed the name text in selection of "to_object" in check python dump
+lenParam.setValue(45)
+
+model.end()
+
+assert(model.checkPythonDump())
index 8418bdc89bf762d073b2768ab3ce4e1982cfb223..2131c35955180a1c31e81182297677f358c5fd4a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       Test1757.py
@@ -54,13 +53,13 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 300, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 300, 0)
 
 #=========================================================================
 # Cut another rectangle to make a groove
 #=========================================================================
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/To_Face_1"), 0, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"))
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/To_Face"), 0, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
 SketchLine_5 = Sketch_2.addLine(-47.794137712106, -188.943752610533, 90.842718875892, -188.943752610533)
 SketchLine_6 = Sketch_2.addLine(90.842718875892, -188.943752610533, 90.842718875892, -51.567231082425)
 SketchLine_7 = Sketch_2.addLine(90.842718875892, -51.567231082425, -47.794137712106, -51.567231082425)
@@ -79,8 +78,8 @@ model.do()
 #=========================================================================
 # Make a cylindrical hole using one of the produced faces
 #=========================================================================
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"))
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_6)(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4)"))
 SketchCircle_1 = Sketch_3.addCircle(143.412751420315, -228.52745656314, 32.158435160764)
 ExtrusionCut_2.setNestedSketch(Sketch_3)
 
@@ -92,8 +91,8 @@ Part_1.document().setCurrentFeature(ExtrusionCut_1.feature(), True)
 #=========================================================================
 # Modify the cylindrical hole base face by another groove in the history before the hole is created
 #=========================================================================
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), -50, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"))
 SketchLine_9 = Sketch_4.addLine(-176.701443076057, -151.212050129331, -91.83965287802501, -151.212050129331)
 SketchLine_10 = Sketch_4.addLine(-91.83965287802501, -151.212050129331, -91.83965287802501, -84.473709256573)
 SketchLine_11 = Sketch_4.addLine(-91.83965287802501, -84.473709256573, -176.701443076057, -84.473709256573)
@@ -125,6 +124,6 @@ import ModelAPI
 
 assert(ModelAPI.ModelAPI_Session.get().validators().validate(Sketch_4.feature()))
 assert(ModelAPI.ModelAPI_Session.get().validators().validate(ExtrusionCut_2.feature()))
-assert(Sketch_3.feature().selection("External").namingName() == "ExtrusionCut_3_1/Modfied_5")
+assert(Sketch_3.feature().selection("External").namingName() == "(ExtrusionCut_3_1/Modified_Face&Sketch_2/SketchLine_6)(ExtrusionCut_3_1/Modified_Face&Sketch_1/SketchLine_4)(ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face)")
 
 assert(model.checkPythonDump())
index 123cab3cb370fffb75893422f0db433ba33a7ee2..9e24a9f1b51ef6288ebcbb78830400a8f2dcd2e2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Lighter case to reproduce problem of #1995
 # The problem was in axis that contained sub-shapes naming of the sketch and the extrusion becomes
@@ -42,9 +41,9 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"))
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_2"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"), model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 50, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"))
 SketchCircle_1 = Sketch_2.addCircle(12.88847795756506, 28.93359954982685, 11.55225986344597)
 model.do()
 
index 743598addfd710c08254055a1db31e7e09850198..2aa2e12c40518339abcc7993caa6c85b58a8f34e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -27,8 +28,9 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(-106.3464837049742, -78.0445969125214, -108.0617495711835, 165.5231560891939)
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")])
+model.do()
 model.end()
 
 assert(model.checkPythonDump())
index daf3d34731eeb2e6ef43b24a0d864e34d9bc0b09..a814c829e37f294f6e1190e4b829813bb2d2b2cd 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,7 +48,7 @@ SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_2.startPoint()
 SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_6")
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 200)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), 200)
-SketchArc_2 = Sketch_1.addArc(250, 0, 1.232595164407831e-032, 0, 500, 0, False)
+SketchArc_2 = Sketch_1.addArc(250, 0, 1.232595164407831e-32, 0, 500, 0, False)
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_2.center())
 SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_7")
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchArc_2.startPoint())
@@ -63,10 +64,11 @@ SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_12")
 model.do()
 Sketch_1.setName("toto")
 Sketch_1.result().setName("tutu")
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "tutu/Face-SketchLine_1f-SketchLine_3f-SketchArc_1_2f-SketchArc_2_2f")], model.selection(), 10, 0)
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "tutu/Edge-SketchLine_2")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "tutu/Face-SketchLine_1r-SketchArc_2_2f-SketchLine_3f-SketchArc_1_2f")], model.selection(), 10, 0)
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "tutu/SketchLine_2")])
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_1_1")], model.selection("EDGE", "PartSet/OZ"), 100, 0)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Extrusion_2_1/Generated_Edge_2&Extrusion_2_1/To_Edge_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Edge_1&Extrusion_2_1/To_Edge_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Extrusion_2_1/Generated_Edge&tutu/SketchLine_2_StartVertex]e[Extrusion_2_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_2_1/Generated_Edge&tutu/SketchLine_2_EndVertex]e[Extrusion_2_1/To_Edge]e")])
+model.do()
 model.end()
 
 # check that resulting group selection is valid
index 1da5212a856bc0705b6a8e4ef5712b7b4dd900ae..17ad6a697f4aabf1146e3d8f2c392e969bb97c5b 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -31,16 +32,16 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_1.coordinates
 model.do()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2f")], model.selection(), 5, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchCircle_2_2f-SketchCircle_1_2r")], model.selection(), 5, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchCircle_3 = Sketch_2.addCircle(-0.01730125245914903, 1.175069067120482, 0.2787321880802174)
 SketchCircle_4 = Sketch_2.addCircle(-0.01730125245914903, 1.175069067120482, 0.3197841740766353)
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchCircle_4.center())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchCircle_2_2f")], model.selection(), 0, 3)
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchCircle_1_2f")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face_1"), 0, model.selection(), 0)
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/XOZ"))
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_1_2r")], model.selection(), 0, 3)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1/Face-SketchCircle_1_2f")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face"), 0, model.selection(), 0)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_1 = Sketch_3.addLine(-3.362323990279312, -0.5188129046480872, 0.8318943090987101, -0.5188129046480872)
 SketchLine_2 = Sketch_3.addLine(0.8318943090987101, -0.5188129046480872, 0.8318943090987101, 7.155729512171993)
 SketchLine_3 = Sketch_3.addLine(0.8318943090987101, 7.155729512171993, -3.362323990279312, 7.155729512171993)
@@ -54,15 +55,16 @@ SketchConstraintVertical_1 = Sketch_3.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_3.setVertical(SketchLine_4.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_1")])
-Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_2_2f")], model.selection(), model.selection("FACE", "Extrusion_2_1/From_Face_1"), 0, model.selection(), 0)
-Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_4_1")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Cut_2_1"), model.selection("FACE", "Face_1_1")])
-Remove_SubShapes_1_objects = [model.selection("SOLID", "Partition_1_1_1_1"), model.selection("SOLID", "Partition_1_1_1_2"), model.selection("SOLID", "Partition_1_1_1_3"), model.selection("SOLID", "Partition_1_1_1_4")]
+Face_1_objects = [model.selection("EDGE", "Sketch_2/SketchLine_2"), model.selection("EDGE", "Sketch_2/SketchLine_3"), model.selection("EDGE", "Sketch_2/SketchLine_4"), model.selection("EDGE", "Sketch_2/SketchLine_1")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_2_2f-SketchCircle_1_2r_wire")], model.selection(), model.selection("FACE", "Extrusion_2_1/From_Face"), 0, model.selection(), 0)
+Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_4_1")])
+Partition_1_objects = [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Cut_2_1"), model.selection("FACE", "Face_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Remove_SubShapes_1_objects_1 = [model.selection("SOLID", "Partition_1_1_1_1"), model.selection("SOLID", "Partition_1_1_1_2"), model.selection("SOLID", "Partition_1_1_1_3"), model.selection("SOLID", "Partition_1_1_1_4")]
 Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPOUND", "Partition_1_1"))
-Remove_SubShapes_1.setSubShapesToKeep(Remove_SubShapes_1_objects)
-
-
+Remove_SubShapes_1.setSubShapesToKeep(Remove_SubShapes_1_objects_1)
+model.do()
 model.end()
 
 # check that remove sub-shapes contains correct selection
index 10747cdea20fb9b0bfee451497b2337a12845cde..d325fb59da8dd5ca25d64f6a63b5658473a8759d 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -52,20 +53,20 @@ SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
 SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_6.result())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
-SketchArc_1 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 81.26217508737108, 0, 0, 81.26217508737108, False)
+SketchArc_1 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 81.26217508737108, 0, 0, 81.26217508737108, False)
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_1.center())
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchLine_9.endPoint(), SketchArc_1.startPoint())
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_2.result(), SketchArc_1.endPoint())
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchLine_10.endPoint(), SketchArc_1.endPoint())
 SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_7.result())
-SketchArc_2 = Sketch_1.addArc(4.151438510550382e-034, -3.089278765476956e-034, 76.26217508737108, 0, 0, 76.26217508737108, False)
+SketchArc_2 = Sketch_1.addArc(4.151438510550382e-34, -3.089278765476956e-34, 76.26217508737108, 0, 0, 76.26217508737108, False)
 SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchArc_2.center())
 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_23")
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchLine_9.result(), SketchArc_2.startPoint())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_24")
 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_10.result(), SketchArc_2.endPoint())
 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_25")
-SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchArc_2.endPoint(), 5, False)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_7.result(), "2*l")
 SketchConstraintLength_1.setName("SketchConstraintLength_2")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_6.result(), "l")
@@ -93,20 +94,26 @@ SketchCircle_10 = Sketch_2.addCircle(49.58498153094326, 15.18789884296047, 2.552
 SketchCircle_11 = Sketch_2.addCircle(66.22695092615982, 10.77677442495125, 4.536925074373645)
 SketchCircle_12 = Sketch_2.addCircle(50.98852111849166, 6.165144351577979, 3.547307159201085)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_9f-SketchLine_10r-SketchArc_1_2f-SketchArc_2_2r")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2")])
-Face_4 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/Edge-SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchLine_10r-SketchArc_2_2f")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/XOY"))
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_9f-SketchArc_1_2f-SketchLine_10r-SketchArc_2_2r_wire")])
+Face_3_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2")]
+Face_3 = model.addFace(Part_1_doc, Face_3_objects)
+Face_4_objects = [model.selection("EDGE", "Sketch_2/SketchCircle_1_2"), model.selection("EDGE", "Sketch_2/SketchCircle_2_2"), model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_2/SketchCircle_5_2"), model.selection("EDGE", "Sketch_2/SketchCircle_7_2"), model.selection("EDGE", "Sketch_2/SketchCircle_6_2"), model.selection("EDGE", "Sketch_2/SketchCircle_9_2"), model.selection("EDGE", "Sketch_2/SketchCircle_8_2"), model.selection("EDGE", "Sketch_2/SketchCircle_10_2"), model.selection("EDGE", "Sketch_2/SketchCircle_12_2"), model.selection("EDGE", "Sketch_2/SketchCircle_11_2"), model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_9f-SketchArc_2_2f-SketchLine_10r_wire")]
+Face_4 = model.addFace(Part_1_doc, Face_4_objects)
+Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_11 = Sketch_3.addLine(40, 0, 30, 0)
-SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "Face_1_1/Edge_6&Face_1_1/Edge_7"))
+SketchPoint_1 = Sketch_3.addPoint(model.selection("VERTEX", "Face_1_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"))
 SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_1.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_19")
 SketchLine_12 = Sketch_3.addLine(30, 0, 30, 10)
 SketchLine_13 = Sketch_3.addLine(30, 10, 40, 10)
 SketchLine_14 = Sketch_3.addLine(40, 10, 40, 0)
 SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_20")
 SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_21")
 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_22")
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_26")
 SketchConstraintHorizontal_4 = Sketch_3.setHorizontal(SketchLine_11.result())
@@ -118,24 +125,26 @@ SketchConstraintEqual_5.setName("SketchConstraintEqual_6")
 SketchConstraintLength_3 = Sketch_3.setLength(SketchLine_13.result(), "l")
 SketchConstraintLength_3.setName("SketchConstraintLength_4")
 model.do()
-Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")])
-MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "l", 4, model.selection("EDGE", "PartSet/OY"), "l", 2)
-Recover_1 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), model.selection("VERTEX", "Face_4_1/Edge_4&Face_4_1/Edge_5"))
-MultiTranslation_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "l", 4, model.selection("EDGE", "PartSet/OY"), "l", 2)
-Recover_2 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), model.selection("VERTEX", "Face_4_1/Edge_2&Face_4_1/Edge_3"))
-MultiTranslation_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "l", 4)
-Recover_3 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), model.selection("VERTEX", "LinearCopy_3_1/Translated_Edge_1_4&LinearCopy_3_1/Translated_Edge_1_3"))
-MultiTranslation_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "l", 3)
-Recover_4 = model.addRecover(Part_1_doc, MultiTranslation_1, [Face_5.result()])
-Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Face_4_1/Edge_6&Face_4_1/Edge_7"), model.selection("VERTEX", "Face_4_1/Edge_1&Face_4_1/Edge_9"))
-MultiTranslation_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "l", 2)
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "LinearCopy_4_1_2"), model.selection("FACE", "LinearCopy_1_1_8"), model.selection("FACE", "LinearCopy_1_1_4"), model.selection("FACE", "LinearCopy_1_1_3"), model.selection("FACE", "LinearCopy_1_1_6"), model.selection("FACE", "LinearCopy_1_1_2"), model.selection("FACE", "LinearCopy_1_1_7"), model.selection("FACE", "LinearCopy_2_1_3"), model.selection("FACE", "LinearCopy_3_1_4"), model.selection("FACE", "LinearCopy_2_1_8"), model.selection("FACE", "LinearCopy_2_1_4"), model.selection("FACE", "LinearCopy_2_1_7"), model.selection("FACE", "LinearCopy_4_1_3"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_5_1_2"), model.selection("FACE", "LinearCopy_4_1_1"), model.selection("FACE", "LinearCopy_5_1_1"), model.selection("FACE", "LinearCopy_3_1_3"), model.selection("FACE", "LinearCopy_3_1_2"), model.selection("FACE", "LinearCopy_3_1_1"), model.selection("FACE", "LinearCopy_2_1_6"), model.selection("FACE", "LinearCopy_2_1_2"), model.selection("FACE", "LinearCopy_2_1_5"), model.selection("FACE", "LinearCopy_2_1_1"), model.selection("FACE", "LinearCopy_1_1_5")])
+Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r_wire")])
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "l", 4, model.selection("EDGE", "PartSet/OY"), "l", 2)
+Recover_1 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_1")], model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_6_StartVertex&Sketch_1/SketchLine_5_EndVertex"))
+LinearCopy_2 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_1_1")], model.selection("EDGE", "PartSet/OX"), "l", 4, model.selection("EDGE", "PartSet/OY"), "l", 2)
+Recover_2 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_2_1")], model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_4_StartVertex&Sketch_1/SketchLine_3_EndVertex"))
+LinearCopy_3 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_2_1")], model.selection("EDGE", "PartSet/OX"), "l", 4)
+Recover_3 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_3 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_3_1")], model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "LinearCopy_3_1_1/MV:Translated&Sketch_3/SketchLine_12_EndVertex&Sketch_3/SketchLine_13_StartVertex"))
+LinearCopy_4 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_3_1")], model.selection("EDGE", "PartSet/OX"), "l", 3)
+Recover_4 = model.addRecover(Part_1_doc, LinearCopy_1, [Face_5.result()])
+Translation_4 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_4_1")], model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_9_StartVertex&Sketch_1/SketchLine_7_EndVertex"), model.selection("VERTEX", "Face_4_1/Modified_Vertex&Sketch_1/SketchLine_10_StartVertex&Sketch_1/SketchLine_1_StartVertex"))
+LinearCopy_5 = model.addMultiTranslation(Part_1_doc, [model.selection("FACE", "Translation_4_1")], model.selection("EDGE", "PartSet/OX"), "l", 2)
+Group_1_objects = [model.selection("FACE", "LinearCopy_4_1_2"), model.selection("FACE", "LinearCopy_1_1_8"), model.selection("FACE", "LinearCopy_1_1_4"), model.selection("FACE", "LinearCopy_1_1_3"), model.selection("FACE", "LinearCopy_1_1_6"), model.selection("FACE", "LinearCopy_1_1_2"), model.selection("FACE", "LinearCopy_1_1_7"), model.selection("FACE", "LinearCopy_2_1_3"), model.selection("FACE", "LinearCopy_3_1_4"), model.selection("FACE", "LinearCopy_2_1_8"), model.selection("FACE", "LinearCopy_2_1_4"), model.selection("FACE", "LinearCopy_2_1_7"), model.selection("FACE", "LinearCopy_4_1_3"), model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_5_1_2"), model.selection("FACE", "LinearCopy_4_1_1"), model.selection("FACE", "LinearCopy_5_1_1"), model.selection("FACE", "LinearCopy_3_1_3"), model.selection("FACE", "LinearCopy_3_1_2"), model.selection("FACE", "LinearCopy_3_1_1"), model.selection("FACE", "LinearCopy_2_1_6"), model.selection("FACE", "LinearCopy_2_1_2"), model.selection("FACE", "LinearCopy_2_1_5"), model.selection("FACE", "LinearCopy_2_1_1"), model.selection("FACE", "LinearCopy_1_1_5")]
+Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 Group_1.setName("Group_3")
 Group_1.result().setName("assemblages")
-Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")])
+Group_2_objects = [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_12")]
+Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
 Group_2.setName("Group_1")
 Group_2.result().setName("eau")
 Group_2.result().setColor(0, 170, 255)
@@ -143,8 +152,11 @@ Group_3 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_4_1")])
 Group_3.setName("Group_2")
 Group_3.result().setName("acier")
 Group_3.result().setColor(170, 85, 0)
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2"), model.selection("FACE", "LinearCopy_1_1_3"), model.selection("FACE", "LinearCopy_1_1_4"), model.selection("FACE", "LinearCopy_1_1_5"), model.selection("FACE", "LinearCopy_1_1_6"), model.selection("FACE", "LinearCopy_1_1_7"), model.selection("FACE", "LinearCopy_2_1_4"), model.selection("FACE", "LinearCopy_2_1_5"), model.selection("FACE", "LinearCopy_2_1_6"), model.selection("FACE", "LinearCopy_2_1_7"), model.selection("FACE", "LinearCopy_2_1_8"), model.selection("FACE", "LinearCopy_2_1_1"), model.selection("FACE", "LinearCopy_2_1_2"), model.selection("FACE", "LinearCopy_2_1_3"), model.selection("FACE", "LinearCopy_3_1_4"), model.selection("FACE", "LinearCopy_3_1_3"), model.selection("FACE", "LinearCopy_3_1_2"), model.selection("FACE", "LinearCopy_3_1_1"), model.selection("FACE", "LinearCopy_4_1_1"), model.selection("FACE", "LinearCopy_4_1_2"), model.selection("FACE", "LinearCopy_4_1_3"), model.selection("FACE", "LinearCopy_5_1_1"), model.selection("FACE", "LinearCopy_5_1_2"), model.selection("FACE", "LinearCopy_1_1_8")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_4_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("SHELL", "Shell_1_1")])
+Shell_1_objects = [model.selection("FACE", "LinearCopy_1_1_1"), model.selection("FACE", "LinearCopy_1_1_2"), model.selection("FACE", "LinearCopy_1_1_3"), model.selection("FACE", "LinearCopy_1_1_4"), model.selection("FACE", "LinearCopy_1_1_5"), model.selection("FACE", "LinearCopy_1_1_6"), model.selection("FACE", "LinearCopy_1_1_7"), model.selection("FACE", "LinearCopy_2_1_4"), model.selection("FACE", "LinearCopy_2_1_5"), model.selection("FACE", "LinearCopy_2_1_6"), model.selection("FACE", "LinearCopy_2_1_7"), model.selection("FACE", "LinearCopy_2_1_8"), model.selection("FACE", "LinearCopy_2_1_1"), model.selection("FACE", "LinearCopy_2_1_2"), model.selection("FACE", "LinearCopy_2_1_3"), model.selection("FACE", "LinearCopy_3_1_4"), model.selection("FACE", "LinearCopy_3_1_3"), model.selection("FACE", "LinearCopy_3_1_2"), model.selection("FACE", "LinearCopy_3_1_1"), model.selection("FACE", "LinearCopy_4_1_1"), model.selection("FACE", "LinearCopy_4_1_2"), model.selection("FACE", "LinearCopy_4_1_3"), model.selection("FACE", "LinearCopy_5_1_1"), model.selection("FACE", "LinearCopy_5_1_2"), model.selection("FACE", "LinearCopy_1_1_8")]
+Shell_1 = model.addShell(Part_1_doc, Shell_1_objects)
+Partition_1_objects = [model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_3_2"), model.selection("FACE", "Face_4_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_5"), model.selection("FACE", "Face_3_3"), model.selection("FACE", "Face_3_4"), model.selection("FACE", "Face_3_7"), model.selection("FACE", "Face_3_6"), model.selection("FACE", "Face_3_8"), model.selection("FACE", "Face_3_9"), model.selection("FACE", "Face_3_10"), model.selection("FACE", "Face_3_11"), model.selection("FACE", "Face_3_12"), model.selection("SHELL", "Shell_1_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+model.do()
 model.end()
 
 # move groups
index 3b4306e64d5474d71022a612f199007d0f7a09f8..bbb5bacc9e73e2ca5bbef82248771e67b9933305 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from ModelAPI import *
@@ -44,7 +45,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 60)
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 90, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 90, 0)
 model.do()
 aSession = ModelAPI_Session.get()
 aSession.setActiveDocument(partSet, False)
index 8697b5d15f77b03564e52fd9bf140938d1c31e73..c09013bbf92b5cb19a3fd2aba75eb36ecc123922 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -25,14 +26,16 @@ partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchCircle_1 = Sketch_1.addCircle(-9.954190485756755, -75.16051465706819, 60.31858435553394)
+SketchCircle_1 = Sketch_1.addCircle(-9.954190485756754, -75.16051465706819, 60.31858435553394)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1__cc"), False)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]__cc"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchCircle_2 = Sketch_2.addCircle(-9.954190485756755, -75.16051465706819, 33.11263086848982)
+SketchCircle_2 = Sketch_2.addCircle(-9.954190485756754, -75.16051465706819, 33.11263086848982)
 SketchConstraintCoincidence_1 = Sketch_2.setCoincident(SketchPoint_1.result(), SketchCircle_2.center())
+model.do()
+model.do()
 model.end()
 
 assert(model.checkPythonDump())
index 27427d75f37070481f2b42c9e3b4fe8dd9c9e184..07956e83678421bf79b9ccae7ca53fabe2bca0fe 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,12 +42,12 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL
 SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchCircle_1 = Sketch_2.addCircle(26.06240015364781, 18.07716886601709, 12.23427461205297)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face_1"), 0, model.selection(), 0)
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face"), 0, model.selection(), 0)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
 model.do()
 
 Folder_1 = model.addFolder(Part_1_doc, Sketch_1, Extrusion_1)
@@ -57,13 +58,13 @@ Folder_2.setName("Cylinder")
 from GeomAPI import GeomAPI_Shape
 
 # check result shape
-model.testNbResults(Boolean_1, 1)
-model.testNbSubResults(Boolean_1, [0])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [7])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [30])
-model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [60])
-model.testResultsVolumes(Boolean_1, [101488.717162133529200218617916107])
+model.testNbResults(Cut_1, 1)
+model.testNbSubResults(Cut_1, [0])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.FACE, [7])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.EDGE, [30])
+model.testNbSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [60])
+model.testResultsVolumes(Cut_1, [101488.717162133529200218617916107])
 
 model.end()
 
index e52fec361983eaeb2da4b8bd01217d71fe8f1b1b..526a6f627d2418f0f26aafb1ce753cd93d2ccee2 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -42,7 +43,7 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL
 SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_5 = Sketch_2.addLine(10, 21.9014765990379, 0, 21.9014765990379)
 SketchLine_5.setName("SketchLine_9")
@@ -74,7 +75,7 @@ SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_8.result(), 10)
 model.do()
 Sketch_2.setName("Sketch_3")
 Sketch_2.result().setName("Sketch_3")
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_9r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_9r_wire")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_10 = Sketch_3.addLine(29.60939424565112, 0, 19.60939424565112, 0)
 SketchLine_10.setName("SketchLine_14")
@@ -107,12 +108,17 @@ model.do()
 Sketch_3.setName("Sketch_4")
 Sketch_3.result().setName("Sketch_4")
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), "h", 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Fillet_1_objects = [model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_divided_5_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&Extrusion_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_6&ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_divided_4_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_1_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_1_1/Modfied_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_6&ExtrusionCut_1_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_divided_4_1&ExtrusionCut_1_1/Modfied_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&ExtrusionCut_2_1/Modfied_divided_5_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_divided_5_1&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_9")]
+Fillet_1_objects = [model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)]"), model.selection("EDGE", "[(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_9)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_9)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)]"), model.selection("EDGE", "[(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_9)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3]"), model.selection("EDGE", "[(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_9)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)]"), model.selection("EDGE", "[(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)][ExtrusionCut_2_1/Generated_Face&Sketch_4/SketchLine_16&weak_name_2]"), model.selection("EDGE", "[(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)(ExtrusionCut_2_1/Modified_Face&Sketch_3/SketchLine_12)(ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face)][ExtrusionCut_2_1/Generated_Face&Sketch_4/SketchLine_18&weak_name_2]")]
 Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2)
-Group_1_objects = [model.selection("FACE", "Fillet_1_1/Modified_Face_3"), model.selection("FACE", "Fillet_1_1/Modified_Face_5"), model.selection("FACE", "Fillet_1_1/Modified_Face_9"), model.selection("FACE", "Fillet_1_1/Modified_Face_15")]
+Group_1_objects = [
+model.selection("FACE", "(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_14)(Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_12)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_15)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_1)"),
+model.selection("FACE", "(Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_12)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_11)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_16)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_2)"),
+model.selection("FACE", "(Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_9)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_13)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_6)"),
+model.selection("FACE", "(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_5)(Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_9)(Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_12)")
+]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
-Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Fillet_1_1/Fillet_Face_13&Fillet_1_1/Modified_Face_4"), model.selection("EDGE", "Fillet_1_1/Modified_Face_11&Fillet_1_1/Fillet_Face_13")])
-Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Fillet_1_1/Modified_Face_12&ExtrusionCut_1_1/Generated_Face_4&Fillet_1_1/Modified_Face_11"), model.selection("VERTEX", "ExtrusionCut_1_1/Generated_Face_4&Fillet_1_1/Modified_Face_11&Fillet_1_1/Modified_Face_6")])
+Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_9][Fillet_1_1/MF:Fillet_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "[Fillet_1_1/MF:Fillet_Face&Sketch_1/SketchLine_3][Fillet_1_1/GF:Fillet&Fillet_1_1/FilletSelected_9]")])
+Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "[Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_9][ExtrusionCut_1_1/Generated_Face&Sketch_3/SketchLine_13][Fillet_1_1/MF:Fillet_Face&Sketch_1/SketchLine_3]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_3/SketchLine_13][Fillet_1_1/MF:Fillet_Face&Sketch_1/SketchLine_3][Fillet_1_1/MF:Fillet_Face&Sketch_3/SketchLine_12]")])
 model.do()
 
 Folder_1 = model.addFolder(Part_1_doc, Sketch_3, ExtrusionCut_2)
index 89121b8a753ca2e835e3be4f7467d57afc8e7a68..2fe34efbe0934a7c266beab5cc13d3e48674108e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -31,7 +32,7 @@ model.addParameter(Part_1_doc, "Drill2_InnerRadius", "0.5")
 model.addParameter(Part_1_doc, "Drill2_DepthMin", "6.5")
 model.addParameter(Part_1_doc, "Drill2_DepthMax", "7.5")
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchLine_1 = Sketch_1.addLine(64., 0, 0, 0)
+SketchLine_1 = Sketch_1.addLine(64, 0, 0, 0)
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchPoint_1.result())
@@ -50,7 +51,7 @@ SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 36)
 SketchLine_5 = Sketch_1.addLine(22, 36, 22, 0)
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_3.result())
-SketchLine_6 = Sketch_1.addLine(32., 36., 32., 0)
+SketchLine_6 = Sketch_1.addLine(32, 36, 32, 0)
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_6.startPoint(), SketchLine_3.result())
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_1.result())
 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.result())
@@ -60,8 +61,10 @@ SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine
 SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchLine_6.startPoint(), SketchLine_3.endPoint(), "Width/2")
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s"), True)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_5_StartVertex"), True)
 SketchPoint_2 = SketchProjection_2.createdFeature()
+model.do()
+model.do()
 model.end()
 
 assert(SketchProjection_2.external().namingName() != "")
index 20d2655e046bc838070f2252be0fec271f922fb0..46a66b93b339ed8f7d4870e7f186fef29ca5098c 100644 (file)
@@ -1,24 +1,26 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
+
 from salome.shaper import model
 
 model.begin()
@@ -167,7 +169,7 @@ SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], Sketch
 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_6.result())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], "Fillet1")
 SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_7.endPoint(), SketchLine_35.result(), "D1_in/2", True)
-SketchConstraintAngle_4 = Sketch_1.setAngleComplementary(SketchLine_23.result(), SketchLine_22.result(), 44.99999999999992)
+SketchConstraintAngle_4 = Sketch_1.setAngleComplementary(SketchLine_23.result(), SketchLine_22.result(), 44.99999999999991)
 SketchConstraintCollinear_4 = Sketch_1.setCollinear(SketchLine_14.result(), SketchLine_9.result())
 SketchConstraintDistanceHorizontal_4 = Sketch_1.setHorizontalDistance(SketchLine_34.startPoint(), SketchLine_23.startPoint(), "Width/32*11")
 SketchConstraintDistanceHorizontal_5 = Sketch_1.setHorizontalDistance(SketchLine_23.startPoint(), SketchLine_22.startPoint(), "Chamfer")
@@ -195,19 +197,19 @@ SketchConstraintDistanceHorizontal_14 = Sketch_1.setHorizontalDistance(SketchLin
 SketchConstraintDistance_11 = Sketch_1.setDistance(SketchLine_23.startPoint(), SketchLine_35.result(), "(D4_out+D2_in)/2", True)
 model.do()
 Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OX"), 360, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), True)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchPoint_2"), False)
 SketchPoint_3 = SketchProjection_3.createdFeature()
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_28"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8])"), False)
 SketchLine_36 = SketchProjection_4.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(14.5, 0, 2.25)
 SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchPoint_3.result(), SketchCircle_1.center())
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_1.results()[1], "Drill1_Radius")
 model.do()
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection(), model.selection("FACE", "PartSet/XOZ"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_14&Revolution_1_1/Generated_Face_15")], "Fillet1")
-Fillet_2_objects = [model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "Revolution_1_1/Generated_Face_6"), model.selection("FACE", "Revolution_1_1/Generated_Face_8"), model.selection("FACE", "Revolution_1_1/Generated_Face_10")]
+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")
+Fillet_2_objects = [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")]
 Fillet_2 = model.addFillet(Part_1_doc, Fillet_2_objects, "Fillet2")
 model.do()
 
index a3ef0be37754fb4ec9760dd2b190567628017000..03a8e6e43766e287914173492b4f117e84d4e8be 100644 (file)
@@ -1,26 +1,26 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
-from GeomAPI import *
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
+from GeomAPI import GeomAPI_Shape
 
 model.begin()
 partSet = model.moduleDocument()
@@ -40,26 +40,9 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 100, 0)
 Extrusion_1.result().setName("Cube")
-
-Edge_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"),
-                  model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"),
-                  model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"),
-                  model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"),
-                  model.selection("EDGE", "Cube/Generated_Face_2&Cube/Generated_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_2&Cube/From_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_2&Cube/To_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_3&Cube/Generated_Face_2"),
-                  model.selection("EDGE", "Cube/Generated_Face_1&Cube/From_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_3&Cube/To_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_3&Cube/From_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_1&Cube/To_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_4&Cube/Generated_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_4&Cube/From_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_4&Cube/To_Face_1"),
-                  model.selection("EDGE", "Cube/Generated_Face_4&Cube/Generated_Face_3")]
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_2][Cube/Generated_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_2][Cube/From_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_2][Cube/To_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_3][Cube/Generated_Face&Sketch_1/SketchLine_2]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_1][Cube/From_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_3][Cube/To_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_3][Cube/From_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_1][Cube/To_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_4][Cube/Generated_Face&Sketch_1/SketchLine_1]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_4][Cube/From_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_4][Cube/To_Face]"), model.selection("EDGE", "[Cube/Generated_Face&Sketch_1/SketchLine_4][Cube/Generated_Face&Sketch_1/SketchLine_3]")]
 Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
 # check all the names of Edge_1 results are different
 names = set()
@@ -70,7 +53,7 @@ assert(len(names) == len(Edge_1.results())), "Some edges have equal name"
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_2.addCircle(200, 0, 50)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection("EDGE", "Cube"), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection("EDGE", "Cube"), 10, 0)
 model.do()
 # check Extrusion_2
 model.testNbResults(Extrusion_2, 1)
index abf10ad1edd15e385feb39a396823b11708e6199..57125b4fd8379d22d8083a84fbaa7984b89ca107 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -51,8 +52,8 @@ SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_1.
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 3)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_7.result(), 8)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r")], model.selection(), 5, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), 5, True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection(), 5, 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"), 5, True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_8 = Sketch_2.addLine(7.560741003605092, 9.43062705614625, -1.095841663628257, 9.43062705614625)
 SketchLine_9 = Sketch_2.addLine(-1.095841663628257, 9.43062705614625, -1.095841663628257, -5.449377136847041)
@@ -67,19 +68,17 @@ SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_9.result())
 SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_10.result())
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_11.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f")])
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("FACE", "Face_1_1")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f-SketchLine_11f")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("FACE", "Face_1_1")])
 model.do()
 
 # now add an additional edge to the first sketch as it is described in the issue
 SketchLine_8 = Sketch_1.addLine(0, 3, 8, 3)
 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_8.endPoint())
-model.do()
-Part_1_doc.setCurrentFeature(Boolean_1.feature(), True)
 model.end()
 
 # check that the plane is located as previously
-model.testNbSubResults(Boolean_1, [2])
-model.testResultsVolumes(Boolean_1, [120])
+model.testNbSubResults(Fill_1, [2])
+model.testResultsVolumes(Fill_1, [120])
 assert(model.checkPythonDump())
index cb70bf6847dea8a3efece1becf0c29cedf52c945..d65470afded9004d5205677c9dd8768324710b69 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -47,9 +48,9 @@ SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.startPoint(),
 SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_8")
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 50)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_3f")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchArc_1_2f-SketchLine_1r")], model.selection(), 100, 0)
 model.do()
-Solid_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_3")]
+Solid_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")]
 Solid_1 = model.addSolid(Part_1_doc, Solid_1_objects)
 # check that resulting build-solid feature is invalid: only one not-closed face is used
 from ModelAPI import *
@@ -58,7 +59,7 @@ assert(aFactory.validate(Solid_1.feature()) == False)
 ModelAPI_Session.get().abortOperation()
 # another try: to make a solid with a face inside
 model.begin()
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"), 70, True)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"), 70, True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_5 = Sketch_2.addLine(14.9039069695087, 8.923908092675951, 26.86805702948195, 11.13714035991706)
 SketchLine_6 = Sketch_2.addLine(26.86805702948195, 11.13714035991706, 18.50962242738747, 32.13572332177004)
@@ -70,11 +71,10 @@ SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10")
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_7.endPoint())
 SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f")])
-Solid_2_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Face_1_1")]
-Solid_2 = model.addSolid(Part_1_doc, Solid_2_objects)
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f")])
+Solid_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Face_1_1")]
+Solid_1 = model.addSolid(Part_1_doc, Solid_1_objects)
+model.do()
 model.end()
 
-assert(aFactory.validate(Solid_2.feature()) == False)
-
 assert(model.checkPythonDump())
diff --git a/src/ModelAPI/Test/Test2491.py b/src/ModelAPI/Test/Test2491.py
new file mode 100644 (file)
index 0000000..4dcb6ef
--- /dev/null
@@ -0,0 +1,122 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-17.23654191510763, 16.36770059625792, -4.760492650097915, 19.42518236023452)
+SketchLine_2 = Sketch_1.addLine(20, 2.492755359431925e-15, 20, -31)
+SketchLine_3 = Sketch_1.addLine(-25.74772708486752, -20, -17.21320343559642, -20)
+SketchLine_4 = Sketch_1.addLine(-13.67766952966368, -21.46446609406726, 2.928932188134523, -38.07106781186547)
+SketchArc_1 = Sketch_1.addArc(-17.21320343559642, -25, -13.67766952966368, -21.46446609406726, -17.21320343559642, -20, False)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_3.endPoint())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_4.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_3.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchArc_2 = Sketch_1.addArc(0, 6.520200294596256e-23, -4.760492650097915, 19.42518236023452, 20, 2.492755359431925e-15, True)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchArc_2.startPoint())
+SketchArc_3 = Sketch_1.addArc(-12, -5, -29.79117622747561, -17.94117647058824, -17.23654191510763, 16.36770059625792, True)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_5")
+SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_1.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_6")
+SketchArc_4 = Sketch_1.addArc(-25.74772708486752, -15, -29.79117622747561, -17.94117647058824, -25.74772708486752, -20, False)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_4.startPoint(), SketchArc_3.startPoint())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_7")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_8")
+SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchLine_3.result())
+SketchConstraintTangent_5 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchArc_3.results()[1])
+SketchArc_5 = Sketch_1.addArc(10, -31, 20, -31, 2.928932188134523, -38.07106781186547, True)
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchArc_5.startPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_9")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_5.endPoint(), SketchLine_4.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10")
+SketchConstraintTangent_6 = Sketch_1.setTangent(SketchArc_5.results()[1], SketchLine_4.result())
+SketchConstraintTangent_7 = Sketch_1.setTangent(SketchLine_2.result(), SketchArc_5.results()[1])
+SketchConstraintTangent_8 = Sketch_1.setTangent(SketchLine_1.result(), SketchArc_2.results()[1])
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 31)
+SketchConstraintTangent_9 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_2.result())
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_3.result(), SketchLine_4.result(), 135)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 5)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_4.results()[1], SketchArc_1.results()[1])
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_5.results()[1], 10)
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_2.results()[1], 20)
+SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_3.results()[1], 22)
+SketchCircle_1 = Sketch_1.addCircle(-22, -5, 7.5)
+SketchLine_5 = Sketch_1.addLine(-22, -5, -12, -5)
+SketchLine_5.setAuxiliary(True)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchArc_3.center(), SketchLine_5.endPoint())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_12")
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintRadius_5 = Sketch_1.setRadius(SketchCircle_1.results()[1], 7.5)
+SketchCircle_2 = Sketch_1.addCircle(0, 6.520200294596256e-23, 10)
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_2.center(), SketchCircle_2.center())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_13")
+SketchConstraintRadius_6 = Sketch_1.setRadius(SketchCircle_2.results()[1], 10)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchCircle_2.center(), SketchArc_3.center(), 5)
+SketchCircle_3 = Sketch_1.addCircle(7, -25, 7.5)
+SketchConstraintRadius_7 = Sketch_1.setRadius(SketchCircle_3.results()[1], 7.5)
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchArc_2.center(), SketchCircle_3.center(), 7)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_2.center(), SketchLine_3.result(), 20, True)
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchArc_2.center(), SketchCircle_3.center(), 25)
+SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchArc_2.center(), 12)
+SketchConstraintDistanceHorizontal_3 = Sketch_1.setHorizontalDistance(SketchCircle_1.center(), SketchArc_2.center(), 22)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_14")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_3_2f-SketchArc_4_2f-SketchLine_3f-SketchArc_1_2r-SketchLine_4f-SketchArc_5_2f-SketchLine_2r-SketchArc_2_2f-SketchLine_1r-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 6.5, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"))
+SketchLine_6 = Sketch_2.addLine(14.45330132699559, 5.092287733454298, -12.15814035598059, 5.092287733454298)
+SketchLine_7 = Sketch_2.addLine(-12.15814035598059, 5.092287733454298, -12.15814035598059, 23.78152371848275)
+SketchLine_8 = Sketch_2.addLine(-12.15814035598059, 23.78152371848275, 14.45330132699559, 23.78152371848275)
+SketchLine_9 = Sketch_2.addLine(14.45330132699559, 23.78152371848275, 14.45330132699559, 5.092287733454298)
+SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_15")
+SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_16")
+SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_17")
+SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_18")
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_6.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_7.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_9.result())
+model.do()
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r")], model.selection(), 0, 100, [model.selection("SOLID", "Extrusion_1_1")])
+model.do()
+model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc)
+model.end()
+assert(model.checkPythonDump())
diff --git a/src/ModelAPI/Test/Test2493.py b/src/ModelAPI/Test/Test2493.py
new file mode 100644 (file)
index 0000000..bdbbfc5
--- /dev/null
@@ -0,0 +1,246 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "h1", "15")
+model.addParameter(Part_1_doc, "h3", "7")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 24)
+SketchCircle_1.setAuxiliary(True)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], "48/2")
+SketchCircle_2 = Sketch_1.addCircle(0, -24, 4)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_1 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchLine_1.result())
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_2.results()[1], 4)
+SketchLine_2 = Sketch_1.addLine(-7.50000000000032, -15.81138830084174, -7.500000000000001, -27)
+SketchLine_2.setName("SketchLine_3")
+SketchLine_2.result().setName("SketchLine_3")
+SketchLine_3 = Sketch_1.addLine(-4.500000000000001, -30, 4.500000000000001, -30)
+SketchLine_3.setName("SketchLine_4")
+SketchLine_3.result().setName("SketchLine_4")
+SketchLine_4 = Sketch_1.addLine(7.500000000000001, -27, 7.49999999999943, -15.81138830084217)
+SketchLine_4.setName("SketchLine_5")
+SketchLine_4.result().setName("SketchLine_5")
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintHorizontal_1.setName("SketchConstraintHorizontal_2")
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchPoint_2 = Sketch_1.addPoint(0, -30)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_3.result())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_8")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_1.result())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_9")
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_5 = SketchProjection_3.createdFeature()
+SketchLine_5.setName("SketchLine_6")
+SketchLine_5.result().setName("SketchLine_6")
+SketchArc_1 = Sketch_1.addArc(-4.500000000000001, -27, -7.500000000000001, -27, -4.500000000000001, -30, False)
+SketchPoint_3 = Sketch_1.addPoint(-7.500000000000001, -30)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchLine_5.result(), 30, True)
+SketchPoint_3.setAuxiliary(True)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_11")
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_3.result())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_12")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_2.endPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_13")
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_14")
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_2.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_3.result())
+SketchArc_2 = Sketch_1.addArc(4.500000000000001, -27, 4.500000000000001, -30, 7.500000000000001, -27, False)
+SketchPoint_4 = Sketch_1.addPoint(7.5, -30)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchPoint_4.coordinates(), 15, False)
+SketchPoint_4.setAuxiliary(True)
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_4.result())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_15")
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_3.result())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_16")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_3.endPoint())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_17")
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_18")
+SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_4.result())
+SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_3.result())
+SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchPoint_2.coordinates(), SketchLine_3.result())
+SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_1.results()[1], 3)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_2.results()[1], SketchArc_1.results()[1])
+SketchArc_3 = Sketch_1.addArc(0, 0, 7.49999999999943, -15.81138830084217, 17.44306393762918, 1.410503622037278, False)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchArc_3.center())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_10")
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_3.results()[1], "35/2")
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchLine_4.endPoint())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_20")
+SketchMultiRotation_1_objects = [SketchLine_2.result(), SketchArc_1.results()[1], SketchLine_3.result(), SketchArc_2.results()[1], SketchLine_4.result(), SketchCircle_2.results()[1]]
+SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_5).startPoint(), 120, 3)
+[SketchLine_6, SketchLine_7, SketchArc_4, SketchArc_5, SketchLine_8, SketchLine_9, SketchArc_6, SketchArc_7, SketchLine_10, SketchLine_11, SketchCircle_3, SketchCircle_4] = SketchMultiRotation_1.rotated()
+SketchLine_11.setName("SketchLine_12")
+SketchLine_11.result().setName("SketchLine_12")
+SketchLine_10.setName("SketchLine_9")
+SketchLine_10.result().setName("SketchLine_9")
+SketchArc_6.setName("SketchArc_5")
+SketchArc_6.result().setName("SketchArc_5")
+SketchArc_6.results()[1].setName("SketchArc_5_2")
+SketchLine_9.setName("SketchLine_11")
+SketchLine_9.result().setName("SketchLine_11")
+SketchArc_5.setName("SketchArc_6")
+SketchArc_5.result().setName("SketchArc_6")
+SketchArc_5.results()[1].setName("SketchArc_6_2")
+SketchLine_7.setName("SketchLine_10")
+SketchLine_7.result().setName("SketchLine_10")
+SketchLine_6.setName("SketchLine_7")
+SketchLine_6.result().setName("SketchLine_7")
+SketchArc_8 = Sketch_1.addArc(0, 0, -17.4430639376291, 1.410503622038327, -7.50000000000032, -15.81138830084174, False)
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchArc_8.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_21")
+SketchConstraintEqual_2 = Sketch_1.setEqual(SketchArc_3.results()[1], SketchArc_8.results()[1])
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_3.center(), SketchArc_8.center())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_19")
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_8.startPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_22")
+SketchArc_9 = Sketch_1.addArc(0, 0, 9.943063937629693, 14.40088467880386, -9.943063937628841, 14.40088467880445, False)
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_9.endPoint(), SketchLine_7.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_23")
+SketchConstraintEqual_3 = Sketch_1.setEqual(SketchArc_3.results()[1], SketchArc_9.results()[1])
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_3.center(), SketchArc_9.center())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24")
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_6.result())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_25")
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchArc_9.startPoint(), SketchLine_10.result())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3f-SketchArc_1_2f-SketchLine_4f-SketchArc_2_2f-SketchLine_5f-SketchArc_3_2f-SketchLine_7f-SketchArc_4_2f-SketchLine_9f-SketchArc_5_2f-SketchLine_9f-SketchArc_9_2f-SketchLine_10f-SketchArc_6_2f-SketchLine_11f-SketchArc_7_2f-SketchLine_12f-SketchArc_8_2f-SketchCircle_2_2r-SketchCircle_4_2r-SketchCircle_3_2r")], model.selection(), "h1", 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchLine_12 = Sketch_2.addLine(-7.499999999996014, 12.99038105676981, 7.499999999996014, 12.99038105676981)
+SketchLine_12.setName("SketchLine_13")
+SketchLine_12.result().setName("SketchLine_13")
+SketchLine_13 = Sketch_2.addLine(7.499999999996014, 12.99038105676981, 15, 0)
+SketchLine_13.setName("SketchLine_14")
+SketchLine_13.result().setName("SketchLine_14")
+SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_27")
+SketchLine_14 = Sketch_2.addLine(15, 0, 7.499999999996014, -12.99038105676981)
+SketchLine_14.setName("SketchLine_15")
+SketchLine_14.result().setName("SketchLine_15")
+SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_28")
+SketchLine_15 = Sketch_2.addLine(7.499999999996014, -12.99038105676981, -7.499999999996014, -12.99038105676981)
+SketchLine_15.setName("SketchLine_16")
+SketchLine_15.result().setName("SketchLine_16")
+SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29")
+SketchLine_16 = Sketch_2.addLine(-7.499999999996014, -12.99038105676981, -15, 0)
+SketchLine_16.setName("SketchLine_17")
+SketchLine_16.result().setName("SketchLine_17")
+SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30")
+SketchLine_17 = Sketch_2.addLine(-15, 0, -7.499999999996014, 12.99038105676981)
+SketchLine_17.setName("SketchLine_18")
+SketchLine_17.result().setName("SketchLine_18")
+SketchConstraintCoincidence_27 = Sketch_2.setCoincident(SketchLine_16.endPoint(), SketchLine_17.startPoint())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_31")
+SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_12.startPoint(), SketchLine_17.endPoint())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_32")
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_12.result())
+SketchConstraintHorizontal_2.setName("SketchConstraintHorizontal_3")
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_15.result())
+SketchConstraintHorizontal_3.setName("SketchConstraintHorizontal_4")
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_18 = SketchProjection_4.createdFeature()
+SketchLine_18.setName("SketchLine_19")
+SketchLine_18.result().setName("SketchLine_19")
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_19 = SketchProjection_5.createdFeature()
+SketchLine_19.setName("SketchLine_20")
+SketchLine_19.result().setName("SketchLine_20")
+SketchConstraintCoincidence_29 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_33")
+SketchConstraintCoincidence_30 = Sketch_2.setCoincident(SketchLine_16.endPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_34")
+SketchPoint_5 = Sketch_2.addPoint(-1.694065894508601e-21, 12.99038105676981)
+SketchConstraintCoincidence_31 = Sketch_2.setCoincident(SketchPoint_5.coordinates(), SketchLine_12.result())
+SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_35")
+SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchLine_12.result(), SketchPoint_5.coordinates())
+SketchConstraintCoincidence_32 = Sketch_2.setCoincident(SketchPoint_5.coordinates(), SketchLine_19.result())
+SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_36")
+SketchPoint_6 = Sketch_2.addPoint(-2.541098841762901e-21, -12.99038105676981)
+SketchConstraintCoincidence_33 = Sketch_2.setCoincident(SketchPoint_6.coordinates(), SketchLine_15.result())
+SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_37")
+SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchPoint_6.coordinates(), SketchLine_19.result())
+SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_38")
+SketchConstraintMiddle_3 = Sketch_2.setMiddlePoint(SketchLine_15.result(), SketchPoint_6.coordinates())
+SketchCircle_5 = Sketch_2.addCircle(0, 0, 15)
+SketchCircle_5.setAuxiliary(True)
+SketchConstraintCoincidence_35 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_18).startPoint(), SketchCircle_5.center())
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_39")
+SketchConstraintCoincidence_36 = Sketch_2.setCoincident(SketchLine_16.endPoint(), SketchCircle_5.results()[1])
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_40")
+SketchConstraintCoincidence_37 = Sketch_2.setCoincident(SketchLine_16.startPoint(), SketchCircle_5.results()[1])
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_41")
+SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchCircle_5.results()[1])
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_42")
+SketchConstraintCoincidence_39 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchCircle_5.results()[1])
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43")
+SketchConstraintEqual_4 = Sketch_2.setEqual(SketchLine_17.result(), SketchLine_12.result())
+SketchConstraintEqual_5 = Sketch_2.setEqual(SketchLine_16.result(), SketchLine_15.result())
+SketchConstraintRadius_5 = Sketch_2.setRadius(SketchCircle_5.results()[1], 15)
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_18r-SketchLine_17r-SketchLine_16r-SketchLine_15r-SketchLine_14r-SketchLine_13r")], model.selection(), "97-h3-h1", 0)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face"))
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_20 = SketchProjection_6.createdFeature()
+SketchLine_20.setName("SketchLine_21")
+SketchLine_20.result().setName("SketchLine_21")
+SketchCircle_6 = Sketch_3.addCircle(0, 0, 10)
+SketchConstraintCoincidence_40 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_20).startPoint(), SketchCircle_6.center())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44")
+SketchConstraintRadius_6 = Sketch_3.setRadius(SketchCircle_6.results()[1], 10)
+model.do()
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_6_2f")], model.selection(), 0, 60, [model.selection("SOLID", "Extrusion_2_1")])
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/From_Face"))
+SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_21 = SketchProjection_7.createdFeature()
+SketchLine_21.setName("SketchLine_22")
+SketchLine_21.result().setName("SketchLine_22")
+SketchCircle_7 = Sketch_4.addCircle(0, 0, 12.5)
+SketchConstraintCoincidence_41 = Sketch_4.setCoincident(SketchAPI_Line(SketchLine_21).startPoint(), SketchCircle_7.center())
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45")
+SketchConstraintRadius_7 = Sketch_4.setRadius(SketchCircle_7.results()[1], "25/2")
+model.do()
+# check parameter is changed, so, FromFace becomes out of resulting solid, but Sketch_4 is still valid
+Extrusion_2.toSize().setValue(48)
+model.end()
+
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Sketch_4.feature()))
index 9fefd083133ca5f5e9c058c4c400487431a2442f..e446e96adb39a1587aad7c5c0ae79e08a7dd251e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,13 +39,13 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"))
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchCircle_1 = Sketch_2.addCircle(0, -10, 25)
 model.do()
-Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")])
 Partition_1 = model.addPartition(Part_1_doc, [model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_1_1")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Face_2_1/Face_2_1"), model.selection("FACE", "Partition_1_1_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Partition_1_1_1"), model.selection("COMPOUND", "Partition_1_1")])
 model.do()
 
 assert(Group_1.feature().error() == "")
index 09838dd7a48bdb86502320a75a10785519bdcfbd..a8bedb3d701f83d93e0cb00214fb7496e7eb1950 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -65,7 +66,7 @@ SketchLine_7.result().setName("SketchLine_8")
 SketchLine_7.setAuxiliary(True)
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_7.startPoint())
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_7.endPoint())
-SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_7.result(), SketchLine_3.result(), 93.56999999999999)
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_7.result(), SketchLine_3.result(), 93.56999999998719)
 SketchArc_2 = Sketch_1.addArc(2.349985665002739, 1.087256027998574, 2.499428733897898, 3.48259875277915, 3.77688682869805, 3.017010693505298, True)
 SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchArc_2.startPoint())
 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchArc_2.results()[1])
@@ -79,14 +80,14 @@ SketchLine_8.setName("SketchLine_9")
 SketchLine_8.result().setName("SketchLine_9")
 SketchLine_8.setAuxiliary(True)
 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_8.endPoint())
-SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_8.result(), SketchLine_7.result(), 32.91)
+SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_8.result(), SketchLine_7.result(), 32.91000000001281)
 SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchLine_8.startPoint(), SketchArc_2.center())
 SketchLine_9 = Sketch_1.addLine(1.546759218272496, 0.000964964207000808, 4.166514953924199, 2.685528408329715)
 SketchLine_9.setName("SketchLine_10")
 SketchLine_9.result().setName("SketchLine_10")
 SketchLine_9.setAuxiliary(True)
 SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_9.endPoint())
-SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_9.result(), SketchLine_8.result(), 7.82)
+SketchConstraintAngle_3 = Sketch_1.setAngle(SketchLine_9.result(), SketchLine_8.result(), 7.820000000000003)
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_9.startPoint(), SketchArc_3.center())
 SketchLine_10 = Sketch_1.addLine(4.166514953924199, 2.685528408329715, 4.411514953924289, 2.446442922550623)
 SketchLine_10.setName("SketchLine_11")
@@ -109,7 +110,7 @@ SketchLine_12.result().setName("SketchLine_13")
 SketchLine_12.setAuxiliary(True)
 SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_4.center(), SketchLine_12.startPoint())
 SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchLine_12.endPoint())
-SketchConstraintAngle_4 = Sketch_1.setAngleBackward(SketchLine_11.result(), SketchLine_12.result(), 8.018000000000001)
+SketchConstraintAngle_4 = Sketch_1.setAngleBackward(SketchLine_11.result(), SketchLine_12.result(), 8.018000000993595)
 SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_4.results()[1], 1.32)
 SketchArc_5 = Sketch_1.addArc(1.545335047953034, 0, 4.534275383417573, 2.308616054576027, 3.791202568545627, -3.03637143583555, True)
 SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchArc_4.endPoint(), SketchArc_5.startPoint())
@@ -154,6 +155,18 @@ SketchLine_17.result().setName("SketchLine_18")
 SketchArc_11.setName("SketchArc_14")
 SketchArc_11.result().setName("SketchArc_14")
 SketchArc_11.results()[1].setName("SketchArc_14_2")
+SketchArc_10.setName("SketchArc_10")
+SketchArc_10.result().setName("SketchArc_10")
+SketchArc_10.results()[1].setName("SketchArc_10_2")
+SketchArc_9.setName("SketchArc_9")
+SketchArc_9.result().setName("SketchArc_9")
+SketchArc_9.results()[1].setName("SketchArc_9_2")
+SketchLine_16.setName("SketchLine_16")
+SketchLine_16.result().setName("SketchLine_16")
+SketchLine_15.setName("SketchLine_15")
+SketchLine_15.result().setName("SketchLine_15")
+SketchLine_14.setName("SketchLine_14")
+SketchLine_14.result().setName("SketchLine_14")
 SketchConstraintCoincidence_30 = Sketch_1.setCoincident(SketchArc_7.endPoint(), SketchArc_8.startPoint())
 SketchConstraintTangent_9 = Sketch_1.setTangent(SketchArc_7.results()[1], SketchArc_8.results()[1])
 SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchLine_5.result(), SketchArc_8.endPoint())
@@ -190,13 +203,13 @@ SketchArc_15.setName("SketchArc_18")
 SketchArc_15.result().setName("SketchArc_18")
 SketchArc_15.results()[1].setName("SketchArc_18_2")
 SketchConstraintCoincidence_42 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchArc_15.startPoint())
-SketchConstraintTangent_12 = Sketch_1.setTangent(SketchArc_14.results()[1], SketchArc_15.results()[1])
+SketchConstraintTangent_11 = Sketch_1.setTangent(SketchArc_14.results()[1], SketchArc_15.results()[1])
 SketchArc_16 = Sketch_1.addArc(1.552616124088898, 0, 3.904833906055851, 3.190047534283911, 5.51611606287941, 0, True)
 SketchArc_16.setName("SketchArc_19")
 SketchArc_16.result().setName("SketchArc_19")
 SketchArc_16.results()[1].setName("SketchArc_19_2")
 SketchConstraintCoincidence_43 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchArc_16.startPoint())
-SketchConstraintTangent_13 = Sketch_1.setTangent(SketchArc_15.results()[1], SketchArc_16.results()[1])
+SketchConstraintTangent_12 = Sketch_1.setTangent(SketchArc_15.results()[1], SketchArc_16.results()[1])
 SketchConstraintCoincidence_44 = Sketch_1.setCoincident(SketchLine_5.result(), SketchArc_16.endPoint())
 SketchConstraintCoincidence_45 = Sketch_1.setCoincident(SketchArc_14.endPoint(), SketchLine_13.result())
 SketchConstraintCoincidence_46 = Sketch_1.setCoincident(SketchArc_14.center(), SketchArc_6.center())
@@ -214,7 +227,7 @@ SketchConstraintCoincidence_50 = Sketch_1.setCoincident(SketchLine_20.endPoint()
 SketchConstraintCoincidence_51 = Sketch_1.setCoincident(SketchLine_21.endPoint(), SketchLine_3.result())
 SketchConstraintVertical_5 = Sketch_1.setVertical(SketchLine_20.result())
 SketchConstraintDistance_6 = Sketch_1.setDistance(SketchLine_21.endPoint(), SketchLine_20.result(), 0.03, True)
-SketchConstraintAngle_5 = Sketch_1.setAngle(SketchLine_20.result(), SketchLine_21.result(), 170)
+SketchConstraintAngle_5 = Sketch_1.setAngle(SketchLine_20.result(), SketchLine_21.result(), 169.9999999984344)
 SketchConstraintDistance_7 = Sketch_1.setDistance(SketchLine_21.endPoint(), SketchLine_19.result(), 0.045, True)
 SketchArc_17 = Sketch_1.addArc(2.429999974807022, 2.369762445224826, 1.08, 2.370000000000011, 2.429999974807022, 3.719762440932702, True)
 SketchArc_17.setName("SketchArc_23")
@@ -250,6 +263,15 @@ SketchArc_23.result().setName("SketchArc_26")
 SketchArc_23.results()[1].setName("SketchArc_26_2")
 SketchLine_23.setName("SketchLine_24")
 SketchLine_23.result().setName("SketchLine_24")
+SketchArc_22.setName("SketchArc_22")
+SketchArc_22.result().setName("SketchArc_22")
+SketchArc_22.results()[1].setName("SketchArc_22_2")
+SketchArc_21.setName("SketchArc_21")
+SketchArc_21.result().setName("SketchArc_21")
+SketchArc_21.results()[1].setName("SketchArc_21_2")
+SketchArc_20.setName("SketchArc_20")
+SketchArc_20.result().setName("SketchArc_20")
+SketchArc_20.results()[1].setName("SketchArc_20_2")
 SketchLine_22.setName("SketchLine_21")
 SketchLine_22.result().setName("SketchLine_21")
 SketchConstraintCoincidence_58 = Sketch_1.setCoincident(SketchArc_18.endPoint(), SketchArc_19.startPoint())
@@ -293,7 +315,7 @@ SketchLine_31.result().setName("SketchLine_32")
 SketchLine_31.setAuxiliary(True)
 SketchConstraintCoincidence_75 = Sketch_1.setCoincident(SketchArc_1.center(), SketchLine_31.startPoint())
 SketchConstraintCoincidence_76 = Sketch_1.setCoincident(SketchLine_31.endPoint(), SketchArc_1.results()[1])
-SketchConstraintAngle_6 = Sketch_1.setAngle(SketchLine_31.result(), SketchLine_3.result(), 59.94)
+SketchConstraintAngle_6 = Sketch_1.setAngle(SketchLine_31.result(), SketchLine_3.result(), 59.93999999988066)
 SketchLine_32 = Sketch_1.addLine(1.871489087529827, 3.334796428456965, 1.871489087529827, 3.598813126524882)
 SketchLine_32.setName("SketchLine_33")
 SketchLine_32.result().setName("SketchLine_33")
@@ -308,14 +330,14 @@ SketchConstraintCoincidence_80 = Sketch_1.setCoincident(SketchLine_33.endPoint()
 SketchConstraintCoincidence_81 = Sketch_1.setCoincident(SketchLine_33.startPoint(), SketchLine_32.result())
 SketchConstraintVertical_7 = Sketch_1.setVertical(SketchLine_33.result())
 model.do()
-Extrusion_1_objects = [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2f-SketchArc_1_2r-SketchLine_5f-SketchArc_11_2f-SketchLine_14r-SketchLine_15f-SketchLine_16r-SketchArc_9_2f-SketchArc_15_2r-SketchLine_33f-SketchLine_34r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2r-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_12_2f-SketchArc_13_2f-SketchArc_10_2f-SketchArc_14_2f-SketchArc_16_2r-SketchLine_29f-SketchLine_30r"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_20f-SketchArc_17_2r-SketchLine_21r-SketchArc_20_2r-SketchLine_22r-SketchLine_23r-SketchArc_23_2f-SketchLine_24f-SketchArc_27_2f-SketchLine_25f-SketchLine_33f-SketchLine_34r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_18_2r-SketchArc_19_2r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_24_2f-SketchArc_25_2f-SketchArc_26_2f-SketchArc_28_2f-SketchLine_28f-SketchLine_31f"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_17_2r-SketchArc_23_2f-SketchLine_28r-SketchLine_33r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2r-SketchArc_11_2f-SketchLine_29r-SketchLine_33r"), model.selection("FACE", "Sketch_1/Face-SketchArc_9_2f-SketchArc_15_2r-SketchLine_30f-SketchLine_34f"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_20_2r-SketchArc_27_2f-SketchLine_31r-SketchLine_34f")]
+Extrusion_1_objects = [model.selection("WIRE", "Sketch_1/Face-SketchLine_5f-SketchArc_1_2r-SketchLine_33f-SketchArc_11_2f-SketchLine_2f-SketchLine_14r-SketchArc_9_2f-SketchLine_34r-SketchArc_15_2r-SketchLine_16r-SketchLine_15f-SketchLine_1r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_16_2r-SketchLine_30r-SketchArc_10_2f-SketchArc_14_2f-SketchArc_13_2f-SketchArc_12_2f-SketchLine_29f-SketchArc_1_2r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchLine_20f-SketchArc_17_2r-SketchLine_33f-SketchArc_23_2f-SketchLine_23r-SketchLine_22r-SketchLine_24f-SketchLine_25f-SketchArc_27_2f-SketchLine_34r-SketchArc_20_2r-SketchLine_21r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchArc_19_2r-SketchArc_22_2r-SketchArc_21_2r-SketchLine_31f-SketchArc_28_2f-SketchArc_26_2f-SketchArc_25_2f-SketchArc_24_2f-SketchLine_28f-SketchArc_18_2r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchLine_28r-SketchArc_23_2f-SketchLine_33r-SketchArc_17_2r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchLine_29r-SketchArc_11_2f-SketchLine_33r-SketchArc_1_2r_wire"), model.selection("FACE", "Sketch_1/Face-SketchArc_9_2f-SketchLine_30f-SketchArc_15_2r-SketchLine_34f"), model.selection("WIRE", "Sketch_1/Face-SketchLine_34f-SketchArc_27_2f-SketchLine_31r-SketchArc_20_2r_wire")]
 Extrusion_1 = model.addExtrusion(Part_1_doc, Extrusion_1_objects, model.selection(), 0.1785, 0.1785)
-Extrusion_2_objects = [model.selection("WIRE", "Sketch_1/Wire-SketchArc_12_2r-SketchArc_13_2r-SketchArc_10_2r-SketchArc_14_2r-SketchArc_18_2f-SketchArc_19_2f-SketchArc_21_2f-SketchArc_22_2f-SketchLine_26f-SketchLine_27r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2r-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_12_2f-SketchArc_13_2f-SketchArc_10_2f-SketchArc_14_2f-SketchArc_16_2r-SketchLine_29f-SketchLine_30r"), model.selection("FACE", "Sketch_1/Face-SketchArc_18_2r-SketchArc_19_2r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_24_2f-SketchArc_25_2f-SketchArc_26_2f-SketchArc_28_2f-SketchLine_28f-SketchLine_31f")]
-Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), model.selection("FACE", "Extrusion_1_2/From_Face_2"), -0.05, model.selection("FACE", "Extrusion_1_2/From_Face_2"), 0)
-Extrusion_3_objects = [model.selection("FACE", "Sketch_1/Face-SketchArc_12_2r-SketchArc_13_2r-SketchArc_10_2r-SketchArc_14_2r-SketchArc_18_2f-SketchArc_19_2f-SketchArc_21_2f-SketchArc_22_2f-SketchLine_26f-SketchLine_27r"), model.selection("FACE", "Sketch_1/Face-SketchArc_18_2r-SketchArc_19_2r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_24_2f-SketchArc_25_2f-SketchArc_26_2f-SketchArc_28_2f-SketchLine_28f-SketchLine_31f"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2r-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_12_2f-SketchArc_13_2f-SketchArc_10_2f-SketchArc_14_2f-SketchArc_16_2r-SketchLine_29f-SketchLine_30r")]
-Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face_1"), 0.05, model.selection("FACE", "Extrusion_1_2/To_Face_1"), 0)
-Extrusion_4_objects = [model.selection("FACE", "Sketch_1/Face-SketchArc_17_2r-SketchArc_23_2f-SketchLine_28r-SketchLine_33r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2r-SketchArc_11_2f-SketchLine_29r-SketchLine_33r"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_11_2r-SketchArc_17_2f-SketchLine_27f-SketchLine_33r"), model.selection("FACE", "Sketch_1/Face-SketchArc_20_2r-SketchArc_27_2f-SketchLine_31r-SketchLine_34f"), model.selection("FACE", "Sketch_1/Face-SketchArc_9_2r-SketchArc_20_2f-SketchLine_26r-SketchLine_34f"), model.selection("WIRE", "Sketch_1/Wire-SketchArc_9_2f-SketchArc_15_2r-SketchLine_30f-SketchLine_34f")]
-Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face_2"), 0.15, model.selection("FACE", "Extrusion_1_1/To_Face_2"), 0)
+Extrusion_2_objects = [model.selection("WIRE", "Sketch_1/Face-SketchArc_13_2r-SketchArc_14_2r-SketchArc_10_2r-SketchLine_26f-SketchArc_21_2f-SketchArc_22_2f-SketchArc_19_2f-SketchArc_18_2f-SketchLine_27r-SketchArc_12_2r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_16_2r-SketchLine_30r-SketchArc_10_2f-SketchArc_14_2f-SketchArc_13_2f-SketchArc_12_2f-SketchLine_29f-SketchArc_1_2r_wire"), model.selection("FACE", "Sketch_1/Face-SketchArc_19_2r-SketchArc_22_2r-SketchArc_21_2r-SketchLine_31f-SketchArc_28_2f-SketchArc_26_2f-SketchArc_25_2f-SketchArc_24_2f-SketchLine_28f-SketchArc_18_2r")]
+Extrusion_2 = model.addExtrusion(Part_1_doc, Extrusion_2_objects, model.selection(), model.selection("FACE", "Extrusion_1_2_2/From_Face"), -0.05, model.selection("FACE", "Extrusion_1_2_2/From_Face"), 0)
+Extrusion_3_objects = [model.selection("FACE", "Sketch_1/Face-SketchArc_13_2r-SketchArc_14_2r-SketchArc_10_2r-SketchLine_26f-SketchArc_21_2f-SketchArc_22_2f-SketchArc_19_2f-SketchArc_18_2f-SketchLine_27r-SketchArc_12_2r"), model.selection("FACE", "Sketch_1/Face-SketchArc_19_2r-SketchArc_22_2r-SketchArc_21_2r-SketchLine_31f-SketchArc_28_2f-SketchArc_26_2f-SketchArc_25_2f-SketchArc_24_2f-SketchLine_28f-SketchArc_18_2r"), model.selection("WIRE", "Sketch_1/Face-SketchArc_2_2r-SketchArc_3_2r-SketchLine_11f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_16_2r-SketchLine_30r-SketchArc_10_2f-SketchArc_14_2f-SketchArc_13_2f-SketchArc_12_2f-SketchLine_29f-SketchArc_1_2r_wire")]
+Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection(), model.selection("FACE", "Extrusion_1_1_1/To_Face"), 0.05, model.selection("FACE", "Extrusion_1_2_1/To_Face"), 0)
+Extrusion_4_objects = [model.selection("FACE", "Sketch_1/Face-SketchLine_28r-SketchArc_23_2f-SketchLine_33r-SketchArc_17_2r"), model.selection("WIRE", "Sketch_1/Face-SketchLine_29r-SketchArc_11_2f-SketchLine_33r-SketchArc_1_2r_wire"), model.selection("WIRE", "Sketch_1/Face-SketchLine_27f-SketchArc_17_2f-SketchLine_33r-SketchArc_11_2r_wire"), model.selection("FACE", "Sketch_1/Face-SketchLine_34f-SketchArc_27_2f-SketchLine_31r-SketchArc_20_2r"), model.selection("FACE", "Sketch_1/Face-SketchLine_34f-SketchArc_20_2f-SketchLine_26r-SketchArc_9_2r"), model.selection("WIRE", "Sketch_1/Face-SketchArc_9_2f-SketchLine_30f-SketchArc_15_2r-SketchLine_34f_wire")]
+Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection(), model.selection("FACE", "Extrusion_1_1_2/To_Face"), 0.15, model.selection("FACE", "Extrusion_1_1_2/To_Face"), 0)
 Extrusion_4.setName("Extrusion_6")
 Extrusion_4.result().setName("Extrusion_6_1")
 Extrusion_4.result().subResult(0).setName("Extrusion_6_1_1")
@@ -325,8 +347,8 @@ Extrusion_4.results()[1].setName("Extrusion_6_2")
 Extrusion_4.results()[1].subResult(0).setName("Extrusion_6_2_1")
 Extrusion_4.results()[1].subResult(1).setName("Extrusion_6_2_2")
 Extrusion_4.results()[1].subResult(2).setName("Extrusion_6_2_3")
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Extrusion_3_1/To_Face_3&Extrusion_3_1/Generated_Face_10&Extrusion_3_1/Generated_Face_11"), model.selection("VERTEX", "Extrusion_6_1/To_Face_1&Extrusion_6_1/Generated_Face_9&Extrusion_6_1/Generated_Face_8"))
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Extrusion_6_1/Generated_Face_3&Extrusion_6_1/To_Face_3&Extrusion_6_1/Generated_Face_4"), False)
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1_3/To_Face][Extrusion_3_1_3/Generated_Face&Sketch_1/SketchLine_28][Extrusion_3_1_3/Generated_Face&Sketch_1/SketchArc_24_2]"), model.selection("VERTEX", "[Extrusion_6_1_1/To_Face][Extrusion_6_1_1/Generated_Face&Sketch_1/SketchArc_23_2][Extrusion_6_1_1/Generated_Face&Sketch_1/SketchLine_33]"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "[Extrusion_6_1_3/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_6_1_3/To_Face][Extrusion_6_1_3/Generated_Face&Sketch_1/SketchLine_33]"), False)
 Partition_1_objects = [model.selection("COMPSOLID", "Extrusion_6_1"), model.selection("FACE", "Plane_1"), model.selection("COMPSOLID", "Extrusion_6_2")]
 Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
index c2eabb4b875d0c9d9ca0025cec332af17135a00f..c237f01dbbe24e57200d2a61803fd8e6d7d44db9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
diff --git a/src/ModelAPI/Test/Test2627.py b/src/ModelAPI/Test/Test2627.py
new file mode 100644 (file)
index 0000000..7f9cbe1
--- /dev/null
@@ -0,0 +1,93 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+model.addParameter(partSet, "L", "10")
+model.addParameter(partSet, "H", "8")
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(10, 0, 0, 0)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchPoint_1.result())
+SketchLine_2 = Sketch_1.addLine(0, 0, 0, 8)
+SketchLine_3 = Sketch_1.addLine(0, 8, 10, 8)
+SketchLine_4 = Sketch_1.addLine(10, 8, 10, 0)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(2.5, -1.540743955509789e-33, 2.5, 8)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_1.result())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_3.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), "L")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), "H")
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_5.startPoint(), "L/4.")
+model.do()
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_5r-SketchLine_1r")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Group_1.setName("face_g")
+Group_1.result().setName("face_g")
+Group_2 = model.addGroup(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_5r-SketchLine_1r")])
+Group_2.setName("face_d")
+Group_2.result().setName("face_d")
+Group_3 = model.addGroup(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5f-SketchLine_3r-SketchLine_2r-SketchLine_1r"), model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_5r-SketchLine_1r")])
+Group_3.setName("face_g_d")
+Group_3.result().setName("face_g_d")
+Group_4 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Sketch_1/SubEdge_1&Sketch_1/SketchLine_1")])
+Group_4.setName("ligne_g")
+Group_4.result().setName("ligne_g")
+Group_5 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Sketch_1/SubEdge_2&Sketch_1/SketchLine_1")])
+Group_5.setName("ligne_d")
+Group_5.result().setName("ligne_d")
+Group_6 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Sketch_1/SubEdge_1&Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SubEdge_2&Sketch_1/SketchLine_1")])
+Group_6.setName("ligne_g_d")
+Group_6.result().setName("ligne_g_d")
+Group_7 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SubVertex_1&Sketch_1/SketchLine_2_EndVertex&Sketch_1/SketchLine_3_StartVertex")])
+Group_7.setName("coin_g")
+Group_7.result().setName("coin_g")
+Group_8 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SubVertex_2&Sketch_1/SketchLine_3_EndVertex&Sketch_1/SketchLine_4_StartVertex")])
+Group_8.setName("coin_d")
+Group_8.result().setName("coin_d")
+Group_9 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SubVertex_1&Sketch_1/SketchLine_2_EndVertex&Sketch_1/SketchLine_3_StartVertex"), model.selection("VERTEX", "Sketch_1/SubVertex_2&Sketch_1/SketchLine_3_EndVertex&Sketch_1/SketchLine_4_StartVertex")])
+Group_9.setName("coins")
+Group_9.result().setName("coins")
+model.end()
+
+# check all groups are correct
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
+
+assert(model.checkPythonDump())
diff --git a/src/ModelAPI/Test/Test2685.py b/src/ModelAPI/Test/Test2685.py
new file mode 100644 (file)
index 0000000..3aba258
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(22, 5, 10)
+SketchCircle_2 = Sketch_1.addCircle(0, 0, 7.5)
+SketchCircle_3 = Sketch_1.addCircle(29, -20, 7.5)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin", 1), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_1 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_1.result(), 22, True)
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_2 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchCircle_1.center(), SketchLine_2.result(), 5, True)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 10)
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_2.results()[1], 7.5)
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_3.results()[1], 7.5)
+SketchLine_3 = Sketch_1.addLine(22, 5, 22, 41.96787958115183)
+SketchLine_3.setAuxiliary(True)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_3.startPoint())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchCircle_3.center(), SketchLine_3.result(), 7, True)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchCircle_3.center(), SketchLine_2.result(), 20, True)
+SketchArc_1 = Sketch_1.addArc(22, 5, 19.39053135678072, 27.42761377547613, 44.57891020979248, 5, True)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchArc_1.center())
+SketchLine_4 = Sketch_1.addLine(22, 5, 85.59353403141361, 5)
+SketchLine_4.setAuxiliary(True)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(44.57891020979248, 5, 44.57891020979248, -20)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_5.startPoint())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_5.result(), 25)
+model.end()
+
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_WEAK))
diff --git a/src/ModelAPI/Test/Test2828.py b/src/ModelAPI/Test/Test2828.py
new file mode 100644 (file)
index 0000000..bb1b34a
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "a", "10")
+model.addParameter(Part_1_doc, "b", "20")
+ParamL = model.addParameter(Part_1_doc, "l", "100")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
+SketchLine_1 = Sketch_1.addLine(13.37522515430284, 1.633845843958015, -6.624774845697162, 1.633845843958015)
+SketchLine_2 = Sketch_1.addLine(-6.624774845697162, 1.633845843958015, -6.624774845697162, -8.366154156041985)
+SketchLine_3 = Sketch_1.addLine(-6.624774845697162, -8.366154156041985, 13.37522515430284, -8.366154156041985)
+SketchLine_4 = Sketch_1.addLine(13.37522515430284, -8.366154156041985, 13.37522515430284, 1.633845843958015)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), "a")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), "b")
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), "l", 0)
+model.do()
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aSession.blockAutoUpdate(True)
+model.testResultsVolumes(Extrusion_1, [20000])
+ParamL.setValue(10)
+# emulate the "See preview" press during the transaction opened
+from ModelAPI import *
+aSession = ModelAPI_Session.get()
+aSession.blockAutoUpdate(False)
+aSession.blockAutoUpdate(True)
+# check that extrusion was updated
+model.testResultsVolumes(Extrusion_1, [2000])
+aSession.blockAutoUpdate(False)
+model.end()
diff --git a/src/ModelAPI/Test/Test2859.py b/src/ModelAPI/Test/Test2859.py
new file mode 100644 (file)
index 0000000..f441a50
--- /dev/null
@@ -0,0 +1,335 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+from ModelAPI import *
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "h1", "15")
+param_h2 = model.addParameter(Part_1_doc, "h2", "70")
+model.addParameter(Part_1_doc, "h3", "7")
+model.addParameter(Part_1_doc, "d", "15")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchLine_1 = Sketch_1.addLine(-7.500000000000083, -15.81138830084192, -7.500000000000083, -26.99999999999995)
+SketchLine_1.setName("SketchLine_2")
+SketchLine_1.result().setName("SketchLine_2")
+SketchLine_2 = Sketch_1.addLine(-4.499999999999853, -30, 4.499999999999912, -30)
+SketchLine_2.setName("SketchLine_3")
+SketchLine_2.result().setName("SketchLine_3")
+SketchLine_3 = Sketch_1.addLine(7.499999999999912, -27, 7.499999999999912, -15.81138830084196)
+SketchLine_3.setName("SketchLine_4")
+SketchLine_3.result().setName("SketchLine_4")
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_2.result())
+SketchConstraintHorizontal_1.setName("SketchConstraintHorizontal_2")
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_3.result())
+SketchPoint_2 = Sketch_1.addPoint(0, -30)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_6")
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_4 = SketchProjection_2.createdFeature()
+SketchLine_4.setName("SketchLine_5")
+SketchLine_4.result().setName("SketchLine_5")
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_2.coordinates(), SketchLine_4.result())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_7")
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_5 = SketchProjection_3.createdFeature()
+SketchLine_5.setName("SketchLine_6")
+SketchLine_5.result().setName("SketchLine_6")
+SketchArc_1 = Sketch_1.addArc(0, 0, -7.500000000000083, -15.81138830084192, -17.44306393762917, 1.410503622037771, True)
+SketchArc_1.setName("SketchArc_2")
+SketchArc_1.result().setName("SketchArc_2")
+SketchArc_1.results()[1].setName("SketchArc_2_2")
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchArc_1.center())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 17.5)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_14")
+SketchArc_2 = Sketch_1.addArc(-4.499999999999853, -27, -7.500000000000083, -26.99999999999995, -4.499999999999853, -30, False)
+SketchArc_2.setName("SketchArc_3")
+SketchArc_2.result().setName("SketchArc_3")
+SketchArc_2.results()[1].setName("SketchArc_3_2")
+SketchPoint_3 = Sketch_1.addPoint(-7.500000000000085, -30)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchLine_5.result(), 30, True)
+SketchPoint_3.setAuxiliary(True)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_8")
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchPoint_3.coordinates(), SketchLine_1.result())
+SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_9")
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_2.startPoint(), SketchLine_1.endPoint())
+SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_10")
+SketchConstraintCoincidence_9 = Sketch_1.setCoincident(SketchArc_2.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_11")
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_2.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_2.results()[1], SketchLine_1.result())
+SketchArc_3 = Sketch_1.addArc(4.499999999999912, -27, 4.499999999999912, -30, 7.499999999999912, -27, False)
+SketchArc_3.setName("SketchArc_4")
+SketchArc_3.result().setName("SketchArc_4")
+SketchArc_3.results()[1].setName("SketchArc_4_2")
+SketchPoint_4 = Sketch_1.addPoint(7.499999999999914, -30)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchPoint_3.coordinates(), SketchPoint_4.coordinates(), 15, False)
+SketchPoint_4.setAuxiliary(True)
+SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_3.result())
+SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_13")
+SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_15")
+SketchConstraintCoincidence_12 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchLine_2.endPoint())
+SketchConstraintCoincidence_12.setName("SketchConstraintCoincidence_16")
+SketchConstraintCoincidence_13 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_13.setName("SketchConstraintCoincidence_17")
+SketchConstraintTangent_3 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_3.result())
+SketchConstraintTangent_4 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchLine_2.result())
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 3)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_3.results()[1], SketchArc_2.results()[1])
+SketchConstraintEqual_2 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
+SketchMultiRotation_1_objects = [SketchLine_1.result(), SketchArc_2.results()[1], SketchLine_2.result(), SketchArc_3.results()[1], SketchLine_3.result()]
+SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_5).startPoint(), 360, 3, True)
+[SketchLine_6, SketchLine_7, SketchArc_4, SketchArc_5, SketchLine_8, SketchLine_9, SketchArc_6, SketchArc_7, SketchLine_10, SketchLine_11] = SketchMultiRotation_1.rotated()
+SketchLine_11.setName("SketchLine_14")
+SketchLine_11.result().setName("SketchLine_14")
+SketchLine_10.setName("SketchLine_13")
+SketchLine_10.result().setName("SketchLine_13")
+SketchArc_7.setName("SketchArc_9")
+SketchArc_7.result().setName("SketchArc_9")
+SketchArc_7.results()[1].setName("SketchArc_9_2")
+SketchArc_6.setName("SketchArc_8")
+SketchArc_6.result().setName("SketchArc_8")
+SketchArc_6.results()[1].setName("SketchArc_8_2")
+SketchLine_9.setName("SketchLine_11")
+SketchLine_9.result().setName("SketchLine_11")
+SketchLine_8.setName("SketchLine_10")
+SketchLine_8.result().setName("SketchLine_10")
+SketchArc_5.setName("SketchArc_6")
+SketchArc_5.result().setName("SketchArc_6")
+SketchArc_5.results()[1].setName("SketchArc_6_2")
+SketchArc_4.setName("SketchArc_5")
+SketchArc_4.result().setName("SketchArc_5")
+SketchArc_4.results()[1].setName("SketchArc_5_2")
+SketchLine_7.setName("SketchLine_8")
+SketchLine_7.result().setName("SketchLine_8")
+SketchLine_6.setName("SketchLine_7")
+SketchLine_6.result().setName("SketchLine_7")
+SketchArc_8 = Sketch_1.addArc(0, 0, -9.943063937629109, 14.40088467880429, 9.94306393762926, 14.40088467880419, True)
+SketchArc_8.setName("SketchArc_10")
+SketchArc_8.result().setName("SketchArc_10")
+SketchArc_8.results()[1].setName("SketchArc_10_2")
+SketchConstraintEqual_3 = Sketch_1.setEqual(SketchArc_1.results()[1], SketchArc_8.results()[1])
+SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_1.center(), SketchArc_8.center())
+SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_18")
+SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_11.result())
+SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_19")
+SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchArc_8.startPoint(), SketchLine_7.result())
+SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_20")
+SketchArc_9 = Sketch_1.addArc(0, 0, 17.44306393762918, 1.410503622037589, 7.499999999999912, -15.81138830084196, True)
+SketchArc_9.setName("SketchArc_11")
+SketchArc_9.result().setName("SketchArc_11")
+SketchArc_9.results()[1].setName("SketchArc_11_2")
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_9.endPoint(), SketchLine_3.endPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_12")
+SketchConstraintEqual_4 = Sketch_1.setEqual(SketchArc_8.results()[1], SketchArc_9.results()[1])
+SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_8.center(), SketchArc_9.center())
+SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_21")
+SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_8.endPoint(), SketchLine_10.result())
+SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_22")
+SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchArc_9.startPoint(), SketchLine_6.result())
+SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_23")
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 24)
+SketchCircle_1.setAuxiliary(True)
+SketchConstraintCoincidence_20 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchCircle_1.center())
+SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24")
+SketchConstraintRadius_3 = Sketch_1.setRadius(SketchCircle_1.results()[1], 24)
+SketchCircle_2 = Sketch_1.addCircle(0, -24, 4)
+SketchConstraintCoincidence_21 = Sketch_1.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
+SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_25")
+SketchConstraintRadius_4 = Sketch_1.setRadius(SketchCircle_2.results()[1], 4)
+SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchLine_4.result())
+SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_26")
+SketchMultiRotation_2 = Sketch_1.addRotation([SketchCircle_2.results()[1]], SketchAPI_Line(SketchLine_4).startPoint(), 360, 3, True)
+[SketchCircle_3, SketchCircle_4] = SketchMultiRotation_2.rotated()
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_3_2f-SketchLine_3f-SketchArc_4_2f-SketchLine_4f-SketchArc_11_2f-SketchLine_7f-SketchArc_5_2f-SketchLine_10f-SketchArc_8_2f-SketchLine_13f-SketchArc_10_2f-SketchLine_8f-SketchArc_6_2f-SketchLine_11f-SketchArc_9_2f-SketchLine_14f-SketchArc_2_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r")], model.selection(), "h1", 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_12 = SketchProjection_4.createdFeature()
+SketchLine_12.setName("SketchLine_12")
+SketchLine_12.result().setName("SketchLine_12")
+SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_13 = SketchProjection_5.createdFeature()
+SketchLine_13.setName("SketchLine_15")
+SketchLine_13.result().setName("SketchLine_15")
+SketchLine_14 = Sketch_2.addLine(7.500000000000332, 12.99038105676728, 15, 0)
+SketchLine_14.setName("SketchLine_16")
+SketchLine_14.result().setName("SketchLine_16")
+SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_12.result())
+SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_28")
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_14.startPoint(), "d", True)
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_14.endPoint(), "d", True)
+SketchLine_15 = Sketch_2.addLine(0, 0, 7.500000000000332, 12.99038105676728)
+SketchLine_15.setName("SketchLine_17")
+SketchLine_15.result().setName("SketchLine_17")
+SketchLine_15.setAuxiliary(True)
+SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_12).startPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_27")
+SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchLine_15.endPoint())
+SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29")
+SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_12.result(), SketchLine_15.result(), "360/6")
+SketchMultiRotation_3 = Sketch_2.addRotation([SketchLine_14.result()], SketchAPI_Line(SketchLine_12).startPoint(), 360, 6, True)
+[SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_20] = SketchMultiRotation_3.rotated()
+SketchLine_20.setName("SketchLine_22")
+SketchLine_20.result().setName("SketchLine_22")
+SketchLine_19.setName("SketchLine_21")
+SketchLine_19.result().setName("SketchLine_21")
+SketchLine_18.setName("SketchLine_20")
+SketchLine_18.result().setName("SketchLine_20")
+SketchLine_17.setName("SketchLine_19")
+SketchLine_17.result().setName("SketchLine_19")
+SketchLine_16.setName("SketchLine_18")
+SketchLine_16.result().setName("SketchLine_18")
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_18r-SketchLine_19r-SketchLine_20r-SketchLine_21r-SketchLine_22r-SketchLine_16r_wire")], model.selection(), "h2-h3-h1", 0)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face"))
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_21 = SketchProjection_6.createdFeature()
+SketchLine_21.setName("SketchLine_23")
+SketchLine_21.result().setName("SketchLine_23")
+SketchCircle_5 = Sketch_3.addCircle(0, 0, 10)
+SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchAPI_Line(SketchLine_21).startPoint(), SketchCircle_5.center())
+SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30")
+SketchConstraintRadius_5 = Sketch_3.setRadius(SketchCircle_5.results()[1], 10)
+model.do()
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_5_2f")], model.selection(), 0, 60, [model.selection("SOLID", "Fuse_1_1")])
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/From_Face"))
+SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_22 = SketchProjection_7.createdFeature()
+SketchLine_22.setName("SketchLine_24")
+SketchLine_22.result().setName("SketchLine_24")
+SketchCircle_6 = Sketch_4.addCircle(0, 0, 12.5)
+SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchAPI_Line(SketchLine_22).startPoint(), SketchCircle_6.center())
+SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_31")
+SketchConstraintRadius_6 = Sketch_4.setRadius(SketchCircle_6.results()[1], 12.5)
+model.do()
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_3_2f-SketchLine_3f-SketchArc_4_2f-SketchLine_4f-SketchArc_11_2f-SketchLine_7f-SketchArc_5_2f-SketchLine_10f-SketchArc_8_2f-SketchLine_13f-SketchArc_10_2f-SketchLine_8f-SketchArc_6_2f-SketchLine_11f-SketchArc_9_2f-SketchLine_14f-SketchArc_2_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Fillet_1_objects = [model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_20]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_21]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_22]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_16]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_19]"), model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_18]")]
+Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 1)
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_2_1/To_Face"))
+SketchProjection_8 = Sketch_5.addProjection(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Extrusion_2_1/To_Face][ExtrusionCut_1_1/Generated_Face&Sketch_3/SketchCircle_5_2]__cc"), False)
+SketchPoint_5 = SketchProjection_8.createdFeature()
+SketchCircle_7 = Sketch_5.addCircle(0, 0, 22)
+SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchPoint_5.result(), SketchCircle_7.center())
+SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_32")
+SketchConstraintRadius_7 = Sketch_5.setRadius(SketchCircle_7.results()[1], 22)
+model.do()
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchCircle_7_2f")], model.selection(), "h3", 0)
+Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fillet_1_1"), model.selection("SOLID", "Extrusion_3_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
+SketchLine_23 = Sketch_6.addLine(22, 70, 20, 70)
+SketchLine_23.setName("SketchLine_25")
+SketchLine_23.result().setName("SketchLine_25")
+SketchProjection_9 = Sketch_6.addProjection(model.selection("VERTEX", "[Extrusion_3_1/Generated_Face&Sketch_5/SketchCircle_7_2][Extrusion_3_1/To_Face]"), False)
+SketchPoint_6 = SketchProjection_9.createdFeature()
+SketchConstraintCoincidence_29 = Sketch_6.setCoincident(SketchLine_23.startPoint(), SketchPoint_6.result())
+SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_33")
+SketchLine_24 = Sketch_6.addLine(20, 70, 22, 68.84529946162075)
+SketchLine_24.setName("SketchLine_26")
+SketchLine_24.result().setName("SketchLine_26")
+SketchConstraintCoincidence_30 = Sketch_6.setCoincident(SketchLine_23.endPoint(), SketchLine_24.startPoint())
+SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_34")
+SketchProjection_10 = Sketch_6.addProjection(model.selection("EDGE", "([Extrusion_3_1/Generated_Face&Sketch_5/SketchCircle_7_2][Extrusion_3_1/To_Face])_Fuse_2_1"), False)
+SketchLine_25 = SketchProjection_10.createdFeature()
+SketchLine_25.setName("SketchLine_27")
+SketchLine_25.result().setName("SketchLine_27")
+SketchConstraintCoincidence_31 = Sketch_6.setCoincident(SketchLine_24.endPoint(), SketchLine_25.result())
+SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_35")
+SketchLine_26 = Sketch_6.addLine(22, 68.84529946162075, 22, 70)
+SketchLine_26.setName("SketchLine_28")
+SketchLine_26.result().setName("SketchLine_28")
+SketchConstraintCoincidence_32 = Sketch_6.setCoincident(SketchLine_24.endPoint(), SketchLine_26.startPoint())
+SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_36")
+SketchConstraintCoincidence_33 = Sketch_6.setCoincident(SketchLine_23.startPoint(), SketchLine_26.endPoint())
+SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_37")
+SketchLine_27 = Sketch_6.addLine(21.99999999999999, 64, 22, 63)
+SketchLine_27.setName("SketchLine_29")
+SketchLine_27.result().setName("SketchLine_29")
+SketchConstraintCoincidence_34 = Sketch_6.setCoincident(SketchLine_27.startPoint(), SketchLine_25.result())
+SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_38")
+SketchConstraintCoincidence_35 = Sketch_6.setCoincident(SketchAPI_Line(SketchLine_25).startPoint(), SketchLine_27.endPoint())
+SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_39")
+SketchLine_28 = Sketch_6.addLine(21.99999999999999, 64, 21.73205080756888, 63)
+SketchLine_28.setName("SketchLine_30")
+SketchLine_28.result().setName("SketchLine_30")
+SketchConstraintCoincidence_36 = Sketch_6.setCoincident(SketchLine_27.startPoint(), SketchLine_28.startPoint())
+SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_40")
+SketchLine_29 = Sketch_6.addLine(21.73205080756888, 63, 22, 63)
+SketchLine_29.setName("SketchLine_31")
+SketchLine_29.result().setName("SketchLine_31")
+SketchConstraintCoincidence_37 = Sketch_6.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_41")
+SketchConstraintCoincidence_38 = Sketch_6.setCoincident(SketchAPI_Line(SketchLine_25).startPoint(), SketchLine_29.endPoint())
+SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_42")
+SketchConstraintLength_1 = Sketch_6.setLength(SketchLine_23.result(), 2)
+SketchConstraintAngle_2 = Sketch_6.setAngleBackward(SketchLine_23.result(), SketchLine_24.result(), 30)
+SketchConstraintHorizontal_2 = Sketch_6.setHorizontal(SketchLine_23.result())
+SketchConstraintHorizontal_2.setName("SketchConstraintHorizontal_3")
+SketchConstraintHorizontal_3 = Sketch_6.setHorizontal(SketchLine_29.result())
+SketchConstraintHorizontal_3.setName("SketchConstraintHorizontal_4")
+SketchConstraintLength_2 = Sketch_6.setLength(SketchLine_27.result(), 1)
+SketchConstraintAngle_3 = Sketch_6.setAngle(SketchLine_28.result(), SketchLine_27.result(), 15)
+model.do()
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fuse_2_1")], [model.selection("SOLID", "Revolution_1_2"), model.selection("SOLID", "Revolution_1_1")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Cut_1_1/Modified_Face&Extrusion_3_1/To_Face"))
+SketchProjection_11 = Sketch_7.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_6/SketchLine_26][Cut_1_1/Modified_Face&Extrusion_3_1/To_Face]__cc"), False)
+SketchPoint_7 = SketchProjection_11.createdFeature()
+SketchCircle_8 = Sketch_7.addCircle(0, 0, 26)
+SketchCircle_8.setAuxiliary(True)
+SketchConstraintCoincidence_39 = Sketch_7.setCoincident(SketchPoint_7.result(), SketchCircle_8.center())
+SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43")
+SketchConstraintRadius_8 = Sketch_7.setRadius(SketchCircle_8.results()[1], 26)
+SketchCircle_9 = Sketch_7.addCircle(0, -26, 5.25)
+SketchConstraintCoincidence_40 = Sketch_7.setCoincident(SketchCircle_8.results()[1], SketchCircle_9.center())
+SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44")
+SketchProjection_12 = Sketch_7.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_30 = SketchProjection_12.createdFeature()
+SketchLine_30.setName("SketchLine_32")
+SketchLine_30.result().setName("SketchLine_32")
+SketchConstraintRadius_9 = Sketch_7.setRadius(SketchCircle_9.results()[1], 5.25)
+SketchConstraintCoincidence_41 = Sketch_7.setCoincident(SketchCircle_9.center(), SketchLine_30.result())
+SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45")
+SketchMultiRotation_4 = Sketch_7.addRotation([SketchCircle_9.results()[1]], SketchAPI_Line(SketchLine_30).startPoint(), 360, 16, True)
+[SketchCircle_10, SketchCircle_11, SketchCircle_12, SketchCircle_13, SketchCircle_14, SketchCircle_15, SketchCircle_16, SketchCircle_17, SketchCircle_18, SketchCircle_19, SketchCircle_20, SketchCircle_21, SketchCircle_22, SketchCircle_23, SketchCircle_24] = SketchMultiRotation_4.rotated()
+model.do()
+Extrusion_4_objects = [model.selection("FACE", "Sketch_7/Face-SketchCircle_19_2f-SketchCircle_20_2r-SketchCircle_19_2f-SketchCircle_19_2f-SketchCircle_18_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_18_2f-SketchCircle_19_2r-SketchCircle_18_2f-SketchCircle_17_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_17_2f-SketchCircle_18_2r-SketchCircle_18_2r-SketchCircle_17_2f-SketchCircle_16_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_15_2f-SketchCircle_15_2f-SketchCircle_16_2r-SketchCircle_15_2f-SketchCircle_14_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_16_2f-SketchCircle_16_2f-SketchCircle_17_2r-SketchCircle_17_2r-SketchCircle_16_2f-SketchCircle_15_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_14_2f-SketchCircle_14_2f-SketchCircle_15_2r-SketchCircle_14_2f-SketchCircle_13_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_13_2f-SketchCircle_13_2f-SketchCircle_14_2r-SketchCircle_13_2f-SketchCircle_12_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_12_2f-SketchCircle_12_2f-SketchCircle_13_2r-SketchCircle_12_2f-SketchCircle_11_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_11_2f-SketchCircle_11_2f-SketchCircle_12_2r-SketchCircle_11_2f-SketchCircle_10_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_9_2r-SketchCircle_10_2f-SketchCircle_10_2f-SketchCircle_11_2r-SketchCircle_10_2f-SketchCircle_9_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_9_2f-SketchCircle_24_2r-SketchCircle_24_2r-SketchCircle_9_2f-SketchCircle_10_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_24_2f-SketchCircle_23_2r-SketchCircle_24_2f-SketchCircle_9_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_23_2f-SketchCircle_24_2r-SketchCircle_23_2f-SketchCircle_23_2f-SketchCircle_22_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_22_2f-SketchCircle_23_2r-SketchCircle_22_2f-SketchCircle_22_2f-SketchCircle_21_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_21_2f-SketchCircle_22_2r-SketchCircle_21_2f-SketchCircle_21_2f-SketchCircle_20_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_20_2f-SketchCircle_21_2r-SketchCircle_20_2f-SketchCircle_20_2f-SketchCircle_19_2r")]
+Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection(), model.selection("FACE", "Sketch_5/Face-SketchCircle_7_2f"), 0, model.selection(), 0)
+model.do()
+# change the parameter value
+param_h2.setValue(90)
+model.end()
+# check the final extrusion is valid:
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Extrusion_4.feature()))
+
+model.testResultsVolumes(Extrusion_4, [597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447, 597.118881248058755772945005447])
diff --git a/src/ModelAPI/Test/Test2873.py b/src/ModelAPI/Test/Test2873.py
new file mode 100644 (file)
index 0000000..d8e88bd
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    Test2873.py
+    Test for issue #2873 "Freeze when inserting a new folder"
+"""
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(50, -50, -50, -50)
+SketchLine_2 = Sketch_1.addLine(-50, -50, -50, 50)
+SketchLine_3 = Sketch_1.addLine(-50, 50, 50, 50)
+SketchLine_4 = Sketch_1.addLine(50, 50, 50, -50)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Face_1_1/Modified_Edge&Sketch_1/SketchLine_4")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "PartSet/Origin")])
+Folder_1 = model.addFolder(Part_1_doc, Face_1, Face_1)
+Folder_2 = model.addFolder(Part_1_doc, Edge_1, Edge_1)
+model.do()
+
+FeaturesToFind = FeatureList()
+FeaturesToFind.append(Sketch_1.feature())
+Part_1_doc.removeFolder(Part_1_doc.findFolderBelow(FeaturesToFind))
+model.do()
+
+Folder_3 = model.addFolder(Part_1_doc, Vertex_1, Vertex_1)
+model.do()
+model.end()
+
+assert(model.checkPythonDump())
index d013747eabb170191a452995450d4751a044dac0..c85cc606e9962ca104cf27b4ed614342a4c249e7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 2503861e30769af00d2c23b282c236c7e3a04c8a..4217efe9f089989379cc5bd303bdb6752149a1cf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #===============================================================================
 # Test ModelAPI static methods
diff --git a/src/ModelAPI/Test/TestContainerSelector.py b/src/ModelAPI/Test/TestContainerSelector.py
new file mode 100644 (file)
index 0000000..0af1ef4
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+# a wire selection: container of intersections (edges are intesection of faces)
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "[[Box_1_1/Left][Box_1_1/Bottom]][[Box_1_1/Front][Box_1_1/Left]][[Box_1_1/Left][Box_1_1/Top]][[Box_1_1/Back][Box_1_1/Left]]")])
+model.end()
+
+assert(model.checkPythonDump())
index 5eb24bc40250c3a57b256c2e5c2e74e53ace80f2..0c2cedbf98829337fce68f05476340bc308e5d69 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -45,9 +46,9 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 70)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 50)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 10, 0)
 Extrusion_1.result().setName("box")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r"))
 SketchLine_5 = Sketch_2.addLine(10, 55, 50, 55)
 SketchLine_6 = Sketch_2.addLine(50, 55, 50, -5)
 SketchLine_7 = Sketch_2.addLine(50, -5, 10, -5)
@@ -67,12 +68,12 @@ SketchConstraintDistanceHorizontal_1 = Sketch_2.setHorizontalDistance(SketchLine
 SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_8.result(), 60)
 SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_7.result(), 40)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")], model.selection(), 15, 5)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 15, 5)
 Extrusion_2.result().setName("tool")
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "box")], [model.selection("SOLID", "tool")])
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "box")], [model.selection("SOLID", "tool")])
 model.do()
 
-assert(Boolean_1.result().name() == Extrusion_1.result().name()), "Boolean CUT name '{}' != '{}'".format(Boolean_1.result().name(), Extrusion_1.result().name())
+assert(Cut_1.result().name() == Extrusion_1.result().name()), "Boolean CUT name '{}' != '{}'".format(Cut_1.result().name(), Extrusion_1.result().name())
 
 model.end()
 
index 8e1e7944f14141d7741c4179e944ebfac6d5bda2..a320561faf8f923abaebce77787c33fc439238cd 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -28,30 +29,30 @@ Box_1 = model.addBox(Part_1_doc, 100, 100, 10)
 Box_1.result().setName("plate")
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "plate/Front"), 50, True)
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "plate/Left"), 50, True)
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "plate"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")])
-#Partition_1.result().setName("plate")
+Partition_1_objects = [model.selection("SOLID", "plate"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 Partition_1.result().subResult(0).setName("Partition_1_1_1")
 Partition_1.result().subResult(1).setName("top_left")
 Partition_1.result().subResult(2).setName("bottom_right")
 Partition_1.result().subResult(3).setName("Partition_1_1_4")
-Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Partition_1_1_1/Modified_Face_3_3"))
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "Partition_1_1_1/Modified_Face_3_3&top_left/Modified_Face_3_1&bottom_right/Modified_Face_3_2"), False)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Partition_1_1_1/Modified_Face&_plate/Top"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Partition_1_1_1/Modified_Face&_plate/Top][Partition_1_1_1/Modified_Face&Plane_2/Plane_2][Partition_1_1_1/Modified_Face&Plane_1/Plane_1]"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchCircle_1 = Sketch_1.addCircle(50, 50, 40)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 40)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection(), 10, model.selection("FACE", "Partition_1_1_1/Modified_Face_3_4"), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection(), 10, model.selection("FACE", "Partition_1_1_1/Modified_Face&_plate/Bottom"), 10)
 Extrusion_1.result().setName("cylinder")
-Boolean_1 = model.addCommon(Part_1_doc, [model.selection("COMPSOLID", "plate")], [model.selection("SOLID", "cylinder")])
+Common_1 = model.addCommon(Part_1_doc, [model.selection("COMPSOLID", "plate")], [model.selection("SOLID", "cylinder")])
 model.do()
 
 # check the name of result is kept
-CommonResult = Boolean_1.result()
+CommonResult = Common_1.result()
 CommonResultName = CommonResult.name()
 assert(CommonResultName == Partition_1.result().name()), "Name of Boolean COMMON result '{}' != '{}'".format(CommonResultName, Partition_1.result().name())
 # check sub-result names are lost
-BooleanName = Boolean_1.name() + "_1"
+BooleanName = Common_1.name() + "_1"
 for i in range(0, CommonResult.numberOfSubs()):
   refName = BooleanName + '_' + str(i + 1)
   subResult = CommonResult.subResult(i)
index 7da2b0e44bfe9b9a8a6134164098b2cf60c8f061..d1ddb395bfc8515fe8ab1da463f610bc10bcad79 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -26,7 +27,6 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(80, 0, 0, 0)
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
@@ -58,27 +58,26 @@ SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_6.e
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 0)
 Extrusion_1.result().setName("compsolid")
-
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "compsolid/Generated_Face_5"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_5"))
 SketchCircle_1 = Sketch_2.addCircle(65, -30, 10)
 SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "compsolid/Generated_Face_5&compsolid/Generated_Face_4&compsolid/To_Face_3"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1_3/To_Face]"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintDistanceVertical_3 = Sketch_2.setVerticalDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchCircle_1.center(), 20)
 SketchConstraintDistanceHorizontal_2 = Sketch_2.setHorizontalDistance(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_2).coordinates(), 15)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection(), model.selection(), 10, model.selection("FACE", "compsolid/Generated_Face_1"), 10)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), model.selection(), 10, model.selection("FACE", "Extrusion_1_1_4/Generated_Face&Sketch_1/SketchLine_3"), 10)
 Extrusion_2.result().setName("cyl")
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3")], [model.selection("SOLID", "cyl")])
 
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_3")], [model.selection("SOLID", "cyl")])
 model.do()
 
 # check the name of Extrusion_1 is kept
-CutResult = Boolean_1.result()
+CutResult = Cut_1.result()
 CutResultName = CutResult.name()
 assert(CutResultName == Extrusion_1.result().name()), "Name of Boolean CUT result '{}' != '{}'".format(CutResultName, Extrusion_1.result().name())
 # check sub-result names are lost
-BooleanName = Boolean_1.name() + "_1"
+BooleanName = Cut_1.name() + "_1"
 for i in range(0, CutResult.numberOfSubs()):
   refName = BooleanName + '_' + str(i + 1)
   subResult = CutResult.subResult(i)
index ca2ac6c92655074b93f2af128991e49c5253191c..8c5cfbc8134fcbc4892004b410f4819adfd2e60f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -61,17 +62,17 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_7.result(), 35)
 SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_5.endPoint(), SketchLine_2.startPoint(), 30)
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_5.endPoint(), SketchLine_2.startPoint(), 15)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 10, 0)
 Extrusion_1.result().setName("box")
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r")], model.selection(), 20, 20)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 20, 20)
 Extrusion_2.result().setName("prism")
 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
 Extrusion_3.result().setName("cylinder")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "box/From_Face_1"))
-SketchLine_8 = Sketch_2.addLine(45, 30, 25, 30)
-SketchLine_9 = Sketch_2.addLine(25, 30, 25, -100)
-SketchLine_10 = Sketch_2.addLine(25, -100, 45, -100)
-SketchLine_11 = Sketch_2.addLine(45, -100, 45, 30)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "box/From_Face"))
+SketchLine_8 = Sketch_2.addLine(45, -10, 25, -10)
+SketchLine_9 = Sketch_2.addLine(25, -10, 25, -140)
+SketchLine_10 = Sketch_2.addLine(25, -140, 45, -140)
+SketchLine_11 = Sketch_2.addLine(45, -140, 45, -10)
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
@@ -82,21 +83,22 @@ SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_10.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_11.result())
 SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_10.result(), 20)
 SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_9.result(), 130)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "box/Generated_Face_3&box/Generated_Face_2&box/From_Face_1"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[box/Generated_Face&Sketch_1/SketchLine_3][box/Generated_Face&Sketch_1/SketchLine_2][box/From_Face]"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintDistanceVertical_2 = Sketch_2.setVerticalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), 30)
 SketchConstraintDistanceHorizontal_3 = Sketch_2.setHorizontalDistance(SketchLine_8.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates(), 25)
 model.do()
-Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchLine_11f")], model.selection(), 5, 15)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f-SketchLine_11f")], model.selection(), 5, 15)
 Extrusion_4.result().setName("cut_tool")
-Boolean_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "box"), model.selection("SOLID", "prism"), model.selection("SOLID", "cylinder")], [model.selection("SOLID", "cut_tool")])
+Cut_1_objects_1 = [model.selection("SOLID", "box"), model.selection("SOLID", "prism"), model.selection("SOLID", "cylinder")]
+Cut_1 = model.addCut(Part_1_doc, Cut_1_objects_1, [model.selection("SOLID", "cut_tool")])
 model.do()
 
 Extrusions = [Extrusion_1, Extrusion_2, Extrusion_3]
-BooleanResults = Boolean_1.results()
+BooleanResults = Cut_1.results()
 for i in range(len(BooleanResults)):
   assert(BooleanResults[i].name() == Extrusions[i].result().name()), "Name of result {} of Boolean CUT '{}' != '{}'".format(i, BooleanResults[i].name(), Extrusions[i].result().name())
-  BooleanName = Boolean_1.name() + "_" + str(i + 1)
+  BooleanName = Cut_1.name() + "_" + str(i + 1)
   for sub in range(0, BooleanResults[i].numberOfSubs()):
     refName = BooleanName + '_' + str(sub + 1)
     subResult = BooleanResults[i].subResult(sub)
index f1149d712eeb500a65018df87dddc955994d5d44..f7755b271f7b05788965189adc4164ceca30b0c2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index e1fa838ce1f22d8ca699eb89bacac53962687235..10619343cec8a08cb0171ec363c5a918eb4b831e 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -38,7 +39,8 @@ SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_3.result())
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_3.result(), SketchLine_1.result())
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Face_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_3")]
+Face_1 = model.addFace(Part_1_doc, Face_1_objects)
 Face_1.result().setName("triangle")
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "triangle")], model.selection(), 10, 0)
 model.do()
index 9d083212ac0b10ffc8a3b44c1426e6ce6c3a8a94..e94d1acea65cc520def2491bc5d4455bfe3d466c 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -43,15 +44,15 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 50)
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_2.result(), SketchLine_1.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 20, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 20, 0)
 Extrusion_1.result().setName("plate")
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 10, [model.selection("SOLID", "plate")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "plate/To_Face_1"))
-SketchCircle_1 = Sketch_2.addCircle(30, 35, 10)
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "plate/Generated_Face_4&plate/To_Face_1"), False)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "plate/To_Face"))
+SketchCircle_1 = Sketch_2.addCircle(30.00000000000001, 15, 10)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "[plate/Generated_Face&Sketch_1/SketchLine_4][plate/To_Face]"), False)
 SketchLine_5 = SketchProjection_2.createdFeature()
 SketchConstraintDistance_1 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_5.result(), 20, True)
-SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "plate/Generated_Face_1&plate/To_Face_1"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "[plate/Generated_Face&Sketch_1/SketchLine_1][plate/To_Face]"), False)
 SketchLine_6 = SketchProjection_3.createdFeature()
 SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_1.center(), SketchLine_6.result(), 15, True)
 SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_1.results()[1], 10)
index b20f90afb33e27b8efce697f33d1e0fd852cfaad..34951dbc5249cf25dcf9981d27de150212aac98d 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -29,7 +30,7 @@ Box_1.result().setName("box")
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "box/Front"))
 SketchCircle_1 = Sketch_1.addCircle(7, 6, 2)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Face_1.result().setName("circle")
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "circle")], model.selection(), 0, 3, [model.selection("SOLID", "box")])
 model.do()
index 6e008eee728a37719d479851ecd117d9267cb6d4..c21b3c4303185555fd5e27e27539c7b83c68620f 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 from ModelAPI import *
@@ -29,15 +30,15 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
 Cylinder_1.result().setName("cylinder")
-MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "cylinder/Face_1"), 10, NB_COPIES)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "([cylinder/Face_1][cylinder/Face_2])([cylinder/Face_1][cylinder/Face_3])"), 10, NB_COPIES)
 model.do()
 
-TransResult = MultiTranslation_1.result()
+TransResult = LinearCopy_1.result()
 TransResultName = TransResult.name()
 assert(TransResultName == Cylinder_1.result().name()), "MultiTranslation name '{}' != '{}'".format(TransResultName, Cylinder_1.result().name())
 # check sub-result names
 assert(NB_COPIES == TransResult.numberOfSubs()), "Number of results {} is not equal to reference {}".format(TransResult.numberOfSubs(), NB_COPIES)
-MultiTranslationName = MultiTranslation_1.name() + "_1"
+MultiTranslationName = LinearCopy_1.name() + "_1"
 for i in range(0, NB_COPIES):
   refName = MultiTranslationName + '_' + str(i + 1)
   subResult = TransResult.subResult(i)
index b660c670ce6c4f95c14203098bf08cdb37b9d85a..3997dca61b065426db8d20a94d91ab7f86582a89 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index ad2043f7f860a5283f896890ad27928609eac428..6800f1ae0d08f81aa05c9e181ea95c0c5c1c9105 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -33,7 +34,7 @@ SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(),
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_2.result(), SketchLine_3.result())
-SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_3.result(), 30)
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_3.result(), 30.00000000000014)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 60)
 SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_4 = SketchProjection_1.createdFeature()
@@ -42,11 +43,11 @@ SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_4.result(), SketchConst
 [SketchLine_5, SketchLine_6, SketchLine_7] = SketchConstraintMirror_1.mirrored()
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_4.result(), 30, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f")], model.selection(), 20, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f")], model.selection(), 20, 0)
 Extrusion_1.result().setName("prism")
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_7r-SketchLine_5r")], model.selection("EDGE", "Sketch_1/SketchLine_6"), 360, 0)
 Revolution_1.result().setName("spinner")
-Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "spinner")], model.selection("VERTEX", "spinner/Lateral_6&spinner/Base_Edge_10"), model.selection("FACE", "prism/Generated_Face_2"), False, True)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "spinner")], model.selection("VERTEX", "[spinner/Generated_Face&Sketch_1/SketchLine_7][spinner/Generated_Face&Sketch_1/SketchLine_5]"), model.selection("FACE", "prism/Generated_Face&Sketch_1/SketchLine_2"), False, True)
 model.do()
 
 assert(Placement_1.result().name() == Revolution_1.result().name()), "Placement name '{}' != '{}'".format(Placement_1.result().name(), Revolution_1.result().name())
index e069c44fb65b3a7eab72b4bfa3c8bd4198ff7341..5995afdc38b311fa66c34494a74ee7402ec5bf74 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index f755a72ad5be559e9e697391fe8e772e7ef94dbf..84168d31877f5d1a750b1cf91cd30db0ca143df4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index cb367867213ad562d58559b840a32554dd79d9cd..ada61b37d34d9e6e0d0f8e796d4cca2159763cb2 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -41,7 +42,7 @@ SketchConstraintRigid_1 = Sketch_1.setFixed(SketchLine_1.startPoint())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 5)
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_1.endPoint(), 8, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchArc_2_2f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchArc_2_2f")], model.selection(), 10, 0)
 Extrusion_1.result().setName("prism")
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "prism"), model.selection("SOLID", "cylinder")], model.selection("EDGE", "PartSet/OX"), 30)
 model.do()
index bad08c5e7ad8232472c3bdfcc8f8630b68f8ffd4..6f6e192a6a7035f01641ed94ed12bd7cfbb4a038 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -26,7 +27,7 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
 Cylinder_1.result().setName("cylinder")
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "cylinder/Face_1"), 20)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("EDGE", "([cylinder/Face_1][cylinder/Face_2])([cylinder/Face_1][cylinder/Face_3])"), 20)
 model.do()
 
 assert(Translation_1.result().name() == Cylinder_1.result().name()), "Translation name '{}' != '{}'".format(Translation_1.result().name(), Cylinder_1.result().name())
index ee8f7eb1d8c3d47424e403a6fd223d1fd5758387..5b6312fed09249965afad9359ba55502915fbe36 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestDocument.py
index 3d8416596d3e7cd5128ca52e8a16b6cfb2cabe01..6ca5cb72f87856771c80d56ade639e3b2e01c645 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index 5437fe05292b02d0a5d430f5eb1f015b38e752c0..a70c534f6790a1f38d11dafe764a668274389741 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # The test for correct referencing for Part feature of whole construction result created in PartSet
 
@@ -34,7 +33,17 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint()
 model.do()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "PartSet/Sketch_1")], model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_3"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "PartSet/Sketch_1")], model.selection("EDGE", "PartSet/Sketch_1/SketchLine_3"), 360, 0)
 model.end()
 
+from GeomAPI import GeomAPI_Shape
+
+model.testNbResults(Revolution_1, 1)
+model.testNbSubResults(Revolution_1, [0])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [2])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [8])
+model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [16])
+model.testResultsVolumes(Revolution_1, [17830100])
+
 assert(model.checkPythonDump())
index 35c8c741c1939f73c09dddd179d988b4c9c9e19f..4c162fad6a9ba2b1ef4691b5e5566db9340b7ed7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # The test for correct selection of a whole feautre as argument of other feature: box and construction
 # plane features as an argument of a Partition
index 3e8b58b4e6cb7a605e86ded3be7ec7b47e9d9a36..cf3877ea14469577eae7b47cfb319dd273efc0a5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # The test for correct selection of a whole feautre as argument of other feature: select all extrusions
 # produced from the scetch, then change the number of sketch contours, so, anytway all extrusions must
@@ -50,13 +49,12 @@ SketchLine_2 = SketchProjection_2.createdFeature()
 SketchConstraintDistance_2 = Sketch_2.setDistance(SketchLine_2.result(), SketchCircle_4.center(), 5, True)
 SketchConstraintDistanceHorizontal_1 = Sketch_2.setHorizontalDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchCircle_4.center(), 25)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("COMPOUND", "all-in-Extrusion_1")], [model.selection("COMPOUND", "all-in-Revolution_1")])
 model.do()
 
 # update the parameter N => number of sketch contours is changed
 Param_N.setValue(4)
-Part_1_doc.setCurrentFeature(Cut_1.feature(), False)
 model.end()
 
 assert(Cut_1.result().numberOfSubs() == 4)
index 6ef31341dd2bc0befedea1ed97d8bf20966848c2..1fb2eb99daba9bdc20d2f154faabc6c8a224dcb2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index 3806afedd08cfd829d9f552da038b8c384ca402c..2a6944faefda8e84ebff7b9c940f9998bfff2997 100644 (file)
@@ -1,24 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
-__updated__ = "2018-01-16"
+# -*- coding: utf-8 -*-
 
 from salome.shaper import model
 
@@ -43,8 +42,8 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL
 SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
 SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0)
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1")], 2)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")], 2)
 model.do()
 
 Folder_1 = model.addFolder(Part_1_doc, Sketch_1, Extrusion_1)
@@ -52,4 +51,5 @@ Folder_1.setName("Box")
 
 model.end()
 
+assert(Folder_1.name() == "Box")
 assert(model.checkPythonDump())
diff --git a/src/ModelAPI/Test/TestFolder_Empty.py b/src/ModelAPI/Test/TestFolder_Empty.py
new file mode 100644 (file)
index 0000000..c30c993
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(0, 0, 0, 50)
+SketchLine_2 = Sketch_1.addLine(0, 50, 50, 50)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(50, 50, 50, 0)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(50, 0, 0, 0)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintRigid_1 = Sketch_1.setFixed(SketchLine_1.startPoint())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_1.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_4.result(), 50)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), 50)
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchLine_3.result())
+SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0)
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")], 2)
+model.do()
+
+Folder_1 = model.addFolder(Part_1_doc)
+
+model.end()
+
+# empty folder is not dumped
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING) == False)
index 632c88c6e428ada7eb089017c667b8e1739b674f..7617347549e32d9c35c7c2c606c9dc51f25e4653 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index bf6768a1ff0e0a29b80fca2240c46aad43c1f7bd..ecaef91c0f50a562f190d668e4b465df03c117b0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test checks adding sketch into a folder
@@ -37,7 +36,7 @@ model.do()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(50, 50, 25)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection(), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2r")], model.selection(), 50, 0)
 
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchCircle_2 = Sketch_2.addCircle(100, -100, 50)
@@ -45,7 +44,7 @@ model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection(), 10, 0)
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 10, [model.selection("SOLID", "Extrusion_2_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_1"))
-SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_1__cc"), False)
+SketchProjection_1 = Sketch_3.addProjection(model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_3/SketchCircle_2_2][Extrusion_2_1/To_Face]__cc"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchCircle_3 = Sketch_3.addCircle(100, -100, 25)
 SketchConstraintCoincidence_1 = Sketch_3.setCoincident(SketchPoint_1.result(), SketchCircle_3.center())
index e6a86c297baf3186b97327d1be27392131c82ea2..86d1b2f5751f849bb58726655df1ecc8503a95b5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Test checks stability of the foldering mechanism due to incorrect input parameters
index 145be954c067bdbf25acd70563559317d3bd37de..f2ee50474303234a84fd6437151f5241bb2a5158 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
diff --git a/src/ModelAPI/Test/TestGeomNamingBoxWithFillet.py b/src/ModelAPI/Test/TestGeomNamingBoxWithFillet.py
new file mode 100644 (file)
index 0000000..68f3354
--- /dev/null
@@ -0,0 +1,85 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+param_p = model.addParameter(Part_1_doc, "p", "5")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(0, 0, 0, 30.0000000000845)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchPoint_1.result())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.result())
+SketchLine_3 = Sketch_1.addLine(0, 30.0000000000845, 30.00000000002328, 30.00000000002326)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(30.00000000002328, 30.00000000002326, 29.99999999996195, 0)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_5 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.result())
+SketchLine_6 = Sketch_1.addLine(29.99999999996195, 0, 0, 0)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_6.endPoint())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 30)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), 30)
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_4.result(), SketchLine_3.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_4.result(), SketchLine_1.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection(), 30, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_4r-SketchLine_3r-SketchLine_1r"))
+SketchLine_7 = Sketch_2.addLine(20, 7, 10, 7)
+SketchLine_8 = Sketch_2.addLine(10, 7, 10, 0)
+SketchLine_9 = Sketch_2.addLine(10, 0, 20, 0)
+SketchLine_10 = Sketch_2.addLine(20, 0, 20, 7)
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_8.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_10.result())
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_6"), False)
+SketchLine_11 = SketchProjection_4.createdFeature()
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_11.result())
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_11).endPoint(), SketchLine_8.endPoint(), 10, True)
+SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_9.result(), 10)
+SketchConstraintLength_4 = Sketch_2.setLength(SketchLine_8.result(), 7)
+model.do()
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_7r-SketchLine_8f-SketchLine_9f-SketchLine_10f_wire")], model.selection(), "p", 0, [model.selection("SOLID", "Extrusion_1_1")])
+Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]")], 3)
+model.do()
+# increase the extrusion-cut heigh to make face of a box divided into two
+param_p.setValue(30);
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Fillet_1.feature()))
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/ModelAPI/Test/TestGeomNamingEdgeByFilter.py b/src/ModelAPI/Test/TestGeomNamingEdgeByFilter.py
new file mode 100644 (file)
index 0000000..e339252
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 15, 15, 15)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 5, True)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Bottom"), 10, True)
+Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), 5, True)
+Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Back"), 10, True)
+Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), 5, True)
+Plane_9 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), 10, True)
+Partition_1_objects = [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1"), model.selection("FACE", "Plane_2"), model.selection("FACE", "Plane_5"), model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_3"), model.selection("FACE", "Plane_4")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+Box_2 = model.addBox(Part_1_doc, 2, 2, 10)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("FACE", "Box_2_1/Bottom"), model.selection("FACE", "_weak_name_4_Partition_1_1_14"), False, True)
+model.do()
+# update the selection of the placement
+Placement_1.setEndShape(model.selection("EDGE", "Partition_1_1_5/Generated_Edge&Plane_3/Plane_3&Plane_2/Plane_2"))
+model.end()
+
+# check that placement is valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Placement_1.feature()))
+
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
diff --git a/src/ModelAPI/Test/TestGeomNamingPlacement.py b/src/ModelAPI/Test/TestGeomNamingPlacement.py
new file mode 100644 (file)
index 0000000..4e1949e
--- /dev/null
@@ -0,0 +1,88 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+param = model.addParameter(Part_1_doc, "p", "60")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_1 = Sketch_1.addLine(30, 30, -20, 30)
+SketchLine_2 = Sketch_1.addLine(-20, 30, -20, -20)
+SketchLine_3 = Sketch_1.addLine(-20, -20, 30, -20)
+SketchLine_4 = Sketch_1.addLine(30, -20, 30, 30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_1.startPoint(), SketchLine_2.startPoint(), 50)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.endPoint(), SketchLine_3.endPoint(), 50)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintDistanceHorizontal_2 = Sketch_1.setHorizontalDistance(SketchLine_2.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates(), 20)
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_3.endPoint(), 20)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchLine_5 = Sketch_2.addLine(19.58333333333334, 17.27351642784226, -0.4166666666666646, 17.27351642784226)
+SketchLine_6 = Sketch_2.addLine(-0.4166666666666646, 17.27351642784226, -0.4166666666794808, -42.72648357216971)
+SketchLine_7 = Sketch_2.addLine(-0.4166666666794808, -42.72648357216971, 19.58333333332052, -42.72648357216971)
+SketchLine_8 = Sketch_2.addLine(19.58333333332052, -42.72648357216971, 19.58333333333334, 17.27351642784226)
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_7.startPoint(), 30, True)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"), False)
+SketchPoint_3 = SketchProjection_3.createdFeature()
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_3).coordinates(), SketchLine_7.endPoint(), 25, True)
+SketchConstraintLength_1 = Sketch_2.setLength(SketchLine_7.result(), 20)
+SketchConstraintLength_2 = Sketch_2.setLength(SketchLine_8.result(), "p")
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), -5, -2)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Box_1 = model.addBox(Part_1_doc, 50, 50, 30)
+Placement_1 = model.addPlacement(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Cut_1_1/Modified_Face&Extrusion_1_1/To_Face"), False, True)
+model.do()
+# change parameter to split extrusion top face to two
+param.setValue(100)
+model.end()
+
+# check that placement is valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Placement_1.feature()))
+
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
diff --git a/src/ModelAPI/Test/TestGeomNamingRevolution.py b/src/ModelAPI/Test/TestGeomNamingRevolution.py
new file mode 100644 (file)
index 0000000..a75364f
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+param = model.addParameter(Part_1_doc, "p", "10")
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
+SketchLine_1 = Sketch_1.addLine(6.82842712474619, 7.171572875253809, 2.82842712474619, 7.171572875253809)
+SketchLine_2 = Sketch_1.addLine(2.82842712474619, 7.171572875253809, 2.82842712474619, 3.171572875253809)
+SketchLine_3 = Sketch_1.addLine(2.82842712474619, 3.171572875253809, 6.82842712474619, 3.171572875253809)
+SketchLine_4 = Sketch_1.addLine(6.82842712474619, 3.171572875253809, 6.82842712474619, 7.171572875253809)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchCircle_1 = Sketch_1.addCircle(4.440892098500626e-16, 0, 1)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 4)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), 4)
+SketchLine_5 = Sketch_1.addLine(0, 10, 10, 0)
+SketchLine_5.setAuxiliary(True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Right][Box_1_1/Top]"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchPoint_1.result())
+SketchProjection_2 = Sketch_1.addProjection(model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchPoint_2.result())
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_5.result(), SketchLine_2.startPoint())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_5.startPoint(), 4, True)
+SketchProjection_3 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), False)
+SketchLine_6 = SketchProjection_3.createdFeature()
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_6.result(), SketchCircle_1.center())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 1)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchAPI_Line(SketchLine_6).endPoint(), SketchCircle_1.center(), "p", True)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 1, 1)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f_wire")], model.selection("EDGE", "[Cut_1_1/Modified_Face&Box_1_1/Left][Cut_1_1/Modified_Face&Box_1_1/Top]"), 45, 0)
+model.do()
+# relocate circle to split the edge - axis of revolution
+param.setValue(5)
+model.end()
+
+# check that revolution is valid
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(Revolution_1.feature()))
+
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
diff --git a/src/ModelAPI/Test/TestGeomNamingSketchPlane.py b/src/ModelAPI/Test/TestGeomNamingSketchPlane.py
new file mode 100644 (file)
index 0000000..c810bfd
--- /dev/null
@@ -0,0 +1,106 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+lenParam = model.addParameter(Part_1_doc, "len", "500")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-302.4220649391276, 58.25973730731688, -52.42206493912754, 58.25973730731688)
+SketchLine_2 = Sketch_1.addLine(-52.42206493912754, 58.25973730731688, -52.42206493912754, -61.38418346467283)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-52.42206493912754, -61.38418346467283, 147.5779350608725, -61.38418346467283)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(147.5779350608725, -61.38418346467283, 147.5779350608725, 58.25973730731685)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(147.5779350608725, 58.25973730731685, 297.5779350608724, 58.25973730731685)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(297.5779350608724, 58.25973730731685, 297.5779350608724, -192.2459441196271)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(297.5779350608724, -192.2459441196271, -302.4220649391276, -192.2459441196271)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(-302.4220649391276, -192.2459441196271, -302.4220649391276, 58.25973730731688)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_8.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_4.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_7.result(), 600)
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_5.result(), SketchLine_1.result())
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), 250)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 200)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 600, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"))
+SketchLine_9 = Sketch_2.addLine(236.9930310780426, -200, -144.601680073095, -200)
+SketchLine_10 = Sketch_2.addLine(-144.601680073095, -200, -144.601680073095, -500)
+SketchLine_11 = Sketch_2.addLine(-144.601680073095, -500, 236.9930310780426, -500)
+SketchLine_12 = Sketch_2.addLine(236.9930310780426, -500, 236.9930310780426, -200)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_9.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_10.result())
+SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
+SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_12.result())
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
+SketchLine_13 = SketchProjection_1.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_13.result(), SketchLine_9.endPoint(), 200, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchLine_10.endPoint(), SketchLine_13.result(), "len", True)
+model.do()
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_10f-SketchLine_11f-SketchLine_12f")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3&weak_name_1"))
+SketchCircle_1 = Sketch_3.addCircle(27.57793506087247, -80, 42.03963933117138)
+SketchProjection_2 = Sketch_3.addProjection(model.selection("EDGE", "[Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3&weak_name_1]"), False)
+SketchProjection_2.setName("SketchProjection_3")
+SketchProjection_2.result().setName("SketchProjection_3")
+SketchLine_14 = SketchProjection_2.createdFeature()
+SketchLine_14.setName("SketchLine_15")
+SketchLine_14.result().setName("SketchLine_15")
+SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_14.result(), SketchCircle_1.center(), 80, True)
+SketchConstraintDistance_4.setName("SketchConstraintDistance_4")
+SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "[(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/From_Face)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_9)][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3&weak_name_1]"), False)
+SketchProjection_3.setName("SketchProjection_4")
+SketchProjection_3.result().setName("SketchProjection_4")
+SketchLine_15 = SketchProjection_3.createdFeature()
+SketchLine_15.setName("SketchLine_16")
+SketchLine_15.result().setName("SketchLine_16")
+SketchConstraintDistance_3 = Sketch_3.setDistance(SketchLine_15.result(), SketchCircle_1.center(), 80, True)
+SketchConstraintDistance_3.setName("SketchConstraintDistance_3")
+model.do()
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchCircle_1_2r_wire")], model.selection(), model.selection(), 0, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_7"), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+model.do()
+# update the sketch 2 to make split of a size of a box
+lenParam.setValue(700)
+model.end()
+
+# check that sketch_3 and extrusion are updated well
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(ExtrusionCut_2.feature()))
old mode 100755 (executable)
new mode 100644 (file)
index 41945e4..3a7eb2b
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       Test1064.py
old mode 100755 (executable)
new mode 100644 (file)
index 88dd0c5..135a5ce
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestResults.py
diff --git a/src/ModelAPI/Test/TestSaveOpen1.py b/src/ModelAPI/Test/TestSaveOpen1.py
new file mode 100644 (file)
index 0000000..515c3c3
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Point_2 = model.addPoint(partSet, 1, 2, 3)
+Point_name = Point_2.name()
+model.end()
+
+# check save document in a current folder
+aSession = ModelAPI_Session.get()
+aFiles = StringList()
+aSession.save(".", aFiles)
+assert(len(aFiles) == 1)
+
+# check open of the same document
+assert(aSession.load(".") == False) # error because this document is already opened
+
+# close the current document
+aSession.closeAll()
+
+# open again: it must be correct now
+assert(aSession.load("."))
+
+# check the created point is opened
+partSet = model.moduleDocument()
+assert(partSet.size("Features") == 1)
+assert(partSet.object("Features", 0).data().name() == Point_name)
diff --git a/src/ModelAPI/Test/TestSaveOpen2.py b/src/ModelAPI/Test/TestSaveOpen2.py
new file mode 100644 (file)
index 0000000..509da78
--- /dev/null
@@ -0,0 +1,70 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Group_1 = model.addGroup(Part_1_doc, [model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]")])
+Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], [model.selection("EDGE", "[Box_1_1/Left][Box_1_1/Top]"), model.selection("EDGE", "[Box_1_1/Right][Box_1_1/Top]")])
+Field_1.addStep(0, 5, [[0], [3], [4]])
+model.do()
+Translation_1 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_1/")], model.selection("EDGE", "OY"), 20)
+model.end()
+
+# check save document in a current folder
+aSession = ModelAPI_Session.get()
+aFiles = StringList()
+aSession.save(".", aFiles)
+assert(len(aFiles) == 3)
+
+# check open of the same document
+assert(aSession.load(".") == False) # error because this document is already opened
+
+# close the current document
+aSession.closeAll()
+
+# open again: it must be correct now
+assert(aSession.load("."))
+
+# activate the Part of session
+model.begin()
+partSet = model.moduleDocument()
+assert(partSet.size("Features") == 2)
+aPart = objectToFeature(partSet.object("Features", 0))
+aPartResult = modelAPI_ResultPart(aPart.results()[0])
+aPartResult.activate()
+aPartDoc = aPartResult.partDoc()
+aSession.setActiveDocument(aPartDoc, True)
+model.do()
+# check the field result data
+aFieldFeature = aPartDoc.objectByName("Features", "Field_1")
+aFieldResult = modelAPI_ResultField(objectToFeature(aFieldFeature).results()[0])
+assert(aFieldResult.textLine(0) == "5")
+aSession.setActiveDocument(partSet, True)
+model.do()
+aTranslation = objectToFeature(partSet.objectByName("Features", "Translation_1"))
+partSet.setCurrentFeature(aTranslation, True)
+model.end()
diff --git a/src/ModelAPI/Test/TestSelectionInitialization.py b/src/ModelAPI/Test/TestSelectionInitialization.py
new file mode 100644 (file)
index 0000000..501f89a
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from ModelAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 1, 2, 3)
+Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "Point_1"), 10)
+model.end()
+
+# save document in a current folder
+aSession = ModelAPI_Session.get()
+aFiles = StringList()
+aSession.save(".", aFiles)
+# close the current document
+aSession.closeAll()
+# open the saved document
+assert(aSession.load("."))
+
+# activate the Part of session
+model.begin()
+partSet = model.moduleDocument()
+assert(partSet.size("Features") == 1)
+aPart = objectToFeature(partSet.object("Features", 0))
+aPartResult = modelAPI_ResultPart(aPart.results()[0])
+aPartResult.activate()
+aPartDoc = aPartResult.partDoc()
+aSession.setActiveDocument(aPartDoc, True)
+model.end()
+
+# check the sphere location (it should not be "Origin" - default one)
+aSphere = objectToFeature(aPartDoc.objectByName("Features", "Sphere_1"))
+assert(aSphere.selection("center_point").namingName() == "Point_1")
diff --git a/src/ModelAPI/Test/TestSelectionRestore.py b/src/ModelAPI/Test/TestSelectionRestore.py
new file mode 100644 (file)
index 0000000..d88075a
--- /dev/null
@@ -0,0 +1,271 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# Test that invalid selection attributes become valid after the parameters changes and
+# coming the topology back in a valid state.
+# Based on the CEA report mail 04.12.2018, page 6
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+model.addParameter(Part_1_doc, "ep_base", "0.65")
+EpVoiles = model.addParameter(Part_1_doc, "ep_voiles", "0.1")
+model.addParameter(Part_1_doc, "ep_poteau", "0.15")
+model.addParameter(Part_1_doc, "h_ouverture", "0.95")
+model.addParameter(Part_1_doc, "h_apres_ouverture", "0.6")
+model.addParameter(Part_1_doc, "ep_dalles", "0.12")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(0.275, 3.325, -0.375, 3.325)
+SketchLine_2 = Sketch_1.addLine(-0.375, 3.325, -0.375, -0.325)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-0.375, -0.325, 4.275, -0.325)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(4.275, -0.325, 4.275, 1.325)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchLine_5 = Sketch_1.addLine(4.275, 1.325, 3.625, 1.325)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(3.625, 1.325, 3.625, 0.325)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchLine_7 = Sketch_1.addLine(3.625, 0.325, 0.275, 0.3250000000000001)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchLine_8 = Sketch_1.addLine(0.275, 0.3250000000000001, 0.275, 3.325)
+SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_8.endPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_5.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintHorizontal_4 = Sketch_1.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_8.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_6.result())
+SketchConstraintVertical_4 = Sketch_1.setVertical(SketchLine_4.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "ep_base")
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 3.65)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 4.65)
+SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_4.result(), 1.65)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_3.result(), "ep_base", False)
+SketchLine_9 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OX"))
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_9.result(), "0.275+ep_voiles/2", False)
+SketchLine_10 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OY"))
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_10.result(), "0.325+ep_voiles/2", False)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_1.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 0, 0.3)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
+SketchLine_11 = Sketch_2.addLine(2.26, -2.31, 1.64, -2.31)
+SketchLine_12 = Sketch_2.addLine(1.64, -2.31, 1.64, -1.69)
+SketchLine_13 = Sketch_2.addLine(1.64, -1.69, 2.26, -1.69)
+SketchLine_14 = Sketch_2.addLine(2.26, -1.69, 2.26, -2.31)
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
+SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_11.result())
+SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_12.result())
+SketchConstraintHorizontal_6 = Sketch_2.setHorizontal(SketchLine_13.result())
+SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_14.result())
+SketchPoint_1 = Sketch_2.addPoint(1.925, -1.875)
+SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_11.result(), 0.62)
+SketchConstraintLength_5.setName("SketchConstraintLength_10")
+SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_11.result(), SketchLine_12.result())
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2", False)
+SketchConstraintDistance_4.setName("SketchConstraintDistance_6")
+SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.21+ep_poteau/2", False)
+SketchConstraintDistance_5.setName("SketchConstraintDistance_7")
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
+SketchLine_15 = SketchProjection_1.createdFeature()
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
+SketchLine_16 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2", False)
+SketchConstraintDistance_6.setName("SketchConstraintDistance_8")
+SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2", False)
+SketchConstraintDistance_7.setName("SketchConstraintDistance_9")
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r")], model.selection(), 0, 0.02)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f"))
+SketchLine_17 = Sketch_3.addLine(0, 2.950000000000001, 0, 1.700000000000001)
+SketchLine_17.setName("SketchLine_15")
+SketchLine_17.result().setName("SketchLine_15")
+SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OY"))
+SketchLine_18.setName("SketchLine_16")
+SketchLine_18.result().setName("SketchLine_16")
+SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_17.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchLine_18.result())
+SketchLine_19 = Sketch_3.addLine(0, 1.2, 0, 0)
+SketchLine_19.setName("SketchLine_17")
+SketchLine_19.result().setName("SketchLine_17")
+SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_19.startPoint(), SketchLine_18.result())
+SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.result())
+SketchLine_20 = Sketch_3.addLine(0, 0, 0.95, 0)
+SketchLine_20.setName("SketchLine_18")
+SketchLine_20.result().setName("SketchLine_18")
+SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OX"))
+SketchLine_21.setName("SketchLine_19")
+SketchLine_21.result().setName("SketchLine_19")
+SketchLine_22 = Sketch_3.addLine(2.525000000000001, 0, 3.975000000000001, 0)
+SketchLine_22.setName("SketchLine_20")
+SketchLine_22.result().setName("SketchLine_20")
+SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
+SketchLine_23 = Sketch_3.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_23.setName("SketchLine_21")
+SketchLine_23.result().setName("SketchLine_21")
+SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"))
+SketchLine_24.setName("SketchLine_22")
+SketchLine_24.result().setName("SketchLine_22")
+SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_17.result(), 1.25)
+SketchConstraintLength_6.setName("SketchConstraintLength_5")
+SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_19.endPoint())
+SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_19.result(), "1.25-ep_voiles/2")
+SketchConstraintLength_7.setName("SketchConstraintLength_6")
+SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_20.result(), "1-ep_voiles/2")
+SketchConstraintLength_8.setName("SketchConstraintLength_7")
+SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_22.result(), "1.5-ep_voiles/2")
+SketchConstraintLength_9.setName("SketchConstraintLength_8")
+SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_23.result())
+SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
+SketchLine_25.setName("SketchLine_23")
+SketchLine_25.result().setName("SketchLine_23")
+SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2", False)
+SketchConstraintDistance_8.setName("SketchConstraintDistance_5")
+SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_23.result(), "1-ep_voiles/2")
+SketchConstraintLength_10.setName("SketchConstraintLength_9")
+SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
+SketchLine_26.setName("SketchLine_35")
+SketchLine_26.result().setName("SketchLine_35")
+SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 0.375, False)
+SketchConstraintDistance_9.setName("SketchConstraintDistance_12")
+model.do()
+Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_15"), model.selection("EDGE", "Sketch_3/SketchLine_17"), model.selection("EDGE", "Sketch_3/SketchLine_18"), model.selection("EDGE", "Sketch_3/SketchLine_20"), model.selection("EDGE", "Sketch_3/SketchLine_21")]
+Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Extrusion_3_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5")]
+Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchLine_27 = Sketch_4.addLine(0, 2.950000000000001, 0, 0)
+SketchLine_27.setName("SketchLine_26")
+SketchLine_27.result().setName("SketchLine_26")
+SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"))
+SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_27.startPoint(), SketchPoint_2.result())
+SketchPoint_3 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"))
+SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_3.result())
+SketchLine_28 = Sketch_4.addLine(0, 0, 3.975000000000001, 0)
+SketchLine_28.setName("SketchLine_27")
+SketchLine_28.result().setName("SketchLine_27")
+SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
+SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
+SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_4.result())
+SketchLine_29 = Sketch_4.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_29.setName("SketchLine_28")
+SketchLine_29.result().setName("SketchLine_28")
+SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchPoint_5 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_5/Generated_Edge&Sketch_3/SketchLine_21_EndVertex]e[Extrusion_3_5/To_Edge]e"))
+SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchPoint_5.result())
+model.do()
+Edge_2_objects = [model.selection("EDGE", "Sketch_4/SketchLine_26"), model.selection("EDGE", "Sketch_4/SketchLine_27"), model.selection("EDGE", "Sketch_4/SketchLine_28")]
+Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
+Extrusion_4_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3")]
+Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
+SketchLine_30 = Sketch_5.addLine(0, 2.950000000000001, 0, 0)
+SketchLine_30.setName("SketchLine_29")
+SketchLine_30.result().setName("SketchLine_29")
+SketchPoint_6 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchPoint_6.result())
+SketchPoint_7 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_7.result())
+SketchLine_31 = Sketch_5.addLine(0, 0, 3.975000000000001, 0)
+SketchLine_31.setName("SketchLine_30")
+SketchLine_31.result().setName("SketchLine_30")
+SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
+SketchPoint_8 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
+SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_8.result())
+SketchLine_32 = Sketch_5.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
+SketchLine_32.setName("SketchLine_31")
+SketchLine_32.result().setName("SketchLine_31")
+SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
+SketchPoint_9 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_3/Generated_Edge&Sketch_4/SketchLine_28_EndVertex]e[Extrusion_4_3/To_Edge]e"))
+SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchPoint_9.result())
+SketchLine_33 = Sketch_5.addLine(3.975000000000001, 0.95, 0, 2.950000000000001)
+SketchLine_33.setName("SketchLine_32")
+SketchLine_33.result().setName("SketchLine_32")
+SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchLine_33.endPoint())
+SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchPoint_6.coordinates(), SketchLine_33.endPoint())
+SketchLine_34 = Sketch_5.addLine(1.85, 2.019182389937107, 1.85, 0)
+SketchLine_34.setName("SketchLine_33")
+SketchLine_34.result().setName("SketchLine_33")
+SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_33.result())
+SketchLine_35 = Sketch_5.addLine(2.075000000000001, 1.905974842767296, 2.075000000000001, 0)
+SketchLine_35.setName("SketchLine_34")
+SketchLine_35.result().setName("SketchLine_34")
+SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchLine_35.startPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_35.endPoint(), SketchLine_31.result())
+SketchConstraintCoincidence_40 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_31.result())
+SketchConstraintVertical_8 = Sketch_5.setVertical(SketchLine_34.result())
+SketchConstraintVertical_9 = Sketch_5.setVertical(SketchLine_35.result())
+SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_30.result(), "1.8+ep_voiles/2", False)
+SketchConstraintDistance_10.setName("SketchConstraintDistance_10")
+SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_35.startPoint(), SketchLine_32.result(), "1.85+ep_voiles/2", False)
+SketchConstraintDistance_11.setName("SketchConstraintDistance_11")
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_29r-SketchLine_30f-SketchLine_33r-SketchLine_32f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_34r-SketchLine_32f-SketchLine_33f_wire")])
+Translation_1_objects = [model.selection("FACE", "Extrusion_4_3"), model.selection("FACE", "Extrusion_3_3"), model.selection("FACE", "Extrusion_4_2"), model.selection("FACE", "Extrusion_3_5"), model.selection("FACE", "Extrusion_3_4"), model.selection("FACE", "Extrusion_3_2"), model.selection("FACE", "Extrusion_4_1"), model.selection("FACE", "Extrusion_3_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_2_1")]
+Translation_1 = model.addTranslation(Part_1_doc, Translation_1_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2")
+Recover_1_objects = [Face_2.result(), Face_3.result(), Face_1.result(), Extrusion_3.result(), Extrusion_4.result(), Extrusion_3.results()[1], Extrusion_3.results()[3], Extrusion_3.results()[4], Extrusion_4.results()[1], Extrusion_3.results()[2], Extrusion_4.results()[2]]
+Recover_1 = model.addRecover(Part_1_doc, Translation_1, Recover_1_objects)
+Translation_2_objects = [model.selection("FACE", "Recover_1_2"), model.selection("FACE", "Recover_1_5"), model.selection("FACE", "Recover_1_3"), model.selection("FACE", "Recover_1_4"), model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_1_6"), model.selection("FACE", "Recover_1_8"), model.selection("FACE", "Recover_1_7"), model.selection("FACE", "Recover_1_11"), model.selection("FACE", "Recover_1_10"), model.selection("FACE", "Recover_1_9")]
+Translation_2 = model.addTranslation(Part_1_doc, Translation_2_objects, model.selection("EDGE", "PartSet/OZ"), "2*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
+Recover_2_objects = [Recover_1.results()[8], Recover_1.results()[9], Recover_1.results()[10], Recover_1.results()[6], Recover_1.results()[7], Recover_1.results()[5], Recover_1.result(), Recover_1.results()[3], Recover_1.results()[2], Recover_1.results()[4], Recover_1.results()[1]]
+Recover_2 = model.addRecover(Part_1_doc, Translation_2, Recover_2_objects)
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_1")])
+Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection("FACE", "Translation_2_11"), 0, model.selection(), 0)
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Translation_1_3"), model.selection("FACE", "Translation_1_4"), model.selection("FACE", "Translation_1_5"), model.selection("FACE", "Translation_1_6"), model.selection("FACE", "Translation_1_7"), model.selection("FACE", "Translation_1_8"), model.selection("FACE", "Translation_1_9"), model.selection("FACE", "Translation_1_10"), model.selection("FACE", "Translation_1_11"), model.selection("FACE", "Translation_2_1"), model.selection("FACE", "Translation_2_2"), model.selection("FACE", "Translation_2_3"), model.selection("FACE", "Translation_2_4"), model.selection("FACE", "Translation_2_5"), model.selection("FACE", "Translation_2_6"), model.selection("FACE", "Translation_2_7"), model.selection("FACE", "Translation_2_8"), model.selection("FACE", "Translation_2_9"), model.selection("FACE", "Translation_2_10"), model.selection("FACE", "Translation_2_11"), model.selection("FACE", "Recover_2_1"), model.selection("FACE", "Recover_2_2"), model.selection("FACE", "Recover_2_3"), model.selection("FACE", "Recover_2_4"), model.selection("FACE", "Recover_2_5"), model.selection("FACE", "Recover_2_6"), model.selection("FACE", "Recover_2_7"), model.selection("FACE", "Recover_2_8"), model.selection("FACE", "Recover_2_9"), model.selection("FACE", "Recover_2_10"), model.selection("FACE", "Recover_2_11"), model.selection("EDGE", "Extrusion_5_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
+# create groups
+model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc)
+model.do()
+# make parameter to de-touch some vertical edges and gorizontal faces =>
+# two partition results are created instead of one => groups become invalid
+EpVoiles.setValue(0.18)
+model.do()
+
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature) == False)
+
+
+# move edges back, so, intersection re-appeared, so, groups should become valid
+EpVoiles.setValue(0.17)
+
+model.end()
+
+for i in range(Part_1_doc.size("Groups")):
+  GroupFeature = Part_1_doc.feature(objectToResult(Part_1_doc.object("Groups", i)))
+  assert(aFactory.validate(GroupFeature))
index 62e1e96de2fb7e9483ef98cb9816796a2fe6519e..10b99c1533f0f5c1901b68e6e2f01caa403859cd 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from GeomAPI import *
 
@@ -41,7 +42,7 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 5, 5, [model.selection("SOLID", "Extrusion_1_1")])
 Sketch_2_origin = GeomAPI_Pnt(0, -10, 0)
 Sketch_2_norm = GeomAPI_Dir(0, -1, 0)
@@ -60,20 +61,19 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 SketchConstraintLength_1 = Sketch_2.setLength(SketchLine_8.result(), "len")
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"), False)
 SketchLine_9 = SketchProjection_1.createdFeature()
 SketchConstraintDistance_1 = Sketch_2.setDistance(SketchLine_5.startPoint(), SketchLine_9.result(), 20, True)
 ExtrusionCut_1.setNestedSketch(Sketch_2)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_1_1/Modfied_1&Extrusion_1_1/Generated_Face_1"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Cylinder_2 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_2&Extrusion_1_1/Generated_Face_3&ExtrusionCut_1_1/Modfied_1"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Cylinder_2 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face]"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
 model.do()
 # make sketch_2 cut the whole top face of the initial extrusion, so, one of the cylinder becomes invalid
 lenParam.setValue(100)
-Part_1_doc.setCurrentFeature(Cylinder_2.feature(), True)
 model.do()
 # update selection of cylinder base points
-model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_3&Extrusion_1_1/Generated_Face_3&ExtrusionCut_1_1/Modfied_1").fillAttribute(Cylinder_1.basePoint())
-model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_divided_1_1&Extrusion_1_1/Generated_Face_1").fillAttribute(Cylinder_2.basePoint())
+model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_6)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_3)]").fillAttribute(Cylinder_1.basePoint())
+model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face&weak_name_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]").fillAttribute(Cylinder_2.basePoint())
 model.end()
 
 # check that both cylinders are valid and have correct results
diff --git a/src/ModelAPI/Test/TestSelectorShell.py b/src/ModelAPI/Test/TestSelectorShell.py
new file mode 100644 (file)
index 0000000..ba855c6
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+model.do()
+# select a shell of a box : this test checks selection of a shell
+aBoxResult = Box_1.feature().results()[0]
+aShell = GeomAPI_ShapeExplorer(aBoxResult.shape(), GeomAPI_Shape.SHELL)
+aGroup = Part_1_doc.addFeature("Group")
+aGroup.selectionList("group_list").append(aBoxResult, aShell.current())
+model.end()
+
+# check that the resulting group is correct
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+assert(aFactory.validate(aGroup))
+
+assert(model.checkPythonDump())
index 68f29eec2b8945f019dc42320d67b72384e3af04..9e3216c945728ffb40623101774ff09d64232a04 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from ModelAPI import *
 from GeomDataAPI import *
index e9ec85ba5c2891e8738df36b7ea2599e2f18cdc7..5caa9d6344514d7e1804459cbfdc14b238309f10 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -34,9 +33,9 @@ SketchCircle_2 = Sketch_1.addCircle(0, 0, 103.3027146966417)
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchCircle_2.center())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r")], model.selection(), 410, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchCircle_3 = Sketch_2.addCircle(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"))
-SketchCircle_4 = Sketch_2.addCircle(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchCircle_3 = Sketch_2.addCircle(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1/To_Face]"))
+SketchCircle_4 = Sketch_2.addCircle(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"))
 SketchArc_1 = Sketch_2.addArc(-76.31943784014528, 69.61892179185162, 22.73963059863011, 100.7688447087372, -98.26117835861398, -31.87776170424145, False)
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchCircle_3.results()[1], SketchArc_1.startPoint())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchCircle_3.results()[1], SketchArc_1.endPoint())
@@ -48,13 +47,15 @@ SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchArc_1.startPoint(),
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchArc_1.results()[1], SketchArc_2.endPoint())
 model.do()
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_1_2f-SketchArc_2_2r")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_1"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchLine_1 = Sketch_3.addLine(72.49453964599654, -117.643151959956, 76.08424302289386, 111.5797586569786)
 SketchArc_3 = Sketch_3.addArc(23.82028040531734, -147.9761102212422, 72.49453964599654, -117.643151959956, 29.20403695178628, -205.0750334594096, False)
 SketchConstraintCoincidence_9 = Sketch_3.setCoincident(SketchLine_1.startPoint(), SketchArc_3.startPoint())
-SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "ExtrusionCut_1_1", 13), False)
+SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), False)
 SketchArc_4 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_10 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchArc_4.results()[1])
+model.do()
+model.do()
 model.end()
 
 from ModelAPI import *
index 1aa708b3fd467ed97e66e3533aec8161ed911942..0494273b79789e165a55d6a4b05506fc7d6d8247 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -61,15 +60,15 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "ep_base")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), 3.65)
 SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_3.result(), 4.65)
 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_4.result(), 1.65)
-SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_3.result(), "ep_base")
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_7.startPoint(), SketchLine_3.result(), "ep_base", False)
 SketchLine_9 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OX"))
-SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_9.result(), "0.275+ep_voiles/2")
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_9.result(), "0.275+ep_voiles/2", False)
 SketchLine_10 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OY"))
-SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_10.result(), "0.325+ep_voiles/2")
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_10.result(), "0.325+ep_voiles/2", False)
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_5.result(), SketchLine_1.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 0, 0.3)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 0, 0.3)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
 SketchLine_11 = Sketch_2.addLine(2.26, -2.31, 1.64, -2.31)
 SketchLine_12 = Sketch_2.addLine(1.64, -2.31, 1.64, -1.69)
 SketchLine_13 = Sketch_2.addLine(1.64, -1.69, 2.26, -1.69)
@@ -86,21 +85,21 @@ SketchPoint_1 = Sketch_2.addPoint(1.925, -1.875)
 SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_11.result(), 0.62)
 SketchConstraintLength_5.setName("SketchConstraintLength_10")
 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_11.result(), SketchLine_12.result())
-SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2")
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_13.result(), "0.11+ep_poteau/2", False)
 SketchConstraintDistance_4.setName("SketchConstraintDistance_6")
-SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.21+ep_poteau/2")
+SketchConstraintDistance_5 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_12.result(), "0.21+ep_poteau/2", False)
 SketchConstraintDistance_5.setName("SketchConstraintDistance_7")
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_15 = SketchProjection_1.createdFeature()
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"))
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"), False)
 SketchLine_16 = SketchProjection_2.createdFeature()
-SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2")
+SketchConstraintDistance_6 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_15.result(), "1.75+ep_poteau/2+ep_voiles/2", False)
 SketchConstraintDistance_6.setName("SketchConstraintDistance_8")
-SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2")
+SketchConstraintDistance_7 = Sketch_2.setDistance(SketchPoint_1.coordinates(), SketchLine_16.result(), "1.8+ep_poteau/2+ep_voiles/2", False)
 SketchConstraintDistance_7.setName("SketchConstraintDistance_9")
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11r-SketchLine_12r-SketchLine_13r-SketchLine_14r")], model.selection(), 0, 0.02)
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f"))
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_14r-SketchLine_13r-SketchLine_12r-SketchLine_11r")], model.selection(), 0, 0.02)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f"))
 SketchLine_17 = Sketch_3.addLine(0, 2.950000000000001, 0, 1.700000000000001)
 SketchLine_17.setName("SketchLine_15")
 SketchLine_17.result().setName("SketchLine_15")
@@ -120,24 +119,22 @@ SketchLine_20.result().setName("SketchLine_18")
 SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OX"))
 SketchLine_21.setName("SketchLine_19")
 SketchLine_21.result().setName("SketchLine_19")
-#SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_21.result())
-#SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_20.endPoint(), SketchLine_21.result())
 SketchLine_22 = Sketch_3.addLine(2.525000000000001, 0, 3.975000000000001, 0)
 SketchLine_22.setName("SketchLine_20")
 SketchLine_22.result().setName("SketchLine_20")
-SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
-SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchLine_21.result())
+SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_21.result())
 SketchLine_23 = Sketch_3.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
 SketchLine_23.setName("SketchLine_21")
 SketchLine_23.result().setName("SketchLine_21")
-SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
-SketchLine_24 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"))
+SketchConstraintCoincidence_19 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
+SketchLine_24 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"))
 SketchLine_24.setName("SketchLine_22")
 SketchLine_24.result().setName("SketchLine_22")
 SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_17.result(), 1.25)
 SketchConstraintLength_6.setName("SketchConstraintLength_5")
-SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.startPoint())
-SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_19.endPoint())
+SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchLine_18.startPoint())
+SketchConstraintCoincidence_21 = Sketch_3.setCoincident(SketchLine_20.startPoint(), SketchLine_19.endPoint())
 SketchConstraintLength_7 = Sketch_3.setLength(SketchLine_19.result(), "1.25-ep_voiles/2")
 SketchConstraintLength_7.setName("SketchConstraintLength_6")
 SketchConstraintLength_8 = Sketch_3.setLength(SketchLine_20.result(), "1-ep_voiles/2")
@@ -145,99 +142,108 @@ SketchConstraintLength_8.setName("SketchConstraintLength_7")
 SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_22.result(), "1.5-ep_voiles/2")
 SketchConstraintLength_9.setName("SketchConstraintLength_8")
 SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_23.result())
-SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"))
+SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
 SketchLine_25.setName("SketchLine_23")
 SketchLine_25.result().setName("SketchLine_23")
-SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2")
+SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_22.endPoint(), SketchLine_25.result(), "0.25+ep_voiles/2", False)
 SketchConstraintDistance_8.setName("SketchConstraintDistance_5")
 SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_23.result(), "1-ep_voiles/2")
 SketchConstraintLength_10.setName("SketchConstraintLength_9")
-SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/To_Face_1"))
+SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
 SketchLine_26.setName("SketchLine_35")
 SketchLine_26.result().setName("SketchLine_35")
-SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 0.375)
+SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_17.startPoint(), SketchLine_26.result(), 0.375, False)
 SketchConstraintDistance_9.setName("SketchConstraintDistance_12")
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_15"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_17"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_18"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_20"), model.selection("EDGE", "Sketch_3/Edge-SketchLine_21")])
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5")], model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_3_1/Generated_Edge_2&Extrusion_3_1/To_Edge_1"), model.selection("VERTEX", "Extrusion_3_3/Generated_Edge_2&Extrusion_3_3/To_Edge_1"), model.selection("VERTEX", "Extrusion_3_4/Generated_Edge_1&Extrusion_3_4/To_Edge_1"))
+Edge_1_objects = [model.selection("EDGE", "Sketch_3/SketchLine_15"), model.selection("EDGE", "Sketch_3/SketchLine_17"), model.selection("EDGE", "Sketch_3/SketchLine_18"), model.selection("EDGE", "Sketch_3/SketchLine_20"), model.selection("EDGE", "Sketch_3/SketchLine_21")]
+Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Extrusion_3_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3"), model.selection("EDGE", "Edge_1_4"), model.selection("EDGE", "Edge_1_5")]
+Extrusion_3 = model.addExtrusion(Part_1_doc, Extrusion_3_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture", 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"), model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_27 = Sketch_4.addLine(0, 2.950000000000001, 0, 0)
 SketchLine_27.setName("SketchLine_26")
 SketchLine_27.result().setName("SketchLine_26")
-SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "Extrusion_3_1/Generated_Edge_2&Extrusion_3_1/To_Edge_1"))
-SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_27.startPoint(), SketchPoint_2.result())
-SketchPoint_3 = Sketch_4.addPoint(model.selection("VERTEX", "Extrusion_3_3/Generated_Edge_2&Extrusion_3_3/To_Edge_1"))
-SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_3.result())
+SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_1/Generated_Edge&Sketch_3/SketchLine_15_StartVertex]e[Extrusion_3_1/To_Edge]e"))
+SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_27.startPoint(), SketchPoint_2.result())
+SketchPoint_3 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_3/Generated_Edge&Sketch_3/SketchLine_18_StartVertex]e[Extrusion_3_3/To_Edge]e"))
+SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchPoint_3.result())
 SketchLine_28 = Sketch_4.addLine(0, 0, 3.975000000000001, 0)
 SketchLine_28.setName("SketchLine_27")
 SketchLine_28.result().setName("SketchLine_27")
-SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
-SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "Extrusion_3_4/Generated_Edge_1&Extrusion_3_4/To_Edge_1"))
-SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_4.result())
+SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_28.startPoint())
+SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_4/Generated_Edge&Sketch_3/SketchLine_20_EndVertex]e[Extrusion_3_4/To_Edge]e"))
+SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchPoint_4.result())
 SketchLine_29 = Sketch_4.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
 SketchLine_29.setName("SketchLine_28")
 SketchLine_29.result().setName("SketchLine_28")
-SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
-SketchPoint_5 = Sketch_4.addPoint(model.selection("VERTEX", "Extrusion_3_5/Generated_Edge_1&Extrusion_3_5/To_Edge_1"))
-SketchConstraintCoincidence_29 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchPoint_5.result())
+SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
+SketchPoint_5 = Sketch_4.addPoint(model.selection("VERTEX", "[Extrusion_3_5/Generated_Edge&Sketch_3/SketchLine_21_EndVertex]e[Extrusion_3_5/To_Edge]e"))
+SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchPoint_5.result())
 model.do()
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_26"), model.selection("EDGE", "Sketch_4/Edge-SketchLine_27"), model.selection("EDGE", "Sketch_4/Edge-SketchLine_28")])
-Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3")], model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
-Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_4_1/Generated_Edge_2&Extrusion_4_1/To_Edge_1"), model.selection("VERTEX", "Extrusion_4_1/Generated_Edge_1&Extrusion_4_1/To_Edge_1"), model.selection("VERTEX", "Extrusion_4_2/Generated_Edge_1&Extrusion_4_2/To_Edge_1"))
+Edge_2_objects = [model.selection("EDGE", "Sketch_4/SketchLine_26"), model.selection("EDGE", "Sketch_4/SketchLine_27"), model.selection("EDGE", "Sketch_4/SketchLine_28")]
+Edge_2 = model.addEdge(Part_1_doc, Edge_2_objects)
+Extrusion_4_objects = [model.selection("EDGE", "Edge_2_1"), model.selection("EDGE", "Edge_2_2"), model.selection("EDGE", "Edge_2_3")]
+Extrusion_4 = model.addExtrusion(Part_1_doc, Extrusion_4_objects, model.selection("EDGE", "PartSet/OZ"), "h_apres_ouverture-ep_dalles/2", 0)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"), model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
 Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
 SketchLine_30 = Sketch_5.addLine(0, 2.950000000000001, 0, 0)
 SketchLine_30.setName("SketchLine_29")
 SketchLine_30.result().setName("SketchLine_29")
-SketchPoint_6 = Sketch_5.addPoint(model.selection("VERTEX", "Extrusion_4_1/Generated_Edge_2&Extrusion_4_1/To_Edge_1"))
-SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchPoint_6.result())
-SketchPoint_7 = Sketch_5.addPoint(model.selection("VERTEX", "Extrusion_4_1/Generated_Edge_1&Extrusion_4_1/To_Edge_1"))
-SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_7.result())
+SketchPoint_6 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_StartVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_28 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchPoint_6.result())
+SketchPoint_7 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_1/Generated_Edge&Sketch_4/SketchLine_26_EndVertex]e[Extrusion_4_1/To_Edge]e"))
+SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchPoint_7.result())
 SketchLine_31 = Sketch_5.addLine(0, 0, 3.975000000000001, 0)
 SketchLine_31.setName("SketchLine_30")
 SketchLine_31.result().setName("SketchLine_30")
-SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
-SketchPoint_8 = Sketch_5.addPoint(model.selection("VERTEX", "Extrusion_4_2/Generated_Edge_1&Extrusion_4_2/To_Edge_1"))
-SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_8.result())
+SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
+SketchPoint_8 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_2/Generated_Edge&Sketch_4/SketchLine_27_EndVertex]e[Extrusion_4_2/To_Edge]e"))
+SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchPoint_8.result())
 SketchLine_32 = Sketch_5.addLine(3.975000000000001, 0, 3.975000000000001, 0.95)
 SketchLine_32.setName("SketchLine_31")
 SketchLine_32.result().setName("SketchLine_31")
-SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
-SketchPoint_9 = Sketch_5.addPoint(model.selection("VERTEX", "Extrusion_4_3/Generated_Edge_1&Extrusion_4_3/To_Edge_1"))
-SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchPoint_9.result())
+SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_31.endPoint(), SketchLine_32.startPoint())
+SketchPoint_9 = Sketch_5.addPoint(model.selection("VERTEX", "[Extrusion_4_3/Generated_Edge&Sketch_4/SketchLine_28_EndVertex]e[Extrusion_4_3/To_Edge]e"))
+SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchPoint_9.result())
 SketchLine_33 = Sketch_5.addLine(3.975000000000001, 0.95, 0, 2.950000000000001)
 SketchLine_33.setName("SketchLine_32")
 SketchLine_33.result().setName("SketchLine_32")
-SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
-SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchLine_33.endPoint())
-SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchPoint_6.coordinates(), SketchLine_33.endPoint())
+SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_32.endPoint(), SketchLine_33.startPoint())
+SketchConstraintCoincidence_35 = Sketch_5.setCoincident(SketchLine_30.startPoint(), SketchLine_33.endPoint())
+SketchConstraintCoincidence_36 = Sketch_5.setCoincident(SketchPoint_6.coordinates(), SketchLine_33.endPoint())
 SketchLine_34 = Sketch_5.addLine(1.85, 2.019182389937107, 1.85, 0)
 SketchLine_34.setName("SketchLine_33")
 SketchLine_34.result().setName("SketchLine_33")
-SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_37 = Sketch_5.setCoincident(SketchLine_34.startPoint(), SketchLine_33.result())
 SketchLine_35 = Sketch_5.addLine(2.075000000000001, 1.905974842767296, 2.075000000000001, 0)
 SketchLine_35.setName("SketchLine_34")
 SketchLine_35.result().setName("SketchLine_34")
-SketchConstraintCoincidence_40 = Sketch_5.setCoincident(SketchLine_35.startPoint(), SketchLine_33.result())
-SketchConstraintCoincidence_41 = Sketch_5.setCoincident(SketchLine_35.endPoint(), SketchLine_31.result())
-SketchConstraintCoincidence_42 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_31.result())
+SketchConstraintCoincidence_38 = Sketch_5.setCoincident(SketchLine_35.startPoint(), SketchLine_33.result())
+SketchConstraintCoincidence_39 = Sketch_5.setCoincident(SketchLine_35.endPoint(), SketchLine_31.result())
+SketchConstraintCoincidence_40 = Sketch_5.setCoincident(SketchLine_34.endPoint(), SketchLine_31.result())
 SketchConstraintVertical_8 = Sketch_5.setVertical(SketchLine_34.result())
 SketchConstraintVertical_9 = Sketch_5.setVertical(SketchLine_35.result())
-SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_30.result(), "1.8+ep_voiles/2")
-SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_35.startPoint(), SketchLine_32.result(), "1.85+ep_voiles/2")
+SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_34.startPoint(), SketchLine_30.result(), "1.8+ep_voiles/2", False)
+SketchConstraintDistance_10.setName("SketchConstraintDistance_10")
+SketchConstraintDistance_11 = Sketch_5.setDistance(SketchLine_35.startPoint(), SketchLine_32.result(), "1.85+ep_voiles/2", False)
+SketchConstraintDistance_11.setName("SketchConstraintDistance_11")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_29f-SketchLine_30f-SketchLine_32f-SketchLine_33r")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_30f-SketchLine_32f-SketchLine_33f-SketchLine_34r")])
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Extrusion_4_3"), model.selection("FACE", "Extrusion_3_3"), model.selection("FACE", "Extrusion_4_2"), model.selection("FACE", "Extrusion_3_5"), model.selection("FACE", "Extrusion_3_4"), model.selection("FACE", "Extrusion_3_2"), model.selection("FACE", "Extrusion_4_1"), model.selection("FACE", "Extrusion_3_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2")
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_29r-SketchLine_30f-SketchLine_33r-SketchLine_32f_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_34f_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_30f-SketchLine_34r-SketchLine_32f-SketchLine_33f_wire")])
+Translation_1_objects = [model.selection("FACE", "Extrusion_4_3"), model.selection("FACE", "Extrusion_3_3"), model.selection("FACE", "Extrusion_4_2"), model.selection("FACE", "Extrusion_3_5"), model.selection("FACE", "Extrusion_3_4"), model.selection("FACE", "Extrusion_3_2"), model.selection("FACE", "Extrusion_4_1"), model.selection("FACE", "Extrusion_3_1"), model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_3_1"), model.selection("FACE", "Face_2_1")]
+Translation_1 = model.addTranslation(Part_1_doc, Translation_1_objects, model.selection("EDGE", "PartSet/OZ"), "h_ouverture+h_apres_ouverture-ep_dalles/2")
 Recover_1_objects = [Face_2.result(), Face_3.result(), Face_1.result(), Extrusion_3.result(), Extrusion_4.result(), Extrusion_3.results()[1], Extrusion_3.results()[3], Extrusion_3.results()[4], Extrusion_4.results()[1], Extrusion_3.results()[2], Extrusion_4.results()[2]]
 Recover_1 = model.addRecover(Part_1_doc, Translation_1, Recover_1_objects)
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Recover_1_2"), model.selection("FACE", "Recover_1_5"), model.selection("FACE", "Recover_1_3"), model.selection("FACE", "Recover_1_4"), model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_1_6"), model.selection("FACE", "Recover_1_8"), model.selection("FACE", "Recover_1_7"), model.selection("FACE", "Recover_1_11"), model.selection("FACE", "Recover_1_10"), model.selection("FACE", "Recover_1_9")], model.selection("EDGE", "PartSet/OZ"), "2*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
+Translation_2_objects = [model.selection("FACE", "Recover_1_2"), model.selection("FACE", "Recover_1_5"), model.selection("FACE", "Recover_1_3"), model.selection("FACE", "Recover_1_4"), model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_1_6"), model.selection("FACE", "Recover_1_8"), model.selection("FACE", "Recover_1_7"), model.selection("FACE", "Recover_1_11"), model.selection("FACE", "Recover_1_10"), model.selection("FACE", "Recover_1_9")]
+Translation_2 = model.addTranslation(Part_1_doc, Translation_2_objects, model.selection("EDGE", "PartSet/OZ"), "2*(h_ouverture+h_apres_ouverture-ep_dalles/2)")
 Recover_2_objects = [Recover_1.results()[8], Recover_1.results()[9], Recover_1.results()[10], Recover_1.results()[6], Recover_1.results()[7], Recover_1.results()[5], Recover_1.result(), Recover_1.results()[3], Recover_1.results()[2], Recover_1.results()[4], Recover_1.results()[1]]
 Recover_2 = model.addRecover(Part_1_doc, Translation_2, Recover_2_objects)
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchPoint_1")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchPoint_1")])
 Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("VERTEX", "Vertex_1_1")], model.selection("EDGE", "PartSet/OZ"), model.selection("FACE", "Translation_2_11"), 0, model.selection(), 0)
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Translation_1_3"), model.selection("FACE", "Translation_1_4"), model.selection("FACE", "Translation_1_5"), model.selection("FACE", "Translation_1_6"), model.selection("FACE", "Translation_1_7"), model.selection("FACE", "Translation_1_8"), model.selection("FACE", "Translation_1_9"), model.selection("FACE", "Translation_1_10"), model.selection("FACE", "Translation_1_11"), model.selection("FACE", "Translation_2_1"), model.selection("FACE", "Translation_2_2"), model.selection("FACE", "Translation_2_3"), model.selection("FACE", "Translation_2_4"), model.selection("FACE", "Translation_2_5"), model.selection("FACE", "Translation_2_6"), model.selection("FACE", "Translation_2_7"), model.selection("FACE", "Translation_2_8"), model.selection("FACE", "Translation_2_9"), model.selection("FACE", "Translation_2_10"), model.selection("FACE", "Translation_2_11"), model.selection("FACE", "Recover_2_1"), model.selection("FACE", "Recover_2_2"), model.selection("FACE", "Recover_2_3"), model.selection("FACE", "Recover_2_4"), model.selection("FACE", "Recover_2_5"), model.selection("FACE", "Recover_2_6"), model.selection("FACE", "Recover_2_7"), model.selection("FACE", "Recover_2_8"), model.selection("FACE", "Recover_2_9"), model.selection("FACE", "Recover_2_10"), model.selection("FACE", "Recover_2_11"), model.selection("EDGE", "Extrusion_5_1")])
+Partition_1_objects = [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("FACE", "Translation_1_1"), model.selection("FACE", "Translation_1_2"), model.selection("FACE", "Translation_1_3"), model.selection("FACE", "Translation_1_4"), model.selection("FACE", "Translation_1_5"), model.selection("FACE", "Translation_1_6"), model.selection("FACE", "Translation_1_7"), model.selection("FACE", "Translation_1_8"), model.selection("FACE", "Translation_1_9"), model.selection("FACE", "Translation_1_10"), model.selection("FACE", "Translation_1_11"), model.selection("FACE", "Translation_2_1"), model.selection("FACE", "Translation_2_2"), model.selection("FACE", "Translation_2_3"), model.selection("FACE", "Translation_2_4"), model.selection("FACE", "Translation_2_5"), model.selection("FACE", "Translation_2_6"), model.selection("FACE", "Translation_2_7"), model.selection("FACE", "Translation_2_8"), model.selection("FACE", "Translation_2_9"), model.selection("FACE", "Translation_2_10"), model.selection("FACE", "Translation_2_11"), model.selection("FACE", "Recover_2_1"), model.selection("FACE", "Recover_2_2"), model.selection("FACE", "Recover_2_3"), model.selection("FACE", "Recover_2_4"), model.selection("FACE", "Recover_2_5"), model.selection("FACE", "Recover_2_6"), model.selection("FACE", "Recover_2_7"), model.selection("FACE", "Recover_2_8"), model.selection("FACE", "Recover_2_9"), model.selection("FACE", "Recover_2_10"), model.selection("FACE", "Recover_2_11"), model.selection("EDGE", "Extrusion_5_1")]
+Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects)
 model.do()
 model.testHaveNamingSubshapes(Partition_1, model, Part_1_doc)
 model.end()
index 65cf0e0f3b0fdfd9fab88544489baed720f4087f..539318fe09396378e02224c348a836b5571ba2bd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 9b1b195c4470f49cef35e30635d05dcf6f5fca66..9fbe0ea6f107b2f909b146049d0aa295390fc101 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index a5e571790e6c6bb76121ac6da76299f89945bdf5..3d921ca1681fdac7fabd717058c421d93fb67f19 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 672fe4cc7212e8decaaff761e2644144585985a1..85cd4302735bbccbf1ba9be459de82b4d829ff71 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 10c00199a5853ffa784aba2bd9f01e8903c3e5ab..8cf28a6bc4d11081070174f80fa40fdd21fd1004 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -40,8 +39,8 @@ SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
 SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
 SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 10, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f"))
 SketchLine_5 = Sketch_2.addLine(-3.660618520812283, -7.666051414039341, -9.927240775274454, -7.666051414039341)
 SketchLine_6 = Sketch_2.addLine(-9.927240775274454, -7.666051414039341, -9.927240775274454, 7.885614342469023)
 SketchLine_7 = Sketch_2.addLine(-9.927240775274454, 7.885614342469023, -3.660618520812283, 7.885614342469023)
@@ -55,7 +54,7 @@ SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r")], model.selection(), 10, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r")], model.selection(), 10, 0)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1")])
 model.do()
 model.testHaveNamingSubshapes(Fuse_1, model, Part_1_doc)
index fd17dbebb582dd5b4785231d1d3adb8840ac1b95..597ad1c6db3206d4dbfe9e7e1e3e1eb018b4b286 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 0113da48ab38c2880bbbdb2a4630a25c0c06e5a2..a1c59ea3817a6ee7ef921bbd9f5c9484c4a9157d 100644 (file)
@@ -1,22 +1,23 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+# -*- coding: utf-8 -*-
 
 from SketchAPI import *
 
@@ -56,9 +57,9 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_5.result(), 2)
 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_3.result(), 1.5)
 SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_8.result(), 4)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1__cc"), False)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1"))
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]__cc"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(0, 0, 4.75)
 SketchCircle_1.setAuxiliary(True)
@@ -67,7 +68,7 @@ SketchCircle_2 = Sketch_2.addCircle(4.113620667976081, 2.375000000000003, 1.1)
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_2.center())
 SketchCircle_3 = Sketch_2.addCircle(-4.113620667974014, 2.375000000003604, 1.1)
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_3.center())
-SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-012, -4.75000000000001, 1.1)
+SketchCircle_4 = Sketch_2.addCircle(4.163806340121522e-12, -4.75000000000001, 1.1)
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchCircle_1.results()[1], SketchCircle_4.center())
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchCircle_2.results()[1], SketchCircle_3.results()[1])
 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchCircle_3.results()[1], SketchCircle_4.results()[1])
@@ -79,12 +80,12 @@ SketchLine_10 = Sketch_2.addLine(-4.113620667974014, 2.375000000003604, 0, 0)
 SketchLine_10.setAuxiliary(True)
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchCircle_3.center(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_10.endPoint())
-SketchLine_11 = Sketch_2.addLine(4.163806340121522e-012, -4.75000000000001, 0, 0)
+SketchLine_11 = Sketch_2.addLine(4.163806340121522e-12, -4.75000000000001, 0, 0)
 SketchLine_11.setAuxiliary(True)
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchCircle_4.center(), SketchLine_11.startPoint())
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_11.endPoint())
 SketchConstraintRadius_1 = Sketch_2.setRadius(SketchCircle_2.results()[1], 1.1)
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_12 = SketchProjection_4.createdFeature()
 SketchConstraintAngle_1 = Sketch_2.setAngleBackward(SketchLine_9.result(), SketchLine_12.result(), 30.00000000000006)
 SketchConstraintAngle_2 = Sketch_2.setAngle(SketchLine_9.result(), SketchLine_10.result(), 119.9999999999498)
@@ -173,39 +174,39 @@ SketchConstraintDistance_2 = Sketch_2.setDistance(SketchCircle_16.center(), Sket
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Line(SketchLine_19).startPoint(), SketchCircle_17.center(), 5.2, True)
 model.do()
 ExtrusionCut_1_objects_1 = [model.selection("FACE", "Sketch_2/Face-SketchCircle_9_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_7_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_17_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_16_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")]
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
-ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_12_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_6_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_8_2f")]
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
+ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Face-SketchCircle_11_2f-SketchCircle_9_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_12_2f-SketchCircle_10_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_6_2f-SketchCircle_5_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_8_2f-SketchCircle_7_2r_wire")]
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_1_1")])
 Axis_4 = model.addAxis(Part_1_doc, 0, -1, -10)
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-ExtrusionCut_3.result().setDeflection(1e-005)
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f")], model.selection("EDGE", "Axis_1"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+ExtrusionCut_3.result().setDeflection(1e-05)
 Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_21 = Sketch_3.addLine(3.5, 2.508501119175777, 3.5, 4.934853156880259)
 SketchLine_22 = Sketch_3.addLine(3.5, 4.934853156880259, 6.2, 4.934853156880259)
 SketchConstraintCoincidence_49 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_22.startPoint())
 SketchLine_23 = Sketch_3.addLine(6.2, 4.934853156880259, 6.2, 3.008501119175777)
 SketchConstraintCoincidence_50 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.startPoint())
-SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False)
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False)
 SketchLine_24 = SketchProjection_6.createdFeature()
 SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_24.result())
 SketchLine_25 = Sketch_3.addLine(6.2, 3.008501119175777, 3.5, 2.508501119175777)
 SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchLine_23.endPoint(), SketchLine_25.startPoint())
 SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_25.endPoint())
-SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), False)
+SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_5"), False)
 SketchLine_26 = SketchProjection_7.createdFeature()
 SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_26.result())
 SketchConstraintCoincidence_55 = Sketch_3.setCoincident(SketchLine_21.endPoint(), SketchLine_26.result())
 SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_22.result())
 SketchConstraintCoincidence_56 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_24.result())
-SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_27 = SketchProjection_8.createdFeature()
 SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_25.result(), SketchLine_27.result())
-SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), False)
+SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_4"), False)
 SketchLine_28 = SketchProjection_9.createdFeature()
 SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_21.startPoint(), SketchLine_28.result(), 0.5, True)
 model.do()
 Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0)
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Common_1_1"), model.selection("SOLID", "Common_1_2")])
 model.do()
index 6656fbe9d5719e0bced0134b717b9bf99d67c8f0..8a678ae5a81917530c4528ad19c0774e74205021 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
@@ -178,9 +177,9 @@ SketchLine_22 = SketchProjection_4.createdFeature()
 SketchConstraintDistance_9 = Sketch_2.setDistance(SketchLine_19.startPoint(), SketchLine_22.result(), "(TL/2-3)-20", True)
 SketchConstraintDistance_10 = Sketch_2.setDistance(SketchLine_19.endPoint(), SketchLine_22.result(), "(TL/2-3)-20", True)
 model.do()
-Wire_1_objects = [model.selection("EDGE", "Sketch_1/Edge-SketchLine_11"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_10"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_4_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_12"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_14"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_13"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_15"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_5_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_16"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_1_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_5"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_3_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")]
+Wire_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_11"), model.selection("EDGE", "Sketch_1/SketchLine_10"), model.selection("EDGE", "Sketch_1/SketchArc_4_2"), model.selection("EDGE", "Sketch_1/SketchLine_12"), model.selection("EDGE", "Sketch_1/SketchLine_14"), model.selection("EDGE", "Sketch_1/SketchLine_13"), model.selection("EDGE", "Sketch_1/SketchLine_15"), model.selection("EDGE", "Sketch_1/SketchArc_5_2"), model.selection("EDGE", "Sketch_1/SketchLine_16"), model.selection("EDGE", "Sketch_1/SketchLine_9"), model.selection("EDGE", "Sketch_1/SketchArc_1_2"), model.selection("EDGE", "Sketch_1/SketchLine_8"), model.selection("EDGE", "Sketch_1/SketchLine_7"), model.selection("EDGE", "Sketch_1/SketchLine_5"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchArc_3_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_1")]
 Wire_1 = model.addWire(Part_1_doc, Wire_1_objects)
-Wire_2_objects = [model.selection("EDGE", "Sketch_2/Edge-SketchLine_17"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_7_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_20"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_19"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_18"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_6_2")]
+Wire_2_objects = [model.selection("EDGE", "Sketch_2/SketchLine_17"), model.selection("EDGE", "Sketch_2/SketchArc_7_2"), model.selection("EDGE", "Sketch_2/SketchLine_20"), model.selection("EDGE", "Sketch_2/SketchLine_19"), model.selection("EDGE", "Sketch_2/SketchLine_18"), model.selection("EDGE", "Sketch_2/SketchArc_6_2")]
 Wire_2 = model.addWire(Part_1_doc, Wire_2_objects)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")])
 Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_2_1")])
index b9145a0467cff92e9c4ca352be69228719cda714..3d386a865138952263f901da96eb459d34622a8d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # -*- coding: utf-8 -*-
 
index 331d753c01f0a40a30b7ddabbb9cb1f75678368e..4891d6a0dbac9cc000e01fda1371e74783620b20 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 21caaa1da5f7d78f8b86ec9a58e0f264493e0b60..e3084bccab926223efa48e2747e5d4239986db8b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -87,9 +86,9 @@ SketchConstraintHorizontal_10 = Sketch_1.setHorizontal(SketchLine_19.result())
 SketchConstraintVertical_10 = Sketch_1.setVertical(SketchLine_20.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 100, 100)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1")], model.selection("EDGE", "Extrusion_1_1/Generated_Face_24&Extrusion_1_1/To_Face_2"), 200)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1")], model.selection("EDGE", "[Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_20][Extrusion_1_1_2/To_Face]"), 200)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 50)
-Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1")], model.selection("EDGE", "Extrusion_2_1/Generated_Face_24&Extrusion_2_1/To_Face_2"), 150)
+Translation_2 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_2_1")], model.selection("EDGE", "[Extrusion_2_1_2/Generated_Face&Sketch_1/SketchLine_20][Extrusion_2_1_2/To_Face]"), 150)
 Boolean_1 = model.addCut(Part_1_doc, [model.selection("COMPSOLID", "Translation_1_1")], [model.selection("COMPSOLID", "Translation_2_1")])
 model.do()
 model.testHaveNamingSubshapes(Boolean_1, model, Part_1_doc)
diff --git a/src/ModelAPI/Test/TestWeakNamingSortOrder.py b/src/ModelAPI/Test/TestWeakNamingSortOrder.py
new file mode 100644 (file)
index 0000000..1b182c7
--- /dev/null
@@ -0,0 +1,101 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Point_2 = model.addPoint(Part_1_doc, 10, 0, 0)
+Point_3 = model.addPoint(Part_1_doc, 0, 10, 0)
+Point_4 = model.addPoint(Part_1_doc, 20, 10, 0)
+Point_5 = model.addPoint(Part_1_doc, 10, 20, 0)
+Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_4")], False)
+Polyline_2 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_2"), model.selection("VERTEX", "Point_3")], False)
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("WIRE", "Polyline_1_1"), model.selection("WIRE", "Polyline_2_1")])
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Compound_1_1_2", 1)], model.selection("EDGE", "PartSet/OY"), 10)
+model.do()
+
+model.testNbResults(Translation_1, 1)
+model.testNbSubResults(Translation_1, [0])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.SOLID, [0])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.FACE, [0])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.EDGE, [1])
+model.testNbSubShapes(Translation_1, GeomAPI_Shape.VERTEX, [2])
+
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Box_1 = model.addBox(Part_2_doc, 10, 10, 10)
+Box_2 = model.addBox(Part_2_doc, 4, 4, 4)
+Translation_2 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Box_2_1")], 3, 3, 3)
+Compound_2 = model.addCompound(Part_2_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Translation_1_1")])
+Translation_3 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Compound_1_1", 0)], 10, 0, 0)
+model.do()
+
+model.testNbResults(Translation_3, 1)
+model.testNbSubResults(Translation_3, [2])
+model.testNbSubShapes(Translation_3, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Translation_3, GeomAPI_Shape.FACE, [12])
+model.testNbSubShapes(Translation_3, GeomAPI_Shape.EDGE, [48])
+model.testNbSubShapes(Translation_3, GeomAPI_Shape.VERTEX, [96])
+model.testResultsVolumes(Translation_3, [1064])
+
+
+Part_3 = model.addPart(partSet)
+Part_3_doc = Part_3.document()
+Box_3 = model.addBox(Part_3_doc, 10, 10, 10)
+Box_4 = model.addBox(Part_3_doc, 10, 10, 10)
+Point_6 = model.addPoint(Part_3_doc, 5, 5, 0)
+Point_7 = model.addPoint(Part_3_doc, 5, 5, 10)
+Axis_4 = model.addAxis(Part_3_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"))
+Rotation_1 = model.addRotation(Part_3_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "Axis_1"), 45)
+Compound_3 = model.addCompound(Part_3_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Rotation_1_1")])
+Translation_4 = model.addTranslation(Part_3_doc, [model.selection("SOLID", "Compound_1_1", 1)], 10, 0, 0)
+model.do()
+
+model.testNbResults(Translation_4, 1)
+model.testNbSubResults(Translation_4, [0])
+model.testNbSubShapes(Translation_4, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Translation_4, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Translation_4, GeomAPI_Shape.EDGE, [24])
+model.testNbSubShapes(Translation_4, GeomAPI_Shape.VERTEX, [48])
+model.testResultsVolumes(Translation_4, [1000])
+
+
+Part_4 = model.addPart(partSet)
+Part_4_doc = Part_4.document()
+Box_5 = model.addBox(Part_4_doc, 10, 10, 10)
+Box_6 = model.addBox(Part_4_doc, 10, 10, 10)
+Compound_4 = model.addCompound(Part_4_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")])
+Translation_5 = model.addTranslation(Part_4_doc, [model.selection("SOLID", "Compound_1_1", 1)], model.selection("EDGE", "PartSet/OZ"), 10)
+model.do()
+
+model.testNbResults(Translation_5, 1)
+model.testNbSubResults(Translation_5, [0])
+model.testNbSubShapes(Translation_5, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Translation_5, GeomAPI_Shape.FACE, [6])
+model.testNbSubShapes(Translation_5, GeomAPI_Shape.EDGE, [24])
+model.testNbSubShapes(Translation_5, GeomAPI_Shape.VERTEX, [48])
+model.testResultsVolumes(Translation_5, [1000])
+
+model.end()
old mode 100755 (executable)
new mode 100644 (file)
index 58e55ff..45fc4df
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
old mode 100755 (executable)
new mode 100644 (file)
index 58686ac..ea3ef14
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELGEOMALGO_H
old mode 100755 (executable)
new mode 100644 (file)
index b8fcbaf..ccc9560
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ModelAPI.i */
old mode 100755 (executable)
new mode 100644 (file)
index 430409f..6eff0ea
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelGeomAlgo_Point2D.h"
old mode 100755 (executable)
new mode 100644 (file)
index 3a54079..03f5b7d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelGeomAlgo_Point2D_H
index 887c64476694643d109787fae1102649e09766a5..e635ebf8b957291ea8fb397f9975fe20c4240789 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Shape.h>
index 2354e8049b3bcf2e845b3e8793b4465f2465bf1f..3f5f49665cf996fdaa9795729eb557b5823f5e28 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelGeomAlgo_Shape_H
old mode 100755 (executable)
new mode 100644 (file)
index 406ef64..b321a3d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELGEOMALGO_MODELGEOMALGO_SWIG_H_
old mode 100755 (executable)
new mode 100644 (file)
index 7ba5ab3..048db5c
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       TestPoint2D.py
index 8f0607feb14e491a229afb4f629a3fe99c28b14f..68063137922d963192b34431f3c9dac8384d4745 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
@@ -120,5 +119,6 @@ ADD_UNIT_TESTS(
   TestRefAttr.py
   TestReference.py
   TestDeflectionDump.py
+  TestUndoRedo.py
   Test2488.py
 )
index 81a7eca12bb4bec09f6c655efd7f8e535f94d5b2..02a9e602ad93a8df942e1822af95442730ed5616 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODELHIGHAPI_H
index 1876d8ee2023f0fcbb07e8632e3ea849ec7463ae..819e7579722715b836ec58a32fadd40d45b3814d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ModelHighAPI.i */
index aa02d3cdb6fb8a724f6456e1c588ee84a12575c0..35370c8190295fb7bcbdc02229ce90c1c06dafd6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Double.h"
index f7997c904b46e3406ab1f112887beb402a64e32b..6861a7c0a3f55b9a5898acbc3ea61556841f541b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_DOUBLE_H_
index 07260dcf26708b2d45e138c8245493f4ff6b8210..993dc57b31f32854a26fa43d8f10d39d626d792c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Dumper.h"
@@ -25,6 +24,7 @@
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAlgoAPI_NExplode.h>
 
 #include <GeomDataAPI_Dir.h>
@@ -440,20 +440,9 @@ bool ModelHighAPI_Dumper::exportTo(const std::string& theFileName)
 
   // standard header (encoding + imported modules)
   aFile << "# -*- coding: utf-8 -*-" << std::endl << std::endl;
-  for (ModulesMap::const_iterator aModIt = myModules.begin();
+  for (ModulesSet::const_iterator aModIt = myModules.begin();
        aModIt != myModules.end(); ++aModIt) {
-    aFile << "from " << aModIt->first << " import ";
-    if (aModIt->second.empty() ||
-        aModIt->second.find(std::string()) != aModIt->second.end())
-      aFile << "*"; // import whole module
-    else {
-      // import specific features
-      std::set<std::string>::const_iterator anObjIt = aModIt->second.begin();
-      aFile << *anObjIt;
-      for (++anObjIt; anObjIt != aModIt->second.end(); ++anObjIt)
-        aFile << ", " << *anObjIt;
-    }
-    aFile << std::endl;
+    aFile << "from " << *aModIt << " import *" << std::endl;
   }
   if (!myModules.empty())
     aFile << std::endl;
@@ -474,10 +463,9 @@ bool ModelHighAPI_Dumper::exportTo(const std::string& theFileName)
   return true;
 }
 
-void ModelHighAPI_Dumper::importModule(const std::string& theModuleName,
-                                       const std::string& theObject)
+void ModelHighAPI_Dumper::importModule(const std::string& theModuleName)
 {
-  myModules[theModuleName].insert(theObject);
+  myModules.insert(theModuleName);
 }
 
 void ModelHighAPI_Dumper::dumpEntitySetName()
@@ -687,7 +675,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const double theValue)
 
 ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const std::shared_ptr<GeomAPI_Pnt>& thePoint)
 {
-  importModule("GeomAPI", "GeomAPI_Pnt");
+  importModule("GeomAPI");
   myDumpBuffer << "GeomAPI_Pnt(" << thePoint->x() << ", "
                << thePoint->y() << ", " << thePoint->z() << ")";
   return *this;
@@ -695,7 +683,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const std::shared_ptr<GeomA
 
 ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const std::shared_ptr<GeomAPI_Dir>& theDir)
 {
-  importModule("GeomAPI", "GeomAPI_Dir");
+  importModule("GeomAPI");
   myDumpBuffer << "GeomAPI_Dir(" << theDir->x() << ", "
                << theDir->y() << ", " << theDir->z() << ")";
   return *this;
@@ -1067,6 +1055,13 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
     isDumpByGeom = aSelectedFeature && aSelectedFeature->isInHistory();
   }
 
+  if (theAttrSelect->isGeometricalSelection() && aShape->shapeType() == GeomAPI_Shape::COMPOUND
+    && theAttrSelect->context().get() && !aShape->isEqual(theAttrSelect->context()->shape())
+    && theAttrSelect->context()->groupName() != ModelAPI_ResultPart::group()) {
+    GeomAPI_ShapeIterator anIt(aShape);
+    aShape = anIt.current();
+  }
+
   myDumpBuffer << "\"" << aShape->shapeTypeStr();
   bool aStandardDump = true;
   if (isDumpByGeom) {
@@ -1096,13 +1091,13 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
                  << aMiddlePoint->y() << ", "
                  << aMiddlePoint->z() << ")";
     aStandardDump = false;
-  } else if (theAttrSelect->isWeakNaming() ||
-    (myWeakNamingSelection && aShape.get() && theAttrSelect->context().get() &&
-       aShape != theAttrSelect->context()->shape())) { // weak naming for local selection only
+  } else if (myWeakNamingSelection && aShape.get() && theAttrSelect->context().get() &&
+       aShape != theAttrSelect->context()->shape()) { // weak naming for local selection only
     GeomAlgoAPI_NExplode aNExplode(theAttrSelect->context()->shape(), aShape->shapeType());
     int anIndex = aNExplode.index(aShape);
     if (anIndex != 0) { // found a week-naming index, so, export it
-      myDumpBuffer<<"\", \""<<theAttrSelect->context()->data()->name()<<"\", "<<anIndex;
+      myDumpBuffer<<"\", \""<<
+        theAttrSelect->contextName(theAttrSelect->context())<<"\", "<<anIndex;
       aStandardDump = false;
     }
   }
index 5c854bab23b7f02a50a3ff674aca14397b270e11..265743dca07f39cebd4a0540dc25886ec1683bbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelHighAPI_Dumper_H_
@@ -102,11 +101,8 @@ public:
 
   /// Add module to list of imported modules
   /// \param theModuleName  name of the module to be imported
-  /// \param theObject      name of the entity to be imported
-  ///                       from the module (if empty, while module will be imported)
   MODELHIGHAPI_EXPORT
-  void importModule(const std::string& theModuleName,
-                    const std::string& theObject = std::string());
+  void importModule(const std::string& theModuleName);
 
   /// Returns name of specified entity
   /// \param theEntity        [in] named entity
@@ -331,7 +327,7 @@ private:
   };
 
   typedef std::map<EntityPtr, EntityName>                                      EntityNameMap;
-  typedef std::map<std::string, std::set<std::string> >                        ModulesMap;
+  typedef std::set<std::string>                                                ModulesSet;
   typedef std::map<DocumentPtr, std::map<std::string, std::pair<int, int> > >  NbFeaturesMap;
 
   struct LastDumpedEntity {
@@ -352,7 +348,7 @@ private:
   std::ostringstream  myDumpBuffer;         ///< intermediate buffer to store dumping data
   std::ostringstream  myFullDump;           ///< full buffer of dumped data
 
-  ModulesMap          myModules;            ///< modules and entities to be imported
+  ModulesSet          myModules;            ///< modules and entities to be imported
   EntityNameMap       myNames;              ///< names of the entities
   DumpStack           myEntitiesStack;      ///< stack of dumped entities
 
index f0d4deb48d9b2f427daa53e5b842b01ac79a8bf5..54631e07685032085321f616cc1175d7d4cf6711 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelHighAPI_FeatureStore.h>
@@ -188,12 +187,23 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) {
     }
   } else if (aType == ModelAPI_AttributeInteger::typeId()) {
     AttributeIntegerPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeInteger>(theAttr);
+    // do not dump a type of ConstraintAngle, because it can be changed due dumping
+    if (anAttr->id() == "AngleType") {
+      return "";
+    }
     if (anAttr->text().empty())
       aResult<<anAttr->value();
     else
       aResult<<anAttr->text();
   } else if (aType == ModelAPI_AttributeDouble::typeId()) {
     AttributeDoublePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(theAttr);
+    if (anAttr->id() == "ConstraintValue") {
+      // do not dump a value of constraint if it is ConstraintAngle,
+      // because this value depends on the angle type
+      FeaturePtr anOwner = ModelAPI_Feature::feature(anAttr->owner());
+      if (anOwner && anOwner->getKind() == "SketchConstraintAngle")
+        return "";
+    }
     int aPrecision = PRECISION;
     // Special case - precision for the arc angle. It is calculated with tolerance 1e-4,
     // so the value has only 4 correct digits
@@ -206,6 +216,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) {
       aResult<<anAttr->text();
   } else if (aType == ModelAPI_AttributeBoolean::typeId()) {
     AttributeBooleanPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(theAttr);
+    // do not dump internal flags of ConstraintAngle
+    if (anAttr->id() == "AngleReversedLine1" || anAttr->id() == "AngleReversedLine2") {
+      return "";
+    }
     aResult<<anAttr->value();
   } else if (aType == ModelAPI_AttributeString::typeId()) {
     AttributeStringPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttr);
@@ -225,7 +239,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) {
   } else if (aType == ModelAPI_AttributeSelection::typeId()) {
     AttributeSelectionPtr anAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttr);
-    aResult<<anAttr->namingName();
+    if (anAttr->context().get())
+      aResult<<anAttr->namingName();
+    else
+      aResult<<"__notinitialized__";
   } else if (aType == ModelAPI_AttributeSelectionList::typeId()) {
     AttributeSelectionListPtr anAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttr);
index 32bea8a3bcb5553f6bb49913ad5de3f190f82311..e7a6a1bac5b142a0af6b36d61278d87a92820c22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModelHighAPI_FeatureStore_H_
index c6280ffd4e3b2c1481340a9061a0c67a5a5e743a..3640677a3a0b12de0009c615a7e44f95c51acd0a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Folder.h"
@@ -74,8 +73,8 @@ void ModelHighAPI_Folder::dump(ModelHighAPI_Dumper& theDumper) const
 {
   const std::string& aDocName = theDumper.name(myFolder->document());
 
-  AttributeReferencePtr aStartRef = myFolder->reference(ModelAPI_Folder::FIRST_FEATURE_ID());
-  AttributeReferencePtr aEndRef   = myFolder->reference(ModelAPI_Folder::LAST_FEATURE_ID());
+  AttributeReferencePtr aStartRef = firstFeature();
+  AttributeReferencePtr aEndRef   = lastFeature();
 
   // do not dump empty folders
   if (!aEndRef->value())
index ba86eb0adf6bfa5fc0f947d2b9d4484968db62e1..66fe99b3c9c95676f903819dcee2c91a4113aa10 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_FOLDER_H_
index e4b8f543c58b41a8d7638264e260bdebc0c8b1e4..8691146f9a63d6f119048661d37b7389e8930bda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Integer.h"
index 7357f16b87163ef17a8da55d2f36eb428b951177..8fadf90105bfed900557f6558a349df3fe52e27f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTEGER_H_
index 8e35b13be1b88f0fec6a144d58b11d7bcdf38f82..ad53e125b0c8581ce5663969c92844bee96a670b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Interface.h"
index 729d84a23997ae5bdb9276ba99bb39ffafe03973..8675bb66ce33f14083bc5ab8d424f5c8100d57b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
index 6e49003f206d1f5a7330c1fc497f0ec9a65caaa7..7b7364103291f818e5ebaa2809305190178fcc36 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_MACRO_H_
index d018517e23f8262bff3c073c0f4e05bc7dd673e0..30c15a9240a3c1b4f00e4441e6154026bb717047 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_RefAttr.h"
index feb9edfdc6124f809975c2bcafa78666e8bc51bb..1984a98a0566b89668d78c5b8fcfdf6b6f44f566 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_REFATTR_H_
index af2fe1cf3d585819c372339cb61e1da66979eb15..5e95540a4786ad803ddc21d5e2be7ac1a0611df4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Reference.h"
index e289eef886af0a3728dd4f2f81f6677513f0f620..50a8cf14f3c8253e423aaf3bdccbece1d5020da7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_REFERENCE_H_
index 20e834a6335461bcd240109d1e94b69b90388662..cb74050bce40a957fa16dba8abc967a06f830736 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Selection.h"
@@ -161,6 +160,12 @@ TypeInnerPointPair ModelHighAPI_Selection::typeInnerPointPair() const
   return myTypeInnerPointPair;
 }
 
+//==================================================================================================
+TypeWeakNamingPair ModelHighAPI_Selection::typeWeakNamingPair() const
+{
+  return myWeakNamingPair;
+}
+
 //==================================================================================================
 std::string ModelHighAPI_Selection::shapeType() const
 {
@@ -221,6 +226,7 @@ void ModelHighAPI_Selection::setDeflection(double theValue)
   aDeflectionAttr->setValue(theValue);
 }
 
+// LCOV_EXCL_START
 void ModelHighAPI_Selection::setTransparency(double theValue)
 {
   if (myVariantType != VT_ResultSubShapePair)
@@ -231,6 +237,7 @@ void ModelHighAPI_Selection::setTransparency(double theValue)
 
   aTransparencyAttr->setValue(theValue);
 }
+// LCOV_EXCL_STOP
 
 int ModelHighAPI_Selection::numberOfSubs() const
 {
index 209aa4d95cf316b016308adc48b2191c8ca4d5ec..52b9b40507d353641166c721ad8a7b333ce5d544 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
@@ -115,6 +114,10 @@ public:
   MODELHIGHAPI_EXPORT
   virtual TypeInnerPointPair typeInnerPointPair() const;
 
+  /// \return pair of sub-shape type and pair of context name and sub-shape index.
+  MODELHIGHAPI_EXPORT
+    virtual TypeWeakNamingPair typeWeakNamingPair() const;
+
   /// \return shape type.
   MODELHIGHAPI_EXPORT
   virtual std::string shapeType() const;
index 20e21e1b47af7ba811e9af87fef05d29f14981bc..c9be661299b85665b84e2e1d6a438e602fa96d3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Services.h"
@@ -103,6 +102,15 @@ void begin()
 
 void end()
 {
+  // some operations make the current feature not the last one (like "galeries" change parameters)
+  DocumentPtr anActive = ModelAPI_Session::get()->activeDocument();
+  int aSize = anActive->size("Features");
+  if (aSize > 0) {
+    FeaturePtr aLastFeat =
+      std::dynamic_pointer_cast<ModelAPI_Feature>(anActive->object("Features", aSize - 1));
+    anActive->setCurrentFeature(aLastFeat, true);
+  }
+
   ModelAPI_Session::get()->finishOperation();
   // to update data tree in the end of dumped script execution
   ModelAPI_EventCreator::get()->sendReordered(FeaturePtr());
index 85d9fb704e5e7a75ac0e65c015ccb374023f5563..bb73976be3a85da7686d55a2cba8c8da335d2ba9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SERVICES_H_
index ffdab15225c33898e756327f385a0401c7d900ea..c1cd7530770b3db603f5401a1b888a4d9359c9c1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelHighAPI_Tools.h"
@@ -346,6 +345,12 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection
       aShapeType = shapeTypeByStr(aType);
       break;
     }
+    case ModelHighAPI_Selection::VT_WeakNamingPair: {
+      TypeWeakNamingPair aPair = theSelection.typeWeakNamingPair();
+      std::string aType = aPair.first;
+      aShapeType = shapeTypeByStr(aType);
+      break;
+    }
   }
 
   return aShapeType;
@@ -377,7 +382,7 @@ std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType)
   return ""; // bad case
 }
 
-/// stores the features information, recoursively stores sub-documetns features
+/// stores the features information, recursively stores sub-documents features
 std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc,
   std::map<std::string, std::map<std::string, ModelHighAPI_FeatureStore> >& theStore,
   const bool theCompare) // if false => store
@@ -390,7 +395,7 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc,
      }
   }
   // store the model features information: iterate all features
-  int anObjectsCount = 0; // stores the number of compared features for this document to compate
+  int anObjectsCount = 0; // stores the number of compared features for this document to compare
   std::set<std::string> aProcessed; // processed features names (that are in the current document)
 
   // process all objects (features and folders)
@@ -422,7 +427,7 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc,
       ModelAPI_Tools::allResults(aFeature, allResults);
       std::list<ResultPtr>::iterator aRes = allResults.begin();
       for(; aRes != allResults.end(); aRes++) {
-        // recoursively store features of sub-documents
+        // recursively store features of sub-documents
         if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) {
           DocumentPtr aDoc = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aRes)->partDoc();
           if (aDoc.get()) {
@@ -511,21 +516,32 @@ static bool checkDump(SessionPtr theSession,
   return true;
 }
 
-bool checkPythonDump()
+bool checkPythonDump(const checkDumpType theCheckType)
 {
   static const std::string anErrorByNaming("checkPythonDump by naming");
   static const std::string anErrorByGeometry("checkPythonDump by geometry");
+  static const std::string anErrorByWeak("checkPythonDump by weak naming");
 
   static char aFileForNamingDump[] = "./check_dump_byname.py";
   static char aFileForGeometryDump[] = "./check_dump_bygeom.py";
+  static char aFileForWeakDump[] = "./check_dump_weak.py";
 
   SessionPtr aSession = ModelAPI_Session::get();
-  // dump with the selection by names
-  if (!dumpToPython(aSession, aFileForNamingDump, "topological_naming", anErrorByNaming))
-    return false;
-  // dump with the selection by geometry
-  if (!dumpToPython(aSession, aFileForGeometryDump, "geometric_selection", anErrorByGeometry))
-    return false;
+  if (theCheckType & CHECK_NAMING) {
+    // dump with the selection by names
+    if (!dumpToPython(aSession, aFileForNamingDump, "topological_naming", anErrorByNaming))
+      return false;
+  }
+  if (theCheckType & CHECK_GEOMETRICAL) {
+    // dump with the selection by geometry
+    if (!dumpToPython(aSession, aFileForGeometryDump, "geometric_selection", anErrorByGeometry))
+      return false;
+  }
+  if (theCheckType & CHECK_WEAK) {
+    // dump with the selection by weak naming
+    if (!dumpToPython(aSession, aFileForWeakDump, "weak_naming", anErrorByWeak))
+      return false;
+  }
 
    // map from document name to feature name to feature data
   std::map<std::string, std::map<std::string, ModelHighAPI_FeatureStore> > aStore;
@@ -537,10 +553,18 @@ bool checkPythonDump()
     return false;
   }
 
-  // check dump with the selection by names
-  bool isOk = checkDump(aSession, aFileForNamingDump, aStore, anErrorByNaming);
-  // check dump with the selection by geometry
-  isOk = isOk && checkDump(aSession, aFileForGeometryDump, aStore, anErrorByGeometry);
+  bool isOk = true;
+  if (theCheckType & CHECK_NAMING) {
+    // check dump with the selection by names
+    isOk = checkDump(aSession, aFileForNamingDump, aStore, anErrorByNaming);
+  }
+  if (theCheckType & CHECK_GEOMETRICAL) {
+    // check dump with the selection by geometry
+    isOk = isOk && checkDump(aSession, aFileForGeometryDump, aStore, anErrorByGeometry);
+  }
+  if (theCheckType & CHECK_WEAK) {
+    isOk = isOk && checkDump(aSession, aFileForWeakDump, aStore, anErrorByWeak);
+  }
 
   return isOk;
 }
index aa5286d84b46dbcb5a1393ad9aaa899761a25327..d0fc586ca29eba28141ea0089ac37e382c44a8dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_
@@ -168,11 +167,19 @@ ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTy
 MODELHIGHAPI_EXPORT
 std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
 
+/// Enumeration to manage the check python dump modes.
+enum checkDumpType {
+  CHECK_NAMING = 1, ///< check topological naming only
+  CHECK_GEOMETRICAL = 2, ///< check geometrical naming only
+  CHECK_NAMING_AND_GEOMETRICAL = 3, ///< default option, check topological and geometrical dumps
+  CHECK_WEAK = 4, ///< check weak naming only
+};
+
 /// Performs the high level API dump, then closes all and executes the script:
 /// model must be recreated fully, with all attributes
 /// \returns true if check is well done
 MODELHIGHAPI_EXPORT
-bool checkPythonDump();
+bool checkPythonDump(const checkDumpType theCheckType = CHECK_NAMING_AND_GEOMETRICAL);
 
 //--------------------------------------------------------------------------------------
 //--------------------------------------------------------------------------------------
index fb7b26c8fda35d6e85f860929692cdbf2cd54cf9..5fe064643119b75ef3381ddcf34356800ed24ea5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SWIG_H_
index d89e4c754e95234d8e2a00f98362da58e0784f03..aeb773c4e008c64803a1205623addf2ce3b2a39f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -55,9 +54,9 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_1.result(), 6.2)
 SketchConstraintLength_4 = Sketch_1.setLength(SketchLine_8.result(), 4)
 SketchConstraintLength_5 = Sketch_1.setLength(SketchLine_5.result(), 2)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_7r-SketchLine_8f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1__cc"), False)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8f-SketchLine_7r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1"))
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_3][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]__cc"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(0, 0, 4.75)
 SketchCircle_1.setAuxiliary(True)
@@ -73,7 +72,7 @@ SketchLine_9 = Sketch_2.addLine(0, 0, 4.113620667973598, 2.375000000005359)
 SketchLine_9.setAuxiliary(True)
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_9.startPoint())
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchCircle_2.center(), SketchLine_9.endPoint())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), False)
 SketchLine_10 = SketchProjection_4.createdFeature()
 SketchConstraintAngle_1 = Sketch_2.setAngleBackward(SketchLine_9.result(), SketchLine_10.result(), 30)
 SketchMultiRotation_1 = Sketch_2.addRotation([SketchCircle_2.results()[1]], SketchCircle_1.center(), 120, 3)
@@ -173,9 +172,9 @@ SketchProjection_5 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OY"
 SketchLine_15 = SketchProjection_5.createdFeature()
 SketchConstraintCoincidence_28 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_15.result())
 model.do()
-ExtrusionCut_1_objects_1 = [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_3_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_9_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_6_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_18_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_17_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_14_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")]
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
-ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_10_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_8_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_7_2f")]
+ExtrusionCut_1_objects_1 = [model.selection("WIRE", "Sketch_2/Face-SketchCircle_3_2f_wire"), model.selection("FACE", "Sketch_2/Face-SketchCircle_9_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_6_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_18_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_17_2f"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_14_2f_wire"), model.selection("FACE", "Sketch_2/Face-SketchCircle_15_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")]
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
+ExtrusionCut_2_objects_1 = [model.selection("WIRE", "Sketch_2/Face-SketchCircle_11_2f-SketchCircle_15_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_10_2f-SketchCircle_14_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_8_2f-SketchCircle_9_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_7_2f-SketchCircle_6_2r_wire")]
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_1_1")])
 model.do()
 model.end()
index aebb48e5009ff5b78fc983e8e24ad0657c096427..461e9deb2dfd53514641735416a3a3b8cbb3f6dc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -28,7 +27,7 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(-325.90051457976, -18.010291595197, 258.003584159371)
 model.do()
 Sketch_1.result().setDeflection(5e-006)
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
 Extrusion_1.result().setDeflection(0.5)
 model.end()
 
index 00a50f4f52656265733d90793ca8c939a846f2e6..b28c84eaf708dd3ef3a4f33faeb31a863b69c871 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index e27aea8def3643c95be9268e7721e51dc765f2d3..9cd4d42ed66df6bf59b0c01aaa3f71d45821ea20 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index f2e518628e1665cad75df61d74f36e46946b2c66..53a0866b42b16e9d207bb547bd82ab63ef209c9e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 976872031f481fd7d430d70f2270a83830a678b4..8e7e016a399ee3172bc5e802137cd875b8558022 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
diff --git a/src/ModelHighAPI/Test/TestUndoRedo.py b/src/ModelHighAPI/Test/TestUndoRedo.py
new file mode 100644 (file)
index 0000000..fdd69d6
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = model.activeDocument()
+model.do()
+
+Point_2 = model.addPoint(Part_1_doc, 0, 0, 0)
+model.end()
+assert(Part_1_doc.size("Construction") == 1)
+
+model.undo()
+assert(Part_1_doc.size("Construction") == 0)
+
+model.redo()
+assert(Part_1_doc.size("Construction") == 1)
index ee79fe18606b89c6063ec90cd8f5c6b678aee875..ba2d74969d98b9447aff8161b3ac26aed929d023 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UseQtExt)
index d52f7698145a4c6e381023121d294b814a549da2..2dd9cfee7dce753ab21a359c8bb9ea4a44f75aac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_H
index 6c494850fcc51e4de5174cd8b3ab7487703e1c31..0df32aa366746b7a4d24e28f61e87ddd7c5b57ff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_ActionInfo.h>
index 347d1613705c9ccdba189f60a1b77ca5926be098..a8a9ea780a8cf5bfb762e1c91e9ee0dbe4fa33e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_ACTIONINFO_H_
index a49b90966d7ecff79eb743871ce1a9f1b94df8a1..8753ebc69f9a3d13dc6681b803c8fa1d6d0df202 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ActionIntParameter_H_
index d24e6e1260c8ddbacf5714f4530b7c77eaf6b495..4a3b182641fa49ccb17c8659ecd9e67ba8b63bc1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ActionParameter_H_
index 5a12e0efd232b2ee738200a0dac93bfa9cbad38c..04d71178d6ef64310e3081518d4820501845b394 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ActionType_H_
index 1c13dcfa6b49f0a3469831aad869ca859e2749bc..1969ea79fb72db7e90f8fb2d46615178bd00b337 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_BRepOwner.h"
index 31600e41af8e9f3d22b4de8ca89a0e854c109676..d0d082c4b6e03c1a066d3d9f0ebe8cffc2be62b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_BRepOwner_H
index 67b5b6f186eb55d9b6b085ba783c921a4b63a74e..48cf5304f5e4fbd1408813d1b08fdf09e1c1e5de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ChoiceCtrl.h"
index a072cd1adf070e8f557ef4968a18b13f823b042d..6f594e34c2c30d4c5c0c3b04de94dd39474a5239 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ChoiceCtrl_H
index a416bded996ade11022c702f526a90780b5ce32c..040fddbbb4fe5b5473cec7451490c0c0f24e10c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Definitions_H
index 6c0cacd4f6cd23700d06237423ddaec2d3ac413d..22b276fd2d4c84613421ba523d618077e416a7b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_Dialog.h"
index 1118af4fcfcf75a9f1488a7d0772879b7c555b19..4dba535a6cf968714d30c12e87e3e290d53a9ecf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Dialog_H
index abe256fd407277bf7e914daf9a9c92f239f78f9e..6bede9a5cd60595e20081d91c4741a9813d51d23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_DoubleSpinBox.h"
index f5b852e353fbb3277bcc8eb28ef6c5e7485070b8..560995b5a2695e81d03ea0a7d22b09a952680052 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_DOUBLESPINBOX_H_
old mode 100755 (executable)
new mode 100644 (file)
index b7b17db..e68fb01
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Events_H
index 777228b4cc37cdc7200402c097784fb50a97e802..e4fba64381fb061ccefe2bf6a5d582c064841cdc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_Filter.h"
index e9dfa45003e7f588bc5f9f01f6b54ba559b72b67..07e1ee3a08b9add969493c0d6e730bd7671fc9e5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Filter_H
index 9affd228fae7785b63d10cc7e5e4f8f8f9a3f991..3a4d58485de7bec23192b5ea4ebd0be2ebb48d0f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_FilterValidated.h"
index 0085ef5389ad2d754e53b2cc0e29aec0141c6cc5..40f2c5e0cacf6f7d55a2bc6acd7874102e1f2c35 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_FilterValidated_H
index d143f198a068a37616858a7dee48ddc27ca6903d..3e91412e3e1f7de853ff4ba0931bab6edcdcd25b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IErrorMgr.h"
index 13f4c32a5f8696d367f9a9108d72883631360a1e..0bc4a81c0efece5c821ad7d7c2228027e73e9a3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IErrorMgr_H
index fbe2646a072ac27f1027cf3ae15bc871fe83c35c..ac8f98dd626ee3ab5b2e958617bccb7f586f7907 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_IReentrant.h"
old mode 100755 (executable)
new mode 100644 (file)
index 3817abc..90d31cd
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
- // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
 #ifndef ModuleBase_IModule_H
 #define ModuleBase_IModule_H
 
index ecfc637176e02874530980a3a1637180882ac296..f22193278a2405475933f2f723b8418d4e103444 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IPrefMgr.h"
index 5887bc4f70eda22421e4557ac9647a25c4d9df7b..5b87145ca2ff9040be870cd35a84b6177f334186 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IPrefMgr_H
index 719e902cabad726ecbb31bab6fa664592b797fc3..df66658a7e0b9f5c5a0eafbeb45e87acaf630745 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IPropertyPanel.h"
index ac54a352703201c754a23e058b83dc9f44406058..a4f954ea03ad8688b67556100c6d32cce1cff50c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_PROPERTYPANEL_H_
index b54f6e4eee19902ad0652be1c036c71bb2bbe6ac..73999c6011f5549c3cdab609edfd8b749720be8c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ISelection.h"
@@ -34,24 +33,19 @@ void ModuleBase_ISelection::appendSelected(const QList<ModuleBase_ViewerPrsPtr>
 {
   // collect the objects from the viewer
   QObjectPtrList anExistedObjects;
-  QList<ModuleBase_ViewerPrsPtr>::const_iterator aPrsIt = theValuesTo.begin(),
-                                              aPrsLast = theValuesTo.end();
-  for (; aPrsIt != aPrsLast; aPrsIt++) {
-    if ((*aPrsIt)->owner() && (*aPrsIt)->object())
-      anExistedObjects.push_back((*aPrsIt)->object());
+  foreach(ModuleBase_ViewerPrsPtr aPrs, theValuesTo) {
+    if (aPrs->owner() && aPrs->object())
+      anExistedObjects.append(aPrs->object());
   }
 
-
-  QList<ModuleBase_ViewerPrsPtr>::const_iterator anIt = theValues.begin(),
-                                              aLast = theValues.end();
-  for (; anIt != aLast; anIt++) {
-    ObjectPtr anObject = (*anIt)->object();
+  ObjectPtr anObject;
+  foreach(ModuleBase_ViewerPrsPtr aPrs, theValues) {
+    anObject = aPrs->object();
     if (anObject.get() != NULL && !anExistedObjects.contains(anObject)) {
       theValuesTo.append(std::shared_ptr<ModuleBase_ViewerPrs>(
                new ModuleBase_ViewerPrs(anObject, GeomShapePtr(), NULL)));
     }
   }
-
 }
 
 //********************************************************************
index 6954118c8fd71e5a3d025f09297f05d3446b0889..bc21404cc5450462b6288cc6a185162cdb5ba118 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ISelection_H
index c730d7be85b6aff3b1d0f314909c9fae5f5a7f26..a9423ceda8bb26c171bb1109221dd36a30709423 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ISelectionActivate_H
index cef49758a23bc02fe4bc26c59943d222f697c483..630251a560c529459bbd4b420e957a225b7181c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ITreeNode_H
@@ -185,9 +184,14 @@ protected:
       int aIdx;
       int aCount = 0;
       int aSize = myChildren.size();
+      int aMaxCount = aSize * aSize;
       int aShift = 0;
       while (i < aSize) {
         aCount++;
+        // To avoid unlimited cycling
+        if (aCount > aMaxCount)
+          break;
+
         aNode = myChildren.at(i);
         aObject = aNode->object();
         if (aObject.get()) {
@@ -202,9 +206,6 @@ protected:
         else
           aShift++;
         i++;
-        // To avoid unlimited cycling
-        if (aCount > aSize * aSize)
-          break;
       }
     }
   }
index f815cfa5001d627c5227f9db53d0e3ce467de89c..32ac92789e480c0f69dac8a5cfe2de883ad17eb0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IViewWindow.h"
index a741975e8d2e33dd0832c55e358de768581939a2..7118ab114e999c9eb17f5c34089c6daf2ce484e3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IViewWindow_H
index bb514d31fd0f55ce856cfef67811b942e60b66c7..57d5ad0f08bcfc4baaf44abe1b41e211983cc838 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IViewer.h"
index adfa441ecad0352528701b9f628978dee7422d2e..05104257db8f70825ffaa890251e30b1ab0d4a2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IViewer_H
old mode 100755 (executable)
new mode 100644 (file)
index af73f8d..1e5e8ac
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IWidgetCreator.h"
old mode 100755 (executable)
new mode 100644 (file)
index ec1d56e..85219c2
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IWidgetCreator_H
index 636873288c9fe38c1483e670c1fd3953dcc73393..769b404d65f8457f5c3e84d0972626167d03dbda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IWorkshop.h"
index e8cf8b62215e291d3aebbee535a3ebe3cf9eea22..5877823bd074ab06315ddfe0f57bef9cfef17d38 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IWorkshop_H
index a691efd3242079f656ea640db9d3df7c32e8a379..a3be0328f94a86fbd2837fc7114432ecab5614a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IconFactory.h"
index b20fb23c0a55846a8fe187756733552a4ddb760c..8257ebb3332980516d1b61c8f9f74112e88cb6a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_IconFactory_H
old mode 100755 (executable)
new mode 100644 (file)
index 31ac636..bfaa15a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_IntSpinBox.h"
old mode 100755 (executable)
new mode 100644 (file)
index 839cdee..fd6ef5b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_INT_SPINBOX_H_
index 563d04da38b26c3a2897e13feb7fed2867c898f4..a55162391275ba6de6bd5c6da7e28ec9e6fa1051 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_LabelValue.h>
index 373fd0b50e38b44a629680e1ca1fe30111927c56..bdb135143f972211f65fa9872c4bde9e6cc16572 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_LabelValue_H
index a245b9e6f49d7147f2fc6d3a1ab045a87e3974ac..d9fe13d2c18339a17daaafebe041484adacb8e43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ListView.h"
index 9fdc540adccb7de0cbb856d30ddd964f89b9b26d..aa973845e1c4ce44c5058e03ed309a308182eead 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ListView_H_
index 7ce788e86d97c07042ab6986ae4645afddda0713..4547ec9c6c593c67bb5b505c1f7f45f409d7bed5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_MODELDIALOGWIDGET_H
index 50c7734d280c69e7af1b38b516efb322c6be5353..dd17a65d83edddf770475a99311d68f2f03732a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ModelWidget.h"
index d2d0fd804b4d7337f486c23d3334ee329c7d43a2..0e6514374c929724c59082a40929f8efe00805a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_MODELWIDGET_H
index 91be0c34cb2221b98cd5ea8aab98fcd1509288ea..b4f4a38b05296e9a20a94d30cabc41198ee4a188 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_Operation.h"
index 4ea8c6c4493267c41597323cf0d420e1b80768ba..845f6368608e555ef9890aa7b0fcba0ed7fda172 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Operation_H
old mode 100755 (executable)
new mode 100644 (file)
index 626584b..c55c693
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_OperationAction.h"
old mode 100755 (executable)
new mode 100644 (file)
index 5e67669..35b9acf
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_OperationAction_H
index 1ca98fbc0e699b6da191e56e8815949116e6c1e1..565223e7f0b8663fdf45bf8f9a186151a1daa760 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_OperationDescription.h>
index 66e1a94fccede5280b4b48da6eb72f2e739e09c5..daeb3f37c603dd32d17b2e4ffd9200cf6754121b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_OPERATIONDESCRIPTION_H
old mode 100755 (executable)
new mode 100644 (file)
index a1346eb..47344a7
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_OperationFeature.h"
old mode 100755 (executable)
new mode 100644 (file)
index 0bdca8f..4eaceb4
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_OperationFeature_H
index d48bf062bacafb97c83b659d2982690356a75f98..118ad800f65f7a4b13179c83d3880d4b8ff51627 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_PageBase.h>
index 7dc6a6dd8c337c27100033316e5c80e2a40ddd16..5bab9b7a3b7e985cef9ba96da047ce8e9596c425 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_PAGEBASE_H_
index 9cb505a671885c60ced674f19a3220bcbe6d7693..b4cbe93290d2899cd2cfc55bcae01470782ad7be 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_PageGroupBox.h>
index 47bfe8ec317cdc0c9ed294dcb0e57d7ce008a04c..0babd6b9613be591330056a34ef314c0c2b5f3a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_PAGEGROUPBOX_H_
index fcb4f81983b621c323526f1855c62df63751a861..1fbcf01e5d6cc574bf12118a47cbdd6b80144e8f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_PageWidget.h>
index ad49fcc7a8e0a32e407df53061ede2299f567065..353887eb157596cccb003557891eb0183b04e565 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_PAGEWIDGET_H_
index 586b33b816198237cb51876b2f99ae7423484b86..e9461b7e7fbbfc117a03e8ebc3aaffeddf52a1b2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_PagedContainer.h>
index 689e0ca9aa7a451ccb7f81a0d2fd8e92acf521fe..feaaa79d8670cf321c5c30e1e2867042f7db5b81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_PAGEDCONTAINER_H_
index 768cf2313ba38b651f8b5f371188eac61f7615f9..e99107377e0a92b9872607a62eec816d3c863408 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ParamIntSpinBox.h"
index 1249ac38010e4f0125864545ffabd5510e3d9b64..2749b825c06b7a383bed5a4cd1337e67711dfb8d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ParamIntSpinBox_H
index 9990dfd200548ecfbe47a7075ecbbd4223c695f8..e7836e656126d0378c8c3e5befcee38549d4de70 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ParamSpinBox.h"
index 8437b746cc8967641c7de81f8cbf7b7316f72795..0e3decee8785ac7cde159dea0cd08842fb6ec89e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ParamSpinBox_H
index e53ec5088b4bacf67ab1935268734f1c55f6813d..a0706030229709d04790bebc96c7cc9274d4da9f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_Preferences.h"
index 1fcb0d8ea2da349b9051f6a3ef68b6373e63d8c8..59badbfacd72280ee0071cd044d37ec68f734083 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Preferences_H
old mode 100755 (executable)
new mode 100644 (file)
index 035d6c5..11ab42d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ResultPrs.h"
index f22cfb1f85769a65bf861352c8d7e27dbc0ceee3..5faaadf2b53d65901918f2dbd9fbca06daa95e65 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ResultPrs_H
index 6cf0e8e975c2c10630c41d78e0dcaffef2a73a98..333000a1d4f1e3f204ab871664d458b6eb503904 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_SelectionValidator.h>
index d522e4878908a42110e827d4228b0cc11d91dbe4..a4a82c613ec7dfe99c04cfbcddacc7ed37e40c2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_SelectionValidator_H
index 27197a7edeb54d3c5474c4a9d0fb1960d54eff74..8618e3b3488e2487506a0938af04b54bc3338fd8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_ToolBox.h>
index 49e23af96af9a0f7a45e72760087537a1f86707d..05fe006a95e416988b9433d663eed50100bb203b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ToolBox_H
old mode 100755 (executable)
new mode 100644 (file)
index a60e3c2..4a85e1c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_Tools.h"
old mode 100755 (executable)
new mode 100644 (file)
index b294344..4005899
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_Tools_H
index ccb8eae4cc447bde125151e06e6a552a8defd67a..70b885f451047bdd8fe1d487169c19824e0a2443 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ViewerFilters.h"
index a5e7d336470ce4e942e005fad160b76069abbbfa..7481d9f5d0a29f4ec0641d359431fd32404fb70b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ViewerFilters_H
index d1988484dcc612de7ce9228478555273c47d6e85..f41bd4bfc514285237d805a39658e4acdeb2a9c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_ViewerPrs.h"
index 443c69084b332e867a2a4d80d51abc812fd3b6d8..b2fec4bfb56218b9508a4e1544cc76312480a334 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_ViewerPrs_H
old mode 100755 (executable)
new mode 100644 (file)
index c353c44..917f27f
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetAction.h>
old mode 100755 (executable)
new mode 100644 (file)
index 6edb7e8..a5ab2f0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetAction_H
index d06de842b93224b071d465d4198473babfe775a6..81d8241a31cb757a9a7153e4b233d6c9593ab13d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetBoolValue.h>
index 36b3b62ef2704d8235aae5026b11fe3f65575383..f3c6368a10796e47133fc43c549a2539771ea0e7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetBoolValue_H
index c2d15b828e4bccf2b70aa19a3f9f4fe429f39321..ce893667e3841abbb6daa6e28efb0d1d86c6487f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetChoice.h"
index dedec5978840d357fa56ac0642bbcad4866d23d7..687f57c662a21a719d6b654c84f52d87cb1d728a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetChoice_H
index 660d69f3fedd78aa73281ba01e28cd51474d3723..5154ea04a4410abce48dca8522c6c22579351dcf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetConcealedObjects.h>
index 9c613b99adaf5ba5e62ac7a6459c0c78999c9d0b..9d38d836a99cb85932fd42d17abdf99eb3b13866 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETCONCEALEDOBJECTS_H_
old mode 100755 (executable)
new mode 100644 (file)
index b44e6bf..946a282
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetCreatorFactory.h>
old mode 100755 (executable)
new mode 100644 (file)
index 0f186bf..66c229a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETCREATORFACTORY_H_
index 0f521b50aa97c82aac3a6f4b5f7cecfc26843eef..4b0e41daa5be7e11d1c94dbcd10b85f36eee2b1b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_Keywords.h>
index 595cb8590bc8a7270f549122c8a67d0f0f02afd5..4854ffe7a89934b68c714eb7b2f5c9bbacd3eb71 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetDoubleValue_H
index adadd23b0f24dc6a7e3dda54df8915005ed70247..017298b9634edfee11b217ea3b20aa68250e61f8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetEditor.h>
index 4c485d19974c8543045c5be5a6c38d22b5fecb19..c8f958a1a1d5431ca2fabaa3284856ebe9ccc55b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetEditor_H
index b9099882564f192633f3a7e244af3347587748a7..51f982cb0528894d35960ab8e202b153c78f90ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetExprEditor.h>
index 310021975840233f1702942a2edbd228b0aeeb44..aa14717fcbf81d7740ab0ac49a2011d95ecd3bb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETEXPREDITOR_H_
index af75ebd125bef3e64edd9aedf62c634a1d965e6f..919ef16a762d5019825ca454cd3a255ae46d6def 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetFactory.h>
index bc9c5d8307c6342f4c56573bded1923846d18c37..90ea7428b54936be913a9ce98774de8ac8479f14 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETFACTORY_H_
index aeebdfa1e81af6de738978d89718fdc9d12e942b..c9685bbf0c1d6de5fe22c92fbf233e234cf1b900 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetFeatureSelector.h>
index f4166d35b66277c75e66d779677c04a31482f160..4534c9bc9c8c169ebd6d18163d59d2171f00dfc4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetFeatureSelector_H
index 85b1772b0a036a417398a0e56e08bc68901189e3..531b7fa80f6e8da55c8fb52adf872256d72639ed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_AttributeString.h>
@@ -66,6 +65,7 @@ ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent,
   aMainLay->addWidget(aTitleLabel, 0, 0);
   myPathField = new QLineEdit(this);
   aMainLay->addWidget(myPathField, 1, 0);
+
   QPushButton* aSelectPathBtn = new QPushButton("...", this);
   aSelectPathBtn->setToolTip(tr("Select file..."));
   aSelectPathBtn->setMaximumWidth(20);
@@ -94,7 +94,7 @@ bool ModuleBase_WidgetFileSelector::storeValueCustom()
   DataPtr aData = myFeature->data();
   AttributeStringPtr aStringAttr = aData->string(attributeID());
   QString aWidgetValue = myPathField->text();
-  aStringAttr->setValue(aWidgetValue.toStdString());
+  aStringAttr->setValue(aWidgetValue.toStdWString());
   updateObject(myFeature);
   return true;
 }
@@ -107,11 +107,13 @@ bool ModuleBase_WidgetFileSelector::restoreValueCustom()
   DataPtr aData = myFeature->data();
   AttributeStringPtr aStringAttr = aData->string(attributeID());
 
-  bool isBlocked = myPathField->blockSignals(true);
-  QString aNewText = QString::fromStdString(aStringAttr->value());
-  if( myPathField->text() != aNewText )
-    myPathField->setText( aNewText );
-  myPathField->blockSignals(isBlocked);
+  char16_t* aStr = aStringAttr->valueU();
+  QString aNewText = QString::fromUtf16(aStr);
+  if (myPathField->text() != aNewText) {
+    bool isBlocked = myPathField->blockSignals(true);
+    myPathField->setText(aNewText);
+    myPathField->blockSignals(isBlocked);
+  }
 
   return true;
 }
@@ -162,7 +164,7 @@ void ModuleBase_WidgetFileSelector::onPathSelectionBtn()
       if (!aFileName.isEmpty()) {
         if (myType == WFS_SAVE)
           aFileName = applyExtension(aFileName, mySelectedFilter);
-        myPathField->setText(aFileName);
+        myPathField->setText(aFileName.toUtf8());
         myDefaultPath = QFileInfo(aFileName).absolutePath();
         emit focusOutWidget(this);
       }
index 28e31619a6ff321ee4b89bcbf8241d2716d16914..0d048d0c20a925ea65358d2e8655fe0cc54258d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETFILESELECTOR_H_
index fa8a77159e5bff3469b4e816fa4e245c5359f3eb..0e131bb1dc8dda8766947714177e795ea9a01e38 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetIntValue.h>
index 4637af46c6d01f6d1398e9067f4e3a9625b3af86..7fb7d13f487663b4c6f369ca6c3bd024e4ff33d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetIntValue_H
index 75b49843fa54c419da7ae49c3594d27b9559e644..af8063f6abc936d0487bb6d8f7d77ff040556f33 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetLabel.h"
index 714f1e3cc182d37853ec0a26bbb7175ec6aa29a8..d213820cabbd8ac98e36fe9dbb5f10d5466c3151 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetLabel_H
index b568871140d0dab8cc826e82621cf6a4c9f4c321..83dc65f57068644313d1bbc314cdd56acd632fdf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetLabelValue.h"
index a50d6ec42be59eccc3983ac0cece7f90edb4f61e..cb7c2f0d2932b1f0de5d22a1ed919b0e57ac266c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetLabelValue_H
index 69f47b081e45a9a87340d0fcdf5453f9fa8f34a0..8003a76f542cefc90bd670b3b78dbdb31fe96dde 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetLineEdit.h>
index 1ce71ef22e61700e4c7a2c005e43821a86fcb92f..05d6b1ed577d76469d61f67f42e0d4b29e27776c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETLINEEDIT_H_
old mode 100755 (executable)
new mode 100644 (file)
index d81556a..675b2f0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetMultiSelector.h>
@@ -62,6 +61,7 @@
 #include <QClipboard>
 #include <QTimer>
 #include <QMainWindow>
+#include <QCheckBox>
 
 #include <memory>
 #include <string>
@@ -159,11 +159,17 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
 
   aMainLay->addWidget(myListView->getControl(), 2, 0, 1, -1);
   aMainLay->setRowStretch(2, 1);
-  //aMainLay->addWidget(new QLabel(this)); //FIXME(sbh)???
-  //aMainLay->setRowMinimumHeight(3, 20);
-  //this->setLayout(aMainLay);
   connect(myTypeCtrl, SIGNAL(valueChanged(int)), this, SLOT(onSelectionTypeChanged()));
 
+  bool aSameTop = theData->getBooleanAttribute("same_topology", false);
+  if (aSameTop) {
+    myGeomCheck = new QCheckBox(tr("Add elements that share the same topology"), this);
+    aMainLay->addWidget(myGeomCheck);
+    connect(myGeomCheck, SIGNAL(toggled(bool)), SLOT(onSameTopology(bool)));
+  }
+  else
+    myGeomCheck = 0;
+
   myIsNeutralPointClear = theData->getBooleanAttribute("clear_in_neutral_point", true);
   if (myShapeTypes.size() > 1 || myIsUseChoice) {
     if (defaultValues.contains(myFeatureId + attributeID())) {
@@ -240,9 +246,9 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom()
     return false;
 
   AttributePtr anAttribute = myFeature->data()->attribute(attributeID());
+  AttributeSelectionListPtr aSelectionListAttr = myFeature->data()->selectionList(attributeID());
   std::string aType = anAttribute->attributeType();
   if (aType == ModelAPI_AttributeSelectionList::typeId()) {
-    AttributeSelectionListPtr aSelectionListAttr = myFeature->data()->selectionList(attributeID());
     // Restore shape type
     std::string aSelectionType = aSelectionListAttr->selectionType().c_str();
     if (!aSelectionType.empty()) {
@@ -251,6 +257,8 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom()
       myIsFirst = false;
     }
   }
+  if (myGeomCheck)
+    myGeomCheck->setChecked(aSelectionListAttr->isGeometricalSelection());
   updateSelectionList();
   return true;
 }
@@ -939,6 +947,8 @@ bool ModuleBase_WidgetMultiSelector::findInSelection(const ObjectPtr& theObject,
                               const std::map<ObjectPtr, std::set<GeomShapePtr> >& theGeomSelection,
                               ModuleBase_IWorkshop* theWorkshop)
 {
+  if (!theObject.get())
+    return false;
   // issue #2154: we should not remove from list objects hidden in the viewer if selection
   // was done with SHIFT button
   if (theWorkshop->hasSHIFTPressed() && !theObject->isDisplayed())
@@ -1040,4 +1050,15 @@ void ModuleBase_WidgetMultiSelector::onListActivated()
 {
   //focusTo();
   emitFocusInWidget();
-}
\ No newline at end of file
+}
+
+void ModuleBase_WidgetMultiSelector::onSameTopology(bool theOn)
+{
+  AttributePtr anAttribute = myFeature->data()->attribute(attributeID());
+  std::string aType = anAttribute->attributeType();
+  if (aType == ModelAPI_AttributeSelectionList::typeId()) {
+    AttributeSelectionListPtr aSelectionListAttr = myFeature->data()->selectionList(attributeID());
+    aSelectionListAttr->setGeometricalSelection(theOn);
+    updateObject(myFeature);
+  }
+}
old mode 100755 (executable)
new mode 100644 (file)
index 1a40c13..f65d09a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETMULTISELECTOR_H_
@@ -37,6 +36,7 @@
 #include <QMap>
 
 class QWidget;
+class QCheckBox;
 //class QComboBox;
 class ModuleBase_ListView;
 class ModuleBase_IWorkshop;
@@ -132,6 +132,8 @@ protected slots:
 
   void onListActivated();
 
+  void onSameTopology(bool theOn);
+
 protected:
   /// Returns true if the event is processed. The default implementation is empty, returns false.
   virtual bool processDelete();
@@ -247,6 +249,8 @@ protected:
 
   bool myIsFirst;
   std::string myDefMode;
+
+  QCheckBox* myGeomCheck;
 };
 
 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */
index d12f7c9ed2dea948e6018885c36dff55954358e2..7ee2e2cd1b83669281ea3481bc10883854990846 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetNameEdit.h"
index d72fd7b9490ae0341c52898e454393df6d8808f1..7c24b40066489263621369c4c7206b9409bd16f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETNAMEEDIT_H_
old mode 100755 (executable)
new mode 100644 (file)
index c035f02..edfd91b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetOptionalBox.h>
old mode 100755 (executable)
new mode 100644 (file)
index b2d9fb8..d5ecaf2
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetOptionalBox_H_
index 7d8596556b0eaf6a7c47c734fd3e4057ad04db4d..faf5ff52791e14db8726cac27fafe84c1298773d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetPointInput.h"
@@ -219,16 +218,19 @@ QIntList ModuleBase_WidgetPointInput::shapeTypes() const
 
 //********************************************************************
 bool ModuleBase_WidgetPointInput
-::setSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs)
+::setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
+  const bool theToValidate)
 {
-  GeomShapePtr aShape = thePrs->shape();
-  if (aShape->isVertex()) {
-    GeomVertexPtr aVertex(new GeomAPI_Vertex(aShape));
-    GeomPointPtr aPnt = aVertex->point();
-    myXSpin->setValue(aPnt->x());
-    myYSpin->setValue(aPnt->y());
-    myZSpin->setValue(aPnt->z());
-    return true;
+  if (theValues.size() == 1) {
+    GeomShapePtr aShape = theValues.first()->shape();
+    if (aShape.get() && aShape->isVertex()) {
+      GeomVertexPtr aVertex(new GeomAPI_Vertex(aShape));
+      GeomPointPtr aPnt = aVertex->point();
+      myXSpin->setValue(aPnt->x());
+      myYSpin->setValue(aPnt->y());
+      myZSpin->setValue(aPnt->z());
+      return true;
+    }
   }
   return false;
 }
index bae10d61a71ca2af8a2a6d763f2e911d5224a037..a793248da13b92266ce9f985220feb4fb0b70206 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetPointInput_H
@@ -61,7 +60,8 @@ public:
 
   /// Fills the attribute with the value of the selected owner
   /// \param thePrs a selected owner
-  virtual bool setSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs);
+  virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
+    const bool theToValidate);
 
 protected:
   /// Retunrs a list of possible shape types
index f939ad513bcde9b2e3a1aecdf057bb2ba3ab8289..f872e4ec04da7a96c00d648c2c3cade136e098b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetRadiobox.h>
index 29c42cfdc97d01dfb2766806f9c9d1f6554e0248..6f69513c6f8b38edb8c08fcf7e39100498a29768 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETRADIOBOX_H_
old mode 100755 (executable)
new mode 100644 (file)
index ec0e2bf..b0c30bb
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetSelector.h>
old mode 100755 (executable)
new mode 100644 (file)
index ffc9ff1..904647f
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetSelector_H
old mode 100755 (executable)
new mode 100644 (file)
index dd4d94c..1e409ee
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetSelectorStore.h>
old mode 100755 (executable)
new mode 100644 (file)
index 86ee63d..36ed504
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetSelectorStore_H
index f3a2fb50ca9e90d73f60b41cc37179c353934641..e5ea9338995ae5ac20362446cbfc2a8d0a26f6f2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetShapeSelector.h>
index 4c2b2dad416be513ad6aed7eeb513536359c53fa..61b51810d7195af48e38ede379e287e989658e27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetShapeSelector_H
index 11d4be0d737b207c23224c7bdb67f9315aece8c7..405ddc1984038896cfa15fe9f562e27aa432a559 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetSwitch.h>
index 065df920ec9e80c51b29576c202e4989e2ab9332..5bb47c201bb95a340b275523a325c393f275928a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETSWITCH_H_
index 0827a699fa0b36acdb7b6dc91b9d977a4ea1bc27..188e2f0126cb2460869918fabfb92ad8039cba21 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetToolbox.h>
index 5b8c1e6d770addfcee276d84f10845d78fe7b926..c268f1751acd33e2a6b9951394a9f8791ff3d839 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETTOOLBOX_H_
index 6fbd9b1749203f2bb5d23bf7a158f41070e96898..9c00ba201bc2d250ba9188088a44bbb49d92dbd3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetValidated.h>
@@ -130,7 +129,8 @@ bool ModuleBase_WidgetValidated::isValidInFilters(const ModuleBase_ViewerPrsPtr&
             std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(anAttr);
           aSelectAttr->setValue(myPresentedObject, GeomShapePtr(), true);
           GeomShapePtr aShape = aSelectAttr->value();
-          if (!aShape.get() && aSelectAttr->contextFeature()->firstResult().get()) {
+          if (!aShape.get() && aSelectAttr->contextFeature().get() &&
+            aSelectAttr->contextFeature()->firstResult().get()) {
             aShape = aSelectAttr->contextFeature()->firstResult()->shape();
           }
           if (aShape.get()) {
index afff4dc673c2ead7658c88abc83d9d6a461f50b6..19f7fff888662fd47f219eae5fc5c870503e26a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef MODULEBASE_WIDGETVALIDATED_H_
old mode 100755 (executable)
new mode 100644 (file)
index 8953db0..512d563
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModuleBase_WidgetValidator.h>
old mode 100755 (executable)
new mode 100644 (file)
index 8c7c927..778ae77
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ModuleBase_WidgetValidator_H_
index 3019a9095f1c4961f46ca608eaeb7ecb2be07d6c..4d561918fa43e15caccb69af2da3675499a96730 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index dd20cd55cdea545a305f52f0e39d92e7e0fb227c..9bc410efa5c9dab1a72419cd0994040426f4d5b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSAPI_H
index 8fa77c35b71b8e52647f22f8c5e0a62a8c807f3a..f23dc25965306c0e6506c00662d13bb8bbff5679 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* ParametersAPI.i */
index dac7f0aa30707da709887f763c9753fce9f98b7d..2af3eec68d1bd59e38dd6436496423c4f77fb9c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ParametersAPI_Parameter.h"
@@ -23,6 +22,7 @@
 #include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 #include <ModelAPI_ResultParameter.h>
+#include <ModelAPI_Events.h>
 //--------------------------------------------------------------------------------------
 ParametersAPI_Parameter::ParametersAPI_Parameter(
     const std::shared_ptr<ModelAPI_Feature> & theFeature)
@@ -92,3 +92,14 @@ ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ParametersAPI_Parameter::ID());
   return ParameterPtr(new ParametersAPI_Parameter(aFeature, theName, theExpression, theComment));
 }
+
+//--------------------------------------------------------------------------------------
+void removeParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
+                     const ParameterPtr & theParameter)
+{
+  FeaturePtr aParam = theParameter->feature();
+  if (aParam) {
+    ModelAPI_ReplaceParameterMessage::send(aParam, 0);
+    thePart->removeFeature(aParam);
+  }
+}
index 7abc34850c0fd9a3123d5e9f853f3914bc0a1ad5..f9c0e236a9133a6c0a3fdeb2f3498738891dc6a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_
@@ -83,6 +82,13 @@ ParameterPtr addParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
                           const std::string & theExpression,
                           const std::string & theComment = std::string());
 
+/**\ingroup CPPHighAPI
+ * \brief Remove Parameter feature and substitute it by the value in referred features
+ */
+PARAMETERSAPI_EXPORT
+void removeParameter(const std::shared_ptr<ModelAPI_Document> & thePart,
+                     const ParameterPtr & theParameter);
+
 //--------------------------------------------------------------------------------------
 //--------------------------------------------------------------------------------------
 #endif /* SRC_PARAMETERSAPI_PARAMETERSAPI_PARAMETER_H_ */
index 784c815da2bab3de67b912d84a49cf8bc1a0a17f..5f8e484b215810ecf19e9aceb8c51ee08ff1de4d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_PARAMETERSAPI_PARAMETERSAPI_SWIG_H_
index 8cc950e41978a2e7711300aad7e61609bdfecb18..17aa1caabf0bbf73ac3c2751b728488e6e023fc1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -116,6 +115,9 @@ INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES})
 ADD_UNIT_TESTS(TestParameterCreation.py
                TestParameterRename.py
                TestParameterChangeValue.py
+               TestParameterDelete.py
+               TestParameterErrorMsg.py
+               TestParametersMgr.py
                Test1806.py
                Test2392.py
                Test2474.py
index 685254c313993cf01be1486c631b2775e862165f..8b34454f11207da3f938f85e531a4631509fedd9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSPLUGIN_H
index cc299083317be073bda56b3ab5da4bda2d24feca..513cabf11085b62902e992cdfeb249b68b5feb2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
@@ -48,7 +47,7 @@
 //------------------------------------------------------------------------------
 // Tools
 
-std::string toStdString(double theValue)
+static std::string toStdString(double theValue)
 {
   std::ostringstream sstream;
   sstream << theValue;
@@ -59,7 +58,7 @@ std::string toStdString(double theValue)
   return sstream.str() + aPnt;
 }
 
-std::set<std::string> toSet(const std::list<std::string>& theContainer)
+static std::set<std::string> toSet(const std::list<std::string>& theContainer)
 {
   return std::set<std::string>(theContainer.begin(), theContainer.end());
 }
index 5f3b9edba36235bae220849d3db6c0c2a6bdb05e..57148ee8036b65a02ebf579dfa876246dcf851f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_PARAMETERSPLUGIN_EVALLISTENER_H_
index ab128d10b10b83c16f0809eda0fb81206001f9c2..2c793535ed56b797ebe4346fc301c1e426838488 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
index 12d473f3d67b130d6e1bb165ae894d4b443786bd..649e46d2598f6056db45f31c84141f8a919c2254 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSPLUGIN_PARAMETER_H_
index cedd90f3ce20cadacfcd96028d9194a8e74cdd69..c212b930d72de22c42d2670926ac57ccdd97bfab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
index 19d00b39addb6f7b56c1266024d502cd451ef723..fec5919205b40f892a62c9b0d225d2fcd5f20ee6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSPLUGIN_PARAMETERSMGR_H_
index 27f864608e5cbc20c3134811e8834cd81133d5ab..b11f2f279e58b27787218a170d8697406b3f92e6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <pyconfig.h>
index 1dd0dff3f10449a7e8bfa248c4cb0849c644b9fc..eb12aa8da4745f1da893952353cbae3008f73929 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSPLUGIN_PLUGIN_H_
index aaa647d9d124d502a4576e52fd2f3c9ae4ffbcdf..1b47e66b6f6e499403ba88aa3a5dbb0b8137499e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ParametersPlugin_Validators.h>
@@ -100,8 +99,6 @@ bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttrib
                                                    Events_InfoMessage& theError) const
 {
   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
-  ResultParameterPtr aParam =
-      std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aFeature->firstResult());
 
   AttributeStringPtr aStrAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
@@ -116,11 +113,6 @@ bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttrib
     return false;
   }
 
-  if (!aParam.get()) {
-    theError = "Result is empty.";
-    return false;
-  }
-
   theError = aFeature->string(ParametersPlugin_Parameter::EXPRESSION_ERROR_ID())->value();
   return theError.empty();
 }
index 60c763689011556eb56f8a2dd41829903b9f0555..c8e487d3a0ad3138b9a959e1c476cf9cedf62487 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
index 6f5edd065d70e27ec1f54f9f551c94c0779f98eb..a144ce7398608a6f05ee0c041363510335f94337 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ParametersPlugin_WidgetCreator.h>
index a90bc97c6b3216640dfaac5ea0278dc3fae457b6..22f4759a659e1dc0e645a2ea3bb7808e60b19649 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ParametersPlugin_WidgetCreator_H
index d31439d406c56b3631f462df94793bca4593a831..a08b1572bd5d343b85e313cd1fdb33c99c4cec64 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ParametersPlugin_WidgetParamsMgr.h"
@@ -298,6 +297,11 @@ bool ParametersPlugin_WidgetParamsMgr::storeValueCustom()
     }
     aId++;
   }
+  // #2813 : make the current feature the latest in the document
+  std::list<FeaturePtr> allFeatures = myFeature->document()->allFeatures();
+  if (!allFeatures.empty()) {
+    myFeature->document()->setCurrentFeature(*(allFeatures.rbegin()), true);
+  }
   return true;
 }
 
index 98d0aefff41bf10bb264d96a7857697c3173072a..444cd0cfbb5317ebe83a09043f91e7b9cabd0586 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef ParametersPlugin_WidgetParamsMgr_H_
old mode 100755 (executable)
new mode 100644 (file)
index 19274803867f95b6e7f08dac188dea9a1ce4444d..208fcdb2381d37c29ec2c5915439cbf29c833cbf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
       Test1806.py
index 280b62e991bfd7afcca8ff1e9afac97de64feea1..b328c7f48654c42758639a8c7ed097db76abe817 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index bd2b659b0eeb274c00c33939ac85e3e0327dac1c..9235621366f1b325661107cb56156946989b6095 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 3f9a8bf56e18d61d11a7bb1b4ff97652ebaa55fe..f6816c87b5b637d7c65ad62fd887a63dadaae682 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestParameterCreation.py
index 3e5b38c1f4b35ccf7c12db7ee4f4d70f96ccc1ca..2fca977bf2dacc615bd977d9ff35ba31c84e05a2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestParameterCreation.py
diff --git a/src/ParametersPlugin/Test/TestParameterDelete.py b/src/ParametersPlugin/Test/TestParameterDelete.py
new file mode 100644 (file)
index 0000000..744f8fc
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from ModelAPI import *
+import math
+
+def assertLineLength(theLine, theLength):
+    dx = theLine.startPoint().x() - theLine.endPoint().x()
+    dy = theLine.startPoint().y() - theLine.endPoint().y()
+    assert(math.fabs(dx**2 + dy**2 - theLength**2)  < 1.e-8), "Line length {} is not equal to expected {}".format(math.sqrt(dx**2 + dy**2), theLength)
+
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+ParamLen = model.addParameter(Part_1_doc, "Len", "100")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(0, -30, 100, -30)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "Len")
+model.do()
+
+aLength = ParamLen.value()
+assertLineLength(SketchLine_1, aLength)
+
+# delete parameter
+model.removeParameter(Part_1_doc, ParamLen)
+model.do()
+
+# move line and check the constraint is still here
+SketchLine_1.startPoint().setValue(SketchLine_1.startPoint().x() + 10., SketchLine_1.startPoint().y())
+model.do()
+assertLineLength(SketchLine_1, aLength)
+
+model.end()
diff --git a/src/ParametersPlugin/Test/TestParameterErrorMsg.py b/src/ParametersPlugin/Test/TestParameterErrorMsg.py
new file mode 100644 (file)
index 0000000..bab95f0
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+# check error on empty name
+Param1 = model.addParameter(partSet, "", "100")
+assert(Param1.feature().error() != "")
+# check error on empty value
+Param2 = model.addParameter(partSet, "L", "")
+assert(Param2.feature().error() != "")
+# check error if name is not variable
+Param3 = model.addParameter(partSet, "100", "100")
+assert(Param3.feature().error() != "")
+# check error on wrong value expression
+Param4 = model.addParameter(partSet, "N", "+-.so&@")
+assert(Param4.feature().error() != "")
+model.end()
index 703ee35d1a39e2d0ba9ef4e41e3c61a5396b9fd2..a0d87a3f1362457a839b0a3f4da1929a2dc86963 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestParameterCreation.py
@@ -63,7 +62,11 @@ __updated__ = "2015-04-27"
 class TestParameterRename(unittest.TestCase):
     def setUp(self):
         self.aSession = ModelAPI_Session.get()
-        self.aDocument = self.aSession.moduleDocument()
+        model.begin()
+        partSet = self.aSession.moduleDocument()
+        Part = model.addPart(partSet)
+        model.end()
+        self.aDocument = Part.document()
         self.createParameters()
         self.createFeature()
 
@@ -73,8 +76,8 @@ class TestParameterRename(unittest.TestCase):
         pass
 
     def createParameters(self):
-        ltNames = ["x1", "y1", "x2"]
-        ltExpressions = ["150.", "200.", "x1 + y1 + 100.0"]
+        ltNames = ["x1", "y1", "x2", "n", "px"]
+        ltExpressions = ["150.", "200.", "x1 + y1 + 100.0", "5", "50"]
         self.dtParams = {}
         for name, expr in zip(ltNames, ltExpressions):
             self.aSession.startOperation()
@@ -123,8 +126,7 @@ class TestParameterRename(unittest.TestCase):
         anEndPoint = geomDataAPI_Point2D(anOY.attribute("EndPoint"))
         aStartPoint.setValue(0., 0.)
         anEndPoint.setValue(0., 100.)
-        anOYRes = modelAPI_Result(self.aDocument.objectByName("Construction", "OY"))
-        anOY.selection("External").setValue(anOYRes, anOYRes.shape())
+        anOY.selection("External").selectSubShape("EDGE", "PartSet/OY")
         anOY.execute()
         refattrB.setObject(modelAPI_ResultConstruction(anOY.firstResult()))
         valueX = aDistanceConstraint1.real("ConstraintValue")
@@ -140,8 +142,7 @@ class TestParameterRename(unittest.TestCase):
         anEndPoint = geomDataAPI_Point2D(anOX.attribute("EndPoint"))
         aStartPoint.setValue(0., 0.)
         anEndPoint.setValue(100., 0.)
-        anOXRes = modelAPI_Result(self.aDocument.objectByName("Construction", "OX"))
-        anOX.selection("External").setValue(anOXRes, anOXRes.shape())
+        anOX.selection("External").selectSubShape("EDGE", "PartSet/OX")
         anOX.execute()
         refattrB.setObject(modelAPI_ResultConstruction(anOX.firstResult()))
         valueY = aDistanceConstraint2.real("ConstraintValue")
@@ -164,6 +165,41 @@ class TestParameterRename(unittest.TestCase):
         self.assertEqual(self.anCircleCentr.y(), 170.)
         self.assertEqual(aRadiusAttr.value(), 150.)
 
+        # add a line and rotate it around origin
+        self.aSession.startOperation()
+        aSketchLine = aSketchFeature.addFeature("SketchLine")
+        aStartPoint = geomDataAPI_Point2D(aSketchLine.attribute("StartPoint"))
+        aEndPoint = geomDataAPI_Point2D(aSketchLine.attribute("EndPoint"))
+        aStartPoint.setText("px", "0")
+        aEndPoint.setValue(0., 0.)
+        self.aSession.finishOperation()
+        self.aSession.startOperation()
+        aEndPoint.move(100., 0.)
+        self.aSession.finishOperation()
+
+        self.aSession.startOperation()
+        aMultiRotation = aSketchFeature.addFeature("SketchMultiRotation")
+        aMultiRotation.reflist("MultiRotationList").append(aSketchLine.lastResult())
+        aMultiRotation.refattr("MultiRotationCenter").setAttr(anCircleCentr)
+        aMultiRotation.real("MultiRotationAngle").setValue(60.0)
+        aMultiRotation.string("AngleType").setValue("SingleAngle")
+        aMultiRotation.boolean("MultiRotationReversed").setValue(False)
+        aMultiRotation.integer("MultiRotationObjects").setText("n")
+        self.aSession.finishOperation()
+
+        self.aMultiRotCopies = aMultiRotation.integer("MultiRotationObjects")
+
+        # create 3D point
+        self.aSession.startOperation()
+        aPoint3D = self.aDocument.addFeature("Point")
+        aPoint3D.string("creation_method").setValue("by_xyz")
+        aCoords = geomDataAPI_Point(aPoint3D.attribute("point3d"))
+        aCoords.setText("px", "0", "0")
+        self.aSession.finishOperation()
+
+        self.aPoint2D = aStartPoint
+        self.aPoint3D = aCoords
+
     def test_rename(self):
         # Rename
         aParam = self.dtParams["x1"]
@@ -188,6 +224,44 @@ class TestParameterRename(unittest.TestCase):
         self.assertEqual(self.anCircleCentr.y(), 170.)
         self.assertEqual(self.aRadiusAttr.value(), 150.)
 
+    def test_rename_integer(self):
+        # rename integer parameter
+        aParam = self.dtParams["n"]
+        aResultAttr = modelAPI_ResultParameter(aParam.firstResult())
+        self.aSession.startOperation()
+        aResultAttr.data().setName("m")
+        self.aSession.finishOperation()
+
+        # Check rename in the parameter
+        self.assertEqual(aParam.name(), "m")
+        self.assertEqual(aParam.string("variable").value(), "m")
+        self.assertEqual(aResultAttr.data().name(), "m")
+
+        # Check rename in feature
+        self.assertEqual(self.aMultiRotCopies.text(), "m")
+        # Check corresponding value
+        self.assertEqual(self.aMultiRotCopies.value(), 5)
+
+    def test_rename_point(self):
+        # rename parameter in point coordinates
+        aParam = self.dtParams["px"]
+        aResultAttr = modelAPI_ResultParameter(aParam.firstResult())
+        self.aSession.startOperation()
+        aResultAttr.data().setName("p")
+        self.aSession.finishOperation()
+
+        # Check rename in the parameter
+        self.assertEqual(aParam.name(), "p")
+        self.assertEqual(aParam.string("variable").value(), "p")
+        self.assertEqual(aResultAttr.data().name(), "p")
+
+        # Check rename in feature
+        self.assertEqual(self.aPoint2D.textX(), "p")
+        self.assertEqual(self.aPoint3D.textX(), "p")
+        # Check corresponding value
+        self.assertEqual(self.aPoint2D.x(), 50.)
+        self.assertEqual(self.aPoint3D.x(), 50.)
+
     def test_rename_not_unique(self):
         # Rename to not unique name
         aParam = self.dtParams["x1"]
@@ -230,6 +304,7 @@ class TestParameterRename(unittest.TestCase):
         self.assertEqual(self.anCircleCentr.y(), 170.)
         self.assertEqual(self.aRadiusAttr.value(), 150.)
 
+
 if __name__ == "__main__":
     test_program = unittest.main(exit=False)
     assert test_program.result.wasSuccessful(), "Test failed"
diff --git a/src/ParametersPlugin/Test/TestParametersMgr.py b/src/ParametersPlugin/Test/TestParametersMgr.py
new file mode 100644 (file)
index 0000000..5996214
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    TestParametersMgr.py
+
+    class ParametersPlugin_ParametersMgr
+"""
+
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+from ModelAPI import *
+
+__updated__ = "2018-12-05"
+
+aSession = ModelAPI_Session.get()
+aDocument = aSession.moduleDocument()
+
+aSession.startOperation()
+aKind = "ParametersMgr"
+aParamMgr = aDocument.addFeature(aKind)
+assert(aParamMgr is not None)
+assert(aParamMgr.getKind() == aKind)
+aSession.finishOperation()
old mode 100755 (executable)
new mode 100644 (file)
index 1b6c7d245a9a9f69584e8629f2434d281da45ada..90da7ca07cddfbf3bc229fafbd388391e90ed228 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Part">
     <group id="Parameters">
index 0defdd96f8c6bd0952d9ee41db67119299f063e9..178c0b8bf886c15a31f8423be1b6ffbe2f915729 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UseQtExt)
index 28784543b2512af3c1ea2844525791461307d3a8..5f2ef7904f6f1a98b7d4a7e30bc955060684f52c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARTSET_H
index 8049c1385221194d527a75929cd4ecfdefa963e6..cc8f34701f7da4a6c54b4ef68f3a939017acb8d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        PartSet_CenterPrs.cpp
index 5e9c86b4fff926ab7591c0a4c1ebf9f9e4f001a1..21f5a6ce52e7436ac9ce192248f0e3978104b6c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        PartSet_CenterPrs.h
index 6c7ec489668af88391a564e5dab679f31ea37388..dc99c8340b9e27bc16bec39981312898f5ef7025 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_Constants_H
old mode 100755 (executable)
new mode 100644 (file)
index 1780f0d..7b4ab82
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PartSet_CustomPrs.h>
old mode 100755 (executable)
new mode 100644 (file)
index 65c3bdf..6b31fda
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_CustomPrs_H
index a95e64d8bd67a7c6073fe04492fd053ecdb1b554..2f7ed9dc679a27d34114c5682282e5a91f4b9eaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_DataModel.h"
index e892ec0660260b83312b9b0ce6eafef797eac247..4e96298cd100e73c4efb070d4d043cea6f4d3b6f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_DataModel_H
old mode 100755 (executable)
new mode 100644 (file)
index d2df7c9..82bf710
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_ExternalObjectsMgr.h"
old mode 100755 (executable)
new mode 100644 (file)
index a2253c1..9e65a65
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_ExternalObjectsMgr_H
index 52e0a9d3fdc56065a30c7e4f14a57c3e3476f191..8e5405d11d4060148c72bcbe45217ff291828153 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        PartSet_ExternalPointsMgr.cpp
index 4f13f09e81b4d19d141099efe420178c5d827081..103b05e657c1ba8cf63b1f31fe31a32f933263e2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        PartSet_ExternalPointsMgr.h
old mode 100755 (executable)
new mode 100644 (file)
index 2a2500a..5dca6fa
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_FilterInfinite.h"
old mode 100755 (executable)
new mode 100644 (file)
index 8c3d4b2..e167654
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_FilterInfinite_H
index ffc6b27464209f07742db25652521ea87c727717..b7e5ccbb1e62e2d116921ed8220e201ff44e65af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_Filters.h"
index 2ceafe51793fcce958f7819096463e81b0a78a6d..55cde03bbdb4e31d62e86dc54db11125d63bbf7c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_Filters_H
index 3aebefefbafd428115dcc47837feb00829e7e93b..2b811848733c1bbe2b93af5829b7aa8ef43762e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_IconFactory.h"
index 34906ae3332a214e1193a04ae119630062508eb0..c4413e0bff0f0db59791607e922499d15c536b95 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_IconFactory_H
index d2025cf6c6b8cb4dca9c42bc517d16fabc694479..06ebaefa6e65416f6446c1cf7f57f9cc7b581cd6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_MenuMgr.h"
index 4c59869146e7baa4d96e1f3764117f279b6f2402..1b7bec76196e60ca2ae872f08bf3e8dd0ef143d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_MenuMgr_H
old mode 100755 (executable)
new mode 100644 (file)
index c6dcfa2..65be581
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_Module.h"
old mode 100755 (executable)
new mode 100644 (file)
index 3979a59..1f23bc7
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_Module_H
old mode 100755 (executable)
new mode 100644 (file)
index 7e942cd..e8ca7cb
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_MouseProcessor_H
old mode 100755 (executable)
new mode 100644 (file)
index 445c4ad..f31b1b4
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_OperationPrs.h"
old mode 100755 (executable)
new mode 100644 (file)
index 99fd2d2..c11c5cf
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_OperationPrs_H
old mode 100755 (executable)
new mode 100644 (file)
index 640af39..1b2b688
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <ModelAPI_Tools.h>
@@ -161,8 +160,21 @@ void PartSet_OverconstraintListener::processEvent(
       std::set<ObjectPtr> aModifiedObjects;
       PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
       CompositeFeaturePtr aSketch = aModule->sketchMgr()->activeSketch();
+
+      // check the sketch in the message and the active sketch are the same
+      std::shared_ptr<ModelAPI_SolverFailedMessage> anErrorMsg =
+          std::dynamic_pointer_cast<ModelAPI_SolverFailedMessage>(theMessage);
+      if (aSketch && anErrorMsg && !anErrorMsg->objects().empty()) {
+        ObjectPtr anObject = *anErrorMsg->objects().begin();
+        CompositeFeaturePtr aSketchFromMsg =
+            std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(anObject);
+        if (!aSketchFromMsg || aSketchFromMsg != aSketch)
+          aSketch = CompositeFeaturePtr();
+      }
+
       if (aSketch.get()) {
-        for (int i = 0; i < aSketch->numberOfSubs(); i++) {
+        int aNumberOfSubs = aSketch->numberOfSubs();
+        for (int i = 0; i < aNumberOfSubs; i++) {
           FeaturePtr aFeature = aSketch->subFeature(i);
           aModifiedObjects.insert(aFeature); // is necessary to redisplay presentations
           std::list<ResultPtr> aResults = aFeature->results();
old mode 100755 (executable)
new mode 100644 (file)
index 56f4a5e..5481f9d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_OverconstraintListener_H
old mode 100755 (executable)
new mode 100644 (file)
index 7585f21..b3f2682
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_PreviewPlanes.h"
@@ -24,6 +23,7 @@
 
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultPart.h>
 
 #include <XGUI_Tools.h>
 #include <XGUI_Displayer.h>
@@ -49,7 +49,9 @@ bool PartSet_PreviewPlanes::hasVisualizedBodies(ModuleBase_IWorkshop* theWorksho
   foreach (ObjectPtr anObj, aDisplayed) {
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
     // result constructions should not be taken as a body
-    if (aResult.get() != NULL && aResult->groupName() == ModelAPI_ResultBody::group()) {
+    if (aResult.get() != NULL &&
+      ((aResult->groupName() == ModelAPI_ResultBody::group()) ||
+      ((aResult->groupName() == ModelAPI_ResultPart::group()))) ) {
       GeomShapePtr aShape = aResult->shape();
       if (aShape.get()) {
         // vertices, edges should not be taken as a body
old mode 100755 (executable)
new mode 100644 (file)
index 1e76e0d..cd8c2cd
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_PreviewPlanes_H
index 56f6c33f6c0f1a2281fde3e7e0922c997068b56b..f8790b45a3736f0e8f2213a404ba32c0f86e3e0d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_PreviewSketchPlane.h"
@@ -143,7 +142,8 @@ bool PartSet_PreviewSketchPlane::getDefaultSizeOfView(
     return false;
 
   Bnd_Box aBox;
-  for (int aSubFeatureId = 0; aSubFeatureId < theSketch->numberOfSubs(); aSubFeatureId++) {
+  int aNumberOfSubs = theSketch->numberOfSubs();
+  for (int aSubFeatureId = 0; aSubFeatureId < aNumberOfSubs; aSubFeatureId++) {
     FeaturePtr aFeature = theSketch->subFeature(aSubFeatureId);
     if (!aFeature.get())
       continue;
index 5d5fca41ab2d78b8ea2c13aa8f2e8907cf1cdfc6..cc1fbebffaaded85896a3f3694fdc6e57aa832d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_PreviewSketchPlane_H
old mode 100755 (executable)
new mode 100644 (file)
index b600306..380e4ac
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_ResultSketchPrs.h"
@@ -285,7 +284,8 @@ void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& theResultShape,
   CompositeFeaturePtr aSketchFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>
                                                                           (aResultFeature);
   std::list<ResultPtr> anAuxiliaryResults;
-  for (int i = 0; i < aSketchFeature->numberOfSubs(); i++) {
+  int aNumberOfSubs = aSketchFeature->numberOfSubs();
+  for (int i = 0; i < aNumberOfSubs; i++) {
     FeaturePtr aFeature = aSketchFeature->subFeature(i);
     if (PartSet_Tools::isAuxiliarySketchEntity(aFeature)) {
       std::list<ResultPtr> aResults = aFeature->results();
old mode 100755 (executable)
new mode 100644 (file)
index 29a49df..19439eb
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_ResultSketchPrs_H
old mode 100755 (executable)
new mode 100644 (file)
index a67aa0f..7864827
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_SketcherMgr.h"
@@ -197,6 +196,7 @@ PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
 
 PartSet_SketcherMgr::~PartSet_SketcherMgr()
 {
+  delete mySketchPlane;
 }
 
 void PartSet_SketcherMgr::onEnterViewPort()
@@ -970,7 +970,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
   // Remove invalid sketch entities
   std::set<FeaturePtr> anInvalidFeatures;
   ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
-  for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
+  int aNumberOfSubs = myCurrentSketch->numberOfSubs();
+  for (int i = 0; i < aNumberOfSubs; i++) {
     FeaturePtr aFeature = myCurrentSketch->subFeature(i);
     if (aFeature.get()) {
       if (!aFactory->validate(aFeature))
@@ -1011,7 +1012,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
   QStringList anInfo;
   Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
   const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
+  aNumberOfSubs = myCurrentSketch->numberOfSubs();
+  for (int i = 0; i < aNumberOfSubs; i++) {
     FeaturePtr aFeature = myCurrentSketch->subFeature(i);
 #ifdef DEBUG_SKETCHER_ENTITIES
     anInfo.append(ModuleBase_Tools::objectInfo(aFeature));
@@ -1081,7 +1083,8 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation)
   }
   else {
     // Hide all sketcher sub-Objects
-    for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
+    int aNumberOfSubs = myCurrentSketch->numberOfSubs();
+    for (int i = 0; i < aNumberOfSubs; i++) {
       FeaturePtr aFeature = myCurrentSketch->subFeature(i);
       std::list<ResultPtr> aResults = aFeature->results();
       std::list<ResultPtr>::const_iterator aIt;
@@ -1479,7 +1482,7 @@ bool PartSet_SketcherMgr::isObjectOfSketch(const ObjectPtr& theObject) const
   FeaturePtr anObjectFeature = ModelAPI_Feature::feature(theObject);
   if (anObjectFeature.get()) {
     int aSize = myCurrentSketch->numberOfSubs();
-    for (int i = 0; i < myCurrentSketch->numberOfSubs() && !isFoundObject; i++) {
+    for (int i = 0; i < aSize && !isFoundObject; i++) {
       FeaturePtr aCurrentFeature = myCurrentSketch->subFeature(i);
       isFoundObject = myCurrentSketch->subFeature(i) == anObjectFeature;
     }
@@ -1900,7 +1903,8 @@ void PartSet_SketcherMgr::updateBySketchParameters(
       if (aPrevState != theState) {
         ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
         XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
-        for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
+        int aNumberOfSubs = myCurrentSketch->numberOfSubs();
+        for (int i = 0; i < aNumberOfSubs; i++) {
           FeaturePtr aSubFeature = myCurrentSketch->subFeature(i);
           bool aProcessed = false;
           bool aConstraintDisplayed = canDisplayConstraint(aSubFeature, theType, aProcessed);
index 634916b7814fb3019823ab6dea15a4305e24547a..0be54180b28ed7bb14e9dc9d9de0358af71d45ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_SketcherMgr_H
index d861c2b52a210dd4738a937476dc076a4c32752a..1e117834c1c9001ea113dde6092dbed8f8f04625 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_SketcherReentrantMgr.h"
index 275b59457c88b7a2a5c8d41f03719247df446e4c..fc2f6723cc9440e9edfa4e1b5cc1943b86d9ebbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_SketcherReentrantMgr_H
old mode 100755 (executable)
new mode 100644 (file)
index 16a0d0f..dcd677d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PartSet_Tools.h>
@@ -664,7 +663,8 @@ void PartSet_Tools::sendSubFeaturesEvent(const CompositeFeaturePtr& theComposite
     return;
 
   static Events_Loop* aLoop = Events_Loop::loop();
-  for (int i = 0; i < theComposite->numberOfSubs(); i++) {
+  int aNumberOfSubs = theComposite->numberOfSubs();
+  for (int i = 0; i < aNumberOfSubs; i++) {
     FeaturePtr aSubFeature = theComposite->subFeature(i);
     static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
     aECreator->sendUpdated(aSubFeature, theEventId);
@@ -756,6 +756,9 @@ ResultPtr PartSet_Tools::createFixedByExternalCenter(
 void PartSet_Tools::getFirstAndLastIndexInFolder(const ObjectPtr& theFolder,
   int& theFirst, int& theLast)
 {
+  theFirst = -1;
+  theLast = -1;
+
   DocumentPtr aDoc = theFolder->document();
   FolderPtr aFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(theFolder);
   if (!aFolder.get())
@@ -763,18 +766,19 @@ void PartSet_Tools::getFirstAndLastIndexInFolder(const ObjectPtr& theFolder,
 
   AttributeReferencePtr aFirstFeatAttr =
     aFolder->data()->reference(ModelAPI_Folder::FIRST_FEATURE_ID());
+  if (!aFirstFeatAttr.get())
+    return;
   FeaturePtr aFirstFeatureInFolder = ModelAPI_Feature::feature(aFirstFeatAttr->value());
-  if (!aFirstFeatureInFolder.get()) {
-    theFirst = -1;
+  if (!aFirstFeatureInFolder.get())
     return;
-  }
+
   AttributeReferencePtr aLastFeatAttr =
     aFolder->data()->reference(ModelAPI_Folder::LAST_FEATURE_ID());
+  if (!aLastFeatAttr.get())
+    return;
   FeaturePtr aLastFeatureInFolder = ModelAPI_Feature::feature(aLastFeatAttr->value());
-  if (!aLastFeatureInFolder.get()) {
-    theLast = -1;
+  if (!aLastFeatureInFolder.get())
     return;
-  }
 
   theFirst = aDoc->index(aFirstFeatureInFolder);
   theLast = aDoc->index(aLastFeatureInFolder);
old mode 100755 (executable)
new mode 100644 (file)
index 2e88b02..0bd4159
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_Tools_H
index e8acf5f61d42c2321c4de8c27d13b1108de6bcce..c08539925ec34de2a67ea6c9985c940525bc0739 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_TreeNodes.h"
@@ -270,6 +269,7 @@ void PartSet_ObjectNode::update()
         else {
           aNode = new PartSet_ObjectNode(aBody, this);
           myChildren.append(aNode);
+          aNode->update();
         }
       }
       else if (aFieldRes.get()) {
@@ -482,7 +482,9 @@ ModuleBase_ITreeNode* PartSet_FolderNode::createNode(const ObjectPtr& theObj)
   //ResultCompSolidPtr aCompRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObj);
   //if (aCompRes.get())
   //  return new PartSet_CompsolidNode(theObj, this);
-  return new PartSet_ObjectNode(theObj, this);
+  ModuleBase_ITreeNode* aNode = new PartSet_ObjectNode(theObj, this);
+  aNode->update();
+  return aNode;
 }
 
 void PartSet_FolderNode::update()
@@ -566,18 +568,20 @@ QTreeNodesList PartSet_FolderNode::objectCreated(const QObjectPtrList& theObject
     }
   }
   // Add nodes in correct order
-  int i;
-  for (i = 0; i < myChildren.size(); i++) {
-    if (aNewNodes.contains(i)) {
-      myChildren.insert(i, aNewNodes[i]);
+  if (aNewNodes.size() > 0) {
+    int i;
+    for (i = 0; i < myChildren.size(); i++) {
+      if (aNewNodes.contains(i)) {
+        myChildren.insert(i, aNewNodes[i]);
+        aNewNodes.remove(i);
+      }
+    }
+    while (aNewNodes.size()) {
+      i = myChildren.size();
+      myChildren.append(aNewNodes[i]);
       aNewNodes.remove(i);
     }
   }
-  while (aNewNodes.size()) {
-    i = myChildren.size();
-    myChildren.append(aNewNodes[i]);
-    aNewNodes.remove(i);
-  }
   foreach(ModuleBase_ITreeNode* aNode, myChildren) {
     aResult.append(aNode->objectCreated(theObjects));
   }
@@ -646,19 +650,22 @@ QTreeNodesList PartSet_FeatureFolderNode::objectCreated(const QObjectPtrList& th
     }
   }
   // To add in correct order
-  int i;
-  for (i = 0; i < myChildren.size(); i++) {
-    if (aNewNodes.contains(i)) {
-      myChildren.insert(i, aNewNodes[i]);
-      aNewNodes.remove(i);
+  if (aNewNodes.size() > 0) {
+    int i;
+    for (i = 0; i < myChildren.size(); i++) {
+      if (aNewNodes.contains(i)) {
+        myChildren.insert(i, aNewNodes[i]);
+        aNewNodes.remove(i);
+      }
+    }
+    while (aNewNodes.size()) {
+      i = myChildren.size();
+      if (aNewNodes.contains(i)) {
+        myChildren.append(aNewNodes[i]);
+        aNewNodes.remove(i);
+      }
     }
   }
-  while (aNewNodes.size()) {
-    i = myChildren.size();
-    myChildren.append(aNewNodes[i]);
-    aNewNodes.remove(i);
-  }
-
   // Update sub-folders
   foreach(ModuleBase_ITreeNode* aNode, myChildren) {
     aResult.append(aNode->objectCreated(theObjects));
@@ -813,7 +820,9 @@ ModuleBase_ITreeNode* PartSet_RootNode::createNode(const ObjectPtr& theObj)
   if (aFeature->getKind() == PartSetPlugin_Part::ID())
     return new PartSet_PartRootNode(theObj, this);
 
-  return new PartSet_ObjectNode(theObj, this);
+  PartSet_ObjectNode* aNode = new PartSet_ObjectNode(theObj, this);
+  aNode->update();
+  return aNode;
 }
 
 //////////////////////////////////////////////////////////////////////////////////
@@ -859,11 +868,19 @@ void PartSet_PartRootNode::update()
 
   bool aHasFields = myFieldsFolder->childrenCount() > 0;
   bool aHasGroups = myGroupsFolder->childrenCount() > 0;
-  if (aHasFields && (!myChildren.contains(myFieldsFolder))) {
-    myChildren.insert(3, myFieldsFolder);
+  if (aHasFields) {
+    if (!myChildren.contains(myFieldsFolder)) {
+      myChildren.insert(3, myFieldsFolder);
+    }
+  } else if (myChildren.contains(myFieldsFolder)) {
+    myChildren.removeAll(myFieldsFolder);
   }
-  if (aHasGroups && (!myChildren.contains(myGroupsFolder))) {
-    myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder);
+  if (aHasGroups) {
+    if (!myChildren.contains(myGroupsFolder)) {
+      myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder);
+    }
+  } else if (myChildren.contains(myGroupsFolder)) {
+    myChildren.removeAll(myGroupsFolder);
   }
 
   // Update features content
@@ -872,13 +889,17 @@ void PartSet_PartRootNode::update()
   // Remove extra sub-nodes
   int aIndex = -1;
   int aId = aRows;
+  QMap<int, ModuleBase_ITreeNode*> aExistingNodes;
   while (aId < myChildren.size()) {
     ModuleBase_ITreeNode* aNode = myChildren.at(aId);
     if (aNode->object().get()) {
       aIndex = aDoc->index(aNode->object(), true);
       if ((aIndex == -1) || (aId != (aIndex + aRows))) {
         myChildren.removeAll(aNode);
-        delete aNode;
+        if (aIndex == -1)
+          delete aNode;
+        else
+          aExistingNodes[aIndex + aRows] = aNode;
         continue;
       }
     }
@@ -893,12 +914,19 @@ void PartSet_PartRootNode::update()
     aId = i + aRows; // Take into account existing folders
     if (aId < myChildren.size()) {
       if (myChildren.at(aId)->object() != aObj) {
-        ModuleBase_ITreeNode* aNode = createNode(aObj);
-        myChildren.insert(aId, aNode);
+        if (aExistingNodes.contains(aId)) {
+          myChildren.insert(aId, aExistingNodes[aId]);
+          aExistingNodes.remove(aId);
+        }
+        else {
+          myChildren.insert(aId, createNode(aObj));
+        }
       }
     } else {
-      ModuleBase_ITreeNode* aNode = createNode(aObj);
-      myChildren.append(aNode);
+      if (aExistingNodes.contains(myChildren.size()))
+        myChildren.append(aExistingNodes[myChildren.size()]);
+      else
+        myChildren.append(createNode(aObj));
     }
   }
   // Update sub-folders
@@ -947,7 +975,7 @@ QVariant PartSet_PartRootNode::data(int theColumn, int theRole) const
 Qt::ItemFlags PartSet_PartRootNode::flags(int theColumn) const
 {
   if (myObject->isDisabled())
-    return (theColumn == 2) ? Qt::ItemIsSelectable : aDefaultFlag;
+    return (theColumn == 2) ? Qt::ItemIsSelectable : aNullFlag;
 
   SessionPtr aSession = ModelAPI_Session::get();
   DocumentPtr aActiveDoc = aSession->activeDocument();
@@ -960,7 +988,9 @@ ModuleBase_ITreeNode* PartSet_PartRootNode::createNode(const ObjectPtr& theObj)
 {
   if (theObj->groupName() == ModelAPI_Folder::group())
     return new PartSet_ObjectFolderNode(theObj, this);
-  return new PartSet_ObjectNode(theObj, this);
+  PartSet_ObjectNode* aNode = new PartSet_ObjectNode(theObj, this);
+  aNode->update();
+  return aNode;
 }
 
 int PartSet_PartRootNode::numberOfFolders() const
@@ -1066,11 +1096,13 @@ void PartSet_ObjectFolderNode::update()
         if (aObj != myChildren.at(i)->object()) {
           aNode = new PartSet_ObjectNode(aObj, this);
           myChildren.insert(i, aNode);
+          aNode->update();
         }
       }
       else {
         aNode = new PartSet_ObjectNode(aObj, this);
         myChildren.append(aNode);
+        aNode->update();
       }
     }
   }
@@ -1098,11 +1130,13 @@ QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& the
         aNode = new PartSet_ObjectNode(aObj, this);
         myChildren.insert(i, aNode);
         aResult.append(aNode);
+        aNode->update();
       }
     } else {
       aNode = new PartSet_ObjectNode(aObj, this);
       myChildren.append(aNode);
       aResult.append(aNode);
+      aNode->update();
     }
   }
   return aResult;
@@ -1141,6 +1175,7 @@ QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& theDo
     }
     else {
       myChildren.removeAll(aNode);
+      aResult.removeAll(aNode);
       delete aNode;
       aRemoved = true;
       continue;
index 5961121e99e4acd9f62bdfa15c060ee612f57049..014c5895d4d0bb8cd9f28ff61f7247335c9cb34f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_TreeNodes_H
old mode 100755 (executable)
new mode 100644 (file)
index f1cef74..4b72de1
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_Validators.h"
index c1fd7eaee43b6cad787e7fd699fe72f23077f871..e4b083bc0388eb9e465a0607dc2d8f8aaa85e13b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_Validators_H
index 8826493e54945429d24a70c1d3e6ab72a9b8d4b4..ff1b3ca551731d527cedc5e3001e970df5830a18 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetEditor.h"
index bd29eb6fa95e8eba346f5941d1c800f93a64d450..c84517f1cc22fe50539017c96f3c0cfb451081f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetEditor_H
index 9772899836f3d5b4d8e3b3bdf7a767f4d707427e..f44ca020954120fcca6e350e97f48e3fe0d9514a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_WidgetAPI.h>
index 4825cf68647b3c07901957496b509434c993d09d..818253f4e43befa60e2fdfc4f63813d0e4adcfa1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetFeaturePointSelector_H
index 2654a43b41c1b801774ef03a4dbbf3842027cacb..87e114ca249cd7fca93237b3e23abf96e5fe4392 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetFileSelector.h"
index ce433b3ac476790fa791f8a3b97e93e6a02ff781..478100d4bdaefb5036dc5668500eb74d8209ecfd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARTSET_WIDGETFILESELECTOR_H_
old mode 100755 (executable)
new mode 100644 (file)
index 60d3d4a..06f0f2c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetMultiSelector.h"
index 7d9e63d2d29c79fc7c036eda76bdb2af6b3c5c87..a07f5195ec6812f5c98428ce94e9d69acf95e5d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetMultiSelector_H
old mode 100755 (executable)
new mode 100644 (file)
index fba6f1b..660666c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetPoint2DFlyout.h"
old mode 100755 (executable)
new mode 100644 (file)
index e0f7b43..0e2b401
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetPoint2DFlyout_H
index 9af640db2587e46b0a5c021e4e1fb6771aea32e0..f89385297b0f9133a3b0606a50d451b2c4b8d265 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetPoint2d.h"
old mode 100755 (executable)
new mode 100644 (file)
index eddd587..515a03c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetPoint2D_H
old mode 100755 (executable)
new mode 100644 (file)
index fb8a9df..350db23
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetShapeSelector.h"
index 8bf7505ff979b3fb712c70413811a47d8fac5864..f118f8ebb6d88fb995bde7f7f667f4c860872d40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetShapeSelector_H
index 7f9fc5adae6c9a4a3725f0d91e36e1138b66b86a..0cb122ec6178469aab99eba4995996695d93817b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetSketchCreator.h"
index a37ec0d1dc63257a6f8dbaf275a1d0d3bcbc8e1b..f4a880abf6a73a06673de76f797af8302c487f47 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetSketchCreator_H
index 8714eb98d5d4fe387583b7772b3079bc3acd9585..7f4fcd8ae40db8fe0092621b4d602aeb30a95a3a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSet_WidgetSketchLabel.h"
@@ -465,10 +464,11 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View
       else {
         aSelAttr->setValue(aFeature, GeomShapePtr());
         GeomShapePtr aShape = aSelAttr->value();
-        if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) {
+        if (!aShape.get() && aSelAttr->contextFeature().get() &&
+          aSelAttr->contextFeature()->firstResult().get()) {
           aShape = aSelAttr->contextFeature()->firstResult()->shape();
         }
-        if (aShape.get()) {
+        if (aShape.get() && aShape->isPlanar()) {
           const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
           setSketchPlane(aTDShape);
           isOwnerSet = true;
index a87a70acf58c310a68aeaac9c853c8d3e8d39665..3bfcf883cd6a1142d4c95be9e656cd98216883d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_WidgetSketchLabel_H
index 5a87b2e65b646c44bec7aa41f08d6829ad98156c..b5a4d2c68458cce608edb0d5229337b318115b13 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
index a6615da36749c941550a8425427750ab3620b92d..d535acb33e53c8c22d75ba0e6bf1f536f6fc1357 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARTSETAPI_H
index d431419e33e0e7a4401b5e044dac48375786904c..083abf8668c11ed0c707713eb1f7870dbe7f83f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* PartSetAPI.i */
index 54a3a6ba2fcd656c74884bd1d84b3390b4abc3e2..5827d8f7d691e35a7ca2419b1bf82e2d0b857c5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSetAPI_Part.h"
index 2cc3111a5aa9252f69434fea0199d36fd37a43f1..a93a68ce3271b612d2932f540ef8e0289f333c23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_PARTSETAPI_PARTSETAPI_PART_H_
index 5c39422c8c3c8c405847d9ef6005d55a1b233621..33efcfa3529144af5ea970c071a0bb7a985a730e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_PARTSETAPI_PARTSETAPI_SWIG_H_
index b66e18113d6d6380f261045cf6124de59843a699..501431d5f658221529d44032b45c379894175505 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Created a Part Remove/Duplicate API functionality since from low level and python dump it is not
 # tested: feature history infor is not stored.
index 46e670e6e25e13216f520640d92a62224d5a9733..a9d98e14fbf8445189565f9970dedd812366ea7b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index e49245390474b746c4161d21ce97cea6165a2707..3b93183d882595eb949ed792b40b303081a46f6b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PARTSETPLUGIN_H
index 2cfcc177b46bfa480d9b2401a4746c93478c80ed..74dcf760571e0462f44d854ca5b767d61658c30f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSetPlugin_Duplicate.h"
index c85c01a022fcb98e2fa338b217bd394cbd5fd640..e2207678188f749a4a70ea51fda74f873e8378de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSetPlugin_Duplicate_H_
@@ -38,12 +37,14 @@ class PartSetPlugin_Duplicate : public ModelAPI_Feature
     static const std::string MY_REMOVE_KIND("Duplicate");
     return MY_REMOVE_KIND;
   }
+//LCOV_EXCL_START
   /// Returns the kind of a feature
   PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
   {
     static std::string MY_KIND = PartSetPlugin_Duplicate::ID();
     return MY_KIND;
   }
+//LCOV_EXCL_STOP
 
   /// Returns to which group in the document must be added feature
   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
@@ -53,9 +54,7 @@ class PartSetPlugin_Duplicate : public ModelAPI_Feature
   }
 
   /// Request for initialization of data model of the feature: adding all attributes
-  PARTSETPLUGIN_EXPORT virtual void initAttributes()
-  {
-  }
+  PARTSETPLUGIN_EXPORT virtual void initAttributes() {}
 
   /// Not normal feature that stored in the tree
   PARTSETPLUGIN_EXPORT virtual bool isAction()
index 4eee01130ea56cad1a35f415f88a224171b7bc55..4be84a309dd0415fb36cf169a853328447e630fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSetPlugin_Part.h"
@@ -97,7 +96,7 @@ std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Part::subFeature(const int theIn
   }
   return FeaturePtr();
 }
-
+//LCOV_EXCL_START
 int PartSetPlugin_Part::subFeatureId(const int theIndex) const
 {
   ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
@@ -109,7 +108,7 @@ int PartSetPlugin_Part::subFeatureId(const int theIndex) const
   }
   return 0; // none
 }
-
+//LCOV_EXCL_STOP
 bool PartSetPlugin_Part::isSub(ObjectPtr theObject) const
 {
   ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
@@ -120,10 +119,6 @@ bool PartSetPlugin_Part::isSub(ObjectPtr theObject) const
   return false;
 }
 
-void PartSetPlugin_Part::removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature)
-{
-}
-
 void PartSetPlugin_Part::erase() {
   ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
   if (aResult.get()) {
index 8a79e0d887b144e4c4b59704a4c414180c358e82..941a2189644cec181935dfd6c4d6b78ad56dd70c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSetPlugin_Part_H_
@@ -45,12 +44,14 @@ class PartSetPlugin_Part : public ModelAPI_CompositeFeature
     return MY_KIND;
   }
 
+//LCOV_EXCL_START
   /// Returns to which group in the document must be added feature
   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
   {
     static std::string MY_GROUP = "Parts";
     return MY_GROUP;
   }
+//LCOV_EXCL_STOP
 
   /// Creates a new part document if needed
   PARTSETPLUGIN_EXPORT virtual void execute();
@@ -80,7 +81,7 @@ class PartSetPlugin_Part : public ModelAPI_CompositeFeature
 
   /// This method to inform that sub-feature is removed and must be removed from the internal data
   /// structures of the owner (the remove from the document will be done outside just after)
-  virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+  virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature) {}
 
   /// Use plugin manager for features creation
   PartSetPlugin_Part();
index 90e5548c2ab306cfa4300e9d4fb08664f575a669..9527146ef5e2e979333fd05807aa2c582ff20778 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSetPlugin_Plugin.h"
@@ -55,7 +54,8 @@ FeaturePtr PartSetPlugin_Plugin::createFeature(std::string theFeatureID)
   // feature of such kind is not found
   return FeaturePtr();
 }
-
+// used only in GUI
+//LCOV_EXCL_START
 void PartSetPlugin_Plugin::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   const Events_ID kRequestEvent =
@@ -83,3 +83,4 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> PartSetPlugin_Plugin::getFeaturesS
   aMsg->setState(PartSetPlugin_Remove::ID(), aDocIsPart);
   return aMsg;
 }
+//LCOV_EXCL_STOP
index 887c49afbb4ee89b0b0dac78fb016de19b31203a..74939cd262f58af5de0e66487c76f5d0038d24df 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSetPlugin_Plugin_H_
index 1c8b921d47d86880703cd566f83c2f4df6e862a4..dee53bf5600c1e2fac4ceabc4d5b34968c4f0fef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PartSetPlugin_Remove.h"
index f24d30e2fe003201aee19a87b7a783c6f6f35d93..fab83ee06a63b87e603bcdd4e054db480c354d2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSetPlugin_Remove_H_
@@ -37,6 +36,7 @@ class PartSetPlugin_Remove : public ModelAPI_Feature
     static const std::string MY_REMOVE_KIND("Remove");
     return MY_REMOVE_KIND;
   }
+//LCOV_EXCL_START
   /// Returns the kind of a feature
   PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
   {
@@ -55,6 +55,7 @@ class PartSetPlugin_Remove : public ModelAPI_Feature
   PARTSETPLUGIN_EXPORT virtual void initAttributes()
   {
   }
+//LCOV_EXCL_STOP
 
   /// Not normal feature that stored in the tree
   PARTSETPLUGIN_EXPORT virtual bool isAction()
index f0a0449aff3c5c409cabab198c81e3ff4fd38183..f65c7defecb4e4328c38fcfbc21e5fee67ee8d66 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Part">
     <group id="Operations">
index 0fb8cdc23155640deb0e1dc084c7a76ce7791c84..8a3673e8b3134f572409eb8cfc1629e4ec411ecc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
index c5df6e2b3961cf701264a40ed8dc3cb176415655..e9374cd0dfe756886edbb300e9e39a236e4a4a7c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESAPI_H
index 055498b86944059fbf2166e293afefe89df9b343..f910ffefba1665ccc3fab425d164ccd1b9b58dd7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* PrimitivesAPI.i */
index f1781f14943e3d01cc560bb1434bd2799fa0ce88..c65330b3113fba6d08a17e56ff5231081d0698c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PrimitivesAPI_Box.h"
index d4619a8b7f6d75b3e25f15134f4463dee4bbba4c..c590a205289490d395964ff866f378f890a57e41 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESAPI_BOX_H_
index da564cc8b0759244b4c6b7e51b5c4247b38049ed..e4525734c9aa61f1cc6dba535b7a4e544e141dc6 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Cone.cpp
 // Created:     20 Mar 2017
@@ -102,4 +119,4 @@ ConePtr addCone(const std::shared_ptr<ModelAPI_Document>& thePart,
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Cone::ID());
   return ConePtr(new PrimitivesAPI_Cone(aFeature, aBasePoint, anAxis, theBaseRadius,
                                         theTopRadius, theHeight));
-}
\ No newline at end of file
+}
index a83f78ae63602f9dac72b1846f5ac898b0c29b5c..3bebe4e452b827cc87844ac24e28ed010914066d 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Cone.h
 // Created:     20 Mar 2017
index 141f0e41aa62e106501fd9ac5cf89b39ac67bd7e..f64f8ed841d4b3fa89f6810385c513f428fe63f5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "PrimitivesAPI_Cylinder.h"
index 4261135476655e7f3e931544537f1472ce3e0172..9182d82e5f70e5d6146992c01395748d9d71c09b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESAPI_CYLINDER_H_
index dc8b6aba6b36e17bc208617183f8c07c24ebe4b6..13a8b19163716713351fbcda610033417df111dd 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Sphere.h
 // Created:     16 Mar 2017
index 0374469cf9e1990be4004f99abd29e96dcd84da3..57197dfa32787f1e277a6003f38f9ead3a21fef0 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Sphere.h
 // Created:     16 Mar 2017
index 825c2b9aeb907fb3ec278f1714c3e3c493c4066e..0af0baf330dfe09992ea95dc3e9e8a57fc14c2b9 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Torus.cpp
 // Created:     20 Mar 2017
@@ -88,4 +105,4 @@ TorusPtr addTorus(const std::shared_ptr<ModelAPI_Document>& thePart,
   ModelHighAPI_Selection anAxis("EDGE", "PartSet/OZ");
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(PrimitivesAPI_Torus::ID());
   return TorusPtr(new PrimitivesAPI_Torus(aFeature, aBasePoint, anAxis, theRadius, theRingRadius));
-}
\ No newline at end of file
+}
index 32c7d101ff7b738e33ad28480594d8d871712b53..2a81631bb9c25d9dcf6a14d10eaf973ae8919ede 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesAPI_Torus.h
 // Created:     20 Mar 2017
index 9de3a6184df4ba8b88793d66326ff07997e89d6d..a1b7996e3009f056e0c278a4e0ee3ba5c262eb99 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESAPI_SWIG_H_
index 7a2d16e4d9b21d1a464106c0f9c49858beac6286..0e04ab120b1244c9d5ae6fc0b86fd19786e4c6ac 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(PROJECT_HEADERS
     PrimitivesPlugin.h
index 964a5702d4f04417671c11b934e48b55839a2c4a..5d597ff621162aa250b7a9791ac0c5c53e1675d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESPLUGIN_H
index efb5684259f67363c12e44a64fd159e985cd1651..8fce2cc9b6adfcd29c40336b73b8f0a3aa11a34d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PrimitivesPlugin_Box.h>
@@ -163,10 +162,11 @@ void PrimitivesPlugin_Box::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Box> theBoxA
   int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
     theBoxAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultBox->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it != listOfFaces.end();
+       ++it)
+  {
+    theResultBox->generated((*it).second, (*it).first);
   }
 }
 
index fa9eeb43c7f8144b24ae6de490aeb2969655ef81..e9ab91cf5e74067b9befb09c33461c490b774454 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PrimitivesPlugin_Box_H_
index 2c2916586faf73884dc1a01fe6be55f172f3d4ee..e3c4d57e220ff50077ca0698740acd667bb831a3 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Cone.cpp
 // Created:     17 Mar 2017
@@ -9,6 +26,7 @@
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
 
@@ -82,21 +100,43 @@ void PrimitivesPlugin_Cone::execute()
   }
 
   // Getting axis.
-  std::shared_ptr<GeomAPI_Ax2> anAxis;
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef = selection(AXIS_ID());
+  GeomShapePtr aShape = anEdgeRef->value();
+  if (!aShape.get()) {
+    if (anEdgeRef->context().get()) {
+      aShape = anEdgeRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
   std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef =
-    selection(PrimitivesPlugin_Cone::AXIS_ID());
-  if(anEdgeRef && anEdgeRef->value() && anEdgeRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->value()));
-  } else if (anEdgeRef && !anEdgeRef->value() && anEdgeRef->context() &&
-             anEdgeRef->context()->shape() && anEdgeRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->context()->shape()));
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
-                                                          anEdge->line()->direction()));
+  else
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax2> anAxis(new GeomAPI_Ax2(aBasePoint,
+                                                      anEdge->line()->direction()));
+
   // Getting base radius, top radius and height
   double aBaseRadius = real(PrimitivesPlugin_Cone::BASE_RADIUS_ID())->value();
   double aTopRadius = real(PrimitivesPlugin_Cone::TOP_RADIUS_ID())->value();
@@ -145,26 +185,27 @@ void PrimitivesPlugin_Cone::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Cone> theCo
   theConeAlgo->prepareNamingFaces();
 
   // Insert to faces
-  int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
       theConeAlgo->getCreatedFaces();
   int nbFaces = 0;
   for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
        it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultCone->generated(aFace, (*it).first, num++);
+    theResultCone->generated((*it).second, (*it).first);
     nbFaces++;
   }
 
   if (nbFaces == 2) {
     // Naming vertices
     GeomAPI_DataMapOfShapeShape aVertices;
-    GeomAPI_ShapeExplorer aVertExp(theConeAlgo->shape(), GeomAPI_Shape::VERTEX);
-    for(int anIndex = 1; aVertExp.more(); aVertExp.next()) {
+    int anIndex = 1;
+    for (GeomAPI_ShapeExplorer aVertExp(theConeAlgo->shape(), GeomAPI_Shape::VERTEX);
+         aVertExp.more();
+         aVertExp.next())
+    {
       if (!aVertices.isBound(aVertExp.current())) {
         std::ostringstream aStream;
         aStream<<"Vertex_"<<anIndex++;
-        theResultCone->generated(aVertExp.current(), aStream.str(), num++);
+        theResultCone->generated(aVertExp.current(), aStream.str());
         aVertices.bind(aVertExp.current(), aVertExp.current());
       }
     }
index 9cbc0b1af91b25f3b64663112d378d187a199fe1..007c0aae4a43dd3edd4a192a3f9a7c9b8a149123 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Cone.h
 // Created:     17 Mar 2017
index c3d5b82235327c599349018d31b12fb1d094574f..9b5e544acf8d7a6b339b041e572f0ce55e35a006 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PrimitivesPlugin_Cylinder.h>
@@ -23,6 +22,7 @@
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
 
@@ -112,21 +112,44 @@ void PrimitivesPlugin_Cylinder::createCylinder(bool withAngle)
   }
 
   // Getting axis.
-  std::shared_ptr<GeomAPI_Ax2> anAxis;
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef = selection(AXIS_ID());
+  GeomShapePtr aShape = anEdgeRef->value();
+  if (!aShape.get()) {
+    if (anEdgeRef->context().get()) {
+      aShape = anEdgeRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
   std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef =
-    selection(PrimitivesPlugin_Cylinder::AXIS_ID());
-  if(anEdgeRef && anEdgeRef->value() && anEdgeRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->value()));
-  } else if (anEdgeRef && !anEdgeRef->value() && anEdgeRef->context() &&
-             anEdgeRef->context()->shape() && anEdgeRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->context()->shape()));
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
-                                                          anEdge->line()->direction()));
+  else
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax2> anAxis(new GeomAPI_Ax2(aBasePoint,
+                                                      anEdge->line()->direction()));
+
+
   // Getting radius and height
   double aRadius = real(PrimitivesPlugin_Cylinder::RADIUS_ID())->value();
   double aHeight = real(PrimitivesPlugin_Cylinder::HEIGHT_ID())->value();
@@ -184,12 +207,12 @@ void PrimitivesPlugin_Cylinder::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Cylinde
   theCylinderAlgo->prepareNamingFaces();
 
   // Insert to faces
-  int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
     theCylinderAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultCylinder->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it != listOfFaces.end();
+       ++it)
+  {
+    theResultCylinder->generated((*it).second, (*it).first);
   }
 }
index e488afa8339890897a709538f7104787105b0ee0..9020fbc48c78f21a569002f0364d7172c9e91370 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PRIMITIVESPLUGIN_CYLINDER_H_
index f190df93edac29db58a8ecad3b7fcbdc97721547..df8427825fbc4180e141dea8d86ef3e79eb3d6df 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PrimitivesPlugin_Plugin.h>
index 91f421cf53949a0bf6f96244764f108c5307162b..e62766d6e0f280c28022bf1db86c44c5aca00ad0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PrimitivesPlugin_Plugin_H_
index c01d2b2fb73ba92e9b3c44427525b244a4dea460..c9c43d750ec8fa478d4cbe6b9b1b77281cbaa5e3 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Sphere.h
 // Created:     15 Mar 2017
@@ -106,23 +123,26 @@ void PrimitivesPlugin_Sphere::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Sphere> t
 
   // Insert to faces
   // Naming for faces and edges
-  int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
       theSphereAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultSphere->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it != listOfFaces.end();
+       ++it)
+  {
+    theResultSphere->generated((*it).second, (*it).first);
   }
 
   // Naming vertices
   GeomAPI_DataMapOfShapeShape aVertices;
-  GeomAPI_ShapeExplorer aVertExp(theSphereAlgo->shape(), GeomAPI_Shape::VERTEX);
-  for(int anIndex = 1; aVertExp.more(); aVertExp.next()) {
+  int anIndex = 1;
+  for (GeomAPI_ShapeExplorer aVertExp(theSphereAlgo->shape(), GeomAPI_Shape::VERTEX);
+       aVertExp.more();
+       aVertExp.next())
+  {
     if (!aVertices.isBound(aVertExp.current())) {
       std::ostringstream aStream;
       aStream<<"Vertex_"<<anIndex++;
-      theResultSphere->generated(aVertExp.current(), aStream.str(), num++);
+      theResultSphere->generated(aVertExp.current(), aStream.str());
       aVertices.bind(aVertExp.current(), aVertExp.current());
     }
   }
index 08693f3a5c55ac147865922c818bea5478d99b1d..01d48dcc67cb90fbd7184376980659913fdf7077 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Sphere.h
 // Created:     15 Mar 2017
index a086def17e8aa7171a97ac95766409bf36cd9883..fef286d79ba3419179b585393a9f31cc0f0b5c7f 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Torus.cpp
 // Created:     17 Mar 2017
@@ -9,6 +26,7 @@
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
 #include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
 
 #include <GeomAlgoAPI_PointBuilder.h>
 
@@ -80,21 +98,43 @@ void PrimitivesPlugin_Torus::execute()
   }
 
   // Getting axis.
-  std::shared_ptr<GeomAPI_Ax2> anAxis;
+  static const std::string aSelectionError = "Error: The axis shape selection is bad.";
+  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef = selection(AXIS_ID());
+  GeomShapePtr aShape = anEdgeRef->value();
+  if (!aShape.get()) {
+    if (anEdgeRef->context().get()) {
+      aShape = anEdgeRef->context()->shape();
+    }
+  }
+  if (!aShape.get()) {
+    setError(aSelectionError);
+    return;
+  }
   std::shared_ptr<GeomAPI_Edge> anEdge;
-  std::shared_ptr<ModelAPI_AttributeSelection> anEdgeRef =
-    selection(PrimitivesPlugin_Torus::AXIS_ID());
-  if(anEdgeRef && anEdgeRef->value() && anEdgeRef->value()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->value()));
-  } else if (anEdgeRef && !anEdgeRef->value() && anEdgeRef->context() &&
-             anEdgeRef->context()->shape() && anEdgeRef->context()->shape()->isEdge()) {
-    anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anEdgeRef->context()->shape()));
+  if (aShape->isEdge())
+  {
+    anEdge = aShape->edge();
+  }
+  else if (aShape->isCompound())
+  {
+    GeomAPI_ShapeIterator anIt(aShape);
+    anEdge = anIt.current()->edge();
   }
-  if(anEdge) {
-    anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(aBasePoint,
-                                                          anEdge->line()->direction()));
+  else
+  {
+    setError(aSelectionError);
+    return;
   }
 
+  if (!anEdge.get())
+  {
+    setError(aSelectionError);
+    return;
+  }
+
+  std::shared_ptr<GeomAPI_Ax2> anAxis(new GeomAPI_Ax2(aBasePoint,
+                                                      anEdge->line()->direction()));
+
   // Getting radius and ring radius
   double aRadius = real(PrimitivesPlugin_Torus::RADIUS_ID())->value();
   double aRingRadius = real(PrimitivesPlugin_Torus::RING_RADIUS_ID())->value();
@@ -145,20 +185,24 @@ void PrimitivesPlugin_Torus::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Torus> the
   int num = 1;
   std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
       theTorusAlgo->getCreatedFaces();
-  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator
-       it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) {
-    std::shared_ptr<GeomAPI_Shape> aFace = (*it).second;
-    theResultTorus->generated(aFace, (*it).first, num++);
+  for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+       it != listOfFaces.end();
+       ++it)
+  {
+    theResultTorus->generated((*it).second, (*it).first);
   }
 
   // Naming of edges
   GeomAPI_DataMapOfShapeShape anEdges;
-  GeomAPI_ShapeExplorer anEdgeExp(theTorusAlgo->shape(), GeomAPI_Shape::EDGE);
-  for(int anIndex = 1; anEdgeExp.more(); anEdgeExp.next()) {
+  int anIndex = 1;
+  for (GeomAPI_ShapeExplorer anEdgeExp(theTorusAlgo->shape(), GeomAPI_Shape::EDGE);
+       anEdgeExp.more();
+       anEdgeExp.next())
+  {
     if (!anEdges.isBound(anEdgeExp.current())) {
       std::ostringstream aStream;
       aStream<<"Edge_"<<anIndex++;
-      theResultTorus->generated(anEdgeExp.current(), aStream.str(), num++);
+      theResultTorus->generated(anEdgeExp.current(), aStream.str());
       anEdges.bind(anEdgeExp.current(), anEdgeExp.current());
     }
   }
index 69ea8bf85a03fad2f1bce1ccf1b197806d34d698..bf2281d39d03681cae07c21c643810f808290907 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
 
 // File:        PrimitivesPlugin_Torus.h
 // Created:     17 Mar 2017
index 8915fbc197c1edfeae5b486c557b9b540f4e3f29..f968b51548329378954dbe794c2071d46aaa8609 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="BoxByDimensions" title="By dimensions" icon="icons/Primitives/box_dxyz_32x32.png">
index 4f1acd5e45c350b7a1be4ff2c7abe9bb34097fb9..27f571b8ea2e48aa1c5daa056752d0342bcfcbe9 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
-
 <source>
   <shape_selector
       id="base_point"
@@ -16,6 +14,7 @@
       label="axis"
       default=""
       shape_types="edge"
+      geometrical_selection="true"
       icon="icons/Primitives/axis.png"
       tooltip="Select the axis of the cone">
     <validator id="GeomValidators_ConstructionComposite"/>
index 373bafb5f2a297d4a08a5e29fd19ef1cec793527..76ecdbe29196a09a53d48c92e8e9911186af8087 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <toolbox id="CreationMethod">
     <box id="Cylinder" title="Cylinder" icon="icons/Primitives/cylinder_32x32.png">
@@ -37,6 +16,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
           label="axis"
           default=""
           shape_types="edge"
+          geometrical_selection="true"
           icon="icons/Primitives/axis.png"
           tooltip="Select the axis of the cylinder">
         <validator id="GeomValidators_ConstructionComposite"/>
@@ -75,6 +55,7 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
           label="axis"
           default=""
           shape_types="edge"
+          geometrical_selection="true"
           icon="icons/Primitives/axis.png"
           tooltip="Select the axis of the cylinder">
         <validator id="GeomValidators_ConstructionComposite"/>
old mode 100755 (executable)
new mode 100644 (file)
index c7d5a4b6211062c5c22236319cb7393da9977495..f250b587e9cd95b2ecf4c16192284ada1e166f7a 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Primitives" document="Part">
     <group id="Primitives">
index 664f41abe60c26795fdea5c2b87ad9f3c6603c04..d2f29ce1e1ea49c0b1d5d623992ba7e25f5a5eca 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
-
 <source>
   <shape_selector id="center_point"
                   label="Center point"
index 44d0ce6888dc7938dc2c514d867066e207108764..244e6780a7d3f1350740d46b82112af382297f54 100644 (file)
@@ -1,5 +1,3 @@
-<!-- Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
-
 <source>
   <shape_selector
       id="base_point"
@@ -16,6 +14,7 @@
       label="axis"
       default=""
       shape_types="edge"
+      geometrical_selection="true"
       icon="icons/Primitives/axis.png"
       tooltip="Select the axis of the torus">
     <validator id="GeomValidators_ConstructionComposite"/>
index bd31cd108a0abe51b73b7fdcb190d000190b08cc..7c14e989023507379bdfb88c5ba2d5af8384178b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 INSTALL(DIRECTORY geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API})
 INSTALL(FILES __init__.py DESTINATION ${SHAPER_INSTALL_PYTHON_API})
@@ -44,13 +43,13 @@ ADD_UNIT_TESTS(
   TestSketcherSetFixed.py
   TestSketcherSetLength.py
   TestSketcherSetRadius.py
-  #TestSketcherSetAngle.py
+  TestSketcherSetAngle.py
   TestSketcherSetEqual.py
   TestSketcherSetFillet.py
 
   TestFeatures.py
   TestFeaturesExtrusion.py
-  #TestFeaturesRevolution.py
+  TestFeaturesRevolution.py
 
   TestPrimitivesBox.py
 
index 3fff3e3e28fcb177e7d51732b944082368cb968e..cdd9f71155f25da155943e54e72e1643394b8559 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -34,7 +33,7 @@ SketchLine_4 = Sketch_1.addLine(184.3750000000001, -109.375, -184.375, -81.25)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
 model.do()
 Extrusion_1.setDirection(model.selection("EDGE", "OX"))
 model.do()
index 8c30d92faa90147d6ae7888562c406d94560e502..f98c3dade1a957ab29fe6e9fb1783e27a7138e0e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 45ee4fec3d3d4337da54f878333ee73c1ec61539..f561711182d85a73fa4d4b9ccc3dca80419c95bf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 9b24e95505456ad3c546e086e3747e4011e08789..b77d3e33e8457aaacea138cd2581b62e95e08ee6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
@@ -56,10 +55,9 @@ class FeaturesRevolutionFixture(FeaturesAddRevolutionFixture):
         base = base_sketch.selectFace()
         axis_point1 = model.addPoint(self.part, 20, -10, 0).result()
         axis_point2 = model.addPoint(self.part, 20, 10, 0).result()
-        axis_object = model.addAxis(self.part, axis_point1[0], axis_point2[0]).result()
+        axis_object = model.addAxis(self.part, axis_point1, axis_point2).result()
 
-        self.revolution = model.addRevolution(self.part, base, axis_object[0],
-                                              0, 180)
+        self.revolution = model.addRevolution(self.part, base, axis_object, 0, 180)
 
         model.do()
 
@@ -81,18 +79,15 @@ class FeaturesAddRevolutionTestCase(FeaturesAddRevolutionFixture):
         base = base_sketch.selectFace()
         axis_point1 = model.addPoint(self.part, 20, -10, 0).result()
         axis_point2 = model.addPoint(self.part, 20, 10, 0).result()
-        axis_object = model.addAxis(self.part, axis_point1[0], axis_point2[0]).result()
+        axis_object = model.addAxis(self.part, axis_point1, axis_point2).result()
 
-        revolution = model.addRevolution(self.part, base, axis_object[0],
-                                         0, 180)
+        revolution = model.addRevolution(self.part, base, axis_object, 0, 180)
 
         self.assertEqual(revolution.creationMethod().value(), "ByAngles")
         self.assertEqual(revolution.toAngle().value(), 0)
         self.assertEqual(revolution.fromAngle().value(), 180)
         self.assertEqual(revolution.toObject().context(), None)
-        self.assertEqual(revolution.toOffset().value(), 0)
         self.assertEqual(revolution.fromObject().context(), None)
-        self.assertEqual(revolution.fromOffset().value(), 0)
 
     def test_add_revolution_by_face_and_planes(self):
         # base
@@ -114,23 +109,19 @@ class FeaturesAddRevolutionTestCase(FeaturesAddRevolutionFixture):
         base = base_sketch.selectFace()
         axis_point1 = model.addPoint(self.part, 20, -10, 0).result()
         axis_point2 = model.addPoint(self.part, 20, 10, 0).result()
-        axis_object = model.addAxis(self.part, axis_point1[0], axis_point2[0]).result()
+        axis_object = model.addAxis(self.part, axis_point1, axis_point2).result()
         to_obejct = to_sketch.selectFace()[0]
         from_object = from_sketch.selectFace()[0]
 
-        revolution = model.addRevolution(self.part, base, axis_object[0],
-                                         to_obejct, 15,
-                                         from_object, 20)
+        self.revolution = model.addRevolution(self.part, base, axis_object,
+                                              to_obejct, 15,
+                                              from_object, 20)
 
-        self.assertEqual(revolution.creationMethod().value(), "ByPlanesAndOffsets")
-        self.assertEqual(revolution.toAngle().value(), 0)
-        self.assertEqual(revolution.fromAngle().value(), 0)
-#         self.assertEqual(revolution.getToObject().context(),
-#                          to_sketch.result())
-        self.assertEqual(revolution.toOffset().value(), 15)
-#         self.assertEqual(revolution.getFromObject().context(),
-#                          from_sketch.result())
-        self.assertEqual(revolution.fromOffset().value(), 20)
+        self.assertEqual(self.revolution.creationMethod().value(), "ByPlanesAndOffsets")
+        self.assertNotEqual(self.revolution.toObject().context(), None)
+        self.assertEqual(self.revolution.toOffset().value(), 15)
+        self.assertNotEqual(self.revolution.fromObject().context(), None)
+        self.assertEqual(self.revolution.fromOffset().value(), 20)
 
 
 class FeaturesRevolutionTestCase(FeaturesRevolutionFixture):
@@ -166,9 +157,7 @@ class FeaturesRevolutionTestCase(FeaturesRevolutionFixture):
         self.assertEqual(self.revolution.toAngle().value(), 90)
         self.assertEqual(self.revolution.fromAngle().value(), 270)
         self.assertEqual(self.revolution.toObject().context(), None)
-        self.assertEqual(self.revolution.toOffset().value(), 0)
         self.assertEqual(self.revolution.fromObject().context(), None)
-        self.assertEqual(self.revolution.fromOffset().value(), 0)
 
     def test_revolution_set_planes_and_offsets(self):
         # base
@@ -190,18 +179,17 @@ class FeaturesRevolutionTestCase(FeaturesRevolutionFixture):
         base = base_sketch.selectFace()
         axis_point1 = model.addPoint(self.part, 20, -10, 0).result()
         axis_point2 = model.addPoint(self.part, 20, 10, 0).result()
-        axis_object = model.addAxis(self.part, axis_point1[0], axis_point2[0]).result()
+        axis_object = model.addAxis(self.part, axis_point1, axis_point2).result()
         to_obejct = to_sketch.selectFace()[0]
         from_object = from_sketch.selectFace()[0]
 
+        self.revolution = model.addRevolution(self.part, base, axis_object, 0, 180)
         self.revolution.setPlanesAndOffsets(to_obejct, 15, from_object, 20)
 
         self.assertEqual(self.revolution.creationMethod().value(), "ByPlanesAndOffsets")
-        # self.assertEqual(self.revolution.toAngle().value(), 0)
-        # self.assertEqual(self.revolution.fromAngle().value(), 0)
-#         self.assertEqual(self.revolution.getToObject().context(), None)
+        self.assertNotEqual(self.revolution.toObject().context(), None)
         self.assertEqual(self.revolution.toOffset().value(), 15)
-#         self.assertEqual(self.revolution.getFromObject().context(), None)
+        self.assertNotEqual(self.revolution.fromObject().context(), None)
         self.assertEqual(self.revolution.fromOffset().value(), 20)
 
 
index 5e1aa538763c5e96a8e6213aedf51e95edded880..92cb43e8c371cdf89489826ee58b9d1933a8812d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 27f353d8ff6d28ee070ceb4d46f10e754fea6d58..10f47e546cfd4727ed8fa2feb1f940f5c25a2a55 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 8059037ae2e316f6eeeb978dee9a6381bf00386c..97d41180552b0da94e4b2ee7d842610001c89fc8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 4ac0320eed4aad769730e130df8250e14c841514..6a4bebff307f4e39674b52990d930e16c8a28e98 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 81dfe1445867a2554da3107d7042a4d556a4bece..af25bad54a444255d5cad3743a526a624cd8db5e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index 4919ddcd397532244ecd76dfdbb3b286e6bf6e2f..e9370cb5ba1670c7eeeb8c8a74305b895b1b2256 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index d5e06ca16aee0299b6228b0222f9d425146b642b..95742b8e796bed5a484f2beeb1e7fbf4fa03b533 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 7ea8f262de9970a7c23c5818fb3fc7bdd6cc6366..c1c380564b4a51092756ea879dfee064ebacae1a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 
index b1af039f0f57069612688123f00481be35d91d3a..1295838ed96a82f9d7ecd7cad5e6e557684a62a9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 46aad38f292e56be466661be941ffd36a857208c..eccaecabe505253ad1876a34a02a8643f7358010 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index bfafe8b81dc372ea8cb39f9e749028a8fcb8052b..d87665431486966230367fe9bfeb9ccc8fac578c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 1a64f4d9407fa7fc0fdb6510c22308f83595aca1..d7505ba91fb81566db3e1891ea890bdd7a3322f9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index f4c914c5cbdaca69d94c459c7912a4cdc59e9055..26f50fd5c48abd3b71a893c30b9c85ba1a3cf3ae 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index b5f6131708c8cbef3617b7ee2d2b5100d4e01a2e..a21ba34a9d9b6995ae44af22ec3c641492d50050 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 061e4318f4958613f444a42f93a72aa97061ffd4..3417bb887c44b6d38e92a6903bddd60a125d1f56 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 085b6db611a6238fd809b7a93f072cb486966d8a..2681321d4d42dd4abaa0710ce9e69365f9416514 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 54a485452b00852c224f91bdf2ebf3ccbf730c6a..41c233aede9c3a7be61b004dc4e955779f965687 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index a8d6f8cbf5b0d9d47389b2860402f8884fc3d07c..72f1d9abdfc3fde8fc748412addffa33492ce252 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 5230bd64a4518490d7691562dbef0189a8a21e4f..3c305ac34e4ed7a011a051fc36daa14039403812 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 90fe226751c1851f2000fc99c22ac95f1ca64c5e..54b8f122b7496c7ac0abb488239d054463b1fa47 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 8486ae141cb6ef42cda3dcef533896fa8bc81b24..c3f0a6171d869b779954172eeb8fab36bc7e8f07 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index df233b0c4c7208b559c3add2343c06e1f12af9c2..e7829efcc8c494afa0fe4607e4414c0da5723bbf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index 18badffd7cc10bbf5ab1307e42657442cebffd57..5fc263cbb741943735c3a03aa41c28fcd7d50612 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index d040e5a8cea6f648acfebd9bda37ab6226fc6c26..27f57663f91cfe04caf764d19d50aea2b9d84a52 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import unittest
 from salome.shaper import model
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ee51e508470b2fc4e08b6b9f5f125bd6e847c75c 100644 (file)
@@ -0,0 +1,18 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
index 3f3490f55e5aae3765ebf9be6a4e54af3e2fd7fd..71b6bab83b678b5d0ebb9c0d3a60f9135bcaf229 100644 (file)
@@ -1,25 +1,4 @@
 # -*- coding: utf-8 -*-
-
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
 #
 # Shaper python API documentation build configuration file, created by
 # sphinx-quickstart on Thu Oct 15 11:55:42 2015.
@@ -75,7 +54,7 @@ master_doc = 'index'
 
 # General information about the project.
 project = 'Shaper python API'
-copyright = '2014-20xx CEA/DEN, EDF R&D'
+copyright = '2014-2019 CEA/DEN, EDF R&D'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
index 831c91fbd585b3e249e6065f736afbad82e62438..f39fb3f06d5ba1be532803a3657b157113d4eac0 100644 (file)
@@ -69,9 +69,9 @@ model.do()
 
 # Creating a cylinder on a face of the box
 
-thisface = "Extrusion_1_1/Generated_Face_2"
-thisxmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"
-thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1"
+thisface = "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"
+thisxmax = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"
+thiszmax = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"
 
 mystand = model.addSketch(mypart, thisface)
 
index 2172b850c2b7f1b553b6c9fb0f9fe9f185916ace..38466f94b7097deadab2fac5665aaa0e611ebd25 100644 (file)
@@ -67,9 +67,9 @@ model.do()
 
 # Creating a cylinder on a face of the box
 
-thisface = "Extrusion_1_1/Generated_Face_2"
-thisxmin = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"
-thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1"
+thisface = "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"
+thisxmin = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"
+thiszmax = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"
 
 mystand = model.addSketch(mypart, thisface)
 circle = mystand.addCircle(0, 25, 5)
index 25e45babf3944046ff05b24c50499ff5f7d204d6..795571074967838a58bd4fbc6b8c8213e8c13531 100644 (file)
@@ -78,7 +78,7 @@ def vertical_body():
 
 def bottom_body():
     # Create XOY sketch
-    sketch = model.addSketch(part, "Extrusion_1_1/Generated_Face_5")
+    sketch = model.addSketch(part, "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4")
 
     # Create base polygon
     points = [(0, 0), (0, L), (P, L), (P, 16 + 16), (P - 20, 16 + 16), (P - 20, 16), (P, 16), (P, 0)]
@@ -111,7 +111,7 @@ def bottom_body():
     sketch.setCoincident(arc.endPoint(), h1.startPoint())
 
     # Binding
-    left_e = sketch.addLine("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1_1")
+    left_e = sketch.addLine("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]")
     sketch.setCoincident(left_e.startPoint(), left.endPoint())
     sketch.setCoincident(left_e.endPoint(), left.startPoint())
 
@@ -132,7 +132,7 @@ def bottom_body():
 
 def body_3():
     # Create XOZ sketch
-    sketch = model.addSketch(part, "Boolean_1_1/Modified_Face_3")
+    sketch = model.addSketch(part, "Boolean_1_1/Modified_Face&Sketch_1/SketchLine_3")
 
     # Create base polygon
     H, L, l, r = 28, 40, 8, 12
@@ -170,7 +170,7 @@ def body_3():
     sketch.setRadius(arc, r)
 
     # Binding
-    bottom_e = sketch.addLine("Boolean_1_1/Modified_Face_7&Extrusion_2_1/To_Face_1")
+    bottom_e = sketch.addLine("[Boolean_1_1/Modified_Face&Sketch_2/SketchLine_6][Extrusion_2_1/To_Face]")
     sketch.setCoincident(bottom_e, bottom.startPoint())
     sketch.setCoincident(bottom_e.startPoint(), bottom.endPoint())
 
@@ -183,7 +183,7 @@ def body_3():
 
 def body_4():
     # Create XOZ 2nd sketch
-    sketch = model.addSketch(part, "Boolean_2_1/Modified_Face_4")
+    sketch = model.addSketch(part, "Boolean_2_1/Modified_Face&Sketch_2/SketchLine_6")
 
     # Create base polygon
     points = [(0, 0), (0, 1), (1, 0)]
@@ -192,11 +192,11 @@ def body_4():
     left, diagonal, bottom = model.addPolygon(sketch, *geom_points)
 
     # Binding
-    bottom_e = sketch.addLine("Boolean_2_1/Modified_Face_2&Boolean_2_1/Modified_Face_4")
+    bottom_e = sketch.addLine("[Boolean_2_1/Modified_Face&Extrusion_2_1/To_Face][Boolean_2_1/Modified_Face&Sketch_2/SketchLine_6]")
     sketch.setCoincident(bottom_e.endPoint(), bottom.startPoint())
     sketch.setCoincident(bottom_e.startPoint(), left.startPoint())
 
-    left_e = sketch.addLine("Boolean_2_1/Modified_Face_5&Extrusion_3_1/Generated_Face_2")
+    left_e = sketch.addLine("[Boolean_2_1/Modified_Face&Extrusion_3_1/From_Face][Extrusion_3_1/Generated_Face&Sketch_3/SketchLine_18]")
     sketch.setCoincident(left_e.startPoint(), left.endPoint())
 
     model.do()  #!!!
index 8718d8cd3f7fc5a22e21208681b906fef63106b1..6202c4b58a28946b6bbd06dfa182b95198c4643b 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """This package defines the Direct Geometry API of the Modeler.
 """
 
index e056939a2901568ff51e80a14ff6f11b7d9cbef7..bc5f57cad5f917920b5399b61ba7c589ff64711d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """This script inspects existing modules in SALOME and registrs them in
 Module reader
index d4d142f13dc1cb9bd028a59a2c6294c09da47034..08f3d86507b48d4fadbb204059b2e784e10a64c5 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """This package defines the Parametric Geometry API of the Modeler.
 
 All features are available via model.add*() functions. Exceptions are:
index 52902eda21ad81332b94a25dab14532547a5e2a2..257feab23b1647c0b380429c2ae8b0e3a8e1aa27 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Build plugin for the Parametric Geometry API of the Modeler.
 """
 
index 5c3e2548621eeac7c08cab22bf7952bdbd66d7ea..5718df5f5c99294827b246ce2663786c96da14c6 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Collection plugin for the Parametric Geometry API of the Modeler.
 """
 
index 1b5a6587efd1eb6952ed7576f5ce3aedb1000c69..779d1cc17ada84cc80bb4e974399ef832fa43cdf 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Connection plugin for the Parametric Geometry API of the Modeler.
 """
 
index 01b17593c12f2e33887036b91855920932275ba6..18f4616ca38c15305e47cc4c810b6a256e4c7ddf 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Construction plugin for the Parametric Geometry API of the Modeler.
 """
 
index 5cb8cd081073ef6cbde2bd33ef13cf4d6015f446..4e739a38278f19c6dd05099821034606ce74bb06 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """Package for dumping purposes.
 """
index 2bb02cfdc7ca8f3d668de6fe6b28aed922efd860..664531b9e31762316992f2f05679d9cc9e094485 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for dumping purposes.
 """
 
index 29d652e5286d99a6df0ddee00e6e52ca965d8b05..308e1e6f3929ba4b695a77e6065b8d0cd8ffa40d 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Exchange plugin for the Parametric Geometry API of the Modeler.
 """
 
index 273a282d25caa4ad527da04c1342d77e6329df45..5eea8ffc2bd312c03984d7d521718114b680f3b9 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Features plugin for the Parametric Geometry API of the Modeler.
 """
 
index ffc05033b93a12be9e36491e7cdb915bc2bb5ba2..721a5e2c787ea4b576e715617024b48f837193fa 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for GDML plugin for the Parametric Geometry API of the Modeler.
 """
 
index fb276792dfedfbdaf0d7c7b29dfa0ae377b056b8..c5204f713ff74e39b435a7f1d7633a2e60315d06 100644 (file)
@@ -1,4 +1,22 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Parameter plugin for the Parametric Geometry API of the Modeler.
 """
 
-from ParametersAPI import addParameter
\ No newline at end of file
+from ParametersAPI import addParameter, removeParameter
\ No newline at end of file
index f66380156d976b0f2dba6e165be9769f53b067ef..ca98b4c29d6f4e8ab0767a125dea7ff449e7e05f 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for PartSet plugin for the Parametric Geometry API of the Modeler.
 """
 
index a707b9cfe838c0a5dfa011fb07adea1e62adaa4a..830633b7aaff825cd779d0ab5634740976cbdaef 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Primitives plugin for the Parametric Geometry API of the Modeler.
 """
 
index f14c47f1aada48651e0be30a41f3704117af22db..a0248aa9ff8069c62aa4b79dbf20332611409239 100644 (file)
@@ -1,26 +1,24 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """Abstract root classes of user-defined Python features producing a Body
 Author: Daniel Brunier-Coulin
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 """
 
 import ModelAPI
index db5279d84ec6c7995b930b2522c2602f434b5636..74336295962a41229c49f67cea7f8897398c6b6d 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for services for the Parametric Geometry API of the Modeler.
 """
 
index 2d5622aee495d850add82153e5666845afdb0494..f2e2fbebe3fc51b3ee28008d02dd3e4de738cc1c 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Package for Sketch plugin for the Parametric Geometry API of the Modeler.
 """
 
index 75217d0658f3cbbc4dfe59879b9d61b70729aa31..2d52f70bcf6d3ad1651f735e2e7ee26236493208 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from ModelAPI import *
 from GeomDataAPI import *
index 0a2c4f6d4e6209d6df709fce038f65c30cfce5f0..7bb8f5362520a4aa868c69d6f8c0fe4f5a2be667 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import ModelHighAPI
 from GeomDataAPI import *
index b8f079e0452708323135d1591b1da789aa877202..d076bfe8598eb5542cf7dd0d5603fb7231b76cb1 100644 (file)
@@ -1 +1,19 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from .tests import *
\ No newline at end of file
index 92ff8a609bc19296865ceed3a4436be036c3c0fd..0a99e7c48cd65b9b897f94dd3abc75f82178712e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import *
 from GeomAPI import *
@@ -130,7 +129,7 @@ def testResultsVolumes(theFeature, theExpectedResultsVolumes, theNbSignificantDi
     aResultVolumeStr = "{:0.27f}".format(aResultVolume).lstrip("0").lstrip(".").lstrip("0")
     anExpectedResultVolume = theExpectedResultsVolumes[anIndex]
     anExpectedResultVolumeStr = "{:0.27f}".format(anExpectedResultVolume).lstrip("0").lstrip(".").lstrip("0")
-    assert math.fabs(aResultVolume - anExpectedResultVolume) < aTolerance * anExpectedResultVolume, "Volume of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits)
+    assert math.fabs(aResultVolume - anExpectedResultVolume) < aTolerance * math.fabs(anExpectedResultVolume), "Volume of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits)
 
 def testHaveNamingFaces(theFeature, theModel, thePartDoc) :
   """ Tests if all faces of result have a name
@@ -263,6 +262,7 @@ def testHaveNamingSubshapes(theFeature, theModel, thePartDoc) :
   """ Tests if all vertices/edges/faces of result have a unique name
   :param theFeature: feature to test.
   """
+  assert(len(theFeature.results()) > 0)
   testHaveNamingByType(theFeature, theModel, thePartDoc, GeomAPI_Shape.VERTEX)
   testHaveNamingByType(theFeature, theModel, thePartDoc, GeomAPI_Shape.EDGE)
   testHaveNamingByType(theFeature, theModel, thePartDoc, GeomAPI_Shape.FACE)
index 726e2c4011e4b3aec609c2c469a658e31043c690..2cbae61b2c49034d9ffefbee8aea4c27757e036b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(TEXT_RESOURCES
        PythonAddons_msg_en.ts
index ca2adfbb240d2d9f6bb564b405379c37321888d9..7f2bc82bb201a5e735965e248b1938401565644f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from salome.shaper import geom
index caf9c1cd4e19db024b9c74714bcef40999531e0a..fd5816ac60e14be0ffb1e855f4d5bfe8270dd87b 100644 (file)
@@ -1 +1,19 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """User-defined features"""
\ No newline at end of file
index 3fcb67d129c2e4dcc0a26dae7ac6666c25397e99..50f82085613d827d7c11ab3f21fe9c2ed81fba0e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """Registration of all user-defined Python features
 """
index 72fc83d530db9e88a17c9ff9f035fc6dd511fadf..c669ec09e5b75a6ed474e0a83da7d9dda678f28c 100644 (file)
@@ -1,26 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-"""Box macro-feature
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+Box macro-feature
 Authors: Renaud Nedelec - Daniel Brunier-Coulin
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 """
 
 from salome.shaper import model
index f45e454103f97b6f4460089bd3ee6d1c2f17a213..b9752fa3e91b74693fe2093766f041a7f94efe18 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <workbench id="Macros" document="Part">
     <group id="Samples">
index 2407a4d114a8421a6d4b69bbbda24d0c5abfc0bc..a82514819575ccdd943a3e01acaf295c375eb648 100644 (file)
@@ -1,27 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Macro-feature to produce rectangle in the sketcher
 Author: Artem ZHIDKOV
-Copyright (C) 2016-20xx CEA/DEN, EDF R&D
 """
 
 from salome.shaper import model
index 45d5ef793fe66237a5cd099f084f4b8dd2c27d98..b50603f4507940ff0216e610dee0d4560a29d230 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <workbench id="Sketch">
     <group id="Linear geometry">
index 672545afc5268ce98dbb2ed89ca07980b91a1bd6..a2c370bb3b43deed7c53197d91abe8e6378ea0c4 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 """Python macro-features package
 A macro-feature is a feature which executes a sequence of user actions.
 Such feature is not registered in the application history. Instead,
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0d18652cfe1feedbe4c034f76725d3b9d18f225d 100644 (file)
@@ -0,0 +1,18 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
index 72fc83d530db9e88a17c9ff9f035fc6dd511fadf..c669ec09e5b75a6ed474e0a83da7d9dda678f28c 100644 (file)
@@ -1,26 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
-
-"""Box macro-feature
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+Box macro-feature
 Authors: Renaud Nedelec - Daniel Brunier-Coulin
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 """
 
 from salome.shaper import model
index f45e454103f97b6f4460089bd3ee6d1c2f17a213..b9752fa3e91b74693fe2093766f041a7f94efe18 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <workbench id="Macros" document="Part">
     <group id="Samples">
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ee51e508470b2fc4e08b6b9f5f125bd6e847c75c 100644 (file)
@@ -0,0 +1,18 @@
+# Copyright (C) 2016-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
index 2407a4d114a8421a6d4b69bbbda24d0c5abfc0bc..a82514819575ccdd943a3e01acaf295c375eb648 100644 (file)
@@ -1,27 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Macro-feature to produce rectangle in the sketcher
 Author: Artem ZHIDKOV
-Copyright (C) 2016-20xx CEA/DEN, EDF R&D
 """
 
 from salome.shaper import model
index 45d5ef793fe66237a5cd099f084f4b8dd2c27d98..b50603f4507940ff0216e610dee0d4560a29d230 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <source>
   <workbench id="Sketch">
     <group id="Linear geometry">
index ab66311812d45fa25dca2bb665338599641bb664..76831f99f0e2a12461cc1bab4e5049a7288e9812 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(UseQtExt)
 
@@ -33,6 +32,7 @@ SET(PROJECT_HEADERS
     SHAPERGUI_OCCSelector.h
     SHAPERGUI_SalomeViewer.h
     SHAPERGUI_NestedButton.h
+       SHAPERGUI_ToolbarsMgr.h
 )
 
 SET(PROJECT_MOC_HEADERS
@@ -40,6 +40,7 @@ SET(PROJECT_MOC_HEADERS
     SHAPERGUI_DataModel.h
     SHAPERGUI_NestedButton.h
     SHAPERGUI_SalomeViewer.h
+       SHAPERGUI_ToolbarsMgr.h
 )
 
 # sources / moc wrappings
@@ -51,11 +52,12 @@ SET(PROJECT_SOURCES
     SHAPERGUI_OCCSelector.cpp
     SHAPERGUI_SalomeViewer.cpp
     SHAPERGUI_NestedButton.cpp
+       SHAPERGUI_ToolbarsMgr.cpp
 )
 
 SET(PROJECT_RESOURCES
     ${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml
-    ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml
+    resources/SalomeApp.xml
     resources/shaper.png
 )
 
@@ -108,10 +110,6 @@ CONFIGURE_FILE(
   "${CMAKE_CURRENT_SOURCE_DIR}/resources/LightApp.xml.in"
   "${CMAKE_CURRENT_BINARY_DIR}/LightApp.xml"
   )
-CONFIGURE_FILE(
-  "${CMAKE_CURRENT_SOURCE_DIR}/resources/SalomeApp.xml.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml"
-  )
 
 INSTALL(TARGETS SHAPER DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${PROJECT_RESOURCES} DESTINATION ${SHAPER_INSTALL_RESOURCES})
index e7189ffd8e38023950240ac34bb8d7198691c283..4b74af5ae33a5ee557e5b178c6c3b6968d73bf93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SHAPERGUI.h"
 #include "SHAPERGUI_DataModel.h"
 #include "SHAPERGUI_OCCSelector.h"
-#include <SHAPERGUI_NestedButton.h>
+#include "SHAPERGUI_NestedButton.h"
+#include "SHAPERGUI_ToolbarsMgr.h"
 
 #include <XGUI_Workshop.h>
 #include <XGUI_PropertyPanel.h>
@@ -33,6 +33,7 @@
 #include <XGUI_FacesPanel.h>
 #include <XGUI_SelectionActivate.h>
 #include <XGUI_InspectionPanel.h>
+#include <XGUI_ViewerProxy.h>
 
 #include <ModuleBase_Operation.h>
 #include <ModuleBase_Preferences.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_OCCSelector.h>
 #include <LightApp_Study.h>
+
 #include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewPort3d.h>
 
 #include <SUIT_Selector.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_DataBrowser.h>
 
@@ -66,6 +70,7 @@
 #include <QAction>
 #include <QTimer>
 #include <QMenu>
+#include <QToolBar>
 
 #define SALOME_PATCH_FOR_CTRL_WHEEL
 
@@ -81,6 +86,11 @@ SHAPERGUI_EXPORT char* getModuleVersion()
 }
 } // extern "C"
 
+
+static const QString ToolbarsSection("SHAPER_Toolbars");
+static const QString FreeCommandsParam("OutOFToolbars");
+
+
 /** 
 * Class for preferences management
 */
@@ -122,7 +132,7 @@ private:
 SHAPERGUI::SHAPERGUI()
     : LightApp_Module("SHAPER"),
       mySelector(0), myIsOpened(0), myPopupMgr(0), myIsInspectionVisible(false),
-  myInspectionPanel(0)
+  myInspectionPanel(0), myIsToolbarsModified(false)
 {
   myWorkshop = new XGUI_Workshop(this);
   connect(myWorkshop, SIGNAL(commandStatusUpdated()),
@@ -156,8 +166,8 @@ void SHAPERGUI::initialize(CAM_Application* theApp)
   int aMenu = createMenu(tr("Inspection"), -1, -1, 30);
   int aSubMenu = createMenu(tr("Information"), aMenu);
 
-  int aId = myActionsList.size();
-  myActionsList.append("INSPECTION_CMD");
+  int aId = getNextCommandId();
+  myActionsList.append(aId);
   SUIT_Desktop* aDesk = application()->desktop();
   QString aTip = tr("Show inspection window");
   myWhatIsAction = createAction(aId, aTip, QIcon(":pictures/whatis.png"), tr("What Is"),
@@ -166,8 +176,37 @@ void SHAPERGUI::initialize(CAM_Application* theApp)
   myWhatIsAction->setData("INSPECTION_CMD");
   createMenu(aId, aSubMenu, 0);
 
-  int aTool = createTool(tr("Inspection tool"));
+  QString aToolName = tr("Inspection tool");
+  int aTool = createTool(aToolName);
   int aToolId = createTool(myWhatIsAction, aTool);
+  registerCommandToolbar(aToolName, aId);
+
+  // Define Edit toolbars command
+  aId = getNextCommandId();
+  //myActionsList.append(aId); Do not use it for editing of toolbars
+  aTip = tr("Edit toolbars of the module");
+  QAction* aAction = createAction(aId, aTip, QIcon(":pictures/configure_toolbars.png"),
+    tr("Edit toolbars..."), aTip, QKeySequence(), aDesk, false, this, SLOT(onEditToolbars()));
+  int aEditMenu = createMenu(tr("MEN_DESK_EDIT"), -1, -1, 30);
+  int aEditItem = createMenu(aId, aEditMenu);
+
+  // Initialize viewer proxy if OCC viewer is already exist
+  ViewManagerList aOCCViewManagers;
+  application()->viewManagers(OCCViewer_Viewer::Type(), aOCCViewManagers);
+  if (aOCCViewManagers.size() > 0) {
+    SUIT_ViewManager* aMgr = aOCCViewManagers.first();
+    SUIT_ViewWindow* aWnd = aMgr->getActiveView();
+    if (aWnd) {
+      OCCViewer_ViewWindow* aOccWnd = static_cast<OCCViewer_ViewWindow*>(aWnd);
+      OCCViewer_ViewPort3d* aViewPort = aOccWnd->getViewPort();
+      if (aViewPort) {
+        XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
+        aViewPort->installEventFilter(aViewer);
+        Handle(V3d_View) aView = aViewPort->getView();
+        aViewer->SetScale(aView, aView->Camera()->Scale());
+      }
+    }
+  }
 }
 
 //******************************************************
@@ -210,6 +249,8 @@ void SHAPERGUI::viewManagers(QStringList& theList) const
 bool SHAPERGUI::activateModule(SUIT_Study* theStudy)
 {
   bool isDone = LightApp_Module::activateModule(theStudy);
+  loadToolbarsConfig();
+
   SHAPERGUI_DataModel* aDataModel = dynamic_cast<SHAPERGUI_DataModel*>(dataModel());
   aDataModel->initRootObject();
 
@@ -319,6 +360,8 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy)
 //******************************************************
 bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
 {
+  saveToolbarsConfig();
+
   myProxyViewer->activateViewer(false);
   setMenuShown(false);
   setToolShown(false);
@@ -377,7 +420,6 @@ bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
   connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
           getApp(), SLOT(onSaveAsDoc()));
 
-
   return LightApp_Module::deactivateModule(theStudy);
 }
 
@@ -535,8 +577,8 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theTBNam
   }
   aNb++;
 
-  int aId = myActionsList.size();
-  myActionsList.append(theId);
+  int aId = getNextCommandId();
+  myActionsList.append(aId);
   SUIT_Desktop* aDesk = application()->desktop();
   int aKeys = 0;
   for (int i = 0; i < theKeys.count(); i++)
@@ -554,9 +596,11 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theTBNam
 
   int aWBTool = createTool(theTBName, theTBName);
   int aToolId = createTool(aId, aWBTool);
-  if (isAddSeparator)
+  registerCommandToolbar(theTBName, aId);
+  if (isAddSeparator) {
     createTool(separator(), aWBTool);
-
+    registerCommandToolbar(theTBName, -1);
+  }
   return aAction;
 }
 
@@ -569,7 +613,6 @@ QAction* SHAPERGUI::addFeatureOfNested(const QString& theWBName,
                                        const ActionInfo& theInfo,
                                        const QList<QAction*>& theNestedActions)
 {
-  myActionsList.append(theInfo.id);
   SUIT_Desktop* aDesk = application()->desktop();
   SHAPERGUI_NestedButton* anAction = new SHAPERGUI_NestedButton(aDesk, theNestedActions);
   anAction->setData(theInfo.id);
@@ -585,11 +628,14 @@ QAction* SHAPERGUI::addFeatureOfNested(const QString& theWBName,
 
   int aWBMenu = createMenu(theWBName, -1, -1, 30);
   int aItemId = createMenu(anAction, aWBMenu);
+  myActionsList.append(aItemId);
   createMenu(separator(), aWBMenu); /// nested action is always separated of others
 
   int aWBTool = createTool(theWBName, theWBName);
   int aToolId = createTool(anAction, aWBTool);
+  registerCommandToolbar(theWBName, aItemId);
   createTool(separator(), aWBTool); /// nested action is always separated of others
+  registerCommandToolbar(theWBName, -1);
 
   return anAction;
 }
@@ -603,8 +649,8 @@ QAction* SHAPERGUI::addDesktopCommand(const QString& theId, const QString& theTi
 {
   int aMenu = createMenu(tr(theMenuSourceText), -1, -1);
 
-  int aId = myActionsList.size();
-  myActionsList.append(theId);
+  int aId = getNextCommandId();
+  myActionsList.append(aId);
   SUIT_Desktop* aDesk = application()->desktop();
   int aKeys = 0;
   for (int i = 0; i < theKeys.count(); i++)
@@ -624,6 +670,7 @@ void SHAPERGUI::addDesktopMenuSeparator(const char* theMenuSourceText, const int
   createMenu(separator(), aMenu, -1, theMenuPosition);
 }
 
+//******************************************************
 bool SHAPERGUI::addActionInToolbar( QAction* theAction, const QString& theToolBarTitle )
 {
   if( !theAction )
@@ -645,9 +692,9 @@ bool SHAPERGUI::addActionInToolbar( QAction* theAction, const QString& theToolBa
 QList<QAction*> SHAPERGUI::commandList() const
 {
   QList<QAction*> aActions;
-  for (int i = 0; i < myActionsList.size(); i++) {
-    QAction* aCmd = action(i);
-    if (aCmd && myActionsList.contains(aCmd->data().toString()))
+  foreach (int aId, myActionsList) {
+    QAction* aCmd = action(aId);
+    if (aCmd)
       aActions.append(aCmd);
   }
 
@@ -792,3 +839,248 @@ void SHAPERGUI::updateModuleVisibilityState()
   LightApp_Module::updateModuleVisibilityState();
   onWhatIs(myIsInspectionVisible);
 }
+
+void SHAPERGUI::onEditToolbars()
+{
+  SHAPERGUI_ToolbarsDlg aDlg(this);
+  if (aDlg.exec() == QDialog::Accepted) {
+    if (aDlg.isReset())
+      resetToolbars();
+    else
+      updateToolbars(aDlg.result());
+  }
+}
+
+void SHAPERGUI::registerCommandToolbar(const QString& theToolName, int theCommandId)
+{
+  if (!myToolbars.contains(theToolName))
+    myToolbars[theToolName] = QList<int>();
+  myToolbars[theToolName].append(theCommandId);
+}
+
+int SHAPERGUI::getNextCommandId() const
+{
+  QtxActionMenuMgr* aMenuMgr = menuMgr();
+  QIntList aIds = aMenuMgr->idList();
+  int aId = aIds.count();
+  while (action(aId) || myActionsList.contains(aId))
+    aId++;
+  return aId;
+}
+
+void SHAPERGUI::updateToolbars(const QMap<QString, QIntList>& theNewToolbars)
+{
+  // Store default toolbars
+  if (myDefaultToolbars.size() == 0)
+    myDefaultToolbars = myToolbars;
+
+  QtxActionToolMgr* aMgr = toolMgr();
+  QStringList aToolbars = theNewToolbars.keys();
+  QIntList aCommands, aOldCmd;
+  int aToolbarId;
+  QAction* aAction;
+  int aActionId;
+  foreach(QString aName, aToolbars) {
+    aCommands = theNewToolbars[aName];
+    // Find or create toolbar
+    if (aMgr->hasToolBar(aName)) {
+      aToolbarId = aMgr->find(aMgr->toolBar(aName));
+      aOldCmd = myToolbars[aName];
+    }
+    else {
+      aToolbarId = aMgr->createToolBar(aName);
+    }
+    int aPos = 0;
+    foreach(int aCmd, aCommands) {
+      // Find action
+      if (aCmd == -1)
+        aAction = separator();
+      else
+        aAction = action(aCmd);
+      aActionId = aMgr->actionId(aAction);
+      if (aActionId == -1) {
+        // Add new action
+        aMgr->insert(aAction, aToolbarId, aPos);
+      }
+      else {
+        // Change position of action
+        if (aMgr->index(aActionId, aToolbarId) != aPos) {
+          if (aMgr->containsAction(aActionId, aToolbarId))
+            aMgr->remove(aActionId, aToolbarId);
+          aMgr->insert(aActionId, aToolbarId, aPos);
+        }
+      }
+      aOldCmd.removeAll(aCmd);
+      aPos++;
+    }
+    // remove extra actions
+    foreach(int aCmd, aOldCmd) {
+      aAction = action(aCmd);
+      aActionId = aMgr->actionId(aAction);
+      aMgr->remove(aActionId, aToolbarId);
+    }
+    myToolbars.remove(aName);
+  }
+  // Remove extra toolbars
+  aToolbars = myToolbars.keys();
+  foreach(QString aName, aToolbars) {
+    aMgr->removeToolBar(aName);
+  }
+  // Set new toolbars structure
+  myToolbars = theNewToolbars;
+  myIsToolbarsModified = true;
+}
+
+void SHAPERGUI::saveToolbarsConfig()
+{
+  if (!myIsToolbarsModified)
+    return;
+  // Save toolbars config into map
+  QMap<QString, QStringList> aToolbarsConfig;
+  QtxActionToolMgr* aMgr = toolMgr();
+  QStringList aToolbars = myToolbars.keys();
+  QIntList aActionsIds;
+  foreach(QString aName, aToolbars) {
+    aActionsIds = myToolbars[aName];
+    QStringList aContent;
+    foreach(int aId, aActionsIds) {
+      if (aId == -1)
+        aContent.append("");
+      else
+        aContent.append(action(aId)->data().toString());
+    }
+    aToolbarsConfig[aName] = aContent;
+  }
+  // Store the config into resources
+  SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+  QStringList aNames = aToolbarsConfig.keys();
+  QStringList aValues;
+  foreach(QString aToolbar, aNames) {
+    aResMgr->setValue(ToolbarsSection, aToolbar, aToolbarsConfig[aToolbar].join(","));
+  }
+  // Remove obsolete parameters from resources
+  QStringList aOldParams = aResMgr->parameters(ToolbarsSection);
+  foreach(QString aName, aOldParams) {
+    if (!aToolbars.contains(aName))
+      aResMgr->remove(ToolbarsSection, aName);
+  }
+  // Store current list of free commands
+  QIntList aFreeCommands = getFreeCommands();
+  QStringList aFreeList;
+  foreach(int aId, aFreeCommands) {
+    aFreeList.append(action(aId)->data().toString());
+  }
+  if (aFreeList.size() > 0)
+    aResMgr->setValue(ToolbarsSection, FreeCommandsParam, aFreeList.join(","));
+
+  myIsToolbarsModified = false;
+}
+
+void SHAPERGUI::loadToolbarsConfig()
+{
+  SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+  QStringList aToolbarNames = aResMgr->parameters(ToolbarsSection);
+  if (aToolbarNames.size() == 0)
+    return;
+
+  // Create commands map
+  QMap<QString, int> aCommandsMap;
+  QString aCmdIdStr;
+  foreach(int aId, myActionsList) {
+    aCmdIdStr = action(aId)->data().toString();
+    aCommandsMap[aCmdIdStr] = aId;
+  }
+
+  // Create new toolbars structure
+  QMap<QString, QIntList> aToolbars;
+  QStringList aCommands;
+  QIntList aKnownCommands;
+  QList<QAction*> aActions;
+  foreach(QString aName, aToolbarNames) {
+    aCommands = aResMgr->stringValue(ToolbarsSection, aName).split(",");
+    if (aName == FreeCommandsParam) {
+      // The value is a list of free commands
+      foreach(QString aCommand, aCommands) {
+        aKnownCommands.append(aCommandsMap[aCommand]);
+      }
+    }
+    else {
+      aToolbars[aName] = QIntList();
+      if (aCommands.size() > 0) {
+        foreach(QString aCommand, aCommands) {
+          if (aCommand.isEmpty())
+            aToolbars[aName].append(-1);
+          else if (aCommandsMap.contains(aCommand)) {
+            int aId = aCommandsMap[aCommand];
+            aToolbars[aName].append(aId);
+            aKnownCommands.append(aId);
+          }
+        }
+      }
+    }
+  }
+  // Find new and obsolete commands
+  QIntList aNewCommands = myActionsList;
+  foreach(int aId, myActionsList) {
+    if (aKnownCommands.contains(aId)) {
+      aKnownCommands.removeAll(aId);
+      aNewCommands.removeAll(aId);
+    }
+  }
+  if (aNewCommands.size() > 0) {
+    // Add new commands to toolbars structure
+    QStringList aKeys = myToolbars.keys();
+    foreach(int aNewId, aNewCommands) {
+      foreach(QString aName, aKeys) {
+        if (myToolbars[aName].contains(aNewId)) {
+          if (!aToolbars.contains(aName)) {
+            aToolbars[aName] = QIntList();
+          }
+          aToolbars[aName].append(aNewId);
+        }
+      }
+    }
+  }
+  if (aKnownCommands.size() > 0) {
+    // Remove obsolete commands from the toolbars structure
+    QStringList aKeys = aToolbars.keys();
+    foreach(int aOldId, aKnownCommands) {
+      foreach(QString aName, aKeys) {
+        if (aToolbars[aName].contains(aOldId)) {
+          aToolbars[aName].removeAll(aOldId);
+          if (aToolbars[aName].size() == 0)
+            aToolbars.remove(aName);
+        }
+      }
+    }
+  }
+  updateToolbars(aToolbars);
+  myIsToolbarsModified = false;
+}
+
+
+QIntList SHAPERGUI::getFreeCommands() const
+{
+  QIntList aFreeCommands;
+  QtxActionToolMgr* aMgr = toolMgr();
+  QAction* anAction;
+  int aId;
+  QMap<QString, QIntList>::const_iterator aIt;
+  QIntList aShaperActions = shaperActions();
+  foreach(int aCmd, aShaperActions) {
+    anAction = action(aCmd);
+    aId = aMgr->actionId(anAction);
+    if (!aMgr->containsAction(aId))
+      aFreeCommands.append(aCmd);
+  }
+  return aFreeCommands;
+}
+
+void SHAPERGUI::resetToolbars()
+{
+  if (!myDefaultToolbars.isEmpty())
+    updateToolbars(myDefaultToolbars);
+  myIsToolbarsModified = false;
+  SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+  aResMgr->remove(ToolbarsSection);
+}
index 1241ebc75d0c90a38b78c4cb797fa5260697c0e6..32b5035cde8ac7006a3e06d8ced4d768411a8c77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SHAPERGUI_H
@@ -29,7 +28,7 @@
 
 #include <ModuleBase_ActionInfo.h>
 
-#include <QStringList>
+#include <QList>
 #include <QMap>
 
 class XGUI_Workshop;
@@ -156,6 +155,21 @@ Q_OBJECT
 
   virtual void updateModuleVisibilityState();
 
+  /// Returns list of the module commands
+  QIntList shaperActions() const { return myActionsList; }
+
+  /// Returns structure of tool bars
+  QMap<QString, QIntList> shaperToolbars() const { return myToolbars; }
+
+  /// Returns free commands which are not in toolbars in the module
+  QIntList getFreeCommands() const;
+
+  /// Returns structure of default tool bars
+  QMap<QString, QIntList> defaultToolbars() const
+  { return (myDefaultToolbars.size() == 0)? myToolbars : myDefaultToolbars; }
+
+  void resetToolbars();
+
  public slots:
   /// \brief The method is redefined to connect to the study viewer before the data
   /// model is filled by opened file. This file open will flush redisplay signals for,
@@ -207,13 +221,22 @@ Q_OBJECT
 private slots:
   void onWhatIs(bool isToggled);
 
+  void onEditToolbars();
+
  private:
    /// Create selector for OCC Viewer
    /// \param theMgr view manager
   SHAPERGUI_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
 
-  /// List of registered actions
-  QStringList myActionsList;
+  void registerCommandToolbar(const QString& theToolName, int theCommandId);
+
+  int getNextCommandId() const;
+
+  // Update current toolbars
+  void updateToolbars(const QMap<QString, QIntList>& theNewToolbars);
+
+  void saveToolbarsConfig();
+  void loadToolbarsConfig();
 
   /// List of registered nested actions
   QStringList myNestedActionsList;
@@ -249,6 +272,11 @@ private slots:
   bool myIsInspectionVisible;
   QDockWidget* myInspectionPanel;
 
+  /// List of registered actions
+  QIntList myActionsList;
+  QMap<QString, QIntList> myToolbars;
+  QMap<QString, QIntList> myDefaultToolbars;
+  bool myIsToolbarsModified;
 };
 
 #endif
index 304dc616c4b9652c432d99e6e65736658ce22567..b7ff690e3addb6a70f6b878687cff0b1ee70c136 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SHAPERGUI_DataModel.h"
@@ -78,20 +77,7 @@ bool SHAPERGUI_DataModel::open(const QString& thePath, CAM_Study* theStudy, QStr
     QString aCurrentFile = SUIT_Tools::addSlash(aTmpDir) + aFileName;
     XGUI_Workshop* aWorkShop = myModule->workshop();
     aWorkShop->openFile(aCurrentFile);
-    //QString aNewFile = SUIT_Tools::addSlash(aNewTmpDir) + aFileName;
-    //if (!QFile::copy(aCurrentFile, aNewFile))
-    //  isDone = false;
   }
-  //if (isDone) {
-  //  myTmpDirectory = aNewTmpDir;
-  //}
-  //else {
-  //  removeDirectory(aNewTmpDir);
-  //  myTmpDirectory = "";
-  //}
-
-  //SessionPtr aMgr = ModelAPI_Session::get();
-  //aMgr->load(qPrintable(aNewTmpDir));
 
   myModule->setIsOpened(true);
   return true;
@@ -113,7 +99,6 @@ bool SHAPERGUI_DataModel::save(QStringList& theFiles)
   bool isMultiFile = aResMgr ? aResMgr->booleanValue("Study", "multi_file", false) : false;
 
   std::string aTmpDir = aStudy->GetTmpDir(qPrintable(myStudyPath), isMultiFile);
-  //std::string aTmpDir = aStudy->GetTmpDir("", false);//true );
   QString aTmp = QString(aTmpDir.c_str());
   theFiles.append(aTmp);
 
@@ -122,21 +107,13 @@ bool SHAPERGUI_DataModel::save(QStringList& theFiles)
     aMgr->blockAutoUpdate(false);
 
   //aWorkShop->saveDocument(QString(aTmpDir.c_str()), aFileNames);
-  aWorkShop->setCurrentDataFile(aTmp + "shaper.opp");
+  aWorkShop->setCurrentDataFile(aTmp + "shaper.shaper");
   aWorkShop->onSave();
   QString aName = aWorkShop->currentDataFile();
-  std::string aa = aName.toStdString();
   aName.replace(QChar('\\'), QChar('/'));
   int aN = aName.lastIndexOf('/');
   theFiles.append(aName.right(aName.length() - aN - 1));
 
-  //std::list<std::string>::iterator aIt;
-  //for (aIt = aFileNames.begin(); aIt != aFileNames.end(); ++aIt) {
-  //  QString aName((*aIt).c_str());
-  //  aName.replace(QChar('\\'), QChar('/'));
-  //  int aN = aName.lastIndexOf('/');
-  //  theFiles.append(aName.right(aName.length() - aN - 1));
-  //}
   return true;
 }
 
@@ -149,8 +126,6 @@ bool SHAPERGUI_DataModel::saveAs(const QString& thePath, CAM_Study* theStudy, QS
 bool SHAPERGUI_DataModel::close()
 {
   myModule->workshop()->closeDocument();
-  //removeDirectory(myTmpDirectory);
-  //myTmpDirectory = "";
   return LightApp_DataModel::close();
 }
 
index e95824ae7b02b84f5d70c371cae025dcce30845c..0669e0d14b7f777e42337ab69682133a14bc5405 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SHAPERGUI_DATAMODEL_H
index 37926325ea41863ae0185acffcf39f420988acd5..76c5cdbbb20c13dc661360449bad17821784bd13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /*
index f2843b27fd9449edba87b4a086051b845eaf6748..030ac4442cf73f0b9dadef3fc712b8cfd5c89043 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /*
index 73379d2b634b0b6dd4c9d44702e2345f9e35a978..7eaf9a66678a0aa441c89eaef7377df9887bc775 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SHAPERGUI_OCCSelector.h"
index 0b63397cc69d31e905c4f0a39e1e72f2b6440a26..4d861724efbe9c52c1570f67b257261b8c007ff8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SHAPERGUI_OCCSelector_H
index 58cb99b4ccb86062964ea8fd29032f541d3de0e7..467f6a9b6f1fc5a41e40995823dc811cb43242d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SHAPERGUI_SalomeViewer.h"
@@ -120,7 +119,7 @@ Handle(V3d_View) SHAPERGUI_SalomeViewer::activeView() const
 //**********************************************
 QWidget* SHAPERGUI_SalomeViewer::activeViewPort() const
 {
-  QWidget* aViewPort;
+  QWidget* aViewPort = 0;
   if (mySelector) {
     OCCViewer_Viewer* aViewer = mySelector->viewer();
     SUIT_ViewManager* aMgr = aViewer->getViewManager();
index b01fd34eab592b031b7db264ab412d83d136c767..6e9129bc158f34c9c2e4fcfb5fda2e82d77cbced 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SHAPERGUI_SalomeViewer_H
diff --git a/src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.cpp b/src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.cpp
new file mode 100644 (file)
index 0000000..0d0afe1
--- /dev/null
@@ -0,0 +1,477 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 "SHAPERGUI_ToolbarsMgr.h"
+#include "SHAPERGUI.h"
+
+#include <CAM_Application.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <QtxActionToolMgr.h>
+
+#include <QLayout>
+#include <QDialogButtonBox>
+#include <QLabel>
+#include <QListWidget>
+#include <QPushButton>
+#include <QInputDialog>
+#include <QMessageBox>
+#include <QMouseEvent>
+
+
+#define SEPARATOR "------"
+#define LIST_WIDTH 180
+
+class SHAPERGUI_CommandIdItem : public QListWidgetItem
+{
+public:
+  SHAPERGUI_CommandIdItem(QListWidget* theParent, int theId, SHAPERGUI* theModule)
+    : QListWidgetItem(theParent), myId(theId), myModule(theModule) {}
+
+
+  virtual QVariant data(int theRole) const {
+    QAction* aAction = 0;
+    if (myId != -1)
+      aAction = myModule->action(myId);
+
+    switch (theRole) {
+    case Qt::DisplayRole:
+      if (aAction)
+        return aAction->text();
+      else
+        return SEPARATOR;
+    case Qt::DecorationRole:
+      if (aAction)
+        return aAction->icon();
+      else
+        return QIcon();
+    }
+    return QListWidgetItem::data(theRole);
+  }
+
+
+  int id() const { return myId; }
+
+private:
+  SHAPERGUI* myModule;
+  int myId;
+};
+
+
+//************************************************************************************
+//************************************************************************************
+//************************************************************************************
+SHAPERGUI_ToolbarsDlg::SHAPERGUI_ToolbarsDlg(SHAPERGUI* theModule)
+  : QDialog(theModule->application()->desktop()),
+  myModule(theModule),
+  myResult(theModule->shaperToolbars()),
+  myIsReset(false)
+{
+  myFreeCommands = theModule->getFreeCommands();
+
+  setWindowTitle(tr("Toolbars"));
+  QVBoxLayout* aMailLayout = new QVBoxLayout(this);
+
+  // Controls part of the dialog
+  QWidget* aControlsWgt = new QWidget(this);
+  QHBoxLayout* aContolsLay = new QHBoxLayout(aControlsWgt);
+  aContolsLay->setContentsMargins(0, 0, 0, 0);
+  aMailLayout->addWidget(aControlsWgt);
+
+  // Right controls
+  QWidget* aListWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aListLayout = new QVBoxLayout(aListWgt);
+  aListLayout->setContentsMargins(0, 0, 0, 0);
+  aContolsLay->addWidget(aListWgt);
+
+  aListLayout->addWidget(new QLabel(tr("Toolbars:"), aListWgt));
+
+  myToolbarsList = new QListWidget(aListWgt);
+  connect(myToolbarsList, SIGNAL(doubleClicked(const QModelIndex&)),
+    SLOT(onDoubleClick(const QModelIndex&)));
+  aListLayout->addWidget(myToolbarsList);
+
+  QWidget* aFreeItemsWgt = new QWidget(aListWgt);
+  QHBoxLayout* aFreeLayout = new QHBoxLayout(aFreeItemsWgt);
+  aFreeLayout->setContentsMargins(0, 0, 0, 0);
+  aListLayout->addWidget(aFreeItemsWgt);
+
+  aFreeLayout->addWidget(new QLabel(tr("Number of commands out of toolbars:"), aFreeItemsWgt));
+  myFreeNbLbl = new QLabel(aFreeItemsWgt);
+  aFreeLayout->addWidget(myFreeNbLbl);
+
+  // Left controls
+  QWidget* aButtonsWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aBtnLayout = new QVBoxLayout(aButtonsWgt);
+  aBtnLayout->setContentsMargins(0, 0, 0, 0);
+  aContolsLay->addWidget(aButtonsWgt);
+
+  QPushButton* aAddBtn = new QPushButton(tr("Add..."), aButtonsWgt);
+  aAddBtn->setToolTip(tr("Add a new empty toolbar to the toolbars list"));
+  connect(aAddBtn, SIGNAL(clicked(bool)), SLOT(onAdd()));
+  aBtnLayout->addWidget(aAddBtn);
+
+  QPushButton* aEditBtn = new QPushButton(tr("Edit..."), aButtonsWgt);
+  aEditBtn->setToolTip(tr("Edit currently selected toolbar"));
+  connect(aEditBtn, SIGNAL(clicked(bool)), SLOT(onEdit()));
+  aBtnLayout->addWidget(aEditBtn);
+
+  QPushButton* aDeleteBtn = new QPushButton(tr("Delete"), aButtonsWgt);
+  aDeleteBtn->setToolTip(tr("Delete currently selected toolbar"));
+  connect(aDeleteBtn, SIGNAL(clicked(bool)), SLOT(onDelete()));
+  aBtnLayout->addWidget(aDeleteBtn);
+  aBtnLayout->addStretch(1);
+
+  QPushButton* aResetBtn = new QPushButton(tr("Reset"), aButtonsWgt);
+  aResetBtn->setToolTip(tr("Restore default toolbars structure"));
+  connect(aResetBtn, SIGNAL(clicked(bool)), SLOT(onReset()));
+  aBtnLayout->addWidget(aResetBtn);
+  aBtnLayout->addSpacing(19);
+
+  // Buttons part of the dialog
+  QDialogButtonBox* aButtons =
+    new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
+      Qt::Horizontal, this);
+  aMailLayout->addWidget(aButtons);
+  connect(aButtons, SIGNAL(accepted()), SLOT(accept()));
+  connect(aButtons, SIGNAL(rejected()), SLOT(reject()));
+  connect(aButtons, SIGNAL(helpRequested()), SLOT(onHelp()));
+
+  updateToolbarsList();
+  updateNumber();
+}
+
+void SHAPERGUI_ToolbarsDlg::onAdd()
+{
+  QString aNewToolbar =
+    QInputDialog::getText(this, tr("Create toolbar"), tr("Name of a new toolbar"));
+  if (!(aNewToolbar.isNull() || aNewToolbar.isEmpty())) {
+    if (!myResult.contains(aNewToolbar)) {
+      myResult[aNewToolbar] = QIntList();
+      updateToolbarsList();
+      myIsReset = false;
+    }
+    else {
+      QString aMsg = tr("A tool bar with name %1 already exists").arg(aNewToolbar);
+      QMessageBox::warning(this, tr("Create toolbar"), aMsg);
+    }
+  }
+}
+
+void SHAPERGUI_ToolbarsDlg::onEdit()
+{
+  QList<QListWidgetItem*> aSelected = myToolbarsList->selectedItems();
+  if (aSelected.size() == 1) {
+    QString aToolbarName = aSelected.first()->text();
+    int aPos = aToolbarName.lastIndexOf(" (");
+    aToolbarName = aToolbarName.left(aPos);
+
+    SHAPERGUI_ToolbarItemsDlg aDlg(this, myModule,
+      aToolbarName, myFreeCommands, myResult[aToolbarName]);
+    if (aDlg.exec() == QDialog::Accepted) {
+      myFreeCommands = aDlg.freeItems();
+      myResult[aToolbarName] = aDlg.toolbarItems();
+      updateNumber();
+      updateToolbarsList();
+      myIsReset = false;
+    }
+  }
+}
+
+void SHAPERGUI_ToolbarsDlg::onDelete()
+{
+  QList<QListWidgetItem*> aSelected = myToolbarsList->selectedItems();
+  if (aSelected.size() == 1) {
+    QString aToolbarName = aSelected.first()->text();
+    int aPos = aToolbarName.lastIndexOf(" (");
+    aToolbarName = aToolbarName.left(aPos);
+
+    QString aMsg = tr("Toolbar %1 will be deleted. Continue?").arg(aToolbarName);
+    if (QMessageBox::question(this, tr("Delete toolbar"), aMsg) == QMessageBox::Yes) {
+      myFreeCommands.append(myResult[aToolbarName]);
+      // remove separators from free items
+      myFreeCommands.removeAll(-1);
+      myResult.remove(aToolbarName);
+      updateToolbarsList();
+      updateNumber();
+      myIsReset = false;
+    }
+  }
+}
+
+void SHAPERGUI_ToolbarsDlg::updateToolbarsList()
+{
+  myToolbarsList->clear();
+  QStringList aItems;
+  QMap<QString, QIntList>::const_iterator aIt;
+  for (aIt = myResult.cbegin(); aIt != myResult.cend(); aIt++) {
+    aItems.append(aIt.key() + tr(" (%1 commands)").arg(aIt.value().size() - aIt.value().count(-1)));
+  }
+  myToolbarsList->addItems(aItems);
+}
+
+
+void SHAPERGUI_ToolbarsDlg::onDoubleClick(const QModelIndex& theIdx)
+{
+  if (theIdx.isValid())
+    onEdit();
+}
+
+void SHAPERGUI_ToolbarsDlg::updateNumber()
+{
+  myFreeNbLbl->setText(QString::number(myFreeCommands.size()));
+}
+
+void SHAPERGUI_ToolbarsDlg::onReset()
+{
+  myResult = myModule->defaultToolbars();
+  updateNumber();
+  updateToolbarsList();
+  myIsReset = true;
+}
+
+void SHAPERGUI_ToolbarsDlg::onHelp()
+{
+  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+  if (app)
+    app->onHelpContextModule("SHAPER", "Introduction.html", "toolbars-dialog-box");
+}
+
+
+//************************************************************************************
+//************************************************************************************
+//************************************************************************************
+SHAPERGUI_ToolbarItemsDlg::SHAPERGUI_ToolbarItemsDlg(QWidget* theParent,
+  SHAPERGUI* theModule,
+  const QString& theToolbar,
+  const QIntList& theFreeItems,
+  const QIntList& theItemsList)
+  : QDialog(theParent),
+  myModule(theModule)
+{
+  setWindowTitle(tr("Edit toolbar"));
+
+  QVBoxLayout* aMailLayout = new QVBoxLayout(this);
+
+  // Name of toolbar
+  QWidget* aNameWgt = new QWidget(this);
+  QHBoxLayout* aNameLay = new QHBoxLayout(aNameWgt);
+  aNameLay->setContentsMargins(0, 0, 0, 0);
+  aMailLayout->addWidget(aNameWgt);
+
+  aNameLay->addWidget(new QLabel(tr("Toolbar name:"), aNameWgt));
+  QLabel* aNameLbl = new QLabel(theToolbar, aNameWgt);
+  QFont aFont = aNameLbl->font();
+  aFont.setBold(true);
+  aNameLbl->setFont(aFont);
+  aNameLay->addWidget(aNameLbl);
+  aNameLay->addStretch(1);
+
+  // Lists widget
+  QWidget* aControlsWgt = new QWidget(this);
+  QHBoxLayout* aCtrlLayout = new QHBoxLayout(aControlsWgt);
+  aCtrlLayout->setContentsMargins(0, 0, 0, 0);
+  aMailLayout->addWidget(aControlsWgt);
+
+  // Left list
+  QWidget* aCommandsWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aCommandsLay = new QVBoxLayout(aCommandsWgt);
+  aCommandsLay->setContentsMargins(0, 0, 0, 0);
+  aCtrlLayout->addWidget(aCommandsWgt);
+
+  aCommandsLay->addWidget(new QLabel(tr("Out of toolbars:"), aCommandsWgt));
+  myCommandsList = new QListWidget(aCommandsWgt);
+  myCommandsList->setSortingEnabled(false);
+
+  myCommandsList->addItem(new SHAPERGUI_CommandIdItem(myCommandsList, -1, myModule));
+  foreach(int aId, theFreeItems) {
+    myCommandsList->addItem(new SHAPERGUI_CommandIdItem(myCommandsList, aId, myModule));
+  }
+  myCommandsList->setMaximumWidth(LIST_WIDTH);
+  aCommandsLay->addWidget(myCommandsList);
+
+  // Middle buttons
+  QWidget* aButtonsWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aBtnLayout = new QVBoxLayout(aButtonsWgt);
+  aBtnLayout->setContentsMargins(0, 0, 0, 0);
+  aCtrlLayout->addWidget(aButtonsWgt);
+
+  aBtnLayout->addStretch(1);
+  QPushButton* aAddButton = new QPushButton(QIcon(":pictures/arrow-right.png"), "", aButtonsWgt);
+  connect(aAddButton, SIGNAL(clicked(bool)), SLOT(onAddItem()));
+  aBtnLayout->addWidget(aAddButton);
+
+  aBtnLayout->addSpacing(20);
+
+  QPushButton* aDelButton = new QPushButton(QIcon(":pictures/arrow-left.png"), "", aButtonsWgt);
+  connect(aDelButton, SIGNAL(clicked(bool)), SLOT(onDelItem()));
+  aBtnLayout->addWidget(aDelButton);
+  aBtnLayout->addStretch(1);
+
+  // Right list
+  QWidget* aItemsWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aItemsLay = new QVBoxLayout(aItemsWgt);
+  aItemsLay->setContentsMargins(0, 0, 0, 0);
+  aCtrlLayout->addWidget(aItemsWgt);
+
+  aItemsLay->addWidget(new QLabel(tr("In the toolbar:"), aItemsWgt));
+  myItemsList = new QListWidget(aItemsWgt);
+  myItemsList->setSortingEnabled(false);
+  foreach(int aId, theItemsList) {
+    myItemsList->addItem(new SHAPERGUI_CommandIdItem(myItemsList, aId, myModule));
+  }
+  myItemsList->setMaximumWidth(LIST_WIDTH);
+  myItemsList->viewport()->installEventFilter(this);
+  aItemsLay->addWidget(myItemsList);
+
+  // Buttons of right list
+  QWidget* aBtnWgt = new QWidget(aControlsWgt);
+  QVBoxLayout* aBtnLay = new QVBoxLayout(aBtnWgt);
+  aBtnLay->setContentsMargins(0, 0, 0, 0);
+  aCtrlLayout->addWidget(aBtnWgt);
+
+  aBtnLay->addStretch(1);
+  QPushButton* aUpButton = new QPushButton(QIcon(":pictures/arrow-up.png"), "", aBtnWgt);
+  connect(aUpButton, SIGNAL(clicked(bool)), SLOT(onUp()));
+  aBtnLay->addWidget(aUpButton);
+
+  aBtnLay->addSpacing(20);
+
+  QPushButton* aDownButton = new QPushButton(QIcon(":pictures/arrow-down.png"), "", aBtnWgt);
+  connect(aDownButton, SIGNAL(clicked(bool)), SLOT(onDown()));
+  aBtnLay->addWidget(aDownButton);
+  aBtnLay->addStretch(1);
+
+  // Buttons part of the dialog
+  QDialogButtonBox* aButtons =
+    new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
+      Qt::Horizontal, this);
+  aMailLayout->addWidget(aButtons);
+  connect(aButtons, SIGNAL(accepted()), SLOT(accept()));
+  connect(aButtons, SIGNAL(rejected()), SLOT(reject()));
+  connect(aButtons, SIGNAL(helpRequested()), SLOT(onHelp()));
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onAddItem()
+{
+  QList<QListWidgetItem*> aCurrentList = myCommandsList->selectedItems();
+  if (aCurrentList.size() > 0) {
+    SHAPERGUI_CommandIdItem* aItem = dynamic_cast<SHAPERGUI_CommandIdItem*>(aCurrentList.first());
+    int aId = aItem->id();
+    if (aId != -1) {
+      myCommandsList->removeItemWidget(aItem);
+      delete aItem;
+    }
+    QModelIndex aIdx = myItemsList->currentIndex();
+    aItem = new SHAPERGUI_CommandIdItem(0, aId, myModule);
+    if (aIdx.isValid()) {
+      int aRow = aIdx.row();
+      myItemsList->insertItem(aRow, aItem);
+    }
+    else {
+      myItemsList->addItem(aItem);
+    }
+  }
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onDelItem()
+{
+  QList<QListWidgetItem*> aCurrentList = myItemsList->selectedItems();
+  if (aCurrentList.size() > 0) {
+    SHAPERGUI_CommandIdItem* aItem = dynamic_cast<SHAPERGUI_CommandIdItem*>(aCurrentList.first());
+    int aId = aItem->id();
+    myItemsList->removeItemWidget(aItem);
+    delete aItem;
+    if (aId != -1) {
+      aItem = new SHAPERGUI_CommandIdItem(myCommandsList, aId, myModule);
+      myCommandsList->addItem(aItem);
+    }
+  }
+}
+
+
+bool SHAPERGUI_ToolbarItemsDlg::eventFilter(QObject* theObj, QEvent* theEvent)
+{
+  if (theEvent->type() == QEvent::MouseButtonRelease) {
+    QMouseEvent* aMouseEvent = (QMouseEvent*)theEvent;
+    QModelIndex aIdx = myItemsList->indexAt(aMouseEvent->pos());
+    if (!aIdx.isValid() || aMouseEvent->button() == Qt::RightButton) {
+      myItemsList->setCurrentIndex(QModelIndex());
+    }
+  }
+  return QDialog::eventFilter(theObj, theEvent);
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onUp()
+{
+  QModelIndex aCurrentIdx = myItemsList->currentIndex();
+  if (aCurrentIdx.isValid()) {
+    int aRow = aCurrentIdx.row();
+    if (aRow > 0) {
+      QListWidgetItem* aItem = myItemsList->takeItem(aRow);
+      aRow--;
+      myItemsList->insertItem(aRow, aItem);
+      myItemsList->setCurrentRow(aRow);
+    }
+  }
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onDown()
+{
+  QModelIndex aCurrentIdx = myItemsList->currentIndex();
+  if (aCurrentIdx.isValid()) {
+    int aNb = myItemsList->count();
+    int aRow = aCurrentIdx.row();
+    if (aRow < (aNb - 1)) {
+      QListWidgetItem* aItem = myItemsList->takeItem(aRow);
+      aRow++;
+      myItemsList->insertItem(aRow, aItem);
+      myItemsList->setCurrentRow(aRow);
+    }
+  }
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::freeItems() const
+{
+  return getItems(myCommandsList, 1);
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::toolbarItems() const
+{
+  return getItems(myItemsList, 0);
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::getItems(QListWidget* theWidget, int theStart) const
+{
+  QIntList aList;
+  SHAPERGUI_CommandIdItem* aItem = 0;
+  int aNb = theWidget->count();
+  for (int i = theStart; i < aNb; i++) {
+    aItem = (SHAPERGUI_CommandIdItem*)theWidget->item(i);
+    aList.append(aItem->id());
+  }
+  return aList;
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onHelp()
+{
+  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+  if (app)
+    app->onHelpContextModule("SHAPER", "Introduction.html", "edit-toolbar-dialog-box");
+}
diff --git a/src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.h b/src/SHAPERGUI/SHAPERGUI_ToolbarsMgr.h
new file mode 100644 (file)
index 0000000..9ba3eb3
--- /dev/null
@@ -0,0 +1,152 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef SHAPERGUI_ToolbarsMgr_H
+#define SHAPERGUI_ToolbarsMgr_H
+
+#include "SHAPER_SHAPERGUI.h"
+
+#include <Qtx.h>
+
+#include <QDialog>
+#include <QString>
+#include <QStringList>
+#include <QMap>
+
+class QListWidget;
+class SHAPERGUI;
+class QLabel;
+
+/**
+* \ingroup Salome
+* A dialog box for editing of toolbar items
+*/
+class SHAPERGUI_ToolbarItemsDlg : public QDialog
+{
+  Q_OBJECT
+public:
+  /// Constructor
+  /// \param theParent a parent for the dialog
+  /// \param theModule a module with toolbars
+  /// \param theToolbar a name of the toolbar for editing
+  /// \param theFreeItems a list of commands out of toolbars
+  /// \param theItemsList a list of command in the toolbar
+  SHAPERGUI_ToolbarItemsDlg(QWidget* theParent,
+    SHAPERGUI* theModule,
+    const QString& theToolbar,
+    const QIntList& theFreeItems,
+    const QIntList& theItemsList);
+
+  /// Returns list of free commands
+  QIntList freeItems() const;
+
+  /// Returns list of commands in the toolbar
+  QIntList toolbarItems() const;
+
+protected:
+  /// An redifinition of a virtual function
+  /// \param theObj an object
+  /// \param theEvent an event
+  virtual bool eventFilter(QObject* theObj, QEvent* theEvent);
+
+private slots:
+  /// A slot for button to add an item to toolbar commands
+  void onAddItem();
+
+  /// A slot for button to remove an item from toolbar commands
+  void onDelItem();
+
+  /// A slot to move a current item up in list of toolbar command
+  void onUp();
+
+  /// A slot to move a current item down in list of toolbar command
+  void onDown();
+
+  /// A slot on help call
+  void onHelp();
+
+private:
+  QIntList getItems(QListWidget* theWidget, int theStart) const;
+
+  SHAPERGUI* myModule;
+
+  QListWidget* myCommandsList;
+  QListWidget* myItemsList;
+};
+
+
+/**
+* \ingroup Salome
+* A dialog box for toolbars management
+*/
+class SHAPERGUI_ToolbarsDlg : public QDialog
+{
+  Q_OBJECT
+public:
+  /// Constructor
+  /// \param theModule a SHAPER module
+  SHAPERGUI_ToolbarsDlg(SHAPERGUI* theModule);
+
+  /// Returns result of editing
+  QMap<QString, QIntList> result() const { return myResult; }
+
+  /// Returns a flag of resetted toolbars structure
+  bool isReset() const {
+    return myIsReset;
+  }
+
+private slots:
+  /// A slot to add a new toolbar
+  void onAdd();
+
+  /// A slot to edit a current toolbar
+  void onEdit();
+
+  /// A slot to delete a current toolbar
+  void onDelete();
+
+  /// A slot to reset toolbars
+  void onReset();
+
+  /// A slot on help call
+  void onHelp();
+
+  /// A slot called on double click on item in list
+  void onDoubleClick(const QModelIndex& theIdx);
+
+private:
+  /// Update content of toolbars list
+  void updateToolbarsList();
+
+  /// Update number of free items
+  void updateNumber();
+
+private:
+  SHAPERGUI* myModule;
+  QMap<QString, QIntList> myResult;
+  QIntList myFreeCommands;
+
+  QLabel* myFreeNbLbl;
+  QListWidget* myToolbarsList;
+
+  bool myIsReset;
+};
+
+
+#endif
\ No newline at end of file
index 43a77b146c64a17315f964ed7bff85a6b630445d..c665da2c8d6cc7bab1fad178a8e647e7864788a6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SHAPER_SHAPERGUI_H
index bab628d81ffd5bbbdb0ab58e85e45d7181343c3e..cbaaa43f71ff15e4d81e7f99ae5038641d43afcf 100644 (file)
@@ -1,24 +1,8 @@
-<!--
-  Copyright (C) 2005-2013  OPEN CASCADE
-
-  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.
-
-  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
-
--->
 <document>
+  <section name="launch">
+    <!-- SALOME launching parameters -->
+    <parameter name="modules"    value="GEOM,SMESH,HEXABLOCK,MED,YACS,PARAVIS,SHAPER"/>
+  </section>
   <section name="SHAPER">
     <!-- Major module parameters -->
     <parameter name="name" value="Shaper"/>
     <parameter name="documentation" value="shaper_help"/>
   </section>
   <section name="shaper_help" >
-    <parameter name="sub_menu"          value="%1 module"/>
-    <parameter name="Developer's Guide" value="%SHAPER_ROOT_DIR%/share/doc/salome/tui/SHAPER/index.html"/>
-    <parameter name="User's Guide"      value="%SHAPER_ROOT_DIR%/share/doc/salome/gui/SHAPER/index.html"/>
+    <parameter name="Developer's Guide/Shaper module/Developer's Guide" value="%SHAPER_ROOT_DIR%/share/doc/salome/tui/SHAPER/index.html"/>
+    <parameter name="User's Guide/Shaper module/User's Guide" value="%SHAPER_ROOT_DIR%/share/doc/salome/gui/SHAPER/index.html"/>
   </section>
   <section name="resources">
     <!-- Module resources -->
-    <parameter name="SHAPER" value="${SHAPER_ROOT_DIR}/share/salome/resources/shaper"/>
+    <parameter name="SHAPER" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
   </section>
   <section name="Viewer" >
     <!-- Viewer preferences -->
     <parameter name="point-selection-sensitivity" value="12" />
     <parameter name="edge-selection-sensitivity" value="2" />
   </section>
+  <section name="windows_geometry">
+   <parameter name="SHAPER" value="@ByteArray[#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #03 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #DF #FC #02 #00 #00 #00 #02 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #B0 #00 #00 #02 #3D #00 #00 #00 #00 #00 #00 #00 #00 #FC #00 #00 #00 #B0 #00 #00 #02 #DF #00 #00 #00 #6B #00 #FF #FF #FF #FA #00 #00 #00 #00 #02 #00 #00 #00 #02 #FB #FF #FF #FF #FF #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #6B #00 #FF #FF #FF #FB #00 #00 #00 #26 #00 #70 #00 #72 #00 #6F #00 #70 #00 #65 #00 #72 #00 #74 #00 #79 #00 #5F #00 #70 #00 #61 #00 #6E #00 #65 #00 #6C #00 #5F #00 #64 #00 #6F #00 #63 #00 #6B #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #01 #1F #00 #FF #FF #FF #00 #00 #00 #01 #00 #00 #00 #00 #00 #00 #00 #00 #FC #02 #00 #00 #00 #02 #FB #00 #00 #00 #2A #00 #69 #00 #6E #00 #73 #00 #70 #00 #65 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #00 #5F #00 #70 #00 #61 #00 #6E #00 #65 #00 #6C #00 #5F #00 #64 #00 #6F #00 #63 #00 #6B #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #D1 #00 #FF #FF #FF #FB #FF #FF #FF #FF #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #70 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #07 #5C #00 #00 #00 #59 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #07 #5C #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #06 #56 #00 #00 #02 #DF #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #04 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #F5 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #08 #00 #50 #00 #61 #00 #72 #00 #74 #01 #00 #00 #01 #B5 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #10 #00 #4D #00 #6F #00 #76 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #01 #00 #00 #02 #DB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #01 #00 #00 #03 #B1 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #04 #00 #00 #00 #18 #00 #43 #00 #6F #00 #6E #00 #73 #00 #74 #00 #72 #00 #75 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0A #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #00 #73 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #02 #1D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #08 #00 #47 #00 #44 #00 #4D #00 #4C #01 #00 #00 #02 #D2 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #10 #00 #46 #00 #65 #00 #61 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #01 #00 #00 #01 #9E #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #43 #00 #6F #00 #6C #00 #6C #00 #65 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #02 #D7 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #46 #00 #69 #00 #6C #00 #6C #00 #65 #00 #74 #01 #00 #00 #03 #08 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #4D #00 #61 #00 #63 #00 #72 #00 #6F #00 #73 #01 #00 #00 #03 #5A #00 #00 #04 #02 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #0C #00 #53 #00 #6B #00 #65 #00 #74 #00 #63 #00 #68 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1E #00 #49 #00 #4E #00 #53 #00 #50 #00 #57 #00 #43 #00 #54 #00 #49 #00 #4F #00 #4E #00 #5F #00 #54 #00 #4F #00 #4F #00 #4C #01 #00 #00 #04 #48 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00]"/>
+  </section>
+  <section name="windows_geometry_version">
+    <parameter name="SHAPER" value="8.5.0"/>
+  </section>
 </document>
diff --git a/src/SHAPERGUI/resources/SalomeApp.xml b/src/SHAPERGUI/resources/SalomeApp.xml
new file mode 100644 (file)
index 0000000..4dc9524
--- /dev/null
@@ -0,0 +1,3 @@
+<document>
+  <import name="LightApp"/>
+</document>
diff --git a/src/SHAPERGUI/resources/SalomeApp.xml.in b/src/SHAPERGUI/resources/SalomeApp.xml.in
deleted file mode 100644 (file)
index 75c9c84..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
-  Copyright (C) 2005-2013  OPEN CASCADE
-
-  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.
-
-  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
-
--->
-<document>
-  <section name="launch">
-    <!-- SALOME launching parameters -->
-    <parameter name="modules"    value="GEOM,SMESH,HEXABLOCK,MED,YACS,PARAVIS,SHAPER"/>
-  </section>
-  <section name="SHAPER">
-    <!-- Major module parameters -->
-    <parameter name="name" value="Shaper"/>
-    <parameter name="icon" value="shaper.png"/>
-    <parameter name="version" value="@SHAPER_Version@"/>
-    <parameter name="documentation" value="shaper_help"/>
-  </section>
-  <section name="shaper_help" >
-    <parameter name="Developer's Guide/Shaper module/Developer's Guide" value="%SHAPER_ROOT_DIR%/share/doc/salome/tui/SHAPER/index.html"/>
-    <parameter name="User's Guide/Shaper module/User's Guide" value="%SHAPER_ROOT_DIR%/share/doc/salome/gui/SHAPER/index.html"/>
-  </section>
-  <section name="resources">
-    <!-- Module resources -->
-    <parameter name="SHAPER" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
-  </section>
-  <section name="Viewer" >
-    <!-- Viewer preferences -->
-    <parameter name="face-selection" value="true" />
-    <parameter name="edge-selection" value="true" />
-    <parameter name="vertex-selection" value="true" />
-    <parameter name="point-selection-sensitivity" value="12" />
-    <parameter name="edge-selection-sensitivity" value="2" />
-  </section>
-  <section name="windows_geometry">
-   <parameter name="SHAPER" value="@ByteArray[#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #03 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #DF #FC #02 #00 #00 #00 #02 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #B0 #00 #00 #02 #3D #00 #00 #00 #00 #00 #00 #00 #00 #FC #00 #00 #00 #B0 #00 #00 #02 #DF #00 #00 #00 #6B #00 #FF #FF #FF #FA #00 #00 #00 #00 #02 #00 #00 #00 #02 #FB #FF #FF #FF #FF #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #6B #00 #FF #FF #FF #FB #00 #00 #00 #26 #00 #70 #00 #72 #00 #6F #00 #70 #00 #65 #00 #72 #00 #74 #00 #79 #00 #5F #00 #70 #00 #61 #00 #6E #00 #65 #00 #6C #00 #5F #00 #64 #00 #6F #00 #63 #00 #6B #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #01 #1F #00 #FF #FF #FF #00 #00 #00 #01 #00 #00 #00 #00 #00 #00 #00 #00 #FC #02 #00 #00 #00 #02 #FB #00 #00 #00 #2A #00 #69 #00 #6E #00 #73 #00 #70 #00 #65 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #00 #5F #00 #70 #00 #61 #00 #6E #00 #65 #00 #6C #00 #5F #00 #64 #00 #6F #00 #63 #00 #6B #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #D1 #00 #FF #FF #FF #FB #FF #FF #FF #FF #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #70 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #07 #5C #00 #00 #00 #59 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #07 #5C #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #06 #56 #00 #00 #02 #DF #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #04 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #F5 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #08 #00 #50 #00 #61 #00 #72 #00 #74 #01 #00 #00 #01 #B5 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #10 #00 #4D #00 #6F #00 #76 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #01 #00 #00 #02 #DB #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #6D #00 #65 #00 #6E #00 #74 #01 #00 #00 #03 #B1 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #04 #00 #00 #00 #18 #00 #43 #00 #6F #00 #6E #00 #73 #00 #74 #00 #72 #00 #75 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0A #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #00 #73 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #02 #1D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #08 #00 #47 #00 #44 #00 #4D #00 #4C #01 #00 #00 #02 #D2 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #10 #00 #46 #00 #65 #00 #61 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #01 #00 #00 #01 #9E #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #43 #00 #6F #00 #6C #00 #6C #00 #65 #00 #63 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #02 #D7 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #46 #00 #69 #00 #6C #00 #6C #00 #65 #00 #74 #01 #00 #00 #03 #08 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #4D #00 #61 #00 #63 #00 #72 #00 #6F #00 #73 #01 #00 #00 #03 #5A #00 #00 #04 #02 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #0C #00 #53 #00 #6B #00 #65 #00 #74 #00 #63 #00 #68 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1E #00 #49 #00 #4E #00 #53 #00 #50 #00 #57 #00 #43 #00 #54 #00 #49 #00 #4F #00 #4E #00 #5F #00 #54 #00 #4F #00 #4F #00 #4C #01 #00 #00 #04 #48 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00]"/>
-  </section>
-  <section name="windows_geometry_version">
-    <parameter name="SHAPER" value="8.5.0"/>
-  </section>
-</document>
old mode 100755 (executable)
new mode 100644 (file)
index bcb2d62..2cfe051
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UseQtExt)
old mode 100755 (executable)
new mode 100644 (file)
index 188b662..115bc80
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SAMPLEPANELPLUGIN_H
old mode 100755 (executable)
new mode 100644 (file)
index 726e2f1..8750fff
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SamplePanelPlugin_Feature.h"
old mode 100755 (executable)
new mode 100644 (file)
index c685585..d1a1940
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SAMPLEPANELPLUGIN_FEATURE_H_
old mode 100755 (executable)
new mode 100644 (file)
index fefb792..4282753
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SamplePanelPlugin_ModelWidget.h>
old mode 100755 (executable)
new mode 100644 (file)
index 9e0001e..fe5bcf7
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SamplePanelPlugin_ModelWidget_H_
old mode 100755 (executable)
new mode 100644 (file)
index 65a8722..0ece64b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SamplePanelPlugin_ModelWidgetCreator.h"
old mode 100755 (executable)
new mode 100644 (file)
index 1adbcc5..2a8484e
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SamplePanelPlugin_ModelWidgetCreator_H
old mode 100755 (executable)
new mode 100644 (file)
index b8ff4af..0b06910
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SamplePanelPlugin_Panel.h>
old mode 100755 (executable)
new mode 100644 (file)
index 2c0e396..5e4ecbf
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SAMPLEPANELPLUGIN_PANEL_H_
old mode 100755 (executable)
new mode 100644 (file)
index d43dc84..b0e6f27
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SamplePanelPlugin_Plugin.h>
old mode 100755 (executable)
new mode 100644 (file)
index 4a0459f..c7d723f
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SAMPLEPANELPLUGIN_PLUGIN_H_
old mode 100755 (executable)
new mode 100644 (file)
index 0259e01..a845127
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SamplePanelPlugin_WidgetCreator.h"
old mode 100755 (executable)
new mode 100644 (file)
index 1d8f7ed..7bbe36d
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SamplePanelPlugin_WidgetCreator_H
old mode 100755 (executable)
new mode 100644 (file)
index 0ebc42a..5476465
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Sample">
     <group id="Features">
diff --git a/src/Selector/CMakeLists.txt b/src/Selector/CMakeLists.txt
new file mode 100644 (file)
index 0000000..573dff4
--- /dev/null
@@ -0,0 +1,65 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
+
+SET(PROJECT_HEADERS
+    Selector.h
+    Selector_Selector.h
+    Selector_Algo.h
+    Selector_Primitive.h
+    Selector_AlgoWithSubs.h
+    Selector_Intersect.h
+    Selector_Container.h
+    Selector_Modify.h
+    Selector_FilterByNeighbors.h
+    Selector_WeakName.h
+    Selector_NameGenerator.h
+    Selector_NExplode.h
+)
+
+SET(PROJECT_SOURCES
+    Selector_Selector.cpp
+    Selector_Algo.cpp
+    Selector_Primitive.cpp
+    Selector_AlgoWithSubs.cpp
+    Selector_Intersect.cpp
+    Selector_Container.cpp
+    Selector_Modify.cpp
+    Selector_FilterByNeighbors.cpp
+    Selector_WeakName.cpp
+    Selector_NameGenerator.cpp
+    Selector_NExplode.cpp
+)
+
+SET(PROJECT_LIBRARIES
+    ${OpenCASCADE_ApplicationFramework_LIBRARIES}
+)
+SET(PROJECT_INCLUDES
+  ${OpenCASCADE_INCLUDE_DIR}
+)
+
+
+ADD_DEFINITIONS(-DSELECTOR_EXPORTS ${OpenCASCADE_DEFINITIONS})
+ADD_LIBRARY(Selector SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(Selector ${PROJECT_LIBRARIES})
+
+INCLUDE_DIRECTORIES(${PROJECT_INCLUDES})
+
+INSTALL(TARGETS Selector DESTINATION ${SHAPER_INSTALL_BIN})
diff --git a/src/Selector/Selector.h b/src/Selector/Selector.h
new file mode 100644 (file)
index 0000000..80d0db2
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef SELECTOR_H
+#define SELECTOR_H
+
+#if defined SELECTOR_EXPORTS
+#if defined WIN32
+#define SELECTOR_EXPORT              __declspec( dllexport )
+#else
+#define SELECTOR_EXPORT
+#endif
+#else
+#if defined WIN32
+#define SELECTOR_EXPORT              __declspec( dllimport )
+#else
+#define SELECTOR_EXPORT
+#endif
+#endif
+
+#endif
diff --git a/src/Selector/Selector_Algo.cpp b/src/Selector/Selector_Algo.cpp
new file mode 100644 (file)
index 0000000..0c860c5
--- /dev/null
@@ -0,0 +1,495 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Algo.h>
+
+#include <Selector_Primitive.h>
+#include <Selector_Intersect.h>
+#include <Selector_Modify.h>
+#include <Selector_Container.h>
+#include <Selector_FilterByNeighbors.h>
+#include <Selector_WeakName.h>
+
+#include <TDF_Tool.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <Geom_Surface.hxx>
+#include <BRep_Tool.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_Tool.hxx>
+#include <TNaming_SameShapeIterator.hxx>
+#include <TNaming_Iterator.hxx>
+#include <TNaming_NewShapeIterator.hxx>
+#include <TDataStd_ReferenceArray.hxx>
+#include <TDataStd_ExtStringList.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDataStd_UAttribute.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopExp_Explorer.hxx>
+#include <BRep_Builder.hxx>
+
+
+/// type of the selection, integer keeps the Selector_Type value
+static const Standard_GUID kSEL_TYPE("db174d59-c2e3-4a90-955e-55544df090d6");
+// geometrical naming indicator
+static const Standard_GUID kGEOMETRICAL_NAMING("a5322d02-50fb-43ed-9255-75c7b93f6657");
+
+
+//  reference attribute that contains the reference to labels where the "from" or "base" shapes
+// of selection are located
+static const Standard_GUID kBASE_ARRAY("7c515b1a-9549-493d-9946-a4933a22f45f");
+// if the base array contains reference to the root label, this means that it refers to an
+// external document and this list contains a tag in the document
+static const Standard_GUID kBASE_LIST("7c515b1a-9549-493d-9946-a4933a22f45a");
+
+Selector_Algo::Selector_Algo()
+{
+  myGeometricalNaming = false; // default values
+  myAlwaysGeometricalNaming = false;
+}
+
+static TDF_Label findGoodLabelWithShape(const TDF_Label theAccess, const TopoDS_Shape& theShape) {
+  TDF_Label aResult;
+  if (TNaming_Tool::HasLabel(theAccess, theShape)) { // selection and delete evolution are not used
+    for(TNaming_SameShapeIterator aShapes(theShape, theAccess); aShapes.More(); aShapes.Next())
+    {
+      Handle(TNaming_NamedShape) aNS;
+      if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+        if (aNS->Evolution() == TNaming_MODIFY || aNS->Evolution() == TNaming_GENERATED ||
+            aNS->Evolution() == TNaming_PRIMITIVE) {
+          aResult = aNS->Label();
+          break;
+        }
+      }
+    }
+  }
+  return aResult;
+}
+
+#define SET_ALGO_FLAGS(algo) \
+  algo->myLab = theAccess; \
+  algo->myBaseDocumentLab = theBaseDocument; \
+  algo->myGeometricalNaming = theGeometricalNaming; \
+  algo->myUseNeighbors = theUseNeighbors; \
+  algo->myUseIntersections = theUseIntersections; \
+  algo->myAlwaysGeometricalNaming = theAlwaysGeometricalNaming;
+
+Selector_Algo* Selector_Algo::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue,
+  const TDF_Label theAccess, const TDF_Label theBaseDocument,
+  const bool theGeometricalNaming, const bool theUseNeighbors, const bool theUseIntersections,
+  const bool theAlwaysGeometricalNaming)
+{
+  Selector_Algo* aResult = NULL;
+  if (theValue.IsNull() || theContext.IsNull())
+    return aResult;
+
+  // check the value shape can be named as it is, or it is needed to construct it from the
+  // higher level shapes (like a box vertex by faces that form this vertex)
+  bool aIsFound = !findGoodLabelWithShape(theAccess, theValue).IsNull();
+  if (!aIsFound && !theBaseDocument.IsNull()) // searching in the base document
+    aIsFound = !findGoodLabelWithShape(theBaseDocument, theValue).IsNull();
+  if (!aIsFound) {
+    TopAbs_ShapeEnum aSelectionType = theValue.ShapeType();
+    if (aSelectionType == TopAbs_COMPOUND || aSelectionType == TopAbs_COMPSOLID ||
+      aSelectionType == TopAbs_SHELL || aSelectionType == TopAbs_WIRE)
+    {
+      Selector_Container* aContainer = new Selector_Container;
+      SET_ALGO_FLAGS(aContainer);
+      if (aContainer->select(theContext, theValue))
+        return aContainer;
+      delete aContainer;
+      return NULL;
+    }
+
+    Selector_Intersect* anIntersect = new Selector_Intersect;
+    SET_ALGO_FLAGS(anIntersect);
+    bool aGoodIntersector = anIntersect->select(theContext, theValue);
+    // weak intersector is bad for not use neighbors and has lower priority than neighbors
+    if (aGoodIntersector && anIntersect->myWeakIndex == -1) {
+      return anIntersect;
+    }
+    if (!theUseNeighbors) {
+      delete anIntersect;
+      return NULL;
+    }
+    // searching by neighbors
+    Selector_FilterByNeighbors* aNBs = new Selector_FilterByNeighbors;
+    SET_ALGO_FLAGS(aNBs);
+    // searching a context lab to store in NB algorithm
+    TDF_Label aContextLab = findGoodLabelWithShape(theAccess, theContext);
+    if (aContextLab.IsNull() && !theBaseDocument.IsNull()) // search also in the base document
+      aContextLab = findGoodLabelWithShape(theBaseDocument, theContext);
+    if (aNBs->select(aContextLab, theContext, theValue)) {
+      delete anIntersect;
+      return aNBs;
+    }
+    delete aNBs;
+    if (aGoodIntersector) { // if neighbors are bad, use intersector with weak index
+      return anIntersect;
+    }
+    delete anIntersect;
+
+    // pure weak naming: there is no sense to use pure weak naming for neighbors selection
+    if (theUseNeighbors) {
+      Selector_WeakName* aWeak = new Selector_WeakName;
+      SET_ALGO_FLAGS(aWeak);
+      if (aWeak->select(theContext, theValue)) {
+        return aWeak;
+      }
+      delete aWeak;
+    }
+    return NULL; // not found value in the tree, not found context shape in the tree also
+  }
+  // searching for the base shapes of the value
+  Handle(TNaming_NamedShape) aPrimitiveNS;
+  NCollection_List<Handle(TNaming_NamedShape)> aModifList;
+  for(int aUseExternal = 0; aUseExternal < 2; aUseExternal++) {
+    TDF_Label aLab = aUseExternal == 0 ? theAccess : theBaseDocument;
+    if (aLab.IsNull() || !TNaming_Tool::HasLabel(aLab, theValue))
+      continue;
+    for(TNaming_SameShapeIterator aShapes(theValue, aLab); aShapes.More(); aShapes.Next())
+    {
+      Handle(TNaming_NamedShape) aNS;
+      if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+        TNaming_Evolution anEvolution = aNS->Evolution();
+        if (anEvolution == TNaming_PRIMITIVE) { // the value shape is declared as PRIMITIVE
+          aPrimitiveNS = aNS;
+          break;
+        } else if (anEvolution == TNaming_GENERATED || anEvolution == TNaming_MODIFY) {
+          // check this is a new shape
+          TNaming_Iterator aNSIter(aNS);
+          for(; aNSIter.More(); aNSIter.Next())
+            if (aNSIter.NewShape().IsSame(theValue))
+              break;
+          if (aNSIter.More()) // new was found
+            aModifList.Append(aNS);
+        }
+      }
+    }
+  }
+
+  if (!aPrimitiveNS.IsNull()) {
+    Selector_Primitive* aPrimitive = new Selector_Primitive;
+    SET_ALGO_FLAGS(aPrimitive);
+    aPrimitive->select(aPrimitiveNS->Label());
+    return aPrimitive;
+  } else {
+    Selector_Modify* aModify = new Selector_Modify;
+    SET_ALGO_FLAGS(aModify);
+    bool aGoodModify = aModify->select(aModifList, theContext, theValue);
+    // weak intersector is bad for not use neighbors and has lower priority than neighbors
+    if (aGoodModify && aModify->myWeakIndex == -1) {
+      return aModify;
+    }
+    if (!theUseNeighbors) {
+      delete aModify;
+      return NULL;
+    }
+    // searching by neighbors
+    Selector_FilterByNeighbors* aNBs = new Selector_FilterByNeighbors;
+    SET_ALGO_FLAGS(aNBs);
+    // searching a context lab to store in NB algorithm
+    TDF_Label aContextLab = findGoodLabelWithShape(theAccess, theContext);
+    if (aContextLab.IsNull() && !theBaseDocument.IsNull()) // search also in the base document
+      aContextLab = findGoodLabelWithShape(theBaseDocument, theContext);
+    if (aNBs->select(aContextLab, theContext, theValue)) {
+      delete aModify;
+      return aNBs;
+    }
+    delete aNBs;
+
+    if (aGoodModify) { // if neighbors are bad, use modify algo with weak index
+      return aModify;
+    }
+    delete aModify;
+  }
+
+  return NULL; // invalid case
+}
+
+Selector_Algo* Selector_Algo::relesectWithAllGeometry(
+  Selector_Algo* theOldAlgo, const TopoDS_Shape theContext)
+{
+  return select(theContext, theOldAlgo->value(),
+    theOldAlgo->myLab, theOldAlgo->myBaseDocumentLab, true, true, true, true);
+}
+
+void Selector_Algo::storeBaseArray(const TDF_LabelList& theRef, const TDF_Label& theLast)
+{
+  Handle(TDataStd_ReferenceArray) anArray =
+    TDataStd_ReferenceArray::Set(myLab, kBASE_ARRAY, 0, theRef.Extent());
+  Handle(TDataStd_ExtStringList) anEntries; // entries of references to external document
+  const TDF_Label aThisDocRoot = myLab.Root();
+  TDF_LabelList::Iterator aBIter(theRef);
+  for(int anIndex = 0; true; aBIter.Next(), anIndex++) {
+    const TDF_Label& aLab = aBIter.More() ? aBIter.Value() : theLast;
+    // check this is a label of this document
+    if (aLab.Root().IsEqual(aThisDocRoot)) {
+      anArray->SetValue(anIndex, aLab);
+    } else { // store reference to external document as an entry-string
+      if (anEntries.IsNull()) {
+        anEntries = TDataStd_ExtStringList::Set(myLab, kBASE_LIST);
+      }
+      TCollection_AsciiString anEntry;
+      TDF_Tool::Entry(aLab, anEntry);
+      anEntries->Append(anEntry);
+      anArray->SetValue(anIndex, aThisDocRoot); // stored root means it is external reference
+    }
+    if (!aBIter.More())
+      break;
+  }
+}
+
+bool Selector_Algo::restoreBaseArray(TDF_LabelList& theRef, TDF_Label& theLast)
+{
+  const TDF_Label aThisDocRoot = myLab.Root();
+  Handle(TDataStd_ExtStringList) anEntries; // entries of references to external document
+  TDataStd_ListOfExtendedString::Iterator anIter;
+  Handle(TDataStd_ReferenceArray) anArray;
+  if (myLab.FindAttribute(kBASE_ARRAY, anArray)) {
+    int anUpper = anArray->Upper();
+    for(int anIndex = anArray->Lower(); anIndex <= anUpper; anIndex++) {
+      TDF_Label aLab = anArray->Value(anIndex);
+      if (aLab.IsEqual(aThisDocRoot)) { // external document reference
+        if (myBaseDocumentLab.IsNull())
+          return false;
+        if (anEntries.IsNull()) {
+          if (!myLab.FindAttribute(kBASE_LIST, anEntries))
+            return false;
+          anIter.Initialize(anEntries->List());
+        }
+        if (!anIter.More())
+          return false;
+        TDF_Tool::Label(myBaseDocumentLab.Data(), anIter.Value(), aLab);
+        anIter.Next();
+      }
+      if (anIndex == anUpper) {
+        theLast = aLab;
+      } else {
+        theRef.Append(aLab);
+      }
+    }
+    return true;
+  }
+  return false;
+}
+
+void Selector_Algo::store(const TopoDS_Shape theShape)
+{
+  TNaming_Builder aBuilder(myLab);
+  aBuilder.Select(theShape, theShape);
+}
+
+bool Selector_Algo::sameGeometry(const TopoDS_Shape theShape1, const TopoDS_Shape theShape2) {
+  if (!theShape1.IsNull() && !theShape2.IsNull() && theShape1.ShapeType() == theShape2.ShapeType())
+  {
+    if (theShape1.ShapeType() == TopAbs_FACE) { // check surfaces
+      TopLoc_Location aLoc1, aLoc2;
+      TopoDS_Face aFace1 = TopoDS::Face(theShape1);
+      Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(aFace1, aLoc1);
+      TopoDS_Face aFace2 = TopoDS::Face(theShape2);
+      Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(aFace2, aLoc2);
+      return aSurf1 == aSurf2 && aLoc1.IsEqual(aLoc2);
+    } else if (theShape1.ShapeType() == TopAbs_EDGE) { // check curves
+      TopLoc_Location aLoc1, aLoc2;
+      Standard_Real aFirst, aLast;
+      TopoDS_Edge anEdge1 = TopoDS::Edge(theShape1);
+      Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(anEdge1, aLoc1, aFirst, aLast);
+      TopoDS_Edge anEdge2 = TopoDS::Edge(theShape2);
+      Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(anEdge2, aLoc2, aFirst, aLast);
+      return aCurve1 == aCurve2 && aLoc1.IsEqual(aLoc2);
+    }
+  }
+  return false;
+}
+
+TopoDS_Shape Selector_Algo::value()
+{
+  Handle(TNaming_NamedShape) aNS;
+  if (myLab.FindAttribute(TNaming_NamedShape::GetID(), aNS))
+    return aNS->Get();
+  return TopoDS_Shape(); // empty, error shape
+}
+
+Selector_Algo* Selector_Algo::restoreByLab(TDF_Label theLab, TDF_Label theBaseDocLab)
+{
+  Handle(TDataStd_Integer) aTypeAttr;
+  if (!theLab.FindAttribute(kSEL_TYPE, aTypeAttr))
+    return NULL;
+  Selector_Type aType = Selector_Type(aTypeAttr->Get());
+  Selector_Algo* aResult = NULL;
+  switch (aType) {
+  case SELTYPE_CONTAINER: {
+    aResult = new Selector_Container;
+    break;
+  }
+  case SELTYPE_INTERSECT: {
+    aResult = new Selector_Intersect;
+    break;
+  }
+  case SELTYPE_MODIFICATION: {
+    aResult = new Selector_Modify;
+    break;
+  }
+  case SELTYPE_PRIMITIVE: {
+    aResult = new Selector_Primitive;
+    break;
+  }
+  case SELTYPE_FILTER_BY_NEIGHBOR: {
+    aResult = new Selector_FilterByNeighbors;
+    break;
+  }
+  case SELTYPE_WEAK_NAMING: {
+    aResult = new Selector_WeakName;
+    break;
+  }
+  default: { // unknown case
+  }
+  }
+  if (aResult) {
+    aResult->myLab = theLab;
+    aResult->myBaseDocumentLab = theBaseDocLab;
+    aResult->myGeometricalNaming = theLab.IsAttribute(kGEOMETRICAL_NAMING);
+    if (!aResult->restore()) {
+      delete aResult;
+      aResult = NULL;
+    }
+  }
+  return aResult;
+}
+
+Selector_Algo* Selector_Algo::restoreByName(TDF_Label theLab, TDF_Label theBaseDocLab,
+  std::string theName, const TopAbs_ShapeEnum theShapeType, const bool theGeomNaming,
+  Selector_NameGenerator* theNameGenerator, TDF_Label& theContextLab)
+{
+  Selector_Algo* aResult = NULL;
+  if (theName[0] == '[') { // intersection or container
+    switch(theShapeType) {
+    case TopAbs_COMPOUND:
+    case TopAbs_COMPSOLID:
+    case TopAbs_SHELL:
+    case TopAbs_WIRE:
+      aResult = new Selector_Container;
+      break;
+    case TopAbs_VERTEX:
+    case TopAbs_EDGE:
+    case TopAbs_FACE:
+      aResult = new Selector_Intersect;
+      break;
+    default:;
+    }
+  } else if (theName[0] == '(') { // filter by neighbors
+    aResult = new Selector_FilterByNeighbors;
+  } else if (theName.find(pureWeakNameID()) == 0) { // weak naming identifier
+    aResult = new Selector_WeakName;
+  } else if (theName.find('&') != std::string::npos) { // modification
+    aResult = new Selector_Modify;
+  } else { // primitive
+    aResult = new Selector_Primitive;
+  }
+  if (aResult) {
+    aResult->myLab = theLab;
+    aResult->myBaseDocumentLab = theBaseDocLab;
+    aResult->myGeometricalNaming = theGeomNaming;
+    theContextLab = aResult->restoreByName(theName, theShapeType, theNameGenerator);
+    if (theContextLab.IsNull()) {
+      delete aResult;
+      aResult = NULL;
+    }
+  }
+  return aResult;
+}
+
+void Selector_Algo::storeType(const Selector_Type theType)
+{
+  myLab.ForgetAllAttributes(true);
+  TDataStd_Integer::Set(myLab, kSEL_TYPE, (int)(theType));
+  if (myGeometricalNaming)
+    TDataStd_UAttribute::Set(myLab, kGEOMETRICAL_NAMING);
+}
+
+/// Returns true if theSub is in theContext shape
+static bool isInContext(const TopoDS_Shape& theContext, const TopoDS_Shape& theSub) {
+  for(TopExp_Explorer anExp(theContext, theSub.ShapeType()); anExp.More(); anExp.Next()) {
+    if (anExp.Current().IsSame(theSub))
+      return true;
+  }
+  return false;
+}
+
+bool Selector_Algo::findNewVersion(const TopoDS_Shape& theContext, TopoDS_Shape& theResult) const
+{
+  if (theResult.IsNull())
+    return false;
+  if (!TNaming_Tool::HasLabel(myLab, theResult)) {
+    if (theResult.ShapeType() == TopAbs_COMPOUND) { // do it for all elements of compound
+      BRep_Builder aBuilder;
+      TopoDS_Compound aResultingCompound;
+      aBuilder.MakeCompound(aResultingCompound);
+      bool aWasChanged = false;
+      for (TopoDS_Iterator anIter(theResult); anIter.More(); anIter.Next()) {
+        TopoDS_Shape aSub = anIter.Value();
+        if (findNewVersion(theContext, aSub))
+          aWasChanged = true;
+        aBuilder.Add(aResultingCompound, aSub);
+      }
+      if (aWasChanged)
+        theResult = aResultingCompound;
+      return aWasChanged;
+    }
+  } else {
+    // check theResult is in theContext
+    if (isInContext(theContext, theResult))
+      return false;
+    // searching the next modifications of the result shape in document
+    TopTools_MapOfShape aResultShapes;
+    for(TNaming_NewShapeIterator aBaseIter(theResult, myLab); aBaseIter.More(); aBaseIter.Next())
+    {
+      TNaming_Evolution anEvolution = aBaseIter.NamedShape()->Evolution();
+      if (anEvolution == TNaming_GENERATED || anEvolution == TNaming_MODIFY) {
+        TopoDS_Shape aNextModification = aBaseIter.Shape();
+        if (aNextModification.IsNull())
+          continue;
+        if (isInContext(theContext, aNextModification))
+          // don't add vertices generated from edges
+          if (aNextModification.ShapeType() <= theResult.ShapeType())
+            aResultShapes.Add(aNextModification);
+        else if (findNewVersion(theContext, aNextModification))
+          if (aNextModification.ShapeType() <= theResult.ShapeType())
+            aResultShapes.Add(aNextModification);
+      }
+    }
+    if (aResultShapes.IsEmpty())
+      return false;
+    if (aResultShapes.Size() == 1) {
+      theResult = TopTools_MapIteratorOfMapOfShape(aResultShapes).Value();
+    } else { // make a compound of all results
+      BRep_Builder aBuilder;
+      TopoDS_Compound aResultingCompound;
+      aBuilder.MakeCompound(aResultingCompound);
+      for(TopTools_MapIteratorOfMapOfShape anIter(aResultShapes); anIter.More(); anIter.Next())
+        aBuilder.Add(aResultingCompound, anIter.Value());
+      theResult = aResultingCompound;
+    }
+    return true;
+  }
+  return false;
+}
diff --git a/src/Selector/Selector_Algo.h b/src/Selector/Selector_Algo.h
new file mode 100644 (file)
index 0000000..ad512aa
--- /dev/null
@@ -0,0 +1,171 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Algo_H_
+#define Selector_Algo_H_
+
+#include "Selector.h"
+
+#include <Standard_GUID.hxx>
+#include <TDF_Label.hxx>
+#include <TDF_LabelList.hxx>
+#include <TopoDS_Shape.hxx>
+
+class Selector_NameGenerator;
+
+/**\class Selector_Selector
+ * \ingroup DataModel
+ * \brief Base class for all kinds of selection algorithms.
+ */
+class Selector_Algo
+{
+  TopAbs_ShapeEnum myShapeType; ///< type of this shape
+
+  TDF_Label myLab; ///< label where this also may be located
+  TDF_Label myBaseDocumentLab; ///< an access-label of the document that may contain initial shapes
+  bool myGeometricalNaming; ///< flag that indicates that geometrical naming selection is enabled
+  bool myAlwaysGeometricalNaming; ///< to enable geometrical naming from beginning, at select
+  bool myUseNeighbors; ///< to use neighbors algorithms
+  bool myUseIntersections; ///< to use intersections algorithms
+
+public:
+  /// Type of a selector algorithm: on this type depends what is stored in this label and how to
+  /// restore it on update.
+  enum Selector_Type {
+    SELTYPE_CONTAINER, ///< just a container of sub-elements, keeps the shape type of container
+    SELTYPE_INTERSECT, ///< sub-shape is intersection of higher level objects
+    SELTYPE_PRIMITIVE, ///< sub-shape found as a primitive on some label
+    SELTYPE_MODIFICATION, ///< modification of base shapes to the final label
+    SELTYPE_FILTER_BY_NEIGHBOR,  ///< identification by neighbor shapes in context
+    SELTYPE_WEAK_NAMING, ///< pure weak naming by weak index in context
+  };
+
+  /// Initializes the algorithm
+  SELECTOR_EXPORT Selector_Algo();
+
+  /// Initializes the selector structure on the label.
+  /// Stores the name data to restore after modification.
+  /// \param theContext whole shape that contains the selected sub-shape
+  /// \param theValue selected subshape
+  /// \param theGeometricalNaming treats selection with equal surfaces as one
+  /// \param theUseNeighbors enables searching algorithm by neighbors
+  /// \param theUseIntersections enables searching algorithm by intersection of higher level shapes
+  SELECTOR_EXPORT static Selector_Algo* select(
+    const TopoDS_Shape theContext, const TopoDS_Shape theValue,
+    const TDF_Label theAccess, const TDF_Label theBaseDocument,
+    const bool theGeometricalNaming = false,
+    const bool theUseNeighbors = true, const bool theUseIntersections = true,
+    const bool theAlwaysGeometricalNaming = false);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() = 0;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() = 0;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) = 0;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) = 0;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) = 0;
+  /// Returns the current sub-shape value (null if can not resolve)
+  SELECTOR_EXPORT TopoDS_Shape value();
+  /// Restores sub-algorithm of a given type by the storage-label
+  SELECTOR_EXPORT static Selector_Algo* restoreByLab(TDF_Label theLab, TDF_Label theBaseDocLab);
+  /// Restores the selected sub-algorithm by the naming name.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT static Selector_Algo* restoreByName(
+    TDF_Label theLab, TDF_Label theBaseDocLab, std::string theName,
+    const TopAbs_ShapeEnum theShapeType, const bool theGeomNaming,
+    Selector_NameGenerator* theNameGenerator, TDF_Label& theContextLab);
+
+  /// Returns true if the given shapes are based on the same geometry
+  static bool sameGeometry(const TopoDS_Shape theShape1, const TopoDS_Shape theShape2);
+
+  /// Creates a new selection algorithm for selection of all topology based on the same geometry
+  SELECTOR_EXPORT static Selector_Algo* relesectWithAllGeometry(
+    Selector_Algo* theOldAlgo, const TopoDS_Shape theContext);
+  /// Sets geometrical naming flag to true
+  void setGeometricalNaming()
+  {myGeometricalNaming = true;}
+
+protected:
+  /// Returns label where this algorithm is attached to, or just an access label to the document
+  const TDF_Label& label() const
+  {return myLab;}
+  /// Stores the array of references to theLab: references to elements of ref-list, then the last
+  void storeBaseArray(const TDF_LabelList& theRef, const TDF_Label& theLast);
+  /// Restores references to the labels: references to elements of ref-list, then the last
+  bool restoreBaseArray(TDF_LabelList& theRef, TDF_Label& theLast);
+  /// Stores result of selection at the given label
+  void store(const TopoDS_Shape theShape);
+  /// Returns an access-label of the document that may contain initial shapes
+  const TDF_Label& baseDocument() const
+  {return myBaseDocumentLab;}
+  /// Returns the geometrical naming flag
+  bool geometricalNaming() const
+  {return myGeometricalNaming;}
+  /// Returns always geometrical naming flag
+  bool alwaysGeometricalNaming() const
+  {return myAlwaysGeometricalNaming;}
+  /// Returns use neighbors flag
+  bool useNeighbors() const
+  {return myUseNeighbors;}
+  /// Returns use intersections flag
+  bool useIntersections() const
+  {return myUseIntersections;}
+  /// Returns GUID for the weak index (integer attribute) of the sub-shape
+  static const Standard_GUID& weakID()
+  {
+    static const Standard_GUID kWEAK_INDEX("e9373a61-cabc-4ee8-aabf-aea47c62ed87");
+    return kWEAK_INDEX;
+  }
+  /// Returns GUID for the type of the shape, stored in case it is intersection or container
+  static const Standard_GUID& shapeTypeID()
+  {
+    static const Standard_GUID kSHAPE_TYPE("864b3267-cb9d-4107-bf58-c3ce1775b171");
+    return kSHAPE_TYPE;
+  }
+  /// string identifier of the weak name in modification or intersection types of algorithm
+  static const std::string& weakNameID()
+  {
+    static const std::string kWEAK_NAME_IDENTIFIER = "weak_name_";
+    return kWEAK_NAME_IDENTIFIER;
+  }
+  /// string identifier of the pure weak name
+  static const std::string& pureWeakNameID()
+  {
+    static const std::string kPURE_WEAK_NAME_IDENTIFIER = "_weak_name_";
+    return kPURE_WEAK_NAME_IDENTIFIER;
+  }
+  /// Stores the type of an algorithm in the data tree (in myLab)
+  void storeType(const Selector_Type theType);
+
+  /// Searches the newer version of the shape in the document if the base shape does not
+  /// belong to context. Returns it in theResult (if any). Returns true is theResult is changed.
+  bool findNewVersion(const TopoDS_Shape& theContext, TopoDS_Shape& theResult) const;
+};
+
+#endif
diff --git a/src/Selector/Selector_AlgoWithSubs.cpp b/src/Selector/Selector_AlgoWithSubs.cpp
new file mode 100644 (file)
index 0000000..d7860b5
--- /dev/null
@@ -0,0 +1,58 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_AlgoWithSubs.h>
+
+Selector_AlgoWithSubs::Selector_AlgoWithSubs() : Selector_Algo()
+{}
+
+void Selector_AlgoWithSubs::clearSubAlgos()
+{
+  std::list<Selector_Algo*>::iterator anAlgo = mySubSelList.begin();
+  for(; anAlgo != mySubSelList.end(); anAlgo++) {
+    delete *anAlgo;
+  }
+  mySubSelList.clear();
+}
+
+Selector_AlgoWithSubs::~Selector_AlgoWithSubs()
+{
+  clearSubAlgos();
+}
+
+TDF_Label Selector_AlgoWithSubs::newSubLabel()
+{
+  return label().FindChild(int(mySubSelList.size() + 1));
+}
+
+bool Selector_AlgoWithSubs::append(Selector_Algo* theAlgo, const bool theEraseIfNull)
+{
+  if (theAlgo) {
+    mySubSelList.push_back(theAlgo);
+    return true;
+  }
+  if (theEraseIfNull)
+    clearSubAlgos();
+  return false;
+}
+
+std::list<Selector_Algo*>& Selector_AlgoWithSubs::list()
+{
+  return mySubSelList;
+}
diff --git a/src/Selector/Selector_AlgoWithSubs.h b/src/Selector/Selector_AlgoWithSubs.h
new file mode 100644 (file)
index 0000000..ead3b1f
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_AlgoWithSubs_H_
+#define Selector_AlgoWithSubs_H_
+
+#include "Selector_Algo.h"
+
+#include <list>
+
+/**\class Selector_AlgoWithSubs
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: generic algorithm that contains sub-algorithms inside.
+ * It is base for Container, Intersection and FilterByNeighbours algorithms.
+ */
+class Selector_AlgoWithSubs: public Selector_Algo
+{
+  std::list<Selector_Algo*> mySubSelList; ///< list of sub-algorithms
+public:
+  /// Initializes selector
+  Selector_AlgoWithSubs();
+  /// Destructor
+  virtual ~Selector_AlgoWithSubs();
+  /// Erases the sub-algorithms stored
+  void clearSubAlgos();
+  /// Returns the next label for a new sub-selector created
+  TDF_Label newSubLabel();
+  /// Appends a new algorithm to the list, erases list if it is null (failed)
+  bool append(Selector_Algo* theAlgo, const bool theEraseIfNull = true);
+  /// Returns the stored list of sub-algorithms.
+  std::list<Selector_Algo*>& list();
+};
+
+#endif
diff --git a/src/Selector/Selector_Container.cpp b/src/Selector/Selector_Container.cpp
new file mode 100644 (file)
index 0000000..44d1b1e
--- /dev/null
@@ -0,0 +1,191 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Container.h>
+
+#include <Selector_NameGenerator.h>
+#include <Selector_NExplode.h>
+
+#include <TNaming_NamedShape.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDF_ChildIterator.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+
+Selector_Container::Selector_Container() : Selector_AlgoWithSubs()
+{}
+
+bool Selector_Container::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue)
+{
+  myShapeType = theValue.ShapeType();
+
+  // iterate all sub-shapes and select them on sublabels
+  for(TopoDS_Iterator aSubIter(theValue); aSubIter.More(); aSubIter.Next()) {
+    Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, aSubIter.Value(),
+      newSubLabel(), baseDocument(),
+      false, useNeighbors(), useIntersections()); //for subs no geometrical naming allowed
+    if (!append(aSubAlgo))
+      return false;
+  }
+  return true;
+}
+
+void Selector_Container::store()
+{
+  storeType(Selector_Algo::SELTYPE_CONTAINER);
+  // store all sub-selectors
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    (*aSubSel)->store();
+  }
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+}
+
+bool Selector_Container::restore()
+{
+  Handle(TDataStd_Integer) aShapeTypeAttr;
+  if (!label().FindAttribute(shapeTypeID(), aShapeTypeAttr))
+    return false;
+  myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
+  // restore sub-selectors
+  bool aSubResult = true;
+  for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
+    Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
+    if (!append(aSubSel, false)) {
+      break; // some empty label left in the end
+    }
+  }
+  return true;
+}
+
+TDF_Label Selector_Container::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  myShapeType = theShapeType;
+  TDF_Label aContext;
+  for(size_t aStart = 0; aStart != std::string::npos; aStart = theName.find('[', aStart + 1)) {
+    size_t anEndPos = theName.find(']', aStart + 1);
+    if (anEndPos != std::string::npos) {
+      // there could be sub-intersections, so, [[...]] case; searching for other open-bracket
+      size_t aNextStart = theName.find('[', aStart + 1);
+      while(aNextStart != std::string::npos && aNextStart < anEndPos) {
+        anEndPos = theName.find(']', anEndPos + 1);
+        if (anEndPos == std::string::npos) {
+          return TDF_Label(); // invalid parentheses
+        }
+        aNextStart = theName.find('[', aNextStart + 1);
+      }
+      if (anEndPos == std::string::npos)
+        return TDF_Label(); // invalid parentheses
+      std::string aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1);
+      TopAbs_ShapeEnum aSubShapeType = TopAbs_FACE;
+      switch (myShapeType) {
+      case TopAbs_COMPSOLID: aSubShapeType = TopAbs_SOLID; break;
+      case TopAbs_WIRE: aSubShapeType = TopAbs_EDGE; break;
+      default:;
+      }
+      TDF_Label aSubContext;
+      Selector_Algo* aSubSel =
+        Selector_Algo::restoreByName(newSubLabel(), baseDocument(), aSubStr, aSubShapeType,
+          geometricalNaming(), theNameGenerator, aSubContext);
+      if (!append(aSubSel))
+        return TDF_Label();
+
+      if (aSubContext.IsNull()) {
+        delete aSubSel;
+        clearSubAlgos();
+        return TDF_Label();
+      }
+      if (!aContext.IsNull() && !aContext.IsEqual(aSubContext)) {
+        if (!theNameGenerator->isLater(aContext, aSubContext))
+          aContext = aSubContext;
+      } else {
+        aContext = aSubContext;
+      }
+    } else
+      return TDF_Label(); // invalid parentheses
+    aStart = anEndPos; // for recursive parenthesis set start on the current end
+  }
+  return aContext;
+}
+
+bool Selector_Container::solve(const TopoDS_Shape& theContext)
+{
+  TopoDS_Shape aResult;
+
+  TopoDS_Builder aBuilder;
+  switch(myShapeType) {
+  case TopAbs_COMPOUND: {
+    TopoDS_Compound aComp;
+    aBuilder.MakeCompound(aComp);
+    aResult = aComp;
+    break;
+  }
+  case TopAbs_COMPSOLID: {
+    TopoDS_CompSolid aComp;
+    aBuilder.MakeCompSolid(aComp);
+    aResult = aComp;
+    break;
+  }
+  case TopAbs_SHELL: {
+    TopoDS_Shell aShell;
+    aBuilder.MakeShell(aShell);
+    aResult = aShell;
+    break;
+  }
+  case TopAbs_WIRE: {
+    TopoDS_Wire aWire;
+    aBuilder.MakeWire(aWire);
+    aResult = aWire;
+    break;
+  }
+  }
+  TopoDS_ListOfShape aSubSelectorShapes;
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    if (!(*aSubSel)->solve(theContext)) {
+      return false;
+    }
+    aBuilder.Add(aResult, (*aSubSel)->value());
+  }
+  if (!aResult.IsNull()) {
+    Selector_Algo::store(aResult);
+    return true;
+  }
+  return false;
+}
+
+std::string Selector_Container::name(Selector_NameGenerator* theNameGenerator)
+{
+  std::string aResult;
+  // add names of sub-components one by one in "[]"
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    aResult += '[';
+    aResult += (*aSubSel)->name(theNameGenerator);
+    aResult += ']';
+  }
+  return aResult;
+}
diff --git a/src/Selector/Selector_Container.h b/src/Selector/Selector_Container.h
new file mode 100644 (file)
index 0000000..e163ea2
--- /dev/null
@@ -0,0 +1,63 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Container_H_
+#define Selector_Container_H_
+
+#include "Selector_AlgoWithSubs.h"
+
+#include <list>
+
+/**\class Selector_Container
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: selected shape is a container of sub-shapes that must
+ * be named one by one.
+ */
+class Selector_Container: public Selector_AlgoWithSubs
+{
+  TopAbs_ShapeEnum myShapeType; ///< type of this container
+public:
+  /// Initializes the selection of this kind
+  SELECTOR_EXPORT bool select(const TopoDS_Shape theContext, const TopoDS_Shape theValue);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+private:
+  /// Initializes selector
+  Selector_Container();
+
+  friend class Selector_Algo;
+};
+
+#endif
diff --git a/src/Selector/Selector_FilterByNeighbors.cpp b/src/Selector/Selector_FilterByNeighbors.cpp
new file mode 100644 (file)
index 0000000..7a74140
--- /dev/null
@@ -0,0 +1,419 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_FilterByNeighbors.h>
+
+#include <Selector_NameGenerator.h>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDataStd_IntegerArray.hxx>
+#include <TDF_ChildIterator.hxx>
+
+// array of the neighbor levels
+static const Standard_GUID kLEVELS_ARRAY("ee4c4b45-e859-4e86-aa4f-6eac68e0ca1f");
+
+Selector_FilterByNeighbors::Selector_FilterByNeighbors() : Selector_AlgoWithSubs()
+{}
+
+/// Searches neighbor of theLevel of neighborhood to theValue in theContex
+static void findNeighbors(const TopoDS_Shape theContext, const TopoDS_Shape theValue,
+  const int theLevel, TopTools_MapOfShape& theResult)
+{
+  TopAbs_ShapeEnum aConnectorType = TopAbs_VERTEX; // type of the connector sub-shapes
+  TopAbs_ShapeEnum aValueType = theValue.ShapeType();
+  if (aValueType == TopAbs_FACE)
+    aConnectorType = TopAbs_EDGE;
+  else if (aValueType == TopAbs_COMPOUND) { // for geometrical naming: compound of faces
+    TopExp_Explorer anExp(theValue, TopAbs_FACE);
+    if (anExp.More()) {
+      aConnectorType = TopAbs_EDGE;
+      aValueType = TopAbs_FACE;
+    } else {
+      aValueType = TopAbs_EDGE;
+    }
+  }
+  TopTools_MapOfShape aNBConnectors; // connector shapes that already belong to neighbors
+  for(TopExp_Explorer aValExp(theValue, aConnectorType); aValExp.More(); aValExp.Next())
+    aNBConnectors.Add(aValExp.Current());
+
+  TopTools_MapOfShape alreadyProcessed;
+  if (aValueType == theValue.ShapeType())
+    alreadyProcessed.Add(theValue);
+  else
+    for(TopExp_Explorer aValExp(theValue, aValueType); aValExp.More(); aValExp.Next())
+      alreadyProcessed.Add(aValExp.Current());
+
+  for(int aLevel = 1; aLevel <= theLevel; aLevel++) {
+    TopoDS_ListOfShape aGoodCandidates;
+    TopExp_Explorer aCandidate(theContext, aValueType);
+    for(; aCandidate.More(); aCandidate.Next()) {
+      if (alreadyProcessed.Contains(aCandidate.Current()))
+        continue;
+      TopExp_Explorer aCandConnector(aCandidate.Current(), aConnectorType);
+      for(; aCandConnector.More(); aCandConnector.Next()) {
+        if (aNBConnectors.Contains(aCandConnector.Current())) // candidate is neighbor
+          break;
+      }
+      if (aCandConnector.More()) {
+        if (aLevel == theLevel) { // add a NB into result: it is connected to other neighbors
+          theResult.Add(aCandidate.Current());
+        } else { // add to the NB of the current level
+          aGoodCandidates.Append(aCandidate.Current());
+        }
+      }
+    }
+    if (aLevel != theLevel) { // good candidates are added to neighbor of this level by connectors
+      for(TopoDS_ListOfShape::Iterator aGood(aGoodCandidates); aGood.More(); aGood.Next()) {
+        TopExp_Explorer aGoodConnector(aGood.Value(), aConnectorType);
+        for(; aGoodConnector.More(); aGoodConnector.Next()) {
+          aNBConnectors.Add(aGoodConnector.Current());
+        }
+        alreadyProcessed.Add(aGood.Value());
+      }
+    }
+  }
+}
+
+/// Searches the neighbor shape by neighbors defined in theNB in theContext shape
+static const TopoDS_Shape findNeighbor(const TopoDS_Shape theContext,
+  const std::list<std::pair<TopoDS_Shape, int> >& theNB, const bool theGeometrical)
+{
+  // searching for neighbors with minimum level
+  int aMinLevel = 0;
+  std::list<std::pair<TopoDS_Shape, int> >::const_iterator aNBIter = theNB.cbegin();
+  for(; aNBIter != theNB.cend(); aNBIter++) {
+    if (aMinLevel == 0 || aNBIter->second < aMinLevel) {
+      aMinLevel = aNBIter->second;
+    }
+  }
+  // collect all neighbors which are neighbors of sub-shapes with minimum level
+  bool aFirst = true;
+  TopoDS_ListOfShape aMatches;
+  for(aNBIter = theNB.cbegin(); aNBIter != theNB.cend(); aNBIter++) {
+    if (aNBIter->second == aMinLevel) {
+      TopTools_MapOfShape aThisNBs;
+      findNeighbors(theContext, aNBIter->first, aMinLevel, aThisNBs);
+      if (aFirst) { // aMatches must contain common part of all NBs lists
+        for(TopTools_MapOfShape::Iterator aThisNB(aThisNBs); aThisNB.More(); aThisNB.Next()) {
+          aMatches.Append(aThisNB.Value());
+        }
+      } else { // remove all in aMatches which are not in this NBs
+        for(TopoDS_ListOfShape::Iterator aMatch(aMatches); aMatch.More(); ) {
+          if (aThisNBs.Contains(aMatch.Value())) {
+            aMatch.Next();
+          } else {
+            aMatches.Remove(aMatch);
+          }
+        }
+      }
+      aFirst = false;
+    }
+  }
+  if (aMatches.IsEmpty())
+    return TopoDS_Shape(); // not found any candidate
+  if (aMatches.Extent() == 1)
+    return aMatches.First(); // already found good candidate
+  TopoDS_Compound aResultCompound; // in case of geometrical name and many candidates
+  // iterate all matches to find by other (higher level) neighbors the best candidate
+  TopoDS_Shape aGoodCandidate;
+  TopTools_MapOfShape aGoodCandidates; // already added good candidates to the map
+  for(TopoDS_ListOfShape::Iterator aCandidate(aMatches); aCandidate.More(); aCandidate.Next()) {
+    bool aValidCadidate = true;
+    for(int aLevel = aMinLevel + 1; true; aLevel++) {
+      bool aFooundHigherLevel = false;
+      TopoDS_ListOfShape aLevelNBs;
+      for(aNBIter = theNB.cbegin(); aNBIter != theNB.cend(); aNBIter++) {
+        if (aNBIter->second == aLevel)
+          aLevelNBs.Append(aNBIter->first);
+        else if (aNBIter->second >= aLevel)
+          aFooundHigherLevel = true;
+      }
+      if (!aFooundHigherLevel && aLevelNBs.IsEmpty()) { // iterated all, so, good candidate
+        if (aGoodCandidate.IsNull()) {
+          aGoodCandidate = aCandidate.Value();
+        } else { // another good candidate
+          if (theGeometrical && Selector_Algo::sameGeometry(aGoodCandidate, aCandidate.Value())) {
+            if (!aGoodCandidates.Add(aCandidate.Value()))
+              break;
+            static TopoDS_Builder aBuilder;
+            if (aResultCompound.IsNull()) {
+              aBuilder.MakeCompound(aResultCompound);
+              aBuilder.Add(aResultCompound, aGoodCandidate);
+            }
+            aBuilder.Add(aResultCompound, aCandidate.Value());
+          } else
+            return TopoDS_Shape();
+        }
+        break; // no more NBs with higher levels
+      }
+      if (!aLevelNBs.IsEmpty()) {
+        TopTools_MapOfShape aNBsOfCandidate;
+        findNeighbors(theContext, aCandidate.Value(), aLevel, aNBsOfCandidate);
+        // check all stored neighbors are in the map of real neighbors
+        for(TopoDS_ListOfShape::Iterator aLevIter(aLevelNBs); aLevIter.More(); aLevIter.Next()) {
+          if (!aNBsOfCandidate.Contains(aLevIter.Value())) {
+            aValidCadidate = false;
+            break;
+          }
+        }
+      }
+      if (!aValidCadidate) // candidate is not valid, break the checking
+        break;
+    }
+  }
+  if (!aResultCompound.IsNull())
+    return aResultCompound;
+  return aGoodCandidate;
+}
+
+bool Selector_FilterByNeighbors::select(
+  const TDF_Label theContextLab, const TopoDS_Shape theContext, const TopoDS_Shape theValue)
+{
+  myShapeType = theValue.ShapeType();
+  myContext = theContextLab;
+  // searching by neighbors
+  std::list<std::pair<TopoDS_Shape, int> > aNBs; /// neighbor sub-shape -> level of neighborhood
+  for(int aLevel = 1; true; aLevel++) {
+    TopTools_MapOfShape aNewNB;
+    findNeighbors(theContext, theValue, aLevel, aNewNB);
+    if (aNewNB.Extent() == 0) { // there are no neighbors of the given level, stop iteration
+      break;
+    }
+    // iterate by the order in theContext to keep same naming names
+    TopExp_Explorer anOrder(theContext, theValue.ShapeType());
+    TopTools_MapOfShape alreadyProcessed;
+    for (; anOrder.More(); anOrder.Next()) {
+      if (alreadyProcessed.Add(anOrder.Current()) && aNewNB.Contains(anOrder.Current())) {
+        TopoDS_Shape aNewNBShape = anOrder.Current();
+        // check which can be named correctly, without "by neighbors" type
+        Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, aNewNBShape,
+          newSubLabel(), baseDocument(), geometricalNaming(), false, useIntersections());
+        if (aSubAlgo) {
+          // add to list of good NBs
+          aNBs.push_back(std::pair<TopoDS_Shape, int>(aNewNBShape, aLevel));
+        }
+        delete aSubAlgo; // don't keep this sub-algo until all subs and whole validity are checked
+      }
+    }
+    TopoDS_Shape aResult = findNeighbor(theContext, aNBs, geometricalNaming());
+    if (!aResult.IsNull() && aResult.IsSame(theValue)) {
+      std::list<std::pair<TopoDS_Shape, int> >::iterator aNBIter = aNBs.begin();
+      for(; aNBIter != aNBs.end(); aNBIter++) {
+        Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, aNBIter->first,
+          newSubLabel(), baseDocument(), geometricalNaming(), false, useIntersections());
+        if (append(aSubAlgo)) {
+          myNBLevel.push_back(aNBIter->second);
+        } else {
+          delete aSubAlgo;
+        }
+      }
+      return true;
+    }
+  }
+  return false;
+}
+
+void Selector_FilterByNeighbors::store()
+{
+  storeType(Selector_Algo::SELTYPE_FILTER_BY_NEIGHBOR);
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+  // store numbers of levels corresponded to the neighbors in sub-selectors
+  Handle(TDataStd_IntegerArray) anArray =
+    TDataStd_IntegerArray::Set(label(), kLEVELS_ARRAY, 0, int(myNBLevel.size()) - 1);
+  std::list<int>::iterator aLevel = myNBLevel.begin();
+  for(int anIndex = 0; aLevel != myNBLevel.end(); aLevel++, anIndex++) {
+    anArray->SetValue(anIndex, Abs(*aLevel));
+  }
+  // store all sub-selectors
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    (*aSubSel)->store();
+  }
+  // store context reference if exists
+  if (!myContext.IsNull()) {
+    static const TDF_LabelList anEmptyRefList;
+    storeBaseArray(anEmptyRefList, myContext);
+  }
+}
+
+bool Selector_FilterByNeighbors::restore()
+{
+  Handle(TDataStd_Integer) aShapeTypeAttr;
+  if (!label().FindAttribute(shapeTypeID(), aShapeTypeAttr))
+    return false;
+  myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
+  // restore levels indices
+  Handle(TDataStd_IntegerArray) anArray;
+  if (!label().FindAttribute(kLEVELS_ARRAY, anArray))
+    return false;
+  for(int anIndex = 0; anIndex <= anArray->Upper(); anIndex++) {
+    myNBLevel.push_back(anArray->Value(anIndex));
+  }
+  // restore sub-selectors
+  bool aSubResult = true;
+  for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
+    Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
+    if (!append(aSubSel, false)) {
+      if (!aSub.Value().HasAttribute())
+        break; // some empty label left in the end
+      // some selector fails, try to use rest selectors, myNBLevel becomes negative: unused
+      if (myNBLevel.size() > list().size()) {
+        std::list<int>::iterator aListIter = myNBLevel.begin();
+        for(int a = 0; a < list().size(); a++)
+          aListIter++;
+        *aListIter = -*aListIter;
+        list().push_back(NULL);
+      }
+    }
+  }
+  // restore context reference if exists
+  static TDF_LabelList anEmptyRefList;
+  restoreBaseArray(anEmptyRefList, myContext);
+
+  return myNBLevel.size() == list().size() && !myNBLevel.empty();
+}
+
+TDF_Label Selector_FilterByNeighbors::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  myShapeType = theShapeType;
+  TDF_Label aContext;
+  std::string aLastLevel; // last level string (after '(' )  to check the context name in the end
+  for (size_t aStart = 0; aStart != std::string::npos;
+    aStart = theName.find('(', aStart + 1)) {
+    size_t anEndPos = theName.find(')', aStart + 1);
+    if (anEndPos != std::string::npos) {
+      std::string aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1);
+      TDF_Label aSubContext;
+      Selector_Algo* aSubSel =
+        Selector_Algo::restoreByName(newSubLabel(), baseDocument(), aSubStr, myShapeType,
+          geometricalNaming(), theNameGenerator, aSubContext);
+      if (!append(aSubSel))
+        return TDF_Label();
+
+      if (aSubContext.IsNull()) {
+        delete aSubSel;
+        clearSubAlgos();
+        return TDF_Label();
+      }
+      if (!aContext.IsNull() && !aContext.IsEqual(aSubContext)) {
+        if (!theNameGenerator->isLater(aContext, aSubContext))
+          aContext = aSubContext;
+      } else {
+        aContext = aSubContext;
+      }
+      //if (!aContext.IsNull()) // for filters by neighbor the latest context shape is vital
+      //  aContext = theNameGenerator->newestContext(aContext);
+
+      // searching for the level index
+      std::string aLevel;
+      for (anEndPos++; anEndPos != std::string::npos &&
+        theName[anEndPos] != '(' && theName[anEndPos] != 0;
+        anEndPos++) {
+        aLevel += theName[anEndPos];
+      }
+      aLastLevel = aLevel;
+      if (aLevel.empty() || aLevel[0] == '_')
+        myNBLevel.push_back(1); // by default it is 1
+      else {
+        int aNum = atoi(aLevel.c_str());
+        if (aNum > 0)
+          myNBLevel.push_back(aNum);
+        else
+          return TDF_Label(); // invalid number
+      }
+    } else
+      return TDF_Label(); // invalid parentheses
+  }
+  if (!aLastLevel.empty()) { // get the context
+    size_t aLinePos = aLastLevel.find("_");
+    if (aLinePos != std::string::npos) {
+      std::string aContextName = aLastLevel.substr(aLinePos + 1);
+      if (!aContextName.empty()) {
+        TDF_Label aThisContext, aValue;
+        if (theNameGenerator->restoreContext(aContextName, aThisContext, aValue)) {
+          if (!aThisContext.IsNull())
+            aContext = aThisContext;
+        }
+      }
+    }
+  }
+  myContext = aContext;
+  return aContext;
+}
+
+bool Selector_FilterByNeighbors::solve(const TopoDS_Shape& theContext)
+{
+  TopoDS_Shape aResult;
+
+  std::list<std::pair<TopoDS_Shape, int> > aNBs; /// neighbor sub-shape -> level of neighborhood
+  std::list<int>::iterator aLevel = myNBLevel.begin();
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++, aLevel++) {
+    if (*aLevel < 0)
+      continue; // skip because sub-selector is not good
+    if ((*aSubSel)->solve(theContext)) {
+      aNBs.push_back(std::pair<TopoDS_Shape, int>((*aSubSel)->value(), *aLevel));
+    }
+  }
+  if (!aNBs.empty()) {
+    aResult = findNeighbor(theContext, aNBs, geometricalNaming());
+    if (!aResult.IsNull()) {
+      Selector_Algo::store(aResult);
+      return true;
+    }
+  }
+  return false;
+}
+
+std::string Selector_FilterByNeighbors::name(Selector_NameGenerator* theNameGenerator)
+{
+  // (nb1)level_if_more_than_1(nb2)level_if_more_than_1(nb3)level_if_more_than_1
+  bool aThisContextNameNeeded = !myContext.IsNull();
+  std::string aContextName;
+  if (aThisContextNameNeeded)
+    aContextName = theNameGenerator->contextName(myContext);
+  std::string aResult;
+  std::list<int>::iterator aLevel = myNBLevel.begin();
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++, aLevel++) {
+    if (!*aSubSel)
+      continue;
+    std::string aSubName = (*aSubSel)->name(theNameGenerator);
+    aResult += "(" + aSubName + ")";
+    if (*aLevel > 1) {
+      std::ostringstream aLevelStr;
+      aLevelStr<<*aLevel;
+      aResult += aLevelStr.str();
+    }
+    // sub-name already contains the needed context name, so, here it is not needed
+    if (aThisContextNameNeeded && (
+         aSubName.find(aContextName) == 0 || aSubName.substr(1).find(aContextName) == 0))
+      aThisContextNameNeeded = false;
+  }
+  if (aThisContextNameNeeded) {
+    aResult = aResult + "_" + aContextName;
+  }
+  return aResult;
+}
diff --git a/src/Selector/Selector_FilterByNeighbors.h b/src/Selector/Selector_FilterByNeighbors.h
new file mode 100644 (file)
index 0000000..527f4d8
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_FilterByNeighbors_H_
+#define Selector_FilterByNeighbors_H_
+
+#include "Selector_AlgoWithSubs.h"
+
+#include <list>
+
+/**\class Selector_FilterByNeighbors
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: selected shape is identified by neighbor faces of
+ * the same type. Or neighbors of neighbors are considered, etc.
+ * be named one by one.
+ */
+class Selector_FilterByNeighbors: public Selector_AlgoWithSubs
+{
+  TopAbs_ShapeEnum myShapeType; ///< type of this shape
+  std::list<int> myNBLevel; ///< list of integers corresponding to subs neighborhood level
+  TDF_Label myContext; ///< label where the context of filter is stored (for naming name strings)
+public:
+  /// Initializes the selection of this kind
+  SELECTOR_EXPORT bool select(
+    const TDF_Label theContextLab, const TopoDS_Shape theContext, const TopoDS_Shape theValue);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+private:
+  /// Initializes selector
+  Selector_FilterByNeighbors();
+
+  friend class Selector_Algo;
+};
+
+#endif
diff --git a/src/Selector/Selector_Intersect.cpp b/src/Selector/Selector_Intersect.cpp
new file mode 100644 (file)
index 0000000..81e54b8
--- /dev/null
@@ -0,0 +1,307 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Intersect.h>
+
+#include <Selector_NameGenerator.h>
+#include <Selector_NExplode.h>
+
+#include <TNaming_NamedShape.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDF_ChildIterator.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+
+Selector_Intersect::Selector_Intersect() : Selector_AlgoWithSubs()
+{
+  myWeakIndex = -1; // no index by default
+}
+
+// returns the sub-shapes of theSubType which belong to all theShapes (so, common or intersection)
+static void commonShapes(const TopoDS_ListOfShape& theShapes, TopAbs_ShapeEnum theSubType,
+  TopoDS_ListOfShape& theResults)
+{
+  TopoDS_ListOfShape::iterator aSubSel = theShapes.begin();
+  for(; aSubSel != theShapes.end(); aSubSel++) {
+    TopTools_MapOfShape aCurrentMap;
+    for(TopExp_Explorer anExp(*aSubSel, theSubType); anExp.More(); anExp.Next()) {
+      if (aCurrentMap.Add(anExp.Current()) && aSubSel == theShapes.begin())
+        theResults.Append(anExp.Current());
+    }
+    if (aSubSel != theShapes.begin()) { // remove from common shapes not in aCurrentMap
+      for(TopoDS_ListOfShape::Iterator aComIter(theResults); aComIter.More(); ) {
+        if (aCurrentMap.Contains(aComIter.Value()))
+          aComIter.Next();
+        else
+          theResults.Remove(aComIter);
+      }
+    }
+  }
+}
+
+bool Selector_Intersect::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue)
+{
+  if (!useIntersections())
+    return false;
+  myShapeType = theValue.ShapeType();
+  TopAbs_ShapeEnum aSelectionType = myShapeType;
+  // try to find the shape of the higher level type in the context shape
+  bool aFacesTried = false; // for identification of vertices, faces are tried, then edges
+  TopoDS_ListOfShape aLastCommon; // store not good commons, but which may be used for weak naming
+  TopoDS_ListOfShape aLastIntersectors;
+  while(aSelectionType != TopAbs_FACE || !aFacesTried) {
+    if (aSelectionType == TopAbs_FACE) {
+      if (theValue.ShapeType() != TopAbs_VERTEX)
+        break;
+      aFacesTried = true;
+      aSelectionType = TopAbs_EDGE;
+    } else
+      aSelectionType = TopAbs_FACE;
+    TopTools_MapOfShape anIntersectors; // shapes of aSelectionType that contain theValue
+    TopoDS_ListOfShape anIntList; // same as anIntersectors
+    for(TopExp_Explorer aSelExp(theContext, aSelectionType); aSelExp.More(); aSelExp.Next()) {
+      if (aSelectionType == TopAbs_EDGE &&
+        BRep_Tool::Degenerated(TopoDS::Edge(aSelExp.Current())))
+        continue;
+      TopExp_Explorer aSubExp(aSelExp.Current(), theValue.ShapeType());
+      for(; aSubExp.More(); aSubExp.Next()) {
+        if (aSubExp.Current().IsSame(theValue)) {
+          if (anIntersectors.Add(aSelExp.Current()))
+            anIntList.Append(aSelExp.Current());
+          break;
+        }
+      }
+    }
+    // check that solution is only one
+    TopoDS_ListOfShape aCommon;
+    commonShapes(anIntList, theValue.ShapeType(), aCommon);
+    if (aCommon.Extent() == 1 && aCommon.First().IsSame(theValue)) {
+      // name the intersectors
+      TopoDS_ListOfShape::Iterator anInt(anIntList);
+      for (; anInt.More(); anInt.Next()) {
+        Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, anInt.Value(),
+          newSubLabel(), baseDocument(), geometricalNaming(), useNeighbors(), false);
+        if (!append(aSubAlgo))
+          break; // if some selector is failed, stop and search another solution
+      }
+      if (!anInt.More()) { // all intersectors were correctly named
+        return true;
+      }
+    } else if (aCommon.Extent() > 1 && aLastCommon.IsEmpty())  {
+      aLastCommon = aCommon;
+      aLastIntersectors = anIntList;
+    }
+  }
+  if (aLastCommon.Extent() > 1) {
+    if (alwaysGeometricalNaming()) {
+      TopoDS_ListOfShape::Iterator aCommonIter(aLastCommon);
+      TopoDS_Shape aFirst = aCommonIter.Value();
+      for(aCommonIter.Next(); aCommonIter.More(); aCommonIter.Next()) {
+        if (!sameGeometry(aFirst, aCommonIter.Value()))
+          break;
+      }
+      if (!aCommonIter.More()) { // all geometry is same, result is a compound
+        return true;
+      }
+    }
+    // weak naming to distinguish commons coming from intersection
+    Selector_NExplode aNexp(aLastCommon);
+    myWeakIndex = aNexp.index(theValue);
+    if (myWeakIndex != -1) {
+      // name the intersectors
+      TopoDS_ListOfShape::Iterator anInt(aLastIntersectors);
+      for (; anInt.More(); anInt.Next()) {
+        Selector_Algo* aSubAlgo = Selector_Algo::select(theContext, anInt.Value(),
+          newSubLabel(), baseDocument(), geometricalNaming(), useNeighbors(), false);
+        if (!append(aSubAlgo))
+          break; // if some selector is failed, stop and search another solution
+      }
+      if (!anInt.More()) { // all intersectors were correctly named
+        return true;
+      }
+    }
+  }
+  return false; // solution does not found
+}
+
+void Selector_Intersect::store()
+{
+  storeType(Selector_Algo::SELTYPE_INTERSECT);
+  // store all sub-selectors
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    (*aSubSel)->store();
+  }
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+  if (myWeakIndex != -1) {
+    TDataStd_Integer::Set(label(), weakID(), myWeakIndex);
+  }
+}
+
+bool Selector_Intersect::restore()
+{
+  Handle(TDataStd_Integer) aShapeTypeAttr;
+  if (!label().FindAttribute(shapeTypeID(), aShapeTypeAttr))
+    return false;
+  myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
+  // restore sub-selectors
+  bool aSubResult = true;
+  for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
+    Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
+    if (!append(aSubSel, false)) {
+      break; // some empty label left in the end
+    }
+  }
+  Handle(TDataStd_Integer) aWeakInt;
+  if (label().FindAttribute(weakID(), aWeakInt)) {
+    myWeakIndex = aWeakInt->Get();
+  }
+  return true;
+}
+
+TDF_Label Selector_Intersect::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  myShapeType = theShapeType;
+  TDF_Label aContext;
+  for(size_t aStart = 0; aStart != std::string::npos; aStart = theName.find('[', aStart + 1)) {
+    size_t anEndPos = theName.find(']', aStart + 1);
+    if (anEndPos != std::string::npos) {
+      std::string aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1);
+      if (aSubStr.find(weakNameID()) == 0) { // weak name identifier
+        std::string aWeakIndex = aSubStr.substr(weakNameID().size());
+        myWeakIndex = atoi(aWeakIndex.c_str());
+        continue;
+      }
+      TopAbs_ShapeEnum aSubShapeType = TopAbs_FACE;
+      if (anEndPos != std::string::npos && anEndPos + 1 < theName.size()) {
+        char aShapeChar = theName[anEndPos + 1];
+        if (theName[anEndPos + 1] != '[') {
+          switch(aShapeChar) {
+          case 'e': aSubShapeType = TopAbs_EDGE; break;
+          case 'v': aSubShapeType = TopAbs_VERTEX; break;
+          default:;
+          }
+        }
+      }
+      TDF_Label aSubContext;
+      Selector_Algo* aSubSel =
+        Selector_Algo::restoreByName(newSubLabel(), baseDocument(), aSubStr, aSubShapeType,
+          geometricalNaming(), theNameGenerator, aSubContext);
+      if (!append(aSubSel))
+        return TDF_Label();
+
+      if (aSubContext.IsNull()) {
+        delete aSubSel;
+        clearSubAlgos();
+        return TDF_Label();
+      }
+      if (!aContext.IsNull() && !aContext.IsEqual(aSubContext)) {
+        if (!theNameGenerator->isLater(aContext, aSubContext))
+          aContext = aSubContext;
+      } else {
+        aContext = aSubContext;
+      }
+    } else
+      return TDF_Label(); // invalid parentheses
+  }
+  return aContext;
+}
+
+bool Selector_Intersect::solve(const TopoDS_Shape& theContext)
+{
+  TopoDS_Shape aResult;
+  TopoDS_ListOfShape aSubSelectorShapes;
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    if (!(*aSubSel)->solve(theContext)) {
+      return false;
+    }
+    aSubSelectorShapes.Append((*aSubSel)->value());
+  }
+  TopoDS_ListOfShape aCommon; // common sub shapes in each sub-selector (a result)
+  commonShapes(aSubSelectorShapes, myShapeType, aCommon);
+  if (aCommon.Extent() != 1) {
+    if (myWeakIndex != -1) {
+      Selector_NExplode aNexp(aCommon);
+      aResult = aNexp.shape(myWeakIndex);
+    } else if (geometricalNaming() && aCommon.Extent() > 1) {
+      // check results are on the same geometry, create compound
+      TopoDS_ListOfShape::Iterator aCommonIter(aCommon);
+      TopoDS_Shape aFirst = aCommonIter.Value();
+      for(aCommonIter.Next(); aCommonIter.More(); aCommonIter.Next()) {
+        if (!sameGeometry(aFirst, aCommonIter.Value()))
+          break;
+      }
+      if (!aCommonIter.More()) { // all geometry is same, create a result compound
+        TopoDS_Builder aBuilder;
+        TopoDS_Compound aCompound;
+        aBuilder.MakeCompound(aCompound);
+        for(aCommonIter.Initialize(aCommon); aCommonIter.More(); aCommonIter.Next()) {
+          aBuilder.Add(aCompound, aCommonIter.Value());
+        }
+        aResult = aCompound;
+      }
+    } else {
+      return false;
+    }
+  } else {
+    aResult = aCommon.First();
+  }
+  if (!aResult.IsNull()) {
+    Selector_Algo::store(aResult);
+    return true;
+  }
+  return false;
+}
+
+std::string Selector_Intersect::name(Selector_NameGenerator* theNameGenerator)
+{
+  std::string aResult;
+  // add names of sub-components one by one in "[]" +optionally [weak_name_1]
+  std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();
+  for(; aSubSel != list().cend(); aSubSel++) {
+    aResult += '[';
+    aResult += (*aSubSel)->name(theNameGenerator);
+    aResult += ']';
+    TopoDS_Shape aSubVal = (*aSubSel)->value();
+    if (!aSubVal.IsNull()) {
+      TopAbs_ShapeEnum aSubType = aSubVal.ShapeType();
+      if (aSubType != TopAbs_FACE) { // in case the sub shape type must be stored
+        switch(aSubType) {
+        case TopAbs_EDGE: aResult += "e"; break;
+        case TopAbs_VERTEX: aResult += "v"; break;
+        default:;
+        }
+      }
+    }
+  }
+  if (myWeakIndex != -1) {
+    std::ostringstream aWeakStr;
+    aWeakStr<<"["<<weakNameID()<<myWeakIndex<<"]";
+    aResult += aWeakStr.str();
+  }
+  return aResult;
+}
diff --git a/src/Selector/Selector_Intersect.h b/src/Selector/Selector_Intersect.h
new file mode 100644 (file)
index 0000000..89bfbf1
--- /dev/null
@@ -0,0 +1,63 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Intersect_H_
+#define Selector_Intersect_H_
+
+#include "Selector_AlgoWithSubs.h"
+
+#include <list>
+
+/**\class Selector_Intersect
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: sub-shape is intersection of higher level objects.
+ */
+class Selector_Intersect: public Selector_AlgoWithSubs
+{
+  TopAbs_ShapeEnum myShapeType; ///< type of this shape
+  int myWeakIndex; ///< weak index in case intersection produces several shapes
+public:
+  /// Initializes the selection of this kind
+  SELECTOR_EXPORT bool select(const TopoDS_Shape theContext, const TopoDS_Shape theValue);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+private:
+  /// Initializes selector
+  Selector_Intersect();
+
+  friend class Selector_Algo;
+};
+
+#endif
diff --git a/src/Selector/Selector_Modify.cpp b/src/Selector/Selector_Modify.cpp
new file mode 100644 (file)
index 0000000..246e0cd
--- /dev/null
@@ -0,0 +1,346 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Modify.h>
+
+#include <Selector_NameGenerator.h>
+#include <Selector_NExplode.h>
+
+#include <TNaming_NamedShape.hxx>
+#include <TNaming_Iterator.hxx>
+#include <TNaming_SameShapeIterator.hxx>
+#include <TNaming_NewShapeIterator.hxx>
+#include <TNaming_Tool.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDF_ChildIterator.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+
+Selector_Modify::Selector_Modify() : Selector_Algo()
+{
+  myWeakIndex = -1; // no index by default
+}
+
+// adds to theResult all labels that contain initial shapes for theValue located in theFinal
+static void findBases(TDF_Label theAccess, Handle(TNaming_NamedShape) theFinal,
+  const TopoDS_Shape& theValue,
+  bool aMustBeAtFinal, const TDF_Label& theAdditionalDocument, TDF_LabelList& theResult)
+{
+  bool aFoundAnyShape = false;
+  TNaming_SameShapeIterator aLabIter(theValue, theAccess);
+  for(; aLabIter.More(); aLabIter.Next()) {
+    Handle(TNaming_NamedShape) aNS;
+    if (aLabIter.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+      if (aMustBeAtFinal && aNS != theFinal)
+        continue; // looking for old at the same final label only
+      TNaming_Evolution anEvolution = aNS->Evolution();
+      if (anEvolution == TNaming_PRIMITIVE) {
+        // check that this is not in the results already
+        const TDF_Label aResult = aNS->Label();
+        TDF_LabelList::Iterator aResIter(theResult);
+        for(; aResIter.More(); aResIter.Next()) {
+          if (aResIter.Value().IsEqual(aResult))
+            break;
+        }
+        if (!aResIter.More()) // not found, so add this new
+          theResult.Append(aResult);
+        aFoundAnyShape = true;
+      }
+      if (anEvolution == TNaming_GENERATED || anEvolution == TNaming_MODIFY) {
+        for(TNaming_Iterator aThisIter(aNS); aThisIter.More(); aThisIter.Next()) {
+          if (aThisIter.NewShape().IsSame(theValue)) {
+            // continue recursively, null NS means that any NS are ok
+            findBases(theAccess, theFinal, aThisIter.OldShape(),
+              false, theAdditionalDocument, theResult);
+            aFoundAnyShape = true;
+          }
+        }
+      }
+    }
+  }
+  if (!aFoundAnyShape && !theAdditionalDocument.IsNull()) { // try to find in additional document
+    static TDF_Label anEmpty;
+    if (TNaming_Tool::HasLabel(theAdditionalDocument, theValue))
+      findBases(theAdditionalDocument, Handle(TNaming_NamedShape)(), theValue,
+        false, anEmpty, theResult);
+  }
+}
+
+/// Returns in theResults all shapes with history started in theBase and ended in theFinal
+static void findFinals(const TDF_Label& anAccess, const TopoDS_Shape& theBase,
+  const TDF_Label& theFinal,
+  const TDF_Label& theAdditionalDoc, TopTools_MapOfShape& thePass, TopTools_MapOfShape& theResults)
+{
+  if (TNaming_Tool::HasLabel(anAccess, theBase)) {
+    for(TNaming_NewShapeIterator aBaseIter(theBase, anAccess); aBaseIter.More(); aBaseIter.Next())
+    {
+      TNaming_Evolution anEvolution = aBaseIter.NamedShape()->Evolution();
+      if (anEvolution == TNaming_GENERATED || anEvolution == TNaming_MODIFY) {
+        if (aBaseIter.NamedShape()->Label().IsEqual(theFinal)) {
+          theResults.Add(aBaseIter.Shape());
+        } else {
+          if (thePass.Add(aBaseIter.Shape()))
+            findFinals(
+              anAccess, aBaseIter.Shape(), theFinal, theAdditionalDoc, thePass, theResults);
+        }
+      }
+    }
+  }
+  if (!theAdditionalDoc.IsNull()) { // search additionally by the additional access label
+    static TDF_Label anEmpty;
+    TopTools_MapOfShape aPass;
+    findFinals(theAdditionalDoc, theBase, theFinal, anEmpty, aPass, theResults);
+  }
+}
+
+void Selector_Modify::findModificationResult(TopoDS_ListOfShape& theCommon) {
+  for(TDF_LabelList::Iterator aBase(myBases); aBase.More(); aBase.Next()) {
+    TDF_Label anAdditionalDoc; // this document if base is started in extra document
+    if (aBase.Value().Root() != label().Root()) {
+      anAdditionalDoc = label();
+    }
+    TopTools_MapOfShape aFinals;
+    TopTools_MapOfShape aPass;
+    for(TNaming_Iterator aBaseShape(aBase.Value()); aBaseShape.More(); aBaseShape.Next()) {
+      findFinals(aBase.Value(), aBaseShape.NewShape(), myFinal, anAdditionalDoc, aPass, aFinals);
+    }
+    if (!aFinals.IsEmpty()) {
+      if (theCommon.IsEmpty()) { // just copy all to common
+        for(TopTools_MapOfShape::Iterator aFinal(aFinals); aFinal.More(); aFinal.Next()) {
+          theCommon.Append(aFinal.Key());
+        }
+      } else { // keep only shapes presented in both lists
+        for(TopoDS_ListOfShape::Iterator aCommon(theCommon); aCommon.More(); ) {
+          if (aFinals.Contains(aCommon.Value())) {
+            aCommon.Next();
+          } else { // common is not found, remove it
+            theCommon.Remove(aCommon);
+          }
+        }
+      }
+    }
+  }
+}
+
+bool Selector_Modify::select(NCollection_List<Handle(TNaming_NamedShape)>& theModifList,
+  const TopoDS_Shape theContext, const TopoDS_Shape theValue)
+{
+  if (theModifList.Extent() > 1) { // searching for the best modification result: by context
+    Handle(TNaming_NamedShape) aCandidate;
+    NCollection_List<Handle(TNaming_NamedShape)>::Iterator aModIter(theModifList);
+    for (; !theModifList.IsEmpty() && aModIter.More(); aModIter.Next()) {
+      aCandidate = aModIter.Value();
+      TDF_Label aFatherLab = aCandidate->Label().Father();
+      Handle(TNaming_NamedShape) aFatherNS;
+      if (aFatherLab.FindAttribute(TNaming_NamedShape::GetID(), aFatherNS)) {
+        for (TNaming_Iterator anIter(aFatherNS); anIter.More(); anIter.Next()) {
+          if (theContext.IsSame(anIter.NewShape())) { // found the best modification
+            theModifList.Clear();
+            break;
+          }
+        }
+      }
+    }
+    // take the best candidate, or the last in the iteration
+    theModifList.Clear();
+    theModifList.Append(aCandidate);
+  }
+
+  if (!theModifList.IsEmpty()) {
+    // searching for all the base shapes of this modification
+    findBases(label(), theModifList.First(), theValue, true, baseDocument(), myBases);
+    if (!myBases.IsEmpty()) {
+      myFinal = theModifList.First()->Label();
+      TopoDS_ListOfShape aCommon;
+      findModificationResult(aCommon);
+      // trying to search by neighbors
+      if (aCommon.Extent() > 1) { // more complicated selection
+        if (alwaysGeometricalNaming()) {
+          TopoDS_ListOfShape::Iterator aCommonIter(aCommon);
+          TopoDS_Shape aFirst = aCommonIter.Value();
+          for (aCommonIter.Next(); aCommonIter.More(); aCommonIter.Next()) {
+            if (!sameGeometry(aFirst, aCommonIter.Value()))
+              break;
+          }
+          if (!aCommonIter.More()) { // all geometry is same, result is a compound
+            return true;
+          }
+        }
+      } else if (aCommon.Extent() == 1) {
+        return true; // simple modification
+      }
+      if (useNeighbors()) { // optimization: for the current moment only in one case this method is
+                            //  called where this is not needed if neighbors option is disabled
+        // weak naming between the common results
+        Selector_NExplode aNexp(aCommon);
+        myWeakIndex = aNexp.index(theValue);
+      } else
+        myWeakIndex = 0;
+      return myWeakIndex != -1;
+    }
+    // weak naming case
+    TopoDS_ListOfShape aCommon;
+    myFinal = theModifList.First()->Label();
+    Handle(TNaming_NamedShape) aNS;
+    if (myFinal.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+      for(TNaming_Iterator aFinalIter(aNS); aFinalIter.More(); aFinalIter.Next()) {
+        const TopoDS_Shape& aNewShape = aFinalIter.NewShape();
+        if (!aNewShape.IsNull())
+          aCommon.Append(aNewShape);
+      }
+    }
+    Selector_NExplode aNexp(aCommon);
+    myWeakIndex = aNexp.index(theValue);
+    return myWeakIndex != -1;
+  }
+  return false;
+}
+
+void Selector_Modify::store()
+{
+  storeType(Selector_Algo::SELTYPE_MODIFICATION);
+  storeBaseArray(myBases, myFinal);
+  if (myWeakIndex != -1) {
+    TDataStd_Integer::Set(label(), weakID(), myWeakIndex);
+  }
+}
+
+bool Selector_Modify::restore()
+{
+  if (restoreBaseArray(myBases, myFinal)) {
+    Handle(TDataStd_Integer) aWeakInt;
+    if (label().FindAttribute(weakID(), aWeakInt)) {
+      myWeakIndex = aWeakInt->Get();
+    }
+    return true;
+  }
+  return false;
+}
+
+TDF_Label Selector_Modify::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  TDF_Label aContext;
+  for(size_t anEnd, aStart = 0; aStart != std::string::npos; aStart = anEnd) {
+    if (aStart != 0)
+      aStart++;
+    anEnd = theName.find('&', aStart);
+    std::string aSubStr =
+      theName.substr(aStart, anEnd == std::string::npos ? anEnd : anEnd - aStart);
+    if (aSubStr.find(weakNameID()) == 0) { // weak name identifier
+      std::string aWeakIndex = aSubStr.substr(weakNameID().size());
+      myWeakIndex = atoi(aWeakIndex.c_str());
+      continue;
+    }
+    TDF_Label aSubContext, aValue;
+    if (!theNameGenerator->restoreContext(aSubStr, aSubContext, aValue))
+      return TDF_Label(); // can not restore
+    if(aSubContext.IsNull() || aValue.IsNull())
+      return TDF_Label(); // can not restore
+    if (myFinal.IsNull()) {
+      myFinal = aValue;
+      aContext = aSubContext;
+    } else
+      myBases.Append(aValue);
+  }
+  return aContext;
+}
+
+bool Selector_Modify::solve(const TopoDS_Shape& theContext)
+{
+  TopoDS_Shape aResult;
+  if (myBases.IsEmpty() && myWeakIndex > 0) { // weak name by the final shapes index
+    TopoDS_ListOfShape aCommon;
+    Handle(TNaming_NamedShape) aNS;
+    if (myFinal.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+      for(TNaming_Iterator aFinalIter(aNS); aFinalIter.More(); aFinalIter.Next()) {
+        const TopoDS_Shape& aNewShape = aFinalIter.NewShape();
+        if (!aNewShape.IsNull())
+          aCommon.Append(aNewShape);
+      }
+    }
+    Selector_NExplode aNexp(aCommon);
+    aResult = aNexp.shape(myWeakIndex);
+  } else { // standard case
+    TopoDS_ListOfShape aFinalsCommon; // final shapes presented in all results from bases
+    findModificationResult(aFinalsCommon);
+    if (aFinalsCommon.Extent() == 1) { // result is valid: found only one shape
+      aResult = aFinalsCommon.First();
+      findNewVersion(theContext, aResult);
+    } else if (aFinalsCommon.Extent() > 1 && myWeakIndex > 0) {
+      Selector_NExplode aNExp(aFinalsCommon);
+      aResult = aNExp.shape(myWeakIndex);
+      findNewVersion(theContext, aResult);
+    } else if (aFinalsCommon.Extent() > 1 && geometricalNaming()) {// if same geometry - compound
+      TopoDS_ListOfShape::Iterator aCommonIter(aFinalsCommon);
+      TopoDS_Shape aFirst = aCommonIter.Value();
+      for(aCommonIter.Next(); aCommonIter.More(); aCommonIter.Next()) {
+        if (!sameGeometry(aFirst, aCommonIter.Value()))
+          break;
+      }
+      if (!aCommonIter.More()) { // all geometry is same, create a result compound
+        TopoDS_Builder aBuilder;
+        TopoDS_Compound aCompound;
+        aBuilder.MakeCompound(aCompound);
+        for(aCommonIter.Initialize(aFinalsCommon); aCommonIter.More(); aCommonIter.Next()) {
+          TopoDS_Shape aSub = aCommonIter.Value();
+          findNewVersion(theContext, aSub);
+          aBuilder.Add(aCompound, aSub);
+        }
+        aResult = aCompound;
+      }
+
+    }
+  }
+
+  if (!aResult.IsNull()) {
+    Selector_Algo::store(aResult);
+    return true;
+  }
+  return false;
+}
+
+std::string Selector_Modify::name(Selector_NameGenerator* theNameGenerator)
+{
+  // final&base1&base2 +optionally: [weak_name_1]
+  std::string aResult;
+  Handle(TDataStd_Name) aName;
+  if (!myFinal.FindAttribute(TDataStd_Name::GetID(), aName))
+    return "";
+  aResult += theNameGenerator->contextName(myFinal) + "/" +
+    std::string(TCollection_AsciiString(aName->Get()).ToCString());
+  for(TDF_LabelList::iterator aBase = myBases.begin(); aBase != myBases.end(); aBase++) {
+    if (!aBase->FindAttribute(TDataStd_Name::GetID(), aName))
+      return "";
+    aResult += "&";
+    aResult += theNameGenerator->contextName(*aBase) + "/" +
+      std::string(TCollection_AsciiString(aName->Get()).ToCString());
+  }
+  if (myWeakIndex != -1) {
+    std::ostringstream aWeakStr;
+    aWeakStr<<"&"<<weakNameID()<<myWeakIndex;
+    aResult += aWeakStr.str();
+  }
+  return aResult;
+}
diff --git a/src/Selector/Selector_Modify.h b/src/Selector/Selector_Modify.h
new file mode 100644 (file)
index 0000000..63953d2
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Modify_H_
+#define Selector_Modify_H_
+
+#include "Selector_Algo.h"
+
+#include <TNaming_NamedShape.hxx>
+
+#include <list>
+
+/**\class Selector_Modify
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: sub-shape is modification of primitive at some
+ * final stage.
+ */
+class Selector_Modify: public Selector_Algo
+{
+  TDF_Label myFinal; ///< final label of the primitive or generation, where the value is
+  TDF_LabelList myBases; ///< initial labels that contain shapes that produce the modification
+  int myWeakIndex; ///< weak index in case modification produces several shapes
+public:
+  /// Initializes the selection of this kind by list of named shapes where the modification results
+  /// are presented and the selected value.
+  SELECTOR_EXPORT bool select(NCollection_List<Handle(TNaming_NamedShape)>& theModifList,
+    const TopoDS_Shape theContext, const TopoDS_Shape theValue);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+
+private:
+  /// Initializes selector
+  Selector_Modify();
+  /// Searches the final shapes presented in all results from bases basing on modification fields
+  void findModificationResult(TopoDS_ListOfShape& theCommon);
+
+  friend class Selector_Algo;
+};
+
+#endif
diff --git a/src/Selector/Selector_NExplode.cpp b/src/Selector/Selector_NExplode.cpp
new file mode 100644 (file)
index 0000000..6e252b8
--- /dev/null
@@ -0,0 +1,195 @@
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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 "Selector_NExplode.h"
+
+#include <TopoDS_Shape.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
+#include <NCollection_DataMap.hxx>
+#include <Precision.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+#include <vector>
+#include <algorithm>
+
+static std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S)
+{
+  // Computing of CentreOfMass
+  gp_Pnt GPoint;
+  double Len;
+
+  if (S.ShapeType() == TopAbs_VERTEX) {
+    GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
+    Len = (double)S.Orientation();
+  }
+  else {
+    GProp_GProps GPr;
+    if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
+      BRepGProp::LinearProperties(S, GPr);
+    }
+    else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
+      BRepGProp::SurfaceProperties(S, GPr);
+    }
+    else {
+      BRepGProp::VolumeProperties(S, GPr);
+    }
+    GPoint = GPr.CentreOfMass();
+    Len = GPr.Mass();
+  }
+
+  double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
+  return std::make_pair(dMidXYZ, Len);
+}
+
+/*!
+* \brief Sort shapes in the list by their coordinates.
+*/
+struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
+{
+  typedef NCollection_DataMap<TopoDS_Shape, std::pair<double, double> > DataMapOfShapeDouble;
+
+  CompareShapes(DataMapOfShapeDouble* theCashMap) : myMap(theCashMap) {}
+
+  bool operator() (const TopoDS_Shape& lhs, const TopoDS_Shape& rhs);
+
+  DataMapOfShapeDouble* myMap;
+};
+
+bool CompareShapes::operator() (const TopoDS_Shape& theShape1,
+  const TopoDS_Shape& theShape2)
+{
+  if (!myMap->IsBound(theShape1)) {
+    myMap->Bind(theShape1, ShapeToDouble(theShape1));
+  }
+
+  if (!myMap->IsBound(theShape2)) {
+    myMap->Bind(theShape2, ShapeToDouble(theShape2));
+  }
+
+  std::pair<double, double> val1 = myMap->Find(theShape1);
+  std::pair<double, double> val2 = myMap->Find(theShape2);
+
+  double tol = Precision::Confusion();
+  bool exchange = Standard_False;
+
+  double dMidXYZ = val1.first - val2.first;
+  if (dMidXYZ >= tol) {
+    exchange = Standard_True;
+  }
+  else if (Abs(dMidXYZ) < tol) {
+    double dLength = val1.second - val2.second;
+    if (dLength >= tol) {
+      exchange = Standard_True;
+    }
+    else if (Abs(dLength) < tol && theShape1.ShapeType() <= TopAbs_FACE) {
+      // equal values possible on shapes such as two halves of a sphere and
+      // a membrane inside the sphere
+// LCOV_EXCL_START
+      // this part of code is taken from GEOM module, but can not reproduce in SHAPER
+      Bnd_Box box1,box2;
+      BRepBndLib::Add(theShape1, box1);
+      if (!box1.IsVoid()) {
+        BRepBndLib::Add(theShape2, box2);
+        Standard_Real dSquareExtent = box1.SquareExtent() - box2.SquareExtent();
+        if (dSquareExtent >= tol) {
+          exchange = Standard_True;
+        }
+        else if (Abs(dSquareExtent) < tol) {
+          Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, val1, val2;
+          box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+          val1 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
+          box2.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+          val2 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
+          if ((val1 - val2) >= tol) {
+            exchange = Standard_True;
+          }
+        }
+      }
+// LCOV_EXCL_STOP
+    } else // compare addresses if shapes are geometrically equal
+      return theShape1.TShape().get() > theShape2.TShape().get();
+  }
+
+  //return val1 < val2;
+  return !exchange;
+}
+
+Selector_NExplode::Selector_NExplode(const TopoDS_ListOfShape& theShapes)
+{
+  std::vector<TopoDS_Shape> aShapesVec;
+
+  for(TopoDS_ListOfShape::Iterator anIter(theShapes); anIter.More(); anIter.Next()) {
+      aShapesVec.push_back(anIter.Value());
+  }
+
+  CompareShapes::DataMapOfShapeDouble aCash;
+  CompareShapes shComp(&aCash);
+  std::stable_sort(aShapesVec.begin(), aShapesVec.end(), shComp);
+
+  std::vector<TopoDS_Shape>::const_iterator anIter = aShapesVec.begin();
+  for (; anIter != aShapesVec.end(); ++anIter) {
+    mySorted.Append(*anIter);
+  }
+}
+
+Selector_NExplode::Selector_NExplode(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType)
+{
+  std::vector<TopoDS_Shape> aShapesVec;
+  TopTools_MapOfShape anAdded; // to avoid same shapes duplication
+  for(TopExp_Explorer anExp(theShape, theType); anExp.More(); anExp.Next()) {
+    if (anAdded.Add(anExp.Current()))
+     aShapesVec.push_back(anExp.Current());
+  }
+
+  CompareShapes::DataMapOfShapeDouble aCash;
+  CompareShapes shComp(&aCash);
+  std::stable_sort(aShapesVec.begin(), aShapesVec.end(), shComp);
+
+  std::vector<TopoDS_Shape>::const_iterator anIter = aShapesVec.begin();
+  for (; anIter != aShapesVec.end(); ++anIter) {
+    mySorted.Append(*anIter);
+  }
+}
+
+
+int Selector_NExplode::index(const TopoDS_Shape& theSubShape)
+{
+  TopoDS_ListOfShape::Iterator anIter(mySorted);
+  for(int anIndex = 1; anIter.More(); anIter.Next(), anIndex++) {
+    if (anIter.Value().IsSame(theSubShape))
+      return anIndex;
+  }
+  return -1; // not found
+}
+
+TopoDS_Shape Selector_NExplode::shape(const int theIndex)
+{
+  TopoDS_ListOfShape::Iterator anIter(mySorted);
+  for(int anIndex = 1; anIter.More(); anIter.Next(), anIndex++) {
+    if (anIndex == theIndex)
+      return anIter.Value();
+  }
+  return TopoDS_Shape(); // not found
+}
diff --git a/src/Selector/Selector_NExplode.h b/src/Selector/Selector_NExplode.h
new file mode 100644 (file)
index 0000000..a7ab04c
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_NExplode_H_
+#define Selector_NExplode_H_
+
+#include "Selector.h"
+
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_ListOfShape.hxx>
+
+/// \class Selector_NExplode
+/// \ingroup DataModel
+/// \brief Sort shapes by their centers of mass, using formula X*999 + Y*99 + Z*0.9.
+/// Algorithm is copied from GEOM module, which uses nexplode Draw command from OCCT.
+/// Used for getting index of sub0shape in WeakNaming algorithm.
+class Selector_NExplode
+{
+ public:
+   /// \brief Initializes the sorted list of shapes by the shapes list.
+   SELECTOR_EXPORT Selector_NExplode(const TopoDS_ListOfShape& theShapes);
+   /// \brief Initializes the sorted list of shapes by the context shape and type of sub-shapes.
+   SELECTOR_EXPORT Selector_NExplode(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType);
+
+   /// Returns an index (started from one) of sub-shape in the sorted list. Returns 0 if not found.
+   SELECTOR_EXPORT int index(const TopoDS_Shape& theSubShape);
+   /// Returns a shape by an index (started from one). Returns null if not found.
+   SELECTOR_EXPORT TopoDS_Shape shape(const int theIndex);
+
+protected:
+  TopoDS_ListOfShape mySorted; ///< keep the ordered list of shapes
+};
+
+#endif
diff --git a/src/Selector/Selector_NameGenerator.cpp b/src/Selector/Selector_NameGenerator.cpp
new file mode 100644 (file)
index 0000000..f6631ed
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_NameGenerator.h>
diff --git a/src/Selector/Selector_NameGenerator.h b/src/Selector/Selector_NameGenerator.h
new file mode 100644 (file)
index 0000000..2a819a3
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_NameGenerator_H_
+#define Selector_NameGenerator_H_
+
+#include "Selector.h"
+
+#include <TDF_Label.hxx>
+
+/**\class Selector_NameGenerator
+ * \ingroup DataModel
+ * \brief An interface for generation of the naming name basing on the current selection and
+ * document information. This requires higher-level data access, so, the caller of "name" method
+ * of Selector must implement this helper-class abstract methods.
+ */
+class Selector_NameGenerator
+{
+public:
+  /// empty constructor, nothing to add
+  Selector_NameGenerator() {};
+
+  /// This method returns the context name by the label of the sub-selected shape
+  virtual std::string contextName(const TDF_Label theSelectionLab) = 0;
+
+  /// This method restores by the context and value name the context label and
+  /// sub-label where the value is. Returns true if it is valid.
+  virtual bool restoreContext(std::string theName,
+    TDF_Label& theContext, TDF_Label& theValue) = 0;
+
+  /// Returns true if the first result is older than the second one in the tree of features
+  virtual bool isLater(const TDF_Label theResult1, const TDF_Label theResult2) const = 0;
+};
+
+#endif
diff --git a/src/Selector/Selector_Primitive.cpp b/src/Selector/Selector_Primitive.cpp
new file mode 100644 (file)
index 0000000..bb2b1f7
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Primitive.h>
+
+#include <Selector_NameGenerator.h>
+
+#include <TNaming_NamedShape.hxx>
+#include <TDataStd_Name.hxx>
+
+
+Selector_Primitive::Selector_Primitive() : Selector_Algo()
+{
+}
+
+void Selector_Primitive::select(const TDF_Label theFinalLabel)
+{
+  myFinal = theFinalLabel;
+}
+
+void Selector_Primitive::store()
+{
+  storeType(Selector_Algo::SELTYPE_PRIMITIVE);
+  static const TDF_LabelList anEmptyRefList;
+  storeBaseArray(anEmptyRefList, myFinal);
+}
+
+bool Selector_Primitive::restore()
+{
+  static TDF_LabelList anEmptyRefList;
+  return restoreBaseArray(anEmptyRefList, myFinal);
+}
+
+TDF_Label Selector_Primitive::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  TDF_Label aContext;
+  if (theNameGenerator->restoreContext(theName, aContext, myFinal)) {
+    if (myFinal.IsNull())
+      aContext.Nullify();
+  }
+  return aContext;
+}
+
+bool Selector_Primitive::solve(const TopoDS_Shape& theContext)
+{
+  Handle(TNaming_NamedShape) aNS;
+  if (myFinal.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+    TopoDS_Shape aResult = aNS->Get();
+    // if shape was modified and not exists in the context anymore, check evolution of this shape
+    // issue 2254 and similar (document CEA parametric first issue description)
+    findNewVersion(theContext, aResult);
+    Selector_Algo::store(aResult);
+    return true;
+  }
+  return false;
+}
+
+std::string Selector_Primitive::name(Selector_NameGenerator* theNameGenerator)
+{
+  Handle(TDataStd_Name) aName;
+  if (!myFinal.FindAttribute(TDataStd_Name::GetID(), aName))
+    return "";
+  std::string aResult = theNameGenerator->contextName(myFinal);
+  if (!aResult.empty())
+    aResult += "/" + std::string(TCollection_AsciiString(aName->Get()).ToCString());
+  return aResult;
+}
diff --git a/src/Selector/Selector_Primitive.h b/src/Selector/Selector_Primitive.h
new file mode 100644 (file)
index 0000000..b9d02ab
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Primitive_H_
+#define Selector_Primitive_H_
+
+#include "Selector_Algo.h"
+
+/**\class Selector_Primitive
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: exact referencing to alone shape in the data structure.
+ */
+class Selector_Primitive: public Selector_Algo
+{
+  TDF_Label myFinal; ///< final label of the where the value is
+public:
+  /// Initializes the selection of this kind
+  /// \param theLabel the final label with the primitive shape
+  SELECTOR_EXPORT void select(const TDF_Label theFinalLabel);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+private:
+  /// Initializes selector
+  Selector_Primitive();
+
+  friend class Selector_Algo;
+};
+
+#endif
diff --git a/src/Selector/Selector_Selector.cpp b/src/Selector/Selector_Selector.cpp
new file mode 100644 (file)
index 0000000..f10a0d0
--- /dev/null
@@ -0,0 +1,111 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_Selector.h>
+
+#include <Selector_NameGenerator.h>
+#include <Selector_Algo.h>
+
+#include <TopTools_MapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TNaming_NamedShape.hxx>
+
+Selector_Selector::Selector_Selector(TDF_Label theLab, TDF_Label theBaseDocLab) :
+  myLab(theLab), myBaseDocumentLab(theBaseDocLab), myAlgo(NULL)
+{}
+
+Selector_Selector::~Selector_Selector()
+{
+  if (myAlgo)
+    delete myAlgo;
+}
+
+bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue,
+  const bool theGeometricalNaming)
+{
+  if (theValue.IsNull() || theContext.IsNull())
+    return false;
+
+  myAlgo = Selector_Algo::select(theContext, theValue, myLab, myBaseDocumentLab,
+    theGeometricalNaming, true, true);
+
+  return myAlgo != NULL;
+}
+
+bool Selector_Selector::store(const TopoDS_Shape theContext)
+{
+  myAlgo->store();
+  return myAlgo->solve(theContext); // to update the selection shape on the label
+}
+
+bool Selector_Selector::restore(const TopoDS_Shape theContext)
+{
+  myAlgo = Selector_Algo::restoreByLab(myLab, myBaseDocumentLab);
+  if (myAlgo) {
+    return myAlgo->solve(theContext); // to update the selection shape on the label
+  }
+  return false;
+}
+
+TopoDS_Shape Selector_Selector::value()
+{
+  Handle(TNaming_NamedShape) aNS;
+  if (myLab.FindAttribute(TNaming_NamedShape::GetID(), aNS))
+    return aNS->Get();
+  return TopoDS_Shape(); // empty, error shape
+}
+
+std::string Selector_Selector::name(Selector_NameGenerator* theNameGenerator) {
+  return myAlgo->name(theNameGenerator);
+}
+
+TDF_Label Selector_Selector::restoreByName(
+  std::string theName, const TopAbs_ShapeEnum theShapeType,
+  Selector_NameGenerator* theNameGenerator, const bool theGeometricalNaming)
+{
+  TDF_Label aResult;
+  myAlgo = Selector_Algo::restoreByName(myLab, myBaseDocumentLab, theName, theShapeType,
+    theGeometricalNaming, theNameGenerator, aResult);
+  if (myAlgo) {
+    return aResult;
+  }
+  return TDF_Label();
+}
+
+void Selector_Selector::combineGeometrical(const TopoDS_Shape theContext)
+{
+  TopoDS_Shape aValue = value();
+  if (aValue.IsNull() || aValue.ShapeType() == TopAbs_COMPOUND)
+    return;
+
+  Selector_Algo* aNewAlgo = Selector_Algo::relesectWithAllGeometry(myAlgo, theContext);
+  if (aNewAlgo) {
+    aNewAlgo->store();
+    aNewAlgo->solve(theContext);
+    delete myAlgo;
+    myAlgo = aNewAlgo;
+  }
+}
+
+bool Selector_Selector::solve(const TopoDS_Shape theContext)
+{
+  return myAlgo->solve(theContext);
+}
diff --git a/src/Selector/Selector_Selector.h b/src/Selector/Selector_Selector.h
new file mode 100644 (file)
index 0000000..bb84365
--- /dev/null
@@ -0,0 +1,85 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_Selector_H_
+#define Selector_Selector_H_
+
+#include "Selector.h"
+
+#include <TDF_Label.hxx>
+#include <TopoDS_Shape.hxx>
+
+class Selector_NameGenerator;
+class Selector_Algo;
+
+/**\class Selector_Selector
+ * \ingroup DataModel
+ * \brief Main object for selection of the sub-shapes in the parametrically updated
+ * shapes using topological naming mechanism.
+ */
+class Selector_Selector
+{
+  TDF_Label myLab; ///< main label where selector is performed
+  TDF_Label myBaseDocumentLab; ///< an access-label to the document that may contain initial shapes
+  Selector_Algo* myAlgo; ///< root algorithm of the selector
+
+public:
+  /// Initializes selector on the label
+  SELECTOR_EXPORT Selector_Selector(TDF_Label theLab, TDF_Label theBaseDocLab = TDF_Label());
+
+  /// Destructor
+  SELECTOR_EXPORT ~Selector_Selector();
+
+  /// Initializes the selector structure on the label.
+  /// Stores the name data to restore after modification.
+  /// \param theContext whole shape that contains the selected sub-shape
+  /// \param theValue selected subshape
+  /// \param theGeometricalNaming treats selection with equal surfaces as one
+  /// \param theUseNeighbors enables searching algorithm by neighbors
+  /// \param theUseIntersections enables searching algorithm by intersection of higher level shapes
+  SELECTOR_EXPORT bool select(const TopoDS_Shape theContext, const TopoDS_Shape theValue,
+    const bool theGeometricalNaming = false);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT bool store(const TopoDS_Shape theContext);
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT bool restore(const TopoDS_Shape theContext);
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT TDF_Label restoreByName(
+    std::string theName, const TopAbs_ShapeEnum theShapeType,
+    Selector_NameGenerator* theNameGenerator, const bool theGeometricalNaming = false);
+
+  /// Returns the current sub-shape value (null if can not resolve)
+  SELECTOR_EXPORT TopoDS_Shape value();
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT std::string name(Selector_NameGenerator* theNameGenerator);
+
+  /// Makes the current local selection becomes all sub-shapes with same base geometry.
+  SELECTOR_EXPORT void combineGeometrical(const TopoDS_Shape theContext);
+
+  /// Stores the selected shape in he tree and returns true if shape found correctly
+  SELECTOR_EXPORT bool solve(const TopoDS_Shape theContext);
+};
+
+#endif
diff --git a/src/Selector/Selector_WeakName.cpp b/src/Selector/Selector_WeakName.cpp
new file mode 100644 (file)
index 0000000..ff74df5
--- /dev/null
@@ -0,0 +1,138 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 <Selector_WeakName.h>
+
+#include <Selector_NameGenerator.h>
+#include <Selector_NExplode.h>
+
+#include <TNaming_Tool.hxx>
+#include <TNaming_SameShapeIterator.hxx>
+#include <TNaming_Iterator.hxx>
+#include <TDataStd_Integer.hxx>
+
+Selector_WeakName::Selector_WeakName() : Selector_Algo()
+{
+}
+
+bool Selector_WeakName::select(const TopoDS_Shape theContext, const TopoDS_Shape theValue)
+{
+  myShapeType = theValue.ShapeType();
+  Selector_NExplode aNexp(theContext, myShapeType);
+  myWeakIndex = aNexp.index(theValue);
+  if (myWeakIndex != -1) {
+    // searching for context shape label to store in myFinal
+    if (TNaming_Tool::HasLabel(label(), theContext)) {
+      for(TNaming_SameShapeIterator aShapes(theContext, label()); aShapes.More(); aShapes.Next())
+      {
+        Handle(TNaming_NamedShape) aNS;
+        if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+          TNaming_Evolution anEvolution = aNS->Evolution();
+          if (anEvolution == TNaming_PRIMITIVE || anEvolution == TNaming_GENERATED ||
+            anEvolution == TNaming_MODIFY) {
+            // check this is a new shape
+            for(TNaming_Iterator aNSIter(aNS); aNSIter.More(); aNSIter.Next()) {
+              if (aNSIter.NewShape().IsSame(theContext)) {
+                myContext = aNS->Label();
+                break;
+              }
+            }
+          }
+        }
+      }
+    }
+    return true;
+  }
+  return false;
+}
+
+void Selector_WeakName::store()
+{
+  static const TDF_LabelList anEmptyRefList;
+  storeType(Selector_Algo::SELTYPE_WEAK_NAMING);
+  storeBaseArray(anEmptyRefList, myContext);
+  TDataStd_Integer::Set(label(), weakID(), myWeakIndex);
+  TDataStd_Integer::Set(label(), shapeTypeID(), (int)myShapeType);
+}
+
+bool Selector_WeakName::restore()
+{
+  Handle(TDataStd_Integer) aWeakInt;
+  if (!label().FindAttribute(weakID(), aWeakInt))
+    return false;
+  myWeakIndex = aWeakInt->Get();
+  Handle(TDataStd_Integer) aShapeTypeAttr;
+  if (!label().FindAttribute(shapeTypeID(), aShapeTypeAttr))
+    return false;
+  myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
+  static TDF_LabelList anEmptyRefList;
+  return restoreBaseArray(anEmptyRefList, myContext);
+}
+
+TDF_Label Selector_WeakName::restoreByName(std::string theName,
+  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+{
+  std::string aWeakIndex = theName.substr(pureWeakNameID().size());
+  std::size_t aContextPosition = aWeakIndex.find("_");
+  myWeakIndex = atoi(aWeakIndex.c_str());
+  myShapeType = theShapeType;
+  TDF_Label aContext;
+  if (aContextPosition != std::string::npos) { // context is also defined
+    std::string aContextName = aWeakIndex.substr(aContextPosition + 1);
+    if (theNameGenerator->restoreContext(aContextName, aContext, myContext)) {
+      if (myContext.IsNull())
+        aContext.Nullify();
+    }
+  }
+  return aContext;
+}
+
+bool Selector_WeakName::solve(const TopoDS_Shape& theContext)
+{
+
+  TopoDS_Shape aContext;
+  if (myContext.IsNull()) {
+    aContext = theContext;
+  } else {
+    Handle(TNaming_NamedShape) aNS;
+    if (myContext.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
+      aContext = aNS->Get();
+    }
+  }
+  if (!aContext.IsNull()) {
+    Selector_NExplode aNexp(aContext, myShapeType);
+    TopoDS_Shape aResult = aNexp.shape(myWeakIndex);
+    if (!aResult.IsNull()) {
+      Selector_Algo::store(aResult);
+      return true;
+    }
+  }
+  return false;
+}
+
+std::string Selector_WeakName::name(Selector_NameGenerator* theNameGenerator)
+{
+  // _weak_naming_1_Context
+  std::ostringstream aWeakStr;
+  aWeakStr<<pureWeakNameID()<<myWeakIndex;
+  std::string aResult = aWeakStr.str();
+  if (!myContext.IsNull())
+    aResult += "_" + theNameGenerator->contextName(myContext);
+  return aResult;
+}
diff --git a/src/Selector/Selector_WeakName.h b/src/Selector/Selector_WeakName.h
new file mode 100644 (file)
index 0000000..aadf4d1
--- /dev/null
@@ -0,0 +1,63 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef Selector_WeakName_H_
+#define Selector_WeakName_H_
+
+#include "Selector_Algo.h"
+
+/**\class Selector_WeakName
+ * \ingroup DataModel
+ * \brief Kind of selection algorithm: if other algorithms fail, this stores the geometrical
+ * index of the selected shape. Pure weak naming approach.
+ */
+class Selector_WeakName: public Selector_Algo
+{
+  TopAbs_ShapeEnum myShapeType; ///< type of this shape
+  int myWeakIndex; ///< weak index in case modification produces several shapes
+  TDF_Label myContext; ///< context shape label
+public:
+  /// Initializes the selection of this kind
+  SELECTOR_EXPORT bool select(const TopoDS_Shape theContext, const TopoDS_Shape theValue);
+
+  /// Stores the name to the label and sub-labels tree
+  SELECTOR_EXPORT virtual void store() override;
+
+  /// Restores the selected shape by the topological naming kept in the data structure
+  /// Returns true if it can restore structure correctly
+  SELECTOR_EXPORT virtual bool restore() override;
+
+  /// Restores the selected shape by the topological name string.
+  /// Returns not empty label of the context.
+  SELECTOR_EXPORT virtual TDF_Label restoreByName(std::string theName,
+    const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) override;
+
+  /// Updates the current shape by the stored topological name
+  SELECTOR_EXPORT virtual bool solve(const TopoDS_Shape& theContext) override;
+
+  /// Returns the naming name of the selection
+  SELECTOR_EXPORT virtual std::string name(Selector_NameGenerator* theNameGenerator) override;
+private:
+  /// Initializes selector
+  Selector_WeakName();
+
+  friend class Selector_Algo;
+};
+
+#endif
index 389d004e71fd90e3be202f73362cfd83f71cfbc4..37be6a336e39f8db975780d287d190bb79627813 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 
@@ -25,6 +24,7 @@ SET(PROJECT_HEADERS
   SketchAPI_Arc.h
   SketchAPI_Circle.h
   SketchAPI_Constraint.h
+  SketchAPI_ConstraintAngle.h
   SketchAPI_IntersectionPoint.h
   SketchAPI_Line.h
   SketchAPI_MacroArc.h
@@ -43,6 +43,7 @@ SET(PROJECT_SOURCES
   SketchAPI_Arc.cpp
   SketchAPI_Circle.cpp
   SketchAPI_Constraint.cpp
+  SketchAPI_ConstraintAngle.cpp
   SketchAPI_IntersectionPoint.cpp
   SketchAPI_Line.cpp
   SketchAPI_MacroArc.cpp
index d9e0bd7b8cd129b65cc0d9c43860e01d6d060f4a..27586c8f461ce41c1b8a0c31ad3698b421623002 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SKETCHAPI_H
index 0f76546eba007d67f21ebaf3117007e94fa32180..5ca8fdeb5ad0bcd8022672a21501ab807b39f15f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 /* SketchAPI.i */
@@ -50,6 +49,7 @@
 %shared_ptr(SketchAPI_Circle)
 %shared_ptr(SketchAPI_MacroCircle)
 %shared_ptr(SketchAPI_Constraint)
+%shared_ptr(SketchAPI_ConstraintAngle)
 %shared_ptr(SketchAPI_IntersectionPoint)
 %shared_ptr(SketchAPI_Line)
 %shared_ptr(SketchAPI_Mirror)
 %include "SketchAPI_Rotation.h"
 %include "SketchAPI_Sketch.h"
 %include "SketchAPI_Constraint.h"
+%include "SketchAPI_ConstraintAngle.h"
index a5e34336cabe0ea487b9111c04f3b926738e78b2..4f973996c92b0e6732f0275a046e42f8abc84323 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Arc.h"
index 7716ce64045e809717bd4c81840d4b4a970d88ed..69e724dcb1a678f4351ad49e4675fc44f5a512f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchAPI_Arc_H_
index 8085f6603f9b01fa0f726af5c6ffb16610f99f43..c4cd7db1543bd9b49ee1bca78e61f7412145c480 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Circle.h"
index a7841a53eede5cb614fcf04b3e6716215f14cffd..839c1e58f0304381b59842012730ac004469237d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchAPI_Circle_H_
index 82b5dfab474f323c0f1634ec230e4b25c5f98cfa..b1fefb5e25c945e95743b65687b36b8237be8834 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Constraint.h"
@@ -24,7 +23,6 @@
 #include <ModelHighAPI_Tools.h>
 
 #include <SketchPlugin_Constraint.h>
-#include <SketchPlugin_ConstraintAngle.h>
 #include <SketchPlugin_ConstraintCoincidence.h>
 #include <SketchPlugin_ConstraintCollinear.h>
 #include <SketchPlugin_ConstraintDistance.h>
@@ -66,16 +64,37 @@ bool SketchAPI_Constraint::initialize()
   return true;
 }
 
+void SketchAPI_Constraint::setEntityA(const ModelHighAPI_RefAttr& theEntity)
+{
+  fillAttribute(theEntity, feature()->refattr(SketchPlugin_Constraint::ENTITY_A()));
+}
+
+void SketchAPI_Constraint::setEntityB(const ModelHighAPI_RefAttr& theEntity)
+{
+  fillAttribute(theEntity, feature()->refattr(SketchPlugin_Constraint::ENTITY_B()));
+}
+
+void SketchAPI_Constraint::setEntityC(const ModelHighAPI_RefAttr& theEntity)
+{
+  fillAttribute(theEntity, feature()->refattr(SketchPlugin_Constraint::ENTITY_C()));
+}
+
+void SketchAPI_Constraint::setEntityD(const ModelHighAPI_RefAttr& theEntity)
+{
+  fillAttribute(theEntity, feature()->refattr(SketchPlugin_Constraint::ENTITY_D()));
+}
+
+void SketchAPI_Constraint::setValue(const ModelHighAPI_Double& theValue)
+{
+  fillAttribute(theValue, feature()->real(SketchPlugin_Constraint::VALUE()));
+}
+
 static const std::string& constraintTypeToSetter(const std::string& theType)
 {
   if (theType == SketchPlugin_ConstraintCoincidence::ID()) {
     static const std::string COINCIDENCE_SETTER("setCoincident");
     return COINCIDENCE_SETTER;
   }
-  if (theType == SketchPlugin_ConstraintAngle::ID()) {
-    static const std::string ANGLE_SETTER("setAngle");
-    return ANGLE_SETTER;
-  }
   if (theType == SketchPlugin_ConstraintCollinear::ID()) {
     static const std::string COLLINEAR_SETTER("setCollinear");
     return COLLINEAR_SETTER;
@@ -150,6 +169,20 @@ static std::string angleTypeToString(int theAngleType)
   return std::string();
 }
 
+bool SketchAPI_Constraint::areAllAttributesDumped(ModelHighAPI_Dumper& theDumper) const
+{
+  bool areAttributesDumped = true;
+  FeaturePtr aBase = feature();
+  for (int i = 0; i < CONSTRAINT_ATTR_SIZE && areAttributesDumped; ++i) {
+    AttributeRefAttrPtr aRefAttr = aBase->refattr(SketchPlugin_Constraint::ATTRIBUTE(i));
+    if (aRefAttr && aRefAttr->isInitialized())
+      areAttributesDumped = theDumper.isDumped(aRefAttr);
+  }
+  if (!areAttributesDumped)
+    theDumper.postpone(aBase);
+  return areAttributesDumped;
+}
+
 void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const
 {
   FeaturePtr aBase = feature();
@@ -169,26 +202,12 @@ void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const
       return;
   }
 
-  // Check all attributes are already dumped. If not, store the constraint as postponed.
-  bool areAttributesDumped = true;
-  for (int i = 0; i < CONSTRAINT_ATTR_SIZE && areAttributesDumped; ++i) {
-    AttributeRefAttrPtr aRefAttr = aBase->refattr(SketchPlugin_Constraint::ATTRIBUTE(i));
-    if (aRefAttr && aRefAttr->isInitialized())
-      areAttributesDumped = theDumper.isDumped(aRefAttr);
-  }
-  if (!areAttributesDumped) {
-    theDumper.postpone(aBase);
+  // postpone constraint until all its attributes be dumped
+  if (!areAllAttributesDumped(theDumper))
     return;
-  }
-
-  bool isAngle = aBase->getKind() == SketchPlugin_ConstraintAngle::ID();
-  std::string aSetterSuffix;
-  if (isAngle)
-    aSetterSuffix = angleTypeToString(aBase->integer(
-                    SketchPlugin_ConstraintAngle::TYPE_ID())->value());
 
   const std::string& aSketchName = theDumper.parentName(aBase);
-  theDumper << aBase << " = " << aSketchName << "." << aSetter << aSetterSuffix << "(";
+  theDumper << aBase << " = " << aSketchName << "." << aSetter << "(";
 
   bool isFirstAttr = true;
   for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
@@ -200,10 +219,8 @@ void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const
   }
 
   AttributeDoublePtr aValueAttr;
-  if (isAngle)
-    aValueAttr = aBase->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
-  else if (aBase->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID() ||
-           aBase->getKind() == SketchPlugin_ConstraintDistanceVertical::ID())
+  if (aBase->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID() ||
+      aBase->getKind() == SketchPlugin_ConstraintDistanceVertical::ID())
     aValueAttr = aBase->real(SketchPlugin_ConstraintDistanceAlongDir::DISTANCE_VALUE_ID());
   else
     aValueAttr = aBase->real(SketchPlugin_Constraint::VALUE());
index 2ad1650650635f2ec363d3bc1b2dc98c2be918a7..200ecf4f0461ad7a125f9bfdbda54b69c21f4b09 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_CONSTRAINT_H_
@@ -29,6 +28,8 @@
 
 #include <SketchPlugin_Constraint.h>
 
+class ModelHighAPI_Double;
+
 /**\class SketchAPI_Constraint
  * \ingroup CPPHighAPI
  * \brief Interface for Constraint feature
@@ -54,9 +55,21 @@ public:
   SKETCHAPI_EXPORT
   bool initialize();
 
+  SKETCHAPI_EXPORT void setEntityA(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityB(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityC(const ModelHighAPI_RefAttr& theEntity);
+  SKETCHAPI_EXPORT void setEntityD(const ModelHighAPI_RefAttr& theEntity);
+
+  SKETCHAPI_EXPORT void setValue(const ModelHighAPI_Double& theValue);
+
   /// Dump wrapped feature
   SKETCHAPI_EXPORT
   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+
+protected:
+  // Check all attributes of constraint are already dumped.
+  // If not, store the constraint as postponed.
+  bool areAllAttributesDumped(ModelHighAPI_Dumper& theDumper) const;
 };
 
 #endif
diff --git a/src/SketchAPI/SketchAPI_ConstraintAngle.cpp b/src/SketchAPI/SketchAPI_ConstraintAngle.cpp
new file mode 100644 (file)
index 0000000..fa12b85
--- /dev/null
@@ -0,0 +1,133 @@
+// Copyright (C) 2019  CEA/DEN, EDF R&D
+//
+// 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 "SketchAPI_ConstraintAngle.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Tools.h>
+
+#include <GeomAPI_Angle2d.h>
+#include <GeomAPI_Lin2d.h>
+
+#include <SketchPlugin_ConstraintAngle.h>
+#include <SketchPlugin_Line.h>
+
+#include <cmath>
+
+SketchAPI_ConstraintAngle::SketchAPI_ConstraintAngle(
+    const std::shared_ptr<ModelAPI_Feature> & theFeature)
+: SketchAPI_Constraint(theFeature)
+{
+  ConstraintPtr aConstraint = std::dynamic_pointer_cast<SketchPlugin_Constraint>(theFeature);
+  if (aConstraint)
+    initialize();
+}
+
+static FeaturePtr getFeatureLine(DataPtr theData, const std::string& theAttribute)
+{
+  FeaturePtr aLine;
+  if (!theData.get() || !theData->isValid()) /// essential check as it is called in openGl thread)
+    return aLine;
+
+  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
+  if (anAttr) {
+    FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
+    if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
+      return aFeature;
+    }
+  }
+  return aLine;
+}
+
+static void calculatePossibleValuesOfAngle(FeaturePtr theFeature,
+    double& theAngleDirect, double& theAngleComplementary, double& theAngleBackward)
+{
+  std::shared_ptr<ModelAPI_Data> aData = theFeature->data();
+  FeaturePtr aLineA = getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
+  FeaturePtr aLineB = getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
+
+  std::shared_ptr<GeomDataAPI_Point2D> aStartA = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    aLineA->attribute(SketchPlugin_Line::START_ID()));
+  std::shared_ptr<GeomDataAPI_Point2D> aEndA = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    aLineA->attribute(SketchPlugin_Line::END_ID()));
+  std::shared_ptr<GeomDataAPI_Point2D> aStartB = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    aLineB->attribute(SketchPlugin_Line::START_ID()));
+  std::shared_ptr<GeomDataAPI_Point2D> aEndB = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    aLineB->attribute(SketchPlugin_Line::END_ID()));
+
+  std::shared_ptr<GeomAPI_Angle2d> anAng(new GeomAPI_Angle2d(
+      aStartA->pnt(), aEndA->pnt(), aStartB->pnt(), aEndB->pnt()));
+  theAngleDirect = anAng->angleDegree();
+  theAngleBackward = 360.0 - theAngleDirect;
+
+  if (theAngleDirect > 180.0)
+    theAngleComplementary = theAngleDirect - 180.0;
+  else
+    theAngleComplementary = 180.0 - theAngleDirect;
+}
+
+static std::string angleTypeToString(FeaturePtr theFeature)
+{
+  static const double TOLERANCE = 1.e-7;
+  double anAngleDirect, anAngleComplmentary, anAngleBackward;
+  calculatePossibleValuesOfAngle(theFeature, anAngleDirect, anAngleComplmentary, anAngleBackward);
+
+  AttributeDoublePtr aValueAttr = theFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
+
+  std::string aType;
+  if (fabs(aValueAttr->value() - anAngleDirect) < TOLERANCE) {
+    // Nothing to do.
+    // This case is empty and going the first to check the direct angle before the others.
+  }
+  else if (fabs(aValueAttr->value() - anAngleComplmentary) < TOLERANCE)
+    aType = "Complementary";
+  else if (fabs(aValueAttr->value() - anAngleBackward) < TOLERANCE)
+    aType = "Backward";
+  return aType;
+}
+
+void SketchAPI_ConstraintAngle::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  // postpone constraint until all its attributes be dumped
+  if (!areAllAttributesDumped(theDumper))
+    return;
+
+  // calculate angle value as it was just applied to the attributes
+  FeaturePtr aBase = feature();
+  std::string aSetterSuffix = angleTypeToString(aBase);
+
+  const std::string& aSketchName = theDumper.parentName(aBase);
+  theDumper << aBase << " = " << aSketchName << "." << "setAngle" << aSetterSuffix << "(";
+
+  bool isFirstAttr = true;
+  for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
+    AttributeRefAttrPtr aRefAttr = aBase->refattr(SketchPlugin_Constraint::ATTRIBUTE(i));
+    if (aRefAttr && aRefAttr->isInitialized()) {
+      theDumper << (isFirstAttr ? "" : ", ") << aRefAttr;
+      isFirstAttr = false;
+    }
+  }
+
+  AttributeDoublePtr aValueAttr = aBase->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID());
+  if (aValueAttr && aValueAttr->isInitialized())
+    theDumper << ", " << aValueAttr;
+
+  theDumper << ")" << std::endl;
+}
diff --git a/src/SketchAPI/SketchAPI_ConstraintAngle.h b/src/SketchAPI/SketchAPI_ConstraintAngle.h
new file mode 100644 (file)
index 0000000..9d1f1af
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef SRC_SKETCHAPI_SKETCHAPI_CONSTRAINTANGLE_H_
+#define SRC_SKETCHAPI_SKETCHAPI_CONSTRAINTANGLE_H_
+
+#include "SketchAPI_Constraint.h"
+
+class ModelHighAPI_Double;
+
+/**\class SketchAPI_ConstraintAngle
+ * \ingroup CPPHighAPI
+ * \brief Interface for ConstraintAngle feature
+ */
+class SketchAPI_ConstraintAngle : public SketchAPI_Constraint
+{
+public:
+  /// Constructor without values
+  SKETCHAPI_EXPORT
+  explicit SketchAPI_ConstraintAngle(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+
+  static std::string ID()
+  {
+    static const std::string MY_SKETCH_CONSTRAINT_ID = "SketchConstraintAngle";
+    return MY_SKETCH_CONSTRAINT_ID;
+  }
+  virtual std::string getID() { return ID(); }
+
+  /// Dump wrapped feature
+  SKETCHAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+#endif
index ff689965c69a9c76e49d76cc311f43505f41009d..e4732fbda8b5ba74f3c8c94c88927d69f4fbed2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_IntersectionPoint.h"
index cc1b4e947a107f780ff058eec33d5acc77ee5f7d..c85c8a24f258576b40b7086ef92d06d6b6188e2c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_INTERSECTIONPOINT_H_
index 6e9aef54512b6498e560f49946a1cf45812a74b5..9afa4cce3cec188fd7131693a697eddb38351c3f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Line.h"
index 69e8688ac54e678e880e20855095129acbaa57ff..c34db1b741759b198b3b0aedbd2424b43efe88e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_LINE_H_
index 4acf03698f203c4a894282144b2a45d64922a990..4bad39fefc6e56952ef3bb263bccb97807fc41a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_MacroArc.h"
index 12bf0f98e7d48f2b88811fbf664608ef1a11c4d3..a4b51ccec3371c608df32034166edab32e63b50c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchAPI_MacroArc_H_
@@ -89,10 +88,6 @@ public:
   SKETCHAPI_EXPORT
   virtual ~SketchAPI_MacroArc();
 
-  void test() {
-    SketchPlugin_MacroArc::ID();
-  }
-
   INTERFACE_12(SketchPlugin_MacroArc::ID(),
                arcType, SketchPlugin_MacroArc::ARC_TYPE(),
                ModelAPI_AttributeString, /** Arc type */,
index 694b0231f2b0e8c6852f67536fc1092281f3ce6c..163fcc26cdc4e535c1d7c305541835e748d176bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_MacroCircle.h"
@@ -137,93 +136,3 @@ void SketchAPI_MacroCircle::setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d
 
   execute();
 }
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setCenterPoint(double theX, double theY)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
-  fillAttribute(centerPoint(), theX, theY);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setCenterPoint(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
-  fillAttribute(theCenterPoint, mycenterPoint);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setPassedPoint(double theX, double theY)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
-  fillAttribute(passedPoint(), theX, theY);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setPassedPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
-  fillAttribute(thePassedPoint, mypassedPoint);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setFirstPoint(double theX, double theY)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(firstPoint(), theX, theY);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(thePoint, myfirstPoint);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setSecondPoint(double theX, double theY)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(secondPoint(), theX, theY);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(thePoint, mysecondPoint);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setThirdPoint(double theX, double theY)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(thirdPoint(), theX, theY);
-
-  execute();
-}
-
-//==================================================================================================
-void SketchAPI_MacroCircle::setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
-{
-  fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
-  fillAttribute(thePoint, mythirdPoint);
-
-  execute();
-}
index 39d06daf00d9fb1309a300cd14467896f39856a3..037054f7430d09ab2c2242995fa7c9e623dd23a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchAPI_MacroCircle_H_
@@ -84,67 +83,24 @@ public:
               thirdPoint, SketchPlugin_MacroCircle::THIRD_POINT_ID(),
               GeomDataAPI_Point2D, /** Third point */)
 
+private:
   /// Set by center and passed points.
-  SKETCHAPI_EXPORT
   void setByCenterAndPassedPoints(double theCenterX, double theCenterY,
                                   double thePassedX, double thePassedY);
 
   /// Set by center and passed points.
-  SKETCHAPI_EXPORT
   void setByCenterAndPassedPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
                                   const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
 
   /// Set by three points.
-  SKETCHAPI_EXPORT
   void setByThreePoints(double theX1, double theY1,
                         double theX2, double theY2,
                         double theX3, double theY3);
 
   /// Set by three points.
-  SKETCHAPI_EXPORT
   void setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
-
-  /// Set center point.
-  SKETCHAPI_EXPORT
-  void setCenterPoint(double theX, double theY);
-
-  /// Set center point.
-  SKETCHAPI_EXPORT
-  void setCenterPoint(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint);
-
-  /// Set passed point.
-  SKETCHAPI_EXPORT
-  void setPassedPoint(double theX, double theY);
-
-  /// Set passed point.
-  SKETCHAPI_EXPORT
-  void setPassedPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
-
-  /// Set first point.
-  SKETCHAPI_EXPORT
-  void setFirstPoint(double theX, double theY);
-
-  /// Set first point.
-  SKETCHAPI_EXPORT
-  void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
-
-  /// Set second point.
-  SKETCHAPI_EXPORT
-  void setSecondPoint(double theX, double theY);
-
-  /// Set second point.
-  SKETCHAPI_EXPORT
-  void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
-
-  /// Set third point.
-  SKETCHAPI_EXPORT
-  void setThirdPoint(double theX, double theY);
-
-  /// Set third point.
-  SKETCHAPI_EXPORT
-  void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
 };
 
 /// Pointer on Circle object.
index 73f13635d9f67e51c5193374021b197da88b3723..d1fbd0da098695ab66bbcf6c797f35676f27fe10 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Mirror.h"
index 6da1203da008ce0c4b266ec8a39b476e7038edc6..45d4c2c73e65b23b3398d96365c74383bcb6bb8f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_MIRROR_H_
index 1b711f1a9e3f0f88077a2a1a52a440747960f3c9..2a5344db55e6de6c1282e8253147c1e4034fc03b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Point.h"
index 3d9b956cc0982d36a5ec39a9af2ce09148a6b028..e9940ac741f6655c5a51ea2fbad0fac5d4e60bae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_POINT_H_
index 6d82651e93c7f0383fe2629a1f8cf7fefd6c98e4..76fb2dc18b30bedfdea9e9e43fd45daf343a44a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Projection.h"
@@ -75,9 +74,7 @@ void SketchAPI_Projection::setExternalFeature(const ModelHighAPI_Selection & the
 
 void SketchAPI_Projection::setByExternalName(const std::string& theExternalName)
 {
-  fillAttribute(ModelHighAPI_Selection("EDGE", theExternalName), external());
-
-  execute(true);
+  setExternalFeature(ModelHighAPI_Selection("EDGE", theExternalName));
 }
 
 void SketchAPI_Projection::setIncludeToResult(bool theKeepResult)
index e3926fc36ea541514bcfa010658a78999493f1b8..02fb43f7e0971464e375dcc04e098cc4f48827ed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_
index 135285e6a0b3cc78b71deb244eaaf721ee27156c..a43337a3f14c56f0f0ea39de6cd45f8af98872aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Rectangle.h"
index b9fe8fced01cea8cf62f0b39a67c34861c4cf269..fd7c29c333f3fdd88375c265ab532bd64c17c6e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
index 67393b56e5642caaed6a200905e5111e0cf547c0..178b3d0a059571b9eb3dbcc0f1334200ad41e052 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Rotation.h"
index d776efccce7f60668db9b0371cec30f4c4002965..a914fe991de1aa5c623462f38f5fd293e8c9e89a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_
index 24be396bf39a2a109d11bd5f4d90d51b82b03e9a..380ec24691922d127e312c490b917c735a4b0d4e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Sketch.h"
@@ -572,9 +571,9 @@ std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::setAngle(
   fillAttribute(SketcherPrs_Tools::ANGLE_DIRECT,
       aFeature->integer(SketchPlugin_ConstraintAngle::TYPE_ID()));
   // fill the value before llines to avoid calculation of angle value by the Angle feature
-  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
   fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   aFeature->execute();
   return InterfacePtr(new ModelHighAPI_Interface(aFeature));
 }
@@ -588,10 +587,9 @@ std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::setAngleComplementary(
       compositeFeature()->addFeature(SketchPlugin_ConstraintAngle::ID());
   fillAttribute(SketcherPrs_Tools::ANGLE_COMPLEMENTARY,
       aFeature->integer(SketchPlugin_ConstraintAngle::TYPE_ID()));
-  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
   fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
-//  fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
+  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   aFeature->execute();
   return InterfacePtr(new ModelHighAPI_Interface(aFeature));
 }
@@ -605,10 +603,9 @@ std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::setAngleBackward(
       compositeFeature()->addFeature(SketchPlugin_ConstraintAngle::ID());
   fillAttribute(SketcherPrs_Tools::ANGLE_BACKWARD,
       aFeature->integer(SketchPlugin_ConstraintAngle::TYPE_ID()));
-  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
   fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
-//  fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
+  fillAttribute(theValue, aFeature->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()));
   aFeature->execute();
   return InterfacePtr(new ModelHighAPI_Interface(aFeature));
 }
@@ -846,9 +843,7 @@ std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Sketch::setVertical(
 static std::shared_ptr<GeomAPI_Pnt2d> pointCoordinates(const AttributePtr& thePoint)
 {
   AttributePoint2DPtr aPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(thePoint);
-  if (aPnt)
-    return aPnt->pnt();
-  return std::shared_ptr<GeomAPI_Pnt2d>();
+  return aPnt ? aPnt->pnt() : std::shared_ptr<GeomAPI_Pnt2d>();
 }
 
 static std::shared_ptr<GeomAPI_Pnt2d> middlePointOnLine(const FeaturePtr& theFeature)
@@ -919,20 +914,21 @@ static std::shared_ptr<GeomAPI_Pnt2d> middlePointOnArc(const FeaturePtr& theFeat
 
 static std::shared_ptr<GeomAPI_Pnt2d> middlePoint(const ObjectPtr& theObject)
 {
+  std::shared_ptr<GeomAPI_Pnt2d> aMiddlePoint;
   FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
   if (aFeature) {
+    // move only features of the following types
     const std::string& aFeatureKind = aFeature->getKind();
     if (aFeatureKind == SketchPlugin_Point::ID())
-      return pointCoordinates(aFeature->attribute(SketchPlugin_Point::COORD_ID()));
+      aMiddlePoint = pointCoordinates(aFeature->attribute(SketchPlugin_Point::COORD_ID()));
     else if (aFeatureKind == SketchPlugin_Line::ID())
-      return middlePointOnLine(aFeature);
+      aMiddlePoint = middlePointOnLine(aFeature);
     else if (aFeatureKind == SketchPlugin_Circle::ID())
-      return pointOnCircle(aFeature);
+      aMiddlePoint = pointOnCircle(aFeature);
     else if (aFeatureKind == SketchPlugin_Arc::ID())
-      return middlePointOnArc(aFeature);
+      aMiddlePoint = middlePointOnArc(aFeature);
   }
-  // do not move other types of features
-  return std::shared_ptr<GeomAPI_Pnt2d>();
+  return aMiddlePoint;
 }
 
 void SketchAPI_Sketch::move(const ModelHighAPI_RefAttr& theMovedEntity,
index aa58dc89edab2ea9fe68955450764eaa9dacf1e6..2ec522a9a436108691d8a5ee0e7f8999827e642a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
index 1989dfa6b467481832c4ffcd5df67fb6a52eff70..808ac012bec5144211356681803c203a2a2fcd9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_SketchEntity.h"
index 937d917d98893431612cba100b06c04bb21cead3..6344f5b8555c7851806b77ec3fd3de29b9720ad7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
index dddf3b4ad7b0455eca4f2573a182f21a7471d295..3bb86f2c6c5daf28869bc5f23d5a7852d3791984 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchAPI_Translation.h"
index 4fd2c08b79b6140efcc45b4423372a9138e7bf5f..8fe15aefd8074548be535f85bfc38561847bc02c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
index 440eb2aec66e0d0600d0ce92c8f0f6f3c464f2ea..1f8748712ddff145543c7bf32a1992777962fffc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_SWIG_H_
@@ -29,6 +28,7 @@
   #include "SketchAPI_Circle.h"
   #include "SketchAPI_MacroCircle.h"
   #include "SketchAPI_Constraint.h"
+  #include "SketchAPI_ConstraintAngle.h"
   #include "SketchAPI_IntersectionPoint.h"
   #include "SketchAPI_Line.h"
   #include "SketchAPI_Mirror.h"
index fb7c3c0196b4c0d89b1877aa1a459c6aef55358a..2bcf93deb10898d2f5177a8c47157ef31064a422 100644 (file)
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
+import math
 import unittest
 
 import ModelAPI
 import SketchAPI
 
+from salome.shaper import geom
+from salome.shaper import model
+
 class SketchTestCase(unittest.TestCase):
 
     def setUp(self):
         self.session = ModelAPI.ModelAPI_Session.get()
-        self.doc = self.session.moduleDocument()
+        aPartSet = self.session.moduleDocument()
+        self.doc = model.addPart(aPartSet).document()
+        model.addCylinder(self.doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+        model.addCylinder(self.doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 10, 90)
+        self.sketch = model.addSketch(self.doc, model.defaultPlane("XOY"))
 
     def tearDown(self):
+        model.end()
+        assert(model.checkPythonDump())
         self.session.closeAll()
 
-# TODO(spo): add tests.
+    def checkPoint(self, thePoint, theReference):
+        self.assertAlmostEqual(thePoint.x(), theReference.x(), 6)
+        self.assertAlmostEqual(thePoint.y(), theReference.y(), 6)
+
+    def test_circle_by_point(self):
+        """ Test 1. Create point by GeomAPI_Pnt and circle coincident by the center
+        """
+        point = geom.Pnt2d(10., 10.)
+        aPoint = self.sketch.addPoint(point)
+        aCircle = self.sketch.addCircle(point, 10.)
+        aCoincidence = self.sketch.setCoincident(aPoint.coordinates(), aCircle.center())
+        model.do()
+        self.checkPoint(aPoint.coordinates(), point)
+        self.checkPoint(aCircle.center(), point)
+
+    def test_circle_by_external(self):
+        """ Test 2. Create point and circle by external features
+        """
+        aPoint = self.sketch.addPoint("PartSet/Origin")
+        aCircle = self.sketch.addCircle("[Cylinder_1_1/Face_1][Cylinder_1_1/Face_3]")
+        model.do()
+        point = geom.Pnt2d(0., 0.)
+        self.checkPoint(aPoint.coordinates(), point)
+        self.checkPoint(aCircle.center(), point)
+
+    def test_circle_center_passed(self):
+        """ Test 3. Create circle by center and passed point
+        """
+        aCenter = geom.Pnt2d(10., 10.)
+        aPassed = geom.Pnt2d(20., 30.)
+
+        self.sketch.addCircle(aCenter.x(), aCenter.y(), aPassed.x(), aPassed.y())
+        model.do()
+        aCircle1 = SketchAPI.SketchAPI_Circle(model.lastSubFeature(self.sketch, "SketchCircle"))
+
+        self.sketch.addCircle(aCenter, aPassed)
+        model.do()
+        aCircle2 = SketchAPI.SketchAPI_Circle(model.lastSubFeature(self.sketch, "SketchCircle"))
+
+        aRadius = math.sqrt((aCenter.x()-aPassed.x())**2 + (aCenter.y()-aPassed.y())**2)
+        self.checkPoint(aCircle1.center(), aCenter)
+        self.assertAlmostEqual(aCircle1.radius().value(), aRadius, 6)
+        self.checkPoint(aCircle2.center(), aCenter)
+        self.assertAlmostEqual(aCircle2.radius().value(), aRadius, 6)
+
+    def test_circle_by_three_points(self):
+        """ Test 4. Create circle by three passed points
+        """
+        aCenter = geom.Pnt2d(10., 10.)
+        aRadius = 5.
+
+        self.sketch.addCircle(aCenter.x() - aRadius, aCenter.y(), aCenter.x() + aRadius, aCenter.y(), aCenter.x(), aCenter.y() + aRadius)
+        model.do()
+        aCircle = SketchAPI.SketchAPI_Circle(model.lastSubFeature(self.sketch, "SketchCircle"))
+
+        self.checkPoint(aCircle.center(), aCenter)
+        self.assertAlmostEqual(aCircle.radius().value(), aRadius, 6)
+
+    def test_arc_by_three_points(self):
+        """ Test 5. Create arc by three passed points
+        """
+        aCenter = geom.Pnt2d(10., 10.)
+        aRadius = 5.
+
+        aPoint1 = geom.Pnt2d(aCenter.x() - aRadius, aCenter.y())
+        aPoint2 = geom.Pnt2d(aCenter.x() + aRadius, aCenter.y())
+        aPoint3 = geom.Pnt2d(aCenter.x(), aCenter.y() + aRadius)
+
+        self.sketch.addArc(aPoint1.x(), aPoint1.y(), aPoint2.x(), aPoint2.y(), aPoint3.x(), aPoint3.y())
+        model.do()
+        anArc1 = SketchAPI.SketchAPI_Arc(model.lastSubFeature(self.sketch, "SketchArc"))
+
+        self.checkPoint(anArc1.center(), aCenter)
+        self.assertAlmostEqual(anArc1.radius().value(), aRadius, 6)
+
+        self.sketch.addArc(aPoint1, aPoint2, aPoint3)
+        model.do()
+        anArc2 = SketchAPI.SketchAPI_Arc(model.lastSubFeature(self.sketch, "SketchArc"))
+
+        self.checkPoint(anArc2.center(), aCenter)
+        self.assertAlmostEqual(anArc2.radius().value(), aRadius, 6)
+
+    def test_arc_by_tangent_point(self):
+        """ Test 6. Create arc tangent to a line
+        """
+        aTgPnt = geom.Pnt2d(10., 0.)
+        aRadius = 5.
+
+        aLine = self.sketch.addLine(0., 0., aTgPnt.x(), aTgPnt.y())
+        model.do()
+
+        aPassed = geom.Pnt2d(aTgPnt.x(), aTgPnt.y() + 2. * aRadius)
+        self.sketch.addArc(aLine.endPoint(), aPassed, False)
+        model.do()
+        anArc = SketchAPI.SketchAPI_Arc(model.lastSubFeature(self.sketch, "SketchArc"))
+
+        aCenter = geom.Pnt2d(aTgPnt.x(), aTgPnt.y() + aRadius)
+        self.checkPoint(anArc.center(), aCenter)
+        self.assertAlmostEqual(anArc.radius().value(), aRadius, 6)
+
+    def test_arc_by_external(self):
+        """ Test 7. Create arc by external feature
+        """
+        anArc = self.sketch.addArc(model.selection("EDGE", "[Cylinder_2_1/Face_1][Cylinder_2_1/Face_3]"))
+        model.do()
+        point = geom.Pnt2d(0., 0.)
+        self.checkPoint(anArc.center(), point)
+        self.assertAlmostEqual(anArc.radius().value(), 10, 6)
+
+    def test_arc_by_name(self):
+        """ Test 8. Create arc by external feature
+        """
+        anArc = self.sketch.addArc("[Cylinder_2_1/Face_1][Cylinder_2_1/Face_3]")
+        model.do()
+        point = geom.Pnt2d(0., 0.)
+        self.checkPoint(anArc.center(), point)
+        self.assertAlmostEqual(anArc.radius().value(), 10, 6)
+
+    def test_point_by_intersection(self):
+        """ Test 9. Create point as intersection with external edge given by a name
+        """
+        self.sketch.addIntersectionPoint("[Cylinder_2_1/Face_1][Cylinder_2_1/Face_4]")
+        model.do()
+        aPoint = SketchAPI.SketchAPI_Point(model.lastSubFeature(self.sketch, "SketchPoint"))
+
+        point = geom.Pnt2d(10., 0.)
+        self.checkPoint(aPoint.coordinates(), point)
+
+    def test_arc_by_projection(self):
+        """ Test 10. Create arc by projection of external feature
+        """
+        self.sketch.addProjection("[Cylinder_2_1/Face_1][Cylinder_2_1/Face_3]")
+        model.do()
+        anArc = SketchAPI.SketchAPI_Arc(model.lastSubFeature(self.sketch, "SketchArc"))
+
+        point = geom.Pnt2d(0., 0.)
+        self.checkPoint(anArc.center(), point)
+        self.assertAlmostEqual(anArc.radius().value(), 10, 6)
+
 
 if __name__ == "__main__":
     test_program = unittest.main(exit=False)
index bf4ffcb7652f21a5c91cf01f11a722b139f95558..787ce8770eb96afd14451f1f7c864d7849b6b5b4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(Common)
 INCLUDE(UnitTest)
@@ -66,6 +65,7 @@ SET(PROJECT_HEADERS
     SketchPlugin_Tools.h
     SketchPlugin_Trim.h
     SketchPlugin_Validators.h
+    SketchPlugin_SketchDrawer.h
 )
 
 SET(PROJECT_SOURCES
@@ -73,7 +73,6 @@ SET(PROJECT_SOURCES
     SketchPlugin_Circle.cpp
     SketchPlugin_Constraint.cpp
     SketchPlugin_ConstraintAngle.cpp
-    SketchPlugin_ConstraintBase.cpp
     SketchPlugin_ConstraintCoincidence.cpp
     SketchPlugin_ConstraintCollinear.cpp
     SketchPlugin_ConstraintDistance.cpp
@@ -111,6 +110,7 @@ SET(PROJECT_SOURCES
     SketchPlugin_Tools.cpp
     SketchPlugin_Trim.cpp
     SketchPlugin_Validators.cpp
+    SketchPlugin_SketchDrawer.cpp
 )
 
 SET(PROJECT_LIBRARIES
@@ -125,6 +125,7 @@ SET(PROJECT_LIBRARIES
 
 SET(XML_RESOURCES
   plugin-Sketch.xml
+  plugin-SketchDrawer.xml
 )
 
 SET(TEXT_RESOURCES
@@ -153,123 +154,139 @@ INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Sketch)
 INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
 
-ADD_UNIT_TESTS(TestSketchPointLine.py
-               TestCreateArcByCenterStartEnd.py
-               TestCreateArcByThreePoints.py
-               TestCreateArcByTangentEdge.py
-               TestCreateArcChangeType.py
-               TestCreateCircleByCenterAndPassed.py
-               TestCreateCircleByThreePoints.py
-               TestCreateCircleChangeType.py
-               TestConstraintCoincidence.py
-               TestConstraintCollinear.py
-               TestConstraintLength.py
-               TestConstraintDistance.py
-               TestConstraintDistanceHorizontal.py
-               TestConstraintDistanceVertical.py
-               TestConstraintDistanceBehavior.py
-               TestConstraintParallel.py
-               TestConstraintPerpendicular.py
-               TestConstraintRadius.py
-               TestConstraintFixed.py
-               TestConstraintHorizontal.py
-               TestConstraintHorizontalValidator.py
-               TestConstraintVertical.py
-               TestConstraintEqual.py
-               TestConstraintTangent.py
-               TestConstraintAngle.py
-               TestConstraintMiddlePoint.py
-               TestEdgesOrder.py
-               TestMirror.py
-               TestMultiTranslation.py
-               TestMultiRotation.py
-               TestMultiRotationWithParameter.py
-               TestMultiRotation01.py
-               TestMultiRotation02.py
-               TestMultiRotation03.py
-               TestMultiRotation04.py
-               TestMultiRotation05.py
-               TestFillet.py
-               TestFilletAfterFolder.py
-               TestFilletInteracting.py
-               TestRectangle.py
-               TestProjection.py
-               TestProjectionIntoResult.py
-               TestSplit.py
-               TestHighload.py
-               TestSnowflake.py
-               TestArcBehavior.py
-               TestRemoveSketch.py
-               Test1061.py
-               Test1673.py
-               Test1924.py
-               Test1966.py
-               Test1967.py
-               Test2062.py
-               Test2095.py
-               Test2115.py
-               TestTrimArc01.py
-               TestTrimArc02.py
-               TestTrimArc03.py
-               TestTrimArc04.py
-               TestTrimArc05.py
-               TestTrimArc06.py
-               TestTrimArc07.py
-               TestTrimCircle01.py
-               TestTrimCircle02.py
-               TestTrimCircle03.py
-               TestTrimCircle04.py
-               TestTrimCircle05.py
-               TestTrimCircleAndArc01.py
-               TestTrimLine01.py
-               TestTrimLine02.py
-               Test2229.py
-               Test2239.py
-               TestDistanceDump.py
-               TestDistanceSignedVsUnsigned01.py
-               TestDistanceSignedVsUnsigned02.py
-               TestDistanceSignedVsUnsigned03.py
-               TestDistanceSignedVsUnsigned04.py
-               TestDistanceSignedVsUnsigned05.py
-               TestSignedDistancePointPoint.py
-               TestSignedDistancePointLine.py
-               TestIntersectionWithLine.py
-               TestIntersectionWithCircle.py
-               TestIntersectionWithSpline.py
-               TestIntersectionChangeEdge.py
-               Test2273.py
-               Test2280.py
-               Test2287.py
-               Test2341.py
-               Test2390.py
-               Test2393.py
-               Test2425.py
-               Test2440.py
-               Test2157.py
-               Test2157_2.py
-               Test2481.py
-               Test1963.py
-               Test2034_1.py
-               Test2034_2.py
-               Test2034_3.py
-               Test2134.py
-               TestDegeneratedGeometry.py
-               Test2119.py
-               Test2224.py
-               Test2427.py
-               Test1577.py
-               Test1578.py
-               Test2654.py
-               Test1779.py
-               Test2711.py
+ADD_UNIT_TESTS(
+  Test1061.py
+  Test1577.py
+  Test1578.py
+  Test1673.py
+  Test1779.py
+  Test1924.py
+  Test1963.py
+  Test1966.py
+  Test1967.py
+  Test2034_1.py
+  Test2034_2.py
+  Test2034_3.py
+  Test2062.py
+  Test2095.py
+  Test2115.py
+  Test2119.py
+  Test2134.py
+  Test2157.py
+  Test2157_2.py
+  Test2224.py
+  Test2229.py
+  Test2239.py
+  Test2273.py
+  Test2280.py
+  Test2287.py
+  Test2341.py
+  Test2376.py
+  Test2390.py
+  Test2393.py
+  Test2425.py
+  Test2427.py
+  Test2440.py
+  Test2481.py
+  Test2654.py
+  Test2711.py
+  Test2741.py
+  Test2810.py
+  Test2824.py
+  Test2860.py
+  TestArcBehavior.py
+  TestConstraintAngle.py
+  TestConstraintCoincidence.py
+  TestConstraintCollinear.py
+  TestConstraintDistance.py
+  TestConstraintDistanceBehavior.py
+  TestConstraintDistanceHorizontal.py
+  TestConstraintDistanceVertical.py
+  TestConstraintEqual.py
+  TestConstraintFixed.py
+  TestConstraintHorizontal.py
+  TestConstraintHorizontalValidator.py
+  TestConstraintLength.py
+  TestConstraintMiddlePoint.py
+  TestConstraintParallel.py
+  TestConstraintPerpendicular.py
+  TestConstraintRadius.py
+  TestConstraintRadiusFailure.py
+  TestConstraintTangent.py
+  TestConstraintVertical.py
+  TestCreateArcByCenterStartEnd.py
+  TestCreateArcByTangentEdge.py
+  TestCreateArcByThreePoints.py
+  TestCreateArcChangeType.py
+  TestCreateCircleByCenterAndPassed.py
+  TestCreateCircleByThreePoints.py
+  TestCreateCircleChangeType.py
+  TestDegeneratedGeometry.py
+  TestDistanceDump.py
+  TestDistanceSignedVsUnsigned01.py
+  TestDistanceSignedVsUnsigned02.py
+  TestDistanceSignedVsUnsigned03.py
+  TestDistanceSignedVsUnsigned04.py
+  TestDistanceSignedVsUnsigned05.py
+  TestEdgesOrder.py
+  TestFillet.py
+  TestFilletAfterFolder.py
+  TestFilletInteracting.py
+  TestHighload.py
+  TestIntersectionChangeEdge.py
+  TestIntersectionWithCircle.py
+  TestIntersectionWithLine.py
+  TestIntersectionWithSpline.py
+  TestMirror.py
+  TestMultiRotation.py
+  TestMultiRotation01.py
+  TestMultiRotation02.py
+  TestMultiRotation03.py
+  TestMultiRotation04.py
+  TestMultiRotation05.py
+  TestMultiRotationWithParameter.py
+  TestMultiTranslation.py
+  TestPresentation.py
+  TestProjection.py
+  TestProjectionIntoResult.py
+  TestProjectionUpdate.py
+  TestRectangle.py
+  TestRemoveSketch.py
+  TestSignedDistancePointLine.py
+  TestSignedDistancePointPoint.py
+  TestSketchDrawer.py
+  TestSketchPointLine.py
+  TestSnowflake.py
+  TestSplit.py
+  TestSplitLine.py
+  TestSplitPreview.py
+  TestTrimArc01.py
+  TestTrimArc02.py
+  TestTrimArc03.py
+  TestTrimArc04.py
+  TestTrimArc05.py
+  TestTrimArc06.py
+  TestTrimArc07.py
+  TestTrimArc08.py
+  TestTrimCircle01.py
+  TestTrimCircle02.py
+  TestTrimCircle03.py
+  TestTrimCircle04.py
+  TestTrimCircle05.py
+  TestTrimCircleAndArc01.py
+  TestTrimLine01.py
+  TestTrimLine02.py
+  TestTrimLine03.py
+  TestTrimPreview.py
+  TestUpdateSketch.py
 )
 
 if(${SKETCHER_CHANGE_RADIUS_WHEN_MOVE})
   ADD_UNIT_TESTS(
-               TestMovePoint.py
-               TestMoveLine.py
-               TestMoveCircle.py
-               TestMoveArc.py
-               TestMovementComplex.py
+    TestMoveArc.py
+    TestMoveCircle.py
+    TestMoveLine.py
+    TestMovementComplex.py
+    TestMovePoint.py
   )
 endif()
index 4748546089b327717059767f479cad0402f506cf..e2eca3f7ba5bbed635ef3037fa54ac334b26348f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SKETCHPLUGIN_H
index 87469bdf9b52768ff0b263869315a1c622e47556..85fb674259d9c577b6dd5a84865f82d85a0e1e38 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Arc.h"
index b9dd9ed8fd5732615f64ea0bd45a2189842df60c..2f2f4abcd03cd9f09ad060621c61130e5703daef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Arc_H_
index 0975e57e43db79f00e2bde9e7f1bc3a8b6fda85b..bb31bf61ba35d1d60328ecd02bfb732bbe7ff63e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Circle.h"
index ea95823d87b5bc83dd45c96287f887ee588ae560..e5a5787cc1ffae7c96f755be6b43808403450f48 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Circle_H_
index 0d6d6c1ca5cd003f679677e1acb59c4caa65333c..3e9b876fca624f4499bedc5f172da4efd0af7307 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Constraint.h"
index 9dd286e3548d480ab2939598381bf2fb01a688cd..f908a19b4ffbdc133c7ff271c18c4617ba07ae47 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Constraint_H_
index 89c61105ce430d444ba5582aea0191ea31cd8c2e..d25a808429ca9c952ae3c11d816fbe5421d0528b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintAngle.h"
index d0b21dafcada12869676045748b72f2e9f414910..39caab3845a0dfeb80c92d3261bb063173e332ed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintAngle_H_
diff --git a/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp b/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp
deleted file mode 100644 (file)
index 0a49944..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-//
-// 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<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "SketchPlugin_ConstraintBase.h"
-
-AISObjectPtr SketchPlugin_ConstraintBase::getAISObject(AISObjectPtr thePrevious)
-{
-  return thePrevious;
-}
-
-const void SketchPlugin_ConstraintBase::addSub(const FeaturePtr& theFeature)
-{
-
-}
index 9c65757d6355809ed4a8a0c34fa11731b2302bc9..5ab603c13454358919d1967c31100c0a895ac527 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintBase_H_
@@ -57,15 +56,7 @@ class SketchPlugin_ConstraintBase : public SketchPlugin_Constraint, public GeomA
                                     public GeomAPI_ICustomPrs
 {
  public:
-  /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
-
-  /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch)
-   *  \param theFeature sub-feature
-   */
-  SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature);
-
-      /// Customize presentation of the feature
+  /// Customize presentation of the feature
   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
   {
index ac7b9961b9837967f4913196db8f6d4bc8d6bf55..af5595d8d306e48cd2df73971d3187c7e7932fd6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintCoincidence.h"
@@ -56,51 +55,6 @@ AISObjectPtr SketchPlugin_ConstraintCoincidence::getAISObject(AISObjectPtr thePr
   return anAIS;
 }
 
-FeaturePtr SketchPlugin_ConstraintCoincidence::findCoincidenceFeature(const FeaturePtr& theFeature1,
-                                                                      const FeaturePtr& theFeature2)
-{
-  FeaturePtr aResultFeature;
-
-  std::list<AttributePtr> anAttrList;
-  if (theFeature1->getKind() == SketchPlugin_Circle::ID() ||
-      theFeature2->getKind() == SketchPlugin_Circle::ID())
-    return aResultFeature;
-
-  if (theFeature2->getKind() == SketchPlugin_Line::ID()) {
-    anAttrList.push_back(theFeature2->attribute(SketchPlugin_Line::START_ID()));
-    anAttrList.push_back(theFeature2->attribute(SketchPlugin_Line::END_ID()));
-  } else if (theFeature2->getKind() == SketchPlugin_Arc::ID()) {
-    anAttrList.push_back(theFeature2->attribute(SketchPlugin_Arc::START_ID()));
-    anAttrList.push_back(theFeature2->attribute(SketchPlugin_Arc::END_ID()));
-  }
-
-  const std::set<AttributePtr>& aRefsList = theFeature1->data()->refsToMe();
-  std::set<AttributePtr>::const_iterator aRefIt = aRefsList.begin();
-  for (; aRefIt != aRefsList.end() && !aResultFeature.get(); ++aRefIt) {
-    FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRefIt)->owner());
-    if (aConstrFeature->getKind() != SketchPlugin_ConstraintCoincidence::ID())
-      continue;
-    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*aRefIt);
-    AttributePtr anAttr = aRefAttr->attr();
-    if (anAttr->id() == SketchPlugin_Arc::CENTER_ID())
-      continue;
-
-    anAttr = aConstrFeature->attribute(SketchPlugin_Constraint::ENTITY_A());
-    if (anAttr == *aRefIt)
-      anAttr = aConstrFeature->attribute(SketchPlugin_Constraint::ENTITY_B());
-
-    aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
-    if (!aRefAttr)
-      continue;
-    anAttr = aRefAttr->attr();
-    for (std::list<AttributePtr>::const_iterator anIt = anAttrList.begin();
-         anIt != anAttrList.end() && !aResultFeature.get(); ++anIt)
-      if (*anIt == anAttr)
-        aResultFeature = aConstrFeature;
-  }
-  return aResultFeature;
-}
-
 AttributePoint2DPtr SketchPlugin_ConstraintCoincidence::getPoint(const FeaturePtr& theFeature)
 {
   AttributePoint2DPtr aPoint = ModelGeomAlgo_Point2D::getPointOfRefAttr(theFeature.get(),
index db5f5e3ca028517e7e04b17ecad613954d85754e..46755761d3258c30444c5ce76f480ebfa221bfb4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintCoincidence_H_
@@ -60,12 +59,6 @@ class SketchPlugin_ConstraintCoincidence : public SketchPlugin_ConstraintBase
   /// \brief Request for initialization of data model of the feature: adding all attributes
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
-  /// Returns coincident feature if there is a coincidence built on the given features
-  /// \param theFeature1 the first feature
-  /// \param theFeature2 the second feature
-  static FeaturePtr findCoincidenceFeature(const FeaturePtr& theFeature1,
-                                           const FeaturePtr& theFeature2);
-
   /// Creates a constraint on two points
   /// \param theSketch a sketch feature
   /// \param thePoint1 the first point
index c1742919fe8ecba76ed83e23b2b676563b3c2158..29f83f7e636ee0cb65c2c71454a3796e88251cd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintCollinear.h"
index aa433de566cbc2d01ead00fd10d67d9e45d4d280..c02e8a0d5643beadf2492b0cffb1af0260ba4dce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintCollinear_H_
index e75dcde94be98107862445248b2f20f5319ab821..04dca6ac8d2aecd87971225e76d48003173c908d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintDistance.h"
index c3f5118c4a24f1b755557c43d16aa0578e61536d..082fb84a897927910399878373ec109bfec7a2f5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintDistance_H_
index b0763b5564c7c1bb7732398575c7dcdc0bd4b8df..35def2323d07fd1537ad83e7cd2a2c3a183ed7fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceAlongDir.cpp
index bd38dad7bfce6e6302c8b9941a3077fe6a270025..ced1ae673b49393b754823c952c6cbb88df5b867 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceAlongDir.h
index ae3a5e0a56d14da1fa3d762c42653fe8f5b4ae71..911cd564b1940430a7852889b7cf08459c55e9de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceHorizontal.cpp
index 689cf57d329946989954c550543ea6eb7f7168be..b8b61b8bd39caa43da2cc5f51bfcfd0c20259ac5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceHorizontal.h
index d0dae6161abeed62beb81cd4b83e5434a65e422e..36146c5a5af7df343c33830c260bac48d08966c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceVertical.cpp
index a9d7284b95c409e29c3883a5f217c5bd67ae9368..9acda77fdcb7abdc25120568ac2834b4bdcfb987 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchPlugin_ConstraintDistanceVertical.h
index f03f7dab1bb0935a085e368a1723b281270ba335..cfd1fd03f4a677df1e1863719fb9d8bdf7e935d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintEqual.h"
index 1094c6aebd4e899404b0966de4e38d750ec3b158..4e5b6fcdf39fde8d201b257aeb248c894af7e11b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintEqual_H_
index 545102700e937eb69f3d359d65d6fcfb1604221b..d3783d6147d29bfc004f549c04e3f55f51a4cdfe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintHorizontal.h"
index 040b095b0f48d53cb728e92bb70e58d34857a5f9..d3a2556f2cf0aa5ce39c78d6909e3752ba41f2ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintHorizontal_H_
index f4dc4a4ffd8eac689f79181bf7274393089d8d4e..289548b341e534f665ed039c74d21e28b85250b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintLength.h"
index 13666de04bf6efd46050783c41435192782e5373..4f86939a1abfad6aaea3c6c7261ba75716495e16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintLength_H_
index c7a8982cacde3cf8db3d2377548e619ae5caee20..c2a8995431527d03761c2c2f505949102fe5ecda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintMiddle.h"
index 99b6b6a95f30308e193845f205d1acfd07adf821..ee3138ae4006320cf25b670e1e985586520fd0d8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintMiddle_H_
old mode 100755 (executable)
new mode 100644 (file)
index 310a3f4..027be0e
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintMirror.h"
index bab18c94d2c7068c370fb6e37c5e042235841bca..5af1ce9e403778e1e784b5714ab78469a9cc8a8b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintMirror_H_
index 4af4bf8653bcaf26321090164866fcd2d2d2a512..005750cad0c8e7887cb2e8eda2b88b2eecc3eafc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintParallel.h"
index 1394e046223eeec83d3f0c243afc32b5b6767209..0369fc89f528e6139cf2804d3f0e90d37064cc69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintParallel_H_
index c922096b031ad593ac46e260266a8aedffc70d04..63389702c347ab4715cfa37fcd40162b5347eee0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintPerpendicular.h"
index 2b1f5f1347bb7ba03cee25b1fd2b1c54e544a6ed..e0ae4467a179744c14c4364f1307210674730e66 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintPerpendicular_H_
index 08b8b9be730c6e558b14537f6c8aba292ebeeca3..c2f363b731b7a36139765491aaf71cf368eaec76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintRadius.h"
index 8b52f35939b90b0f71de69f16aa03655ce0aa3fa..dac930faa2943e60a14f9dd39f6eaf2397c80185 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintRadius_H_
index 36c329e4a969f19aa58d2198cb6dab7104369720..e26ecbd72e611cbafd492ef9eb1b3bde05d207ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintRigid.h"
index a16da68cf37b8b7f01ffde94cc9c1f72eae4db06..6ffb3094de102ba49c4a373fbde62635b747514b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintRigid_H_
index 4a41cac55a0011b4291a1089755f57817b0a7747..dff2c7b0130d7b73c4036afee12d2d1a4f560d88 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintTangent.h"
index 0212d9403ee457346d9fed76253959feb01c2df4..87b23c0e0576ca25cbbc3211775ab2af268b7d81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintTangent_H_
index db4be31c01d8115a04a04aa397a3f58485d54ae0..7346e68d5ae8660dbf5588f1e756ce023901cbfd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ConstraintVertical.h"
index 61ee3ab7e536f84ea1f6a320906ef46817f3e3ec..d53a705872fc7a96807826963d656d256dc75bf0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ConstraintVertical_H_
index b7ec05716d689323d5ee41d0857b5b630cddb939..df323b1674c425972a5fd4967c57130812f71fd3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        SketchPlugin_Ellipse.cpp
index fe0873f083b76f27feb5e417bf83769926c286b4..e8c0252bdc623132a9a77246e12431636b670a7f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        SketchPlugin_Ellipse.h
index 7eb8b71e8d77e1e044f209085592d331189e22db..e054133dc118e34384880d02c13a52f4671f1f10 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_ExternalValidator.h"
index 85f054e575a1b8f8cc1b412918d1d98cd94a3291..ece98d0151b65a69448b9e65833dbe8e2069b90b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_ExternalValidator_H
index f67eeeae484a45d1b47cbcd4fabc49cf2795bc2b..6ad032f18babeb82f14283b8243686072265027f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Feature.h"
index a9823830700559907394b85759940a911e842a53..c5403b5c9a3d5cc05b3518b8a70675c0799d0691 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Feature_H_
@@ -65,9 +64,6 @@ class SketchPlugin_Feature : public ModelAPI_Feature
     return true;
   }
 
-  /// Construction result is allways recomuted on the fly
-  SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
-
   /// Returns true is sketch element is under the rigid constraint
   SKETCHPLUGIN_EXPORT virtual bool isFixed() {return false;}
 
index 3373df8c6df0504ea4a39d8531c6cb8e5c534a10..e076f47c2454d2b1ba6081c6dc91f7fb6e9b8f43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Fillet.h"
@@ -82,8 +81,9 @@ static std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
                                                  const AttributePtr theAttribute);
 
 SketchPlugin_Fillet::SketchPlugin_Fillet()
-: myFilletCreated(false)
+: myFilletCreated(false), myIsReversed(false)
 {
+  myIsNotInversed[0] = myIsNotInversed[1] = true;
 }
 
 void SketchPlugin_Fillet::initAttributes()
@@ -104,6 +104,10 @@ void SketchPlugin_Fillet::execute()
 
   // create feature for fillet arc
   FeaturePtr aFilletArc = createFilletArc();
+  if (!aFilletArc) {
+    setError("Error: unable to create a fillet arc.");
+    return;
+  }
 
   // collect features referred to the edges participating in fillet
   AttributePoint2DPtr aFilletPoints[2];
@@ -308,6 +312,10 @@ FeaturePtr SketchPlugin_Fillet::createFilletArc()
   if (!myBaseFeatures[0] || !myBaseFeatures[1])
     calculateFilletParameters();
 
+  // fix for issue #2810 (sometimes, myCenterXY is NULL, fillet should report an error)
+  if (!myCenterXY)
+    return FeaturePtr();
+
   // Create arc feature.
   FeaturePtr aFilletArc = sketch()->addFeature(SketchPlugin_Arc::ID());
 
index 14ea9f8d61e75f790cee965ff6fe906721882286..f000ff0e3686864350788507152b06e92e226e15 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Fillet_H_
index be389af74185cdfc8f8d62f926cb8697f3a82a0c..5563a6bd5cc5d0b483b31b6571c0132cb06713b2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_IntersectionPoint.h"
index 2ddebd6b1fa044eeccae4a100f35727b5b5eacac..f4df8d1de3e2f23c813974654e28c692c4e2ce2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_IntersectionPoint_H_
index 23cbe266674cfd4cc376d113f1d9807341e8a32b..f68bf346b45bf124b9c24b11e00a60a9c26a675d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Line.h"
@@ -92,6 +91,7 @@ void SketchPlugin_Line::execute()
   }
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_Line::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   std::string aFilledAttributeName;
@@ -113,6 +113,7 @@ std::string SketchPlugin_Line::processEvent(const std::shared_ptr<Events_Message
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 double SketchPlugin_Line::distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
 {
index d51c6608f79225a3944b8d74e107f113627a32b7..7a23944ae6260d0ab8714a83579e07ea033e931a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Line_H_
@@ -77,7 +76,7 @@ class SketchPlugin_Line : public SketchPlugin_SketchEntity,
   SKETCHPLUGIN_EXPORT virtual void execute();
 
   /// Apply information of the message to current object. It fills start attribute of
-  /// the currrent feature by last attribute of the message feature, build coincidence
+  /// the current feature by last attribute of the message feature, build coincidence
   /// if message has selected object
   virtual std::string processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
@@ -92,7 +91,7 @@ class SketchPlugin_Line : public SketchPlugin_SketchEntity,
   SketchPlugin_Line();
 
 private:
-  /// Calculates the lenght of the line and fill the lenght attribute with the value
+  /// Calculates the length of the line and fill the length attribute with the value
   void updateLenghtValue();
 
 protected:
index b6a09bde6af0dcd820b36d2ff88b344ef7856607..3e6327e08ef04fc5a9bc844f1018048a0014266d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_MacroArc.h"
@@ -373,6 +372,7 @@ void SketchPlugin_MacroArc::execute()
   Events_Loop::loop()->send(aMessage);
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   std::string aFilledAttributeName;
@@ -450,6 +450,7 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Mes
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 FeaturePtr SketchPlugin_MacroArc::createArcFeature()
 {
@@ -491,6 +492,9 @@ void SketchPlugin_MacroArc::fillByCenterAndTwoPassed()
     return;
 
   GeomAPI_Circ2d aCircleForArc(myCenter, myStart);
+  // avoid degerated arc, when the center and the start points are equal
+  if (!aCircleForArc.implPtr<void*>())
+    return;
 
   bool aWasBlocked = data()->blockSendAttributeUpdated(true);
   // check the end point is referred to another feature
index 20b42c4629c0cf01ae8dbcbd7bf2fba0aa1b23e9..815cd7002fce88c7d4f6f47a28a48734396b6983 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_MacroArc_H_
index 6699fedf13c34491c3e4e7dcc50b6e1dce5ed274..188832e471f76989e78ebfb93b594d0b70d91413 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_MacroArcReentrantMessage_H_
index 3b8049b5777f16462b2aff6f7c81c063a8ff8ae9..0bcabf4ff4731a90b7d26c7f2f34fffe07ca4cc9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_MacroCircle.h"
@@ -119,6 +118,7 @@ void SketchPlugin_MacroCircle::execute()
   Events_Loop::loop()->send(aMessage);
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_MacroCircle::processEvent(
                                               const std::shared_ptr<Events_Message>& theMessage)
 {
@@ -180,6 +180,7 @@ std::string SketchPlugin_MacroCircle::processEvent(
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 void SketchPlugin_MacroCircle::constraintsForCircleByCenterAndPassed(FeaturePtr theCircleFeature)
 {
index 621439c445fd7a2904945bdf613fe80dabd87b12..1f0f88c772e8e6d787aa21211088088d1582617a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_MacroCircle_H_
index ac07fa6642958c047b6e7aad68cb6ec398cbee85..5bc378e9a05ad01eaaf240eb5ce292bda2adfe3a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        SketchPlugin_MacroEllipse.cpp
index 0af9ee7bd06d3d62802c513eaf8fd97bfbd7195e..8d374df5c8dbc59c5f057052fac8b2a194ccfc8e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        SketchPlugin_MacroEllipse.h
old mode 100755 (executable)
new mode 100644 (file)
index 0b798f3..12ded25
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_MultiRotation.h"
index 8e8f2b89cda187761059554349541baa2779a58c..84ec0c9a70b3f648d4e74a5e343d19b899f71714 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_MultiRotation_H_
old mode 100755 (executable)
new mode 100644 (file)
index cd5b731..e14f5f0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_MultiTranslation.h"
index ea5d48197c8f5f333d9016ff21b4a647729e927a..a9af6f8fee4d24c16e55d96ffa581d4add374efd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_MultiTranslation_H_
index 6a47d8539057fdbf43ae8913aaddeb4671550b55..c9a10a82b2801a132a3c2d12c82d2f3ed35d855c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchPlugin_Plugin.h>
@@ -54,6 +53,7 @@
 #include <SketchPlugin_ExternalValidator.h>
 #include <SketchPlugin_Ellipse.h>
 #include <SketchPlugin_MacroEllipse.h>
+#include <SketchPlugin_SketchDrawer.h>
 
 #include <SketcherPrs_Tools.h>
 
@@ -244,11 +244,14 @@ FeaturePtr SketchPlugin_Plugin::createFeature(std::string theFeatureID)
     return FeaturePtr(new SketchPlugin_Ellipse);
   } else if (theFeatureID == SketchPlugin_MacroEllipse::ID()) {
     return FeaturePtr(new SketchPlugin_MacroEllipse);
+  } else if (theFeatureID == SketchPlugin_SketchDrawer::ID()) {
+    return FeaturePtr(new SketchPlugin_SketchDrawer);
   }
   // feature of such kind is not found
   return FeaturePtr();
 }
 
+// LCOV_EXCL_START
 void SketchPlugin_Plugin::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   const Events_ID kRequestEvent =
@@ -318,3 +321,4 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> SketchPlugin_Plugin
   }
   return aMsg;
 }
+// LCOV_EXCL_STOP
index b4a17a408bdc41202233b4cbc01ee039d2350681..e5d0cc740b2442e20bb39265d3679f77e36380aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SKETCHPLUGIN_PLUGIN_H_
index 252ecf18118b57f82eda9f600e73a45ba5b1639c..c53006489726c728a5ac5c6877c996b4b90cc6dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Point.h"
@@ -67,7 +66,7 @@ bool SketchPlugin_Point::isFixed() {
 }
 
 void SketchPlugin_Point::attributeChanged(const std::string& theID) {
-  // the second condition for unability to move external point anywhere
+  // the second condition for inability to move external point anywhere
   if (theID == EXTERNAL_ID() || isFixed()) {
     std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
     if (!aSelection) {
index ae23556e3cc846c29f74b342b090f691a365983b..1cdcae05f39ddb505170bedc42e94cb4fe169a23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Point_H_
index 91b45643c5b46e6cf5848b9f9d4fc059d6b5a264..0d40b618130d79109470f4f7ad9ef8d9f099180f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchPlugin_Projection.h>
index 26b4b960e0a91bbbf82098b5bfe8752ccf92bbce..b928dfabdd5c577428685e3805da92641c5e0b56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Projection_H_
old mode 100755 (executable)
new mode 100644 (file)
index d23ad07..852213b
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Config_PropManager.h>
@@ -25,6 +24,7 @@
 
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_PlanarEdges.h>
+#include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_Vertex.h>
 
 #include <GeomDataAPI_Point2D.h>
@@ -255,38 +255,46 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
       std::shared_ptr<GeomAPI_Shape> aSelection = aSelAttr->value();
       if (!aSelection.get()) aSelection = aSelAttr->context()->shape();
       // update the sketch plane
-      std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aSelection));
-      std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
-      if (aPlane) {
-        double anA, aB, aC, aD;
-        aPlane->coefficients(anA, aB, aC, aD);
-
-        // calculate attributes of the sketch
-        std::shared_ptr<GeomAPI_Dir> aNormDir(new GeomAPI_Dir(anA, aB, aC));
-        std::shared_ptr<GeomAPI_XYZ> aCoords = aNormDir->xyz();
-        std::shared_ptr<GeomAPI_XYZ> aZero(new GeomAPI_XYZ(0, 0, 0));
-        aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero));
-        std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
-        // X axis is preferable to be dirX on the sketch
-        // here can not be very small value to avoid very close to X normal axis (issue 595)
-        static const double tol = 0.1;
-        bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol;
-        std::shared_ptr<GeomAPI_Dir> aTempDir(
-          isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
-        std::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
-        std::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
-
-        // update position of the sketch
-        std::shared_ptr<GeomDataAPI_Point> anOrigin = std::dynamic_pointer_cast
-          <GeomDataAPI_Point>(data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
-        anOrigin->setValue(anOrigPnt);
-        std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-          data()->attribute(SketchPlugin_Sketch::NORM_ID()));
-        aNormal->setValue(aNormDir);
-        std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
-          data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
-        aDirX->setValue(aXDir);
-        std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
+      std::shared_ptr<GeomAPI_Face> aFace;
+      if (aSelection->isFace()) {
+        aFace = aSelection->face();
+      } else if (aSelection->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aSelection);
+        aFace = anIt.current()->face();
+      }
+      if (aFace.get()) {
+        std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
+        if (aPlane.get()) {
+          double anA, aB, aC, aD;
+          aPlane->coefficients(anA, aB, aC, aD);
+
+          // calculate attributes of the sketch
+          std::shared_ptr<GeomAPI_Dir> aNormDir(new GeomAPI_Dir(anA, aB, aC));
+          std::shared_ptr<GeomAPI_XYZ> aCoords = aNormDir->xyz();
+          std::shared_ptr<GeomAPI_XYZ> aZero(new GeomAPI_XYZ(0, 0, 0));
+          aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero));
+          std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
+          // X axis is preferable to be dirX on the sketch
+          // here can not be very small value to avoid very close to X normal axis (issue 595)
+          static const double tol = 0.1;
+          bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol;
+          std::shared_ptr<GeomAPI_Dir> aTempDir(
+            isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
+          std::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
+          std::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
+
+          // update position of the sketch
+          std::shared_ptr<GeomDataAPI_Point> anOrigin = std::dynamic_pointer_cast
+            <GeomDataAPI_Point>(data()->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
+          anOrigin->setValue(anOrigPnt);
+          std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+            data()->attribute(SketchPlugin_Sketch::NORM_ID()));
+          aNormal->setValue(aNormDir);
+          std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+            data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
+          aDirX->setValue(aXDir);
+          std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
+        }
       }
     }
   } else if (theID == NORM_ID() || theID == DIRX_ID() || theID == ORIGIN_ID()) {
@@ -361,9 +369,3 @@ std::shared_ptr<GeomAPI_Ax3> SketchPlugin_Sketch::plane(SketchPlugin_Sketch* the
 
   return std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(anOrigin->pnt(), aDirX->dir(), aNorm->dir()));
 }
-
-void SketchPlugin_Sketch::exchangeIDs(
-  std::shared_ptr<ModelAPI_Feature> theFeature1, std::shared_ptr<ModelAPI_Feature> theFeature2)
-{
-  reflist(SketchPlugin_Sketch::FEATURES_ID())->exchange(theFeature1, theFeature2);
-}
index 3e7328e77cc15623cdfb930d5964e25228331bf6..b38b69b90f8d88b165dc83354eba42ba0e16d0bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Sketch_H_
@@ -204,16 +203,8 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICu
   /// Returns true if feature or reuslt belong to this composite feature as subs
   SKETCHPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const;
 
-  /// Construction result is allways recomuted on the fly
-  SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
-
   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
 
-  /// Exchanges IDs of two given features: needed for fillet feature better naming (issue 769)
-  SKETCHPLUGIN_EXPORT virtual void exchangeIDs(std::shared_ptr<ModelAPI_Feature> theFeature1,
-    std::shared_ptr<ModelAPI_Feature> theFeature2);
-
-
   /// \brief Create a result for the point in the attribute if the attribute is initialized
   /// \param theFeature a source feature
   /// \param theSketch a sketch intance
diff --git a/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp b/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp
new file mode 100644 (file)
index 0000000..0a54e61
--- /dev/null
@@ -0,0 +1,216 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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 "SketchPlugin_SketchDrawer.h"
+
+#include "SketchPlugin_Arc.h"
+#include "SketchPlugin_Line.h"
+#include "SketchPlugin_Circle.h"
+#include "SketchPlugin_Point.h"
+#include "SketchPlugin_Sketch.h"
+#include "SketchPlugin_ConstraintDistance.h"
+#include "SketchPlugin_ConstraintCoincidence.h"
+#include "SketchPlugin_ConstraintLength.h"
+#include "SketchPlugin_ConstraintRadius.h"
+#include "SketchPlugin_ConstraintVertical.h"
+#include "SketchPlugin_ConstraintHorizontal.h"
+#include "SketchPlugin_ConstraintDistanceVertical.h"
+#include "SketchPlugin_ConstraintDistanceHorizontal.h"
+#include "SketchPlugin_Tools.h"
+
+#include <GeomAPI_Face.h>
+#include <GeomAPI_Edge.h>
+#include <GeomAPI_Circ.h>
+#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_DataMapOfShapeShape.h>
+
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_ResultConstruction.h>
+
+#include <cmath>
+
+static const double kTOL = 1.e-6;
+
+SketchPlugin_SketchDrawer::SketchPlugin_SketchDrawer() : ModelAPI_Feature()
+{}
+
+void SketchPlugin_SketchDrawer::initAttributes()
+{
+  data()->addAttribute(BASE_ID(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(PLANE_ID(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(ADD_DIMENSIONS_ID(), ModelAPI_AttributeBoolean::typeId());
+}
+
+// sets a point attribute of the feature by 3D point on the sketch
+static void setPoint(FeaturePtr theFeature, const std::string& theAttrID,
+  std::shared_ptr<SketchPlugin_Sketch> theSketch, GeomPointPtr thePoint,
+  std::list<std::pair<GeomPnt2dPtr, std::string> >& aPoints)
+{
+  GeomPnt2dPtr aPnt2D = theSketch->to2D(thePoint);
+  std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    theFeature->attribute(theAttrID))->setValue(aPnt2D);
+  aPoints.push_back(std::pair<GeomPnt2dPtr, std::string>(aPnt2D, theAttrID));
+}
+
+void SketchPlugin_SketchDrawer::execute()
+{
+  GeomShapePtr aBase = selection(BASE_ID())->value();
+  if (!aBase.get() && selection(BASE_ID())->context().get())
+    aBase = selection(BASE_ID())->context()->shape();
+  if (!aBase.get()) {
+    setError("Error: a base shape can not be obtained");
+    return; // invalid case
+  }
+
+  ObjectPtr aPlaneContext = selection(PLANE_ID())->contextObject();
+  GeomShapePtr aPlaneShape = selection(PLANE_ID())->value();
+  if (!aPlaneShape.get() && aPlaneContext.get())
+    aPlaneShape = selection(PLANE_ID())->context()->shape();
+  if (!aPlaneShape.get() || aPlaneShape->shapeType() != GeomAPI_Shape::FACE) {
+    setError("Error: a sketch plane can not be obtained");
+    return; // invalid case
+  }
+  GeomFacePtr aPlaneFace(new GeomAPI_Face(aPlaneShape));
+  GeomPlanePtr aPlane = aPlaneFace->getPlane();
+
+  // create and initialize sketch
+  DocumentPtr aMyDoc = document();
+  std::shared_ptr<SketchPlugin_Sketch> aSketch =
+    std::dynamic_pointer_cast<SketchPlugin_Sketch>(aMyDoc->addFeature(SketchPlugin_Sketch::ID()));
+  // by selection of plane
+  aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->
+    setValue(selection(PLANE_ID())->context(), aPlaneShape);
+  // remove reference, but keep the sketch position
+  aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->
+    setValue(ResultPtr(), GeomShapePtr());
+
+  bool addDimensions = boolean(ADD_DIMENSIONS_ID())->value();
+  // iterate all edges of the base to find all edges that belong to this plane
+  GeomAPI_DataMapOfShapeShape alreadyProcessed;
+  std::list<AttributePoint2DPtr> aCreatedPoints;// points to check and set coincidence
+  for(GeomAPI_ShapeExplorer anEdges(aBase, GeomAPI_Shape::EDGE); anEdges.more(); anEdges.next()) {
+    if (!alreadyProcessed.bind(anEdges.current(), anEdges.current()))
+      continue; // skip duplicated edges
+    GeomEdgePtr anEdge(new GeomAPI_Edge(anEdges.current()));
+    if (anEdge->isDegenerated())
+      continue; // skip degenerated edges
+    GeomPointPtr aStart = anEdge->firstPoint();
+    GeomPointPtr anEnd = anEdge->lastPoint();
+    if (aPlane->distance(aStart) >= kTOL || aPlane->distance(anEnd) >= kTOL)
+      continue; // skip edges not in plane
+
+    FeaturePtr anItem;
+    std::list<std::pair<GeomPnt2dPtr, std::string> > aPoints; // created point to attribute ID
+    if (anEdge->isLine()) { // line is already in the plane: create by two points
+      anItem = aSketch->addFeature(SketchPlugin_Line::ID());
+      setPoint(anItem, SketchPlugin_Line::START_ID(), aSketch, aStart, aPoints);
+      setPoint(anItem, SketchPlugin_Line::END_ID(), aSketch, anEnd, aPoints);
+      anItem->execute(); // for constraints setting on result
+      // add a vertical or horizontal constraints
+      bool isHorVertConstr = true;
+      if (fabs(aPoints.front().first->x() - aPoints.back().first->x()) < kTOL) {
+        FeaturePtr aVert = aSketch->addFeature(SketchPlugin_ConstraintVertical::ID());
+        aVert->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject(anItem->firstResult());
+      } else if (fabs(aPoints.front().first->y() - aPoints.back().first->y()) < kTOL) {
+        FeaturePtr aHor = aSketch->addFeature(SketchPlugin_ConstraintHorizontal::ID());
+        aHor->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject(anItem->firstResult());
+      } else {
+        isHorVertConstr = false;
+      }
+      if (addDimensions) {
+        if (isHorVertConstr) { // only length constraint is enough
+          FeaturePtr aLen = aSketch->addFeature(SketchPlugin_ConstraintLength::ID());
+          aLen->refattr(SketchPlugin_ConstraintLength::ENTITY_A())
+            ->setObject(anItem->firstResult());
+          aLen->real(SketchPlugin_ConstraintLength::VALUE())->setValue(anEdge->length());
+        } else { // set horizontal and vertical distance constraints
+          FeaturePtr aVDist = aSketch->addFeature(SketchPlugin_ConstraintDistanceVertical::ID());
+          aVDist->refattr(SketchPlugin_Constraint::ENTITY_A())
+            ->setAttr(anItem->attribute(SketchPlugin_Line::START_ID()));
+          aVDist->refattr(SketchPlugin_Constraint::ENTITY_B())
+            ->setAttr(anItem->attribute(SketchPlugin_Line::END_ID()));
+          aVDist->real(SketchPlugin_ConstraintDistanceVertical::VALUE())
+            ->setValue(aPoints.back().first->y() - aPoints.front().first->y());
+          FeaturePtr aHDist = aSketch->addFeature(SketchPlugin_ConstraintDistanceHorizontal::ID());
+          aHDist->refattr(SketchPlugin_Constraint::ENTITY_A())
+            ->setAttr(anItem->attribute(SketchPlugin_Line::START_ID()));
+          aHDist->refattr(SketchPlugin_Constraint::ENTITY_B())
+            ->setAttr(anItem->attribute(SketchPlugin_Line::END_ID()));
+          aHDist->real(SketchPlugin_ConstraintDistanceVertical::VALUE())
+            ->setValue(aPoints.back().first->x() - aPoints.front().first->x());
+        }
+      }
+    } else if (anEdge->isArc()) { // check also center
+      GeomPointPtr aCenter = anEdge->circle()->center();
+      if (aPlane->distance(aCenter) >= kTOL)
+        continue;
+      // create arc by 3 points
+      anItem = aSketch->addFeature(SketchPlugin_Arc::ID());
+      setPoint(anItem, SketchPlugin_Arc::CENTER_ID(), aSketch, aCenter, aPoints);
+      setPoint(anItem, SketchPlugin_Arc::START_ID(), aSketch, aStart, aPoints);
+      setPoint(anItem, SketchPlugin_Arc::END_ID(), aSketch, anEnd, aPoints);
+      anItem->execute(); // for constraints setting on result
+      // set radius constraint
+      if (addDimensions) {
+        FeaturePtr aRad = aSketch->addFeature(SketchPlugin_ConstraintRadius::ID());
+        aRad->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject(anItem->lastResult());
+      }
+    } else if (anEdge->isCircle()) { // check also center and middle (at value 2.)
+      GeomPointPtr aCenter = anEdge->circle()->center();
+      if (aPlane->distance(aCenter) >= kTOL || aPlane->distance(anEdge->middlePoint()) >= kTOL)
+        continue;
+      // circle by center and radius
+      anItem = aSketch->addFeature(SketchPlugin_Circle::ID());
+      setPoint(anItem, SketchPlugin_Circle::CENTER_ID(), aSketch, aCenter, aPoints);
+      anItem->real(SketchPlugin_Circle::RADIUS_ID())->setValue(anEdge->circle()->radius());
+      anItem->execute(); // for constraints setting on result
+      // set radius constraint
+      if (addDimensions) {
+        FeaturePtr aRad = aSketch->addFeature(SketchPlugin_ConstraintRadius::ID());
+        aRad->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject(anItem->lastResult());
+      }
+    } else {
+      continue; // other types of edges are not supported, only lines, circles and arcs
+    }
+    // check some resulting points are coincident to existing
+    std::list<std::pair<GeomPnt2dPtr, std::string> >::iterator aPIter = aPoints.begin();
+    for(; aPIter != aPoints.end(); aPIter++) {
+      AttributePoint2DPtr aPointAttr =
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anItem->attribute(aPIter->second));
+      std::list<AttributePoint2DPtr>::iterator aCoincIter = aCreatedPoints.begin();
+      for(; aCoincIter != aCreatedPoints.end(); aCoincIter++) {
+        double aDX = (*aCoincIter)->x() - aPIter->first->x();
+        if (fabs(aDX) >= kTOL)
+          continue;
+        double aDY = (*aCoincIter)->y() - aPIter->first->y();
+        if (fabs(aDY) >= kTOL)
+          continue;
+        // create a coincidence constraint
+        FeaturePtr aCoinc = aSketch->addFeature(SketchPlugin_ConstraintCoincidence::ID());
+        aCoinc->refattr(SketchPlugin_Constraint::ENTITY_A())->setAttr(aPointAttr);
+        aCoinc->refattr(SketchPlugin_Constraint::ENTITY_B())->setAttr(*aCoincIter);
+        break; // only one coincidence per point
+      }
+      aCreatedPoints.push_back(aPointAttr);
+    }
+  }
+  aMyDoc->setCurrentFeature(aSketch, false);
+}
diff --git a/src/SketchPlugin/SketchPlugin_SketchDrawer.h b/src/SketchPlugin/SketchPlugin_SketchDrawer.h
new file mode 100644 (file)
index 0000000..f124b2e
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#ifndef SketchPlugin_SketchDrawer_H_
+#define SketchPlugin_SketchDrawer_H_
+
+#include "SketchPlugin.h"
+#include <ModelAPI_Feature.h>
+
+/// \class SketchPlugin_SketchDrawer
+/// \ingroup Plugins
+/// \brief Feature for creation of a sketch on selected base object and plane. It tries
+///  to make sketch elements equal to edges and vertices of the objects that belong to
+///  the selected plane.
+class SketchPlugin_SketchDrawer: public ModelAPI_Feature
+{
+ public:
+  /// A constructor
+  SketchPlugin_SketchDrawer();
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_FEATURE_ID("SketchDrawer");
+    return MY_FEATURE_ID;
+  }
+
+  /// Attribute name of the base shape selected.
+  inline static const std::string& BASE_ID()
+  {
+    static const std::string ID("base_shape");
+    return ID;
+  }
+  /// Attribute name of the plane selected.
+  inline static const std::string& PLANE_ID()
+  {
+    static const std::string ID("plane");
+    return ID;
+  }
+  /// Attribute name of the add-dimensions flag.
+  inline static const std::string& ADD_DIMENSIONS_ID()
+  {
+    static const std::string ID("add_dimensions");
+    return ID;
+  }
+
+  /// \return the kind of a feature.
+  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = SketchPlugin_SketchDrawer::ID();
+    return MY_KIND;
+  }
+
+  /// Creates a new sketch.
+  SKETCHPLUGIN_EXPORT virtual void execute();
+
+  /// Request for initialization of data model of the feature: adding all attributes.
+  SKETCHPLUGIN_EXPORT virtual void initAttributes();
+
+  /// Reimplemented from ModelAPI_Feature::isMacro(). Means that feature is removed on apply.
+  /// \returns true
+  SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;}
+
+  /// No preview is generated until it is applied.
+  SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;}
+};
+
+#endif
index cb532d2bfbef4a255aa5a186c1047d86f8671720..86dcae365f978a8bb2cdd490cb21da6a4eceec9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_SketchEntity.h"
index baa37b9d8f5ba1ba3ca64aea7924c8e670e10b07..c207dd72b264b3f279483e3fa17021978e59a006 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_SketchEntity_H_
@@ -112,6 +111,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
     return false;
   }
 
+// LCOV_EXCL_START
   /// Customize presentation of the feature
   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
@@ -192,6 +192,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
     }
     return isCustomized;
   }
+// LCOV_EXCL_STOP
 
 protected:
   /// initializes mySketch
index d9e0cc2527b5b0814f4d5ab6cc42468d4ebade37..720da74a6f318af71193fc89b3e690462e5679b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Split.h"
@@ -421,6 +420,7 @@ void SketchPlugin_Split::execute()
 #endif
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_Split::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
 #ifdef DEBUG_SPLIT
@@ -484,6 +484,7 @@ std::string SketchPlugin_Split::processEvent(const std::shared_ptr<Events_Messag
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 AISObjectPtr SketchPlugin_Split::getAISObject(AISObjectPtr thePrevious)
 {
@@ -619,7 +620,8 @@ void SketchPlugin_Split::fillObjectShapes(const ObjectPtr& theObject,
     ModelGeomAlgo_Point2D::getPointsInsideShape_p(aFeatureShape, aRefAttributes, aC->pnt(),
                                                 aX->dir(), aY, aPoints, aPointToAttributes);
 
-    GeomAlgoAPI_ShapeTools::splitShape_p(aFeatureShape, aPoints, aShapes);
+    if (!aPoints.empty())
+      GeomAlgoAPI_ShapeTools::splitShape_p(aFeatureShape, aPoints, aShapes);
   }
   myCashedShapes[theObject] = aShapes;
   myCashedReferences[theObject] = aPointToAttributes;
@@ -713,23 +715,6 @@ GeomShapePtr SketchPlugin_Split::getSubShape(const std::string& theObjectAttribu
   return aBaseShape;
 }
 
-std::shared_ptr<GeomDataAPI_Point2D> SketchPlugin_Split::getPointOfRefAttr(
-                                                      const AttributePtr& theAttribute)
-{
-  AttributePoint2DPtr aPointAttribute;
-
-  if (theAttribute->attributeType() == ModelAPI_AttributeRefAttr::typeId()) {
-    AttributeRefAttrPtr aRefAttr =
-      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-    if (aRefAttr.get() && aRefAttr->isInitialized()) {
-      AttributePtr anAttribute = aRefAttr->attr();
-      if (anAttribute.get() && anAttribute->attributeType() == GeomDataAPI_Point2D::typeId())
-        aPointAttribute = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttribute);
-    }
-  }
-  return aPointAttribute;
-}
-
 void SketchPlugin_Split::getFeaturePoints(const FeaturePtr& theFeature,
                                                     AttributePoint2DPtr& theStartPointAttr,
                                                     AttributePoint2DPtr& theEndPointAttr)
@@ -1566,6 +1551,7 @@ std::shared_ptr<ModelAPI_Result> SketchPlugin_Split::getFeatureResult(
   return aResult;
 }
 
+#ifdef _DEBUG
 std::set<std::shared_ptr<ModelAPI_Attribute> > SketchPlugin_Split::getEdgeAttributes(
                                            const std::shared_ptr<ModelAPI_Feature>& theFeature)
 {
@@ -1585,6 +1571,7 @@ std::set<std::shared_ptr<ModelAPI_Attribute> > SketchPlugin_Split::getEdgeAttrib
 
   return anAttributes;
 }
+#endif
 
 std::shared_ptr<GeomDataAPI_Point2D> SketchPlugin_Split::getPointAttribute
                                                               (const bool isFirstAttribute)
index 363db36458a37f3051af9524741a864d2d490eec..01d153e76871e51037b29b4a367dc0e3189a365a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Split_H_
@@ -149,11 +148,6 @@ private:
                         std::shared_ptr<GeomDataAPI_Point2D>& theStartPointAttr,
                         std::shared_ptr<GeomDataAPI_Point2D>& theEndPointAttr);
 
-  /// Returns cast of attribute to geometrical point if the attribute is a ref attr attribute
-  /// \param theAttribute an attribute
-  /// \param geom point 2D or NULL
-  std::shared_ptr<GeomDataAPI_Point2D> getPointOfRefAttr(const AttributePtr& theAttribute);
-
   /// Obtains those constraints of the feature that should be modified. output maps contain
   /// point of coincidence and attribute id to be modified after split
   /// \param theFeaturesToDelete [out] constrains that will be deleted after split
index d94c5501b615418b95cb399eeb37c020947619bd..4f55be24d485ffb1d9997890f99f5da42e708fcd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Tools.h"
index d889b3d616e299149634d1b177b3507f7eecc979..730d865b9127c4c9eee76c2995c18a862cd4bc01 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SKETCHPLUGIN_TOOLS_H_
index 387f3a8b4e9edaf2ccfcffc9263c3f0b0066b81d..af67ca006e368ecbe08cc1988007fcacc0245423 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Trim.h"
@@ -478,6 +477,7 @@ void SketchPlugin_Trim::execute()
 #endif
 }
 
+// LCOV_EXCL_START
 std::string SketchPlugin_Trim::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
 #ifdef DEBUG_TRIM_METHODS
@@ -529,6 +529,7 @@ std::string SketchPlugin_Trim::processEvent(const std::shared_ptr<Events_Message
   }
   return aFilledAttributeName;
 }
+// LCOV_EXCL_STOP
 
 bool SketchPlugin_Trim::setCoincidenceToAttribute(const AttributePtr& theAttribute,
                                 const std::set<AttributePoint2DPtr>& theFurtherCoincidences,
@@ -1197,20 +1198,6 @@ void SketchPlugin_Trim::fillAttribute(const AttributePtr& theModifiedAttribute,
     if (aModifiedAttribute.get() && aSourceAttribute.get())
       aModifiedAttribute->setValue(aSourceAttribute->value());
   }
-  else if (anAttributeType == ModelAPI_AttributeRefAttr::typeId()) {
-    AttributeRefAttrPtr aRefAttributeToFill = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
-                                                                             theModifiedAttribute);
-    AttributeRefAttrPtr aSourceRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
-                                         theSourceAttribute);
-    if (!aSourceRefAttr.get())
-      aRefAttributeToFill->setAttr(theSourceAttribute);
-    else {
-      if (aSourceRefAttr->isObject())
-        aRefAttributeToFill->setObject(aSourceRefAttr->object());
-      else
-        aRefAttributeToFill->setAttr(aSourceRefAttr->attr());
-    }
-  }
 }
 
 FeaturePtr SketchPlugin_Trim::createLineFeature(const FeaturePtr& theBaseFeature,
index 40090b40ee0dbfeb9b6bf230364488ad4161bba7..90bbf7434287ccc569b500efebb80cbd849e74cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Trim_H_
old mode 100755 (executable)
new mode 100644 (file)
index 68817c5..8962cf0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchPlugin_Validators.h"
@@ -45,7 +44,6 @@
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefAttrList.h>
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
index bfaffbeda13bbf6c246793c5e4524d5bb0bcefe1..4a7bd052576a7952bb799ef1c3169c1a83e380c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Validators_H
old mode 100755 (executable)
new mode 100644 (file)
index 6fa4320f0d8651292d2b77ba4ec946587b2889df..a335673c48488da74a0cfd0ddc3e20be552ffcd3 100644 (file)
@@ -1,29 +1,27 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1061.py
     Test case for issue #1061 "Distance constraint using for points with equal coordinates"
 """
 
-import math
 from salome.shaper import model
 
 model.begin()
@@ -41,8 +39,7 @@ model.do()
 
 # check distance between points
 aDist2 = (SketchLine_1.endPoint().x() - SketchLine_2.startPoint().x())**2 + (SketchLine_1.endPoint().y() - SketchLine_2.startPoint().y())**2
-assert(math.fabs(aDist2 - DISTANCE**2) > 1e-12)
+assert(aDist2 < 1e-12)
+assert(Sketch_1.solverError() != "")
 
 model.end()
-
-assert(model.checkPythonDump())
index 075770ef97dc802024beebedd2234ede77d359c9..967af7702fddeb78fab8ec19a041559fc75d9328 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1577.py
index bc90a952aa32b31802d986de068c4590614a4d8a..cf0f02cdb6d08cd6493c79587f1863fb2c68a3ff 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1578.py
index af9cc1f118ae3f4eb709b411f14a592af30cbd6f..a534a0cccde7b849d9ff48c571724b2694de22be 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1673.py
index 797248731414e585bcaa1c973c0984fb9b712737..3df2ca0901b1a68d9d502c4ea6a7f04fda90ad3a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1779.py
@@ -205,10 +204,10 @@ SketchConstraintTangent_10 = Sketch_1.setTangent(SketchLine_1.result(), SketchAr
 SketchConstraintTangent_10.setName("SketchConstraintTangent_13")
 SketchConstraintAngle_2 = Sketch_1.setAngle(SketchLine_11.result(), SketchLine_10.result(), 45)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_13r-SketchLine_14f-SketchLine_2f-SketchArc_1_2f-SketchArc_2_2f-SketchLine_5r-SketchArc_3_2f-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r-SketchArc_4_2f-SketchArc_5_2r-SketchArc_6_2r-SketchLine_21r-SketchCircle_4_2r")], model.selection(), "height", 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_14"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_2f-SketchArc_3_2f-SketchLine_5r-SketchArc_2_2f-SketchArc_4_2f-SketchLine_21r-SketchArc_6_2r-SketchLine_14f-SketchArc_5_2r-SketchLine_13r-SketchCircle_2_2r-SketchCircle_1_2r-SketchCircle_4_2r-SketchCircle_3_2r")], model.selection(), "height", 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"))
 SketchLine_12 = Sketch_2.addLine(38.24999999999999, 6.5, 13.75, 6.5)
-SketchLine_13 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_14&Extrusion_1_1/To_Face_1"))
+SketchLine_13 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face_1]"))
 SketchLine_13.setName("SketchLine_15")
 SketchLine_13.result().setName("SketchLine_15")
 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_12.endPoint(), SketchLine_13.result())
@@ -238,7 +237,7 @@ SketchConstraintLength_3 = Sketch_2.setLength(SketchLine_12.result(), "width_hol
 SketchConstraintDistance_13 = Sketch_2.setDistance(SketchLine_13.endPoint(), SketchLine_16.result(), "width_hole/2")
 SketchConstraintDistance_13.setName("SketchConstraintDistance_17")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_12f-SketchLine_16f-SketchLine_17f-SketchLine_18f")], model.selection(), 0, 100, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_12r-SketchLine_16f-SketchLine_17f-SketchLine_18f")], model.selection(), 0, 100, [model.selection("SOLID", "Extrusion_1_1")])
 model.do()
 
 # check ExtrusionCut_1 is valid
index 42037816cc056dbea6aab88d6fab4968ef0473e9..21ef966caddea81ebf12e3be7ed7fc4c663ce7ce 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1924.py
index 261e8c5473057917d8fe37f31542e5790545d024..7e291e9a0cf0f856a3942c56c6358645480cae63 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1963.py
index 8da4ac2dc943008b0fc1c39cb11ee1aa0f8cb447..3fad0d785ccf0f8c09112f80cbdafbb8f439869b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1966.py
index 05c5a1b0b1e8633f48f47113c9cfdf35df1442d2..fd8ad5a55bdf9586a5336982f083f9e5ff8b2f13 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1967.py
index 45e3cd981881e73a8193602ff91754913ab76ab3..1c851fbb45c50faa3fbaa2656a9684de6335c117 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2018.py
index 7b55c988e7cfac140f3d10e364b6fddd5b6642ea..9982d37aeaff2c248c8a21e5d9e73abf44b59593 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2034_1.py
index 41a1b2e019554db76e6db7153974c4d56b838c1d..7717b8b41d29e02986518f69d8a8055f04b411a0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2034_2.py
index 632db037c6b225aebda41172df6c9586703c3458..6a61763065bbf2aa47b1a5156f7412ed0cc7ef6d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2034_3.py
@@ -48,14 +47,14 @@ SketchConstraintEqual_1 = Sketch_1.setEqual(SketchLine_4.result(), SketchLine_1.
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_5.result(), 10)
 model.do()
 Sketch_2 = model.addSketch(partSet, model.defaultPlane("XOZ"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"), False)
 SketchPoint_1 = SketchProjection_3.createdFeature()
 SketchArc_1 = Sketch_2.addArc(0, 5, -5, 0, 5, 0, False)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchPoint_1.result(), SketchArc_1.startPoint())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_5e"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), False)
 SketchPoint_2 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchArc_1.endPoint(), SketchAPI_Point(SketchPoint_2).coordinates())
-SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_4s-SketchLine_1e"), False)
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), False)
 SketchPoint_3 = SketchProjection_5.createdFeature()
 model.do()
 
index aa323b823d9974490d0e8c82cfa7e38aec8e5b46..88d0d4b38e680672f474ff26d038b30baa7a1f50 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 88e773669581c5a9de0da6e072501eb87b366973..6f9eb157496b522d71c7a7d73e92744c79624bbc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 from salome.shaper import model
index 97c3c5c85912b044608078baf1499e19acffe193..cb26f625d975cd386ac538b468440e0b34c1e9ed 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test1061.py
index 1c949e8cba47e9caa9f21aa80158980df7fe944b..b3409dd1d7842460aee73e24f961953e0840a0bc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2119.py
@@ -86,24 +85,24 @@ SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 10)
 SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchPoint_1.coordinates())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchArc_1_2r-SketchArc_2_2r")], model.selection(), "b/2", "b/2")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), False)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchArc_2_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchArc_1_2r-SketchLine_10f")], model.selection(), "b/2", "b/2")
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face]"), False)
 SketchPoint_2 = SketchProjection_1.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(-15, 35, 25)
 SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchPoint_2.result())
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_1.results()[1], "50/2")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 0, 13, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"))
-SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_4"), False)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2f_wire")], model.selection(), 0, 13, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&ExtrusionCut_1_1/From_Face"))
+SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "ExtrusionCut_1_1/Generated_Vertex&ExtrusionCut_1_1/From_Face"), False)
 SketchPoint_3 = SketchProjection_2.createdFeature()
-SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_4"), False)
+SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2"), False)
 SketchLine_11 = SketchProjection_3.createdFeature()
 SketchArc_3 = Sketch_3.addArc(-15, 35, -15, 46.0103340429751, -17.02045759563166, 24.17663606626138, True)
 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchPoint_3.result(), SketchArc_3.center())
 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_11.result(), SketchArc_3.startPoint())
-SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), False)
+SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2"), False)
 SketchArc_4 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchArc_4.results()[1])
 SketchLine_12 = Sketch_3.addLine(-15, 46.0103340429751, -15, 35)
index a1f660456bab08cfd297ade62cde68392a11b510..6790f60059d07864d2cc7c221493cba92dd69556 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2134.py
index 0635801f720f576474734cde5829f08a68c18989..d691efa57612497b9fcda028a52dbc742d7ccbe1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index c15f1d6ee494981ea99bd32f78aea744b9befb86..82eea0162646f6469ebe009417a3318f7745c1e5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
index d5ee63d33cedf53cd7bcbc5a75931677cbc39a50..caeb4e65aa878838ea946aebd4d30a14c56d17d1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2224.py
index 22a3809220e729e8049f07285464df904ac0faca..9cf4ab4b613e34d067f7ff89c20e07b35ba0911a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from ModelAPI import *
 from salome.shaper import model
index 30827d0a447cbe699c0b73964332a9ce8129d5d9..8bf69fc3dff7ab47f561d9fc1df1cdf250f583b6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2239.py
index 399c9d2b311fe9ace78cfe29924bf14ecb267af7..235c23746fecebb4e024fa77c74276a9c4ebb88f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2273.py
index d96bf8aac6a035c5b99511cd97451698e7b98f14..7f2e35ccc96b97e0fba61bdd592235e4e462fa9a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2280.py
@@ -32,7 +31,7 @@ Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Cylinder_1_1/Face_2"))
-SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "Cylinder_1_1/Face_1&Cylinder_1_1/Face_2"), True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_2]"), True)
 SketchCircle_1 = SketchProjection_1.createdFeature()
 SketchCircle_2 = Sketch_1.addCircle(0.0, 10.0, 8.0)
 model.do()
index 1049f7d1c64a3bd1d07b5f231ad2fe150eaadb31..983e92d0fe79b70c4bc07eddb78ca12d10cd95d9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -28,13 +27,13 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_1 = Sketch_1.addLine(-20, -62, 81, 60)
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), True)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"), True)
 SketchLine_2 = SketchProjection_1.createdFeature()
 model.do()
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchProjection_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchProjection_1")])
 model.end()
 
 # before bug fix it was "Sketch_2"
-assert(Edge_1.baseObjects().value(0).namingName() == "Sketch_2/Edge-SketchProjection_1")
+assert(Edge_1.baseObjects().value(0).namingName() == "Sketch_2/SketchProjection_1")
 
 assert(model.checkPythonDump())
index a621443605caceef3affcf469e66f4b7100b2702..8f175e4b32b2c3637ed1277a6dc4981716c09002 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2341.py
@@ -112,13 +111,13 @@ SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_3.endPoint(), Sketch
 SketchConstraintLength_6 = Sketch_1.setLength(SketchLine_9.result(), 20)
 SketchConstraintLength_6.setName("SketchConstraintLength_8")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6r-SketchLine_7r-SketchLine_8f-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2r-SketchLine_11f-SketchLine_12r")], model.selection(), 3.5, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchArc_2_2f-SketchLine_11f-SketchArc_3_2r-SketchLine_12r-SketchLine_7r-SketchLine_6r-SketchLine_8f-SketchArc_1_2f")], model.selection(), 3.5, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"))
 SketchLine_14 = Sketch_2.addLine(6, 0, -6, 0)
-SketchProjection_8 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_7s-SketchLine_6e"), False)
+SketchProjection_8 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_6_EndVertex"), False)
 SketchPoint_7 = SketchProjection_8.createdFeature()
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchLine_14.startPoint(), SketchPoint_7.result())
-SketchProjection_9 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_6s-SketchLine_8s"), False)
+SketchProjection_9 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_6_StartVertex"), False)
 SketchPoint_8 = SketchProjection_9.createdFeature()
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchPoint_8.result())
 SketchLine_15 = Sketch_2.addLine(-6, 0, -6, -3.5)
@@ -126,14 +125,14 @@ SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_14.endPoint()
 SketchLine_16 = Sketch_2.addLine(-6, -3.5, -6, -10.5)
 SketchConstraintCoincidence_23 = Sketch_2.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
 SketchLine_17 = Sketch_2.addLine(5.978225648847096, 0.08643259872215214, 6, -3.5)
-SketchProjection_10 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_10 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
 SketchPoint_9 = SketchProjection_10.createdFeature()
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchPoint_9.result())
 SketchLine_18 = Sketch_2.addLine(6, -3.5, 6, -10.5)
 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
 SketchConstraintLength_7 = Sketch_2.setLength(SketchLine_18.result(), 7)
 SketchConstraintLength_7.setName("SketchConstraintLength_9")
-SketchProjection_11 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_11 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/To_Face]"), False)
 SketchPoint_10 = SketchProjection_11.createdFeature()
 SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_10).coordinates(), SketchLine_15.endPoint())
 SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_18.result())
index 98fd0413c89eb00874f2785cfe4fe7964508e6fa..a11579aa46601c6b7503970b19aa41aeb22d3d85 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2376.py
@@ -42,9 +41,7 @@ model.checkSketch(Sketch_1, SKETCH_DOF)
 # add one more distance constraint, DoF should be the same
 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_2.result(), 25, True)
 model.do()
-model.checkSketch(Sketch_1, SKETCH_DOF)
-# TODO: following line should be uncommented when PlanGCS will be able to determine over-constraint in this case
-#assert Sketch_1.solverError().value() != "", "FAILED: Sketch should report over-constrained situation"
+assert Sketch_1.solverError().value() != "", "FAILED: Sketch should report over-constrained situation"
 
 # remove last constraint
 partSet.removeFeature(SketchConstraintDistance_2.feature())
index 1739cbe66c0d369d97a4c934e79cbe040c798e64..75dac5790f3c12ad24e56b3f21402906db6d4409 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2390.py
@@ -93,11 +92,11 @@ SketchConstraintVertical_15 = Sketch_4.setVertical(SketchLine_52.result())
 SketchConstraintVertical_16 = Sketch_4.setVertical(SketchLine_55.result())
 SketchConstraintVertical_17 = Sketch_4.setVertical(SketchLine_58.result())
 SketchConstraintHorizontal_11 = Sketch_4.setHorizontal(SketchLine_56.result())
-SketchProjection_13 = Sketch_4.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5e"), False)
+SketchProjection_13 = Sketch_4.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_5_EndVertex"), False)
 SketchPoint_4 = SketchProjection_13.createdFeature()
 SketchConstraintDistanceHorizontal_17 = Sketch_4.setHorizontalDistance(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_52.endPoint(), "Drill2_Loc")
 SketchConstraintLength_3 = Sketch_4.setLength(SketchLine_54.result(), "Drill2_InnerRadius")
-SketchProjection_14 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), False)
+SketchProjection_14 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_3"), False)
 SketchLine_59 = SketchProjection_14.createdFeature()
 SketchConstraintAngle_6 = Sketch_4.setAngle(SketchLine_57.result(), SketchLine_56.result(), 45)
 SketchConstraintLength_4 = Sketch_4.setLength(SketchLine_56.result(), "Drill2_Radius")
@@ -111,7 +110,7 @@ SketchConstraintDistance_14 = Sketch_4.setDistance(SketchLine_57.endPoint(), Ske
 SketchConstraintTangent_3 = Sketch_4.setTangent(SketchLine_58.result(), SketchArc_2.results()[1])
 model.do()
 
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_9r-SketchLine_10r-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchArc_1_2f")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchArc_1_2f-SketchLine_10r-SketchLine_9r-SketchLine_7r")], model.selection("EDGE", "Sketch_2/SketchLine_7"), 360, 0)
 model.do()
 
 from GeomAPI import GeomAPI_Shape
@@ -157,4 +156,4 @@ model.testResultsVolumes(Revolution_1, [41.691543241529835484016075497], SIGNIFI
 model.end()
 
 # TODO: uncomment following line when issue #2389 is fixed
-#assert(model.checkPythonDump())
\ No newline at end of file
+#assert(model.checkPythonDump())
index 0fc461049a11eb36ba46bde8f1be52731f1468ce..085308d6510e96c7143ea470a737c1c80b092bfd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2393.py
@@ -38,7 +37,7 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Top"), 10,
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
-SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "Box_1_1/Front&Box_1_1/Top"), True)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), True)
 SketchLine_1 = SketchProjection_2.createdFeature()
 SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Point(SketchPoint_1).coordinates(), 90, 3)
 [SketchLine_1, SketchLine_2, SketchLine_3] = SketchMultiRotation_1.rotated()
@@ -54,4 +53,4 @@ model.checkSketch(Sketch_1, 0)
 
 model.end()
 
-assert(model.checkPythonDump())
\ No newline at end of file
+assert(model.checkPythonDump())
index ec052ba3df66af997646fd324ffacc47b6129458..476b5b8639d2699b813024972f34d6ceb8467ffd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2425.py
index e390a8114abd5f3c7451aae4e27ae3d91dce908d..5ba070cac285ffe3373cd80140b3cd6c9c8e9aa6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2427.py
index eb4077a58aa7982d88ac726a95b843d8b0699a01..909e0ca9eb9cecbd4ed81050c866db74f142970f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2440.py
@@ -44,7 +43,7 @@ Import_1.result().setName("profile_top_1")
 
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_1 = Sketch_1.addLine(-0.5, 0, -0.1, 0.5)
-SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "profile_top_1/Shape2"), False)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "profile_top_1/Shape_2"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 model.do()
 
index 83483375ab91406cb5e1ef3fe89d3fc8463bb5a2..8c3ec2356b2abd57ece6fa72ff3e7a9dce8fcc6c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2481.py
index 066d5e292a4a67ff288e1e2925bc6d6171a3dbb9..17a725a3d203980cc24afbcfe9be4c715abfaea1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2654.py
@@ -113,13 +112,13 @@ SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_1.startPoint(
 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_23")
 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_11.result(), SketchArc_2.startPoint(), 7.37, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchLine_10r-SketchArc_1_2r-SketchArc_2_2f-SketchArc_3_2f")], model.selection(), "h", 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), False)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchArc_3_2f-SketchLine_10r-SketchArc_1_2r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchArc_2_2f")], model.selection(), "h", 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7"))
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/From_Face]"), False)
 SketchPoint_2 = SketchProjection_3.createdFeature()
-SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]"), False)
 SketchPoint_3 = SketchProjection_4.createdFeature()
-SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_5 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/To_Face]"), False)
 SketchPoint_4 = SketchProjection_5.createdFeature()
 SketchLine_13 = Sketch_2.addLine(6.005577592461473, 0, -5.994422407538528, 0)
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_13.startPoint())
@@ -129,7 +128,7 @@ SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_26")
 SketchLine_14 = Sketch_2.addLine(-5.994422407538528, 0, -5.994422407538528, -3.5)
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
 SketchConstraintCoincidence_21.setName("SketchConstraintCoincidence_27")
-SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_6 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"), False)
 SketchPoint_5 = SketchProjection_6.createdFeature()
 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchPoint_5.result())
 SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_28")
@@ -161,7 +160,7 @@ SketchConstraintVertical_6 = Sketch_2.setVertical(SketchLine_17.result())
 SketchConstraintLength_6 = Sketch_2.setLength(SketchLine_17.result(), 7)
 SketchConstraintEqual_2 = Sketch_2.setEqual(SketchLine_17.result(), SketchLine_15.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchLine_16r-SketchLine_17r-SketchArc_5_2f")], model.selection(), "h", 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_14f-SketchLine_15f-SketchArc_5_2f-SketchLine_17r-SketchLine_16r")], model.selection(), "h", 0)
 model.do()
 
 
@@ -178,9 +177,6 @@ assert(Split_1.feature().error() != "")
 Part_1_doc.removeFeature(Split_1.feature())
 model.do()
 model.checkSketch(Sketch_2, 0)
-
-Part_1_doc.setCurrentFeature(Extrusion_2.feature(), True)
-
 model.end()
 
 assert(model.checkPythonDump())
index e0aa593a1cd670fa3e926b7cb9bcd1d1bb358a63..f419bf9efe15a8d40b04c7de7f4f960e6a6edeef 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test2711.py
diff --git a/src/SketchPlugin/Test/Test2741.py b/src/SketchPlugin/Test/Test2741.py
new file mode 100644 (file)
index 0000000..181e986
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    Test2741.py
+    Test case for issue #2741 "Undo of distance argument change produces crash"
+"""
+
+from salome.shaper import model
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-34.48932587013569, -5.994823429605995, -23.03828378136105, 27.99739301876914)
+SketchLine_2 = Sketch_1.addLine(-23.03828378136105, 27.99739301876914, -14.34307552407934, -3.849202930145424)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_2.result(), 20, True)
+model.do()
+
+# Change point-line distance constraint to point-point distance
+SketchAPI_Constraint(SketchConstraintDistance_1).setEntityB(SketchLine_2.endPoint())
+model.do()
+model.end()
+
+# Check no crash on undo distance changing
+model.undo()
diff --git a/src/SketchPlugin/Test/Test2810.py b/src/SketchPlugin/Test/Test2810.py
new file mode 100644 (file)
index 0000000..c269d84
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    Test2810.py
+    Test case for issue #2810 "crash creating arc fillet"
+"""
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchArc_1 = Sketch_1.addArc(10, 10, 11, 10, 10, 11, False)
+SketchLine_1 = Sketch_1.addLine(12, 10, 12, 9)
+model.do()
+
+Sketch_1.setFixed(SketchArc_1.results()[1])
+Sketch_1.setFixed(SketchLine_1.result())
+
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.startPoint())
+model.do()
+
+SketchFillet = Sketch_1.setFillet(SketchArc_1.startPoint())
+model.do()
+
+assert(Sketch_1.feature().error() != "")
+
+model.end()
diff --git a/src/SketchPlugin/Test/Test2824.py b/src/SketchPlugin/Test/Test2824.py
new file mode 100644 (file)
index 0000000..a0f808e
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    Test2824.py
+    Test case for issue #2824 "Constraints at wrong positions when editing the sketch (BARCOM)"
+"""
+
+from salome.shaper import model
+from GeomAPI import *
+from GeomDataAPI import *
+
+import math
+
+TOLERANCE = 1.e-6
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOZ"))
+SketchArc_1 = Sketch_1.addArc(7.554548355024374, 9.322927740745062, 20, 30.60489708262655, 31.5458454490763, 15, True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "OZ"), False)
+SketchLine_1 = SketchProjection_1.createdFeature()
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.startPoint(), SketchLine_1.result(), 20, True)
+SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "OX"), False)
+SketchLine_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchArc_1.endPoint(), SketchLine_2.result(), 15, True)
+model.do()
+# move the arc like the user does
+for i in range(0, 10):
+    Sketch_1.move(SketchArc_1.startPoint(), SketchArc_1.startPoint().x(), SketchArc_1.startPoint().y() + 5)
+model.end()
+model.undo()
+
+# compare the arc arguments and the resulting shape
+aStartAttrY = SketchArc_1.startPoint().y()
+aEndAttrX = SketchArc_1.endPoint().x()
+
+anArcShape = SketchArc_1.feature().lastResult().shape()
+aShapeExplorer = GeomAPI_ShapeExplorer(anArcShape, GeomAPI_Shape.VERTEX)
+
+aPoint = aShapeExplorer.current().vertex().point()
+aEndShapeX = aPoint.x()
+assert(math.fabs(aEndAttrX - aEndShapeX) < TOLERANCE)
+
+aShapeExplorer.next()
+aPoint = aShapeExplorer.current().vertex().point()
+aStartShapeY = aPoint.z() # in 3D sketch y iz Z
+assert(math.fabs(aStartAttrY - aStartShapeY) < TOLERANCE)
diff --git a/src/SketchPlugin/Test/Test2860.py b/src/SketchPlugin/Test/Test2860.py
new file mode 100644 (file)
index 0000000..261ee84
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    Test2860.py
+    Test case for issue #2650 "setAngleComplementary becomes setAngle in BARCOM"
+    Test case for issue #2860 "Error in python dump reload because of setAngleComplementary"
+"""
+
+from salome.shaper import model
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-9.326798599059195, -0.7578903795715272, 33.09960827213365, 41.66851649162133)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 60)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "OY"), False)
+SketchLine_2 = SketchProjection_1.createdFeature()
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_2.result(), 45)
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchAPI_Line(SketchLine_2).startPoint(), SketchLine_1.endPoint(), 5)
+model.do()
+model.end()
+
+assert(model.checkPythonDump())
index 263e89a76abcf696a01c32113e797255af0c88e6..279b50f949fd5be7a51c09bc178f080f575c2460 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestArcBehavior.py
index 30e3eafae78d392105a66fda8cf959a44ac8e5d0..47b066f16685905c0a4b354dd8ad6f402bf9f6e7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintAngle.py
index 7d6424e87d2a739db8b0db0b758cef476d3466a6..15fbf900738f13aa76d0c79be2a05b35b1c84ffe 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintCoincidence.py
index 17cb5cb25f65ceded0396d1078da00885bc56ebf..5e0238de60f027585bf85c39d70bb092d770dd02 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintCollinear.py
index 46ce2e4d1cba0c4bf6125b3f467242c37fda21dd..5e17fc03cf5fc6c391c72e6ce8847c43684f722f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintDistance.py
@@ -171,6 +170,25 @@ assert (refattrB.isInitialized())
 assert (aDistance.isInitialized())
 assert math.fabs(aDistance.value() - aDist) < 1.e-4, "Distance values are different: {0} != {1}".format(aDistance.value(), aDist)
 assert (model.dof(aSketchFeature) == 5)
+
+#=========================================================================
+# Swap point and line in the distance
+#=========================================================================
+aSession.startOperation()
+refattrA.setAttr(aSketchPointCoords)
+refattrB.setObject(aLineResult)
+aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 5)
+# set flyout point then abort operation, after that check the Distance is correct
+aSession.startOperation()
+aFlyoutPoint = geomDataAPI_Point2D(aConstraint.attribute("ConstraintFlyoutValuePnt"))
+aFlyoutPoint.setValue(100.0, 100.0)
+aSession.abortOperation()
+assert (refattrA.isInitialized())
+assert (refattrB.isInitialized())
+assert (aDistance.isInitialized())
+assert math.fabs(aDistance.value() - aDist) < 1.e-4, "Distance values are different: {0} != {1}".format(aDistance.value(), aDist)
+assert (model.dof(aSketchFeature) == 5)
 #=========================================================================
 # Change distance value
 #=========================================================================
index 269d4acfa7264d601f63941a182b894a80265c3c..413331d7238e016769e7f86fc8a4af98e61818b4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index 29cfb568025fcc4482f30f47de0d864e47ccf611..1a6bcbfa1d035154aa5e25004750f27f565873ce 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintDistanceHorizontal.py
index 5045080d35512ed3ce1f7206e8a4c5776857979b..b4365147f67b06b0567650fafd1d9b46466b2b4f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintDistanceVertical.py
index cd5bf4b684f7fb72746e3a45cc32ab846fe663b7..a3c8662f0632e69ff8df287db8a21fc5ba0feddf 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintEqual.py
@@ -147,7 +146,7 @@ anExtCircleCenter = geomDataAPI_Point2D(anExtCircle.attribute("circle_center"))
 anExtCircleRadius = anExtCircle.real("circle_radius")
 anExtCircleCenter.setValue(-50., 50.)
 anExtCircleRadius.setValue(10.)
-anExtCircle.selection("External").selectSubShape("EDGE", "Sketch_1/Edge-SketchCircle_1_2")
+anExtCircle.selection("External").selectSubShape("EDGE", "Sketch_1/SketchCircle_1_2")
 aSession.finishOperation()
 assert (model.dof(aSketchFeature) == 7)
 aSession.startOperation()
@@ -212,7 +211,7 @@ anExtLineStart = geomDataAPI_Point2D(anExtLine.attribute("StartPoint"))
 anExtLineEnd = geomDataAPI_Point2D(anExtLine.attribute("EndPoint"))
 anExtLineStart.setValue(-40., 35.)
 anExtLineEnd.setValue(-60., 25.)
-anExtLine.selection("External").selectSubShape("EDGE", "Sketch_1/Edge-SketchLine_1")
+anExtLine.selection("External").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
 anExtLineLen = lineLength(anExtLine)
 aSession.finishOperation()
 assert (model.dof(aSketchFeature) == 13)
index ad3921f041a79e3588a3dae397e9c12c9e54fa73..f6db5d97a6b83388d8beb5eb91804db001e4c98a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintRigid.py
index a276e4e4dd2fe7994fc4c555bb5f1dbe482da0ab..4ec43be119f293625a529f782754b3a6db366b7d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintHorizontal.py
index 103d7db80a1729ed03befdc89da41cf0eea0b176..7417476d269dd86d7b16aaee58ba8affad2ea55f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintHorizontalValidator.py
index d9b418a78e238c18c43a7f218da08414ace37136..93609fecffbbed60bdb4498938585ac73a4458d8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintLength.py
index 53133e6b5cc24775b17cbb76930d3ccdf9ec1087..54641a89996e4ee3f1bc5614c06b53a3338c4ee2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintCoincidence.py
index 1b040ba3ced73893847f619c6b08fe6f13a8e0a3..4e71f0d01368b87458e3aa4b7dea7a312f55bf1d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintParallel.py
index 5a1f2646c024ddf223b2abb4bdd7a06f8b9b04f6..6f346c417e6fed594d26e8954dee1c72be564bab 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintPerpendicular.py
index 8afa1ea716a2f09c984e58efb9a529b838378d75..fbfa56093179be4c19b7d6ad9ba994006e1bb92d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintRadius.py
diff --git a/src/SketchPlugin/Test/TestConstraintRadiusFailure.py b/src/SketchPlugin/Test/TestConstraintRadiusFailure.py
new file mode 100644 (file)
index 0000000..d3b6a7f
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-30, 0, -10, 0)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchLine_1.result(), 20)
+model.do()
+
+assert(SketchConstraintRadius_1.feature().error() != "")
+
+model.end()
index 3f3ac2e7ed9382800fe81551d4df974ab3b58e94..bf9a49e420eff651072b3d7f473ffafc085d6000 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintTangent.py
index ec05f8dda2436930c1a5bf74bad596fd8707b849..847518c3bd9a22c76eb249a6d892bb39fe7098eb 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintVertical.py
index 0e44647749bcb621f235025a4c94a29aa0ccf221..9dbd30803ea3a86c5019251cce8bd1ab32221ce0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateArc.py
@@ -272,6 +271,116 @@ verifyPointOnCircle(aStart, aPrevArc)
 model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 6)
 model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 0)
 
+#=========================================================================
+# Test 5. Create another arc by center and points coincident to other features
+#=========================================================================
+# create new arc
+aSession.startOperation()
+anArc = aSketchFeature.addFeature("SketchMacroArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aCenterRef = anArc.refattr("center_point_ref")
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point_1"))
+aStartRef = anArc.refattr("start_point_ref")
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point_1"))
+aEndRef = anArc.refattr("end_point_ref")
+anArcType = anArc.string("arc_type")
+# initialize attributes
+anArcType.setValue("by_center_and_points")
+aCenterRef.setObject(aLine.lastResult())
+aCenter.setValue(aLineStartPoint.pnt())
+aStartRef.setObject(aLine.lastResult())
+aStart.setValue(aLineEndPoint.pnt())
+aEndRef.setObject(aPrevArc.lastResult())
+aEnd.setValue(aPrevArcStart.pnt())
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 16), "Number of subs {}".format(aSketchFeature.numberOfSubs())
+# check connected features do not change their positions
+model.assertArc(aPrevArc, aPrevArcCenterXY, aPrevArcStartXY, aPrevArcEndXY)
+model.assertLine(aLine, aLineStart, aLineEnd)
+# verify newly created arc
+anArc = model.lastSubFeature(aSketchFeature, "SketchArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point"))
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point"))
+verifyPointOnLine(aCenter, aLine)
+verifyPointOnLine(aStart, aLine)
+verifyPointOnCircle(aEnd, aPrevArc)
+model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 9)
+model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 0)
+
+#=========================================================================
+# Test 6. Create one more arc by center and points coincident to other features
+#=========================================================================
+# get previous arc
+aPrevArc = model.lastSubFeature(aSketchFeature, "SketchArc")
+aPrevArcCenter = geomDataAPI_Point2D(aPrevArc.attribute("center_point"))
+aPrevArcStart = geomDataAPI_Point2D(aPrevArc.attribute("start_point"))
+aPrevArcEnd = geomDataAPI_Point2D(aPrevArc.attribute("end_point"))
+aPrevArcCenterXY = [aPrevArcCenter.x(), aPrevArcCenter.y()]
+aPrevArcStartXY = [aPrevArcStart.x(), aPrevArcStart.y()]
+aPrevArcEndXY = [aPrevArcEnd.x(), aPrevArcEnd.y()]
+# create new arc
+aSession.startOperation()
+anArc = aSketchFeature.addFeature("SketchMacroArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aCenterRef = anArc.refattr("center_point_ref")
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point_1"))
+aStartRef = anArc.refattr("start_point_ref")
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point_1"))
+aEndRef = anArc.refattr("end_point_ref")
+anArcType = anArc.string("arc_type")
+# initialize attributes
+anArcType.setValue("by_center_and_points")
+delta = [aPrevArcEndXY[0] - aPrevArcCenterXY[0], aPrevArcEndXY[1] - aPrevArcCenterXY[1]]
+aCenter.setValue(aPrevArcCenterXY[0] + 2 * delta[0], aPrevArcCenterXY[1] + 2 * delta[1])
+aStart.setValue(aPrevArcCenterXY[0] + 2 * delta[0] - 0.9 * delta[1], aPrevArcCenterXY[1] + 2 * delta[1] + 0.9 * delta[0])
+aEndRef.setObject(aPrevArc.lastResult())
+aEnd.setValue(aPrevArcCenterXY[0] + 1.1 * delta[0], aPrevArcCenterXY[1] + 1.1 * delta[1])
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 18), "Number of subs {}".format(aSketchFeature.numberOfSubs())
+# verify newly created arc
+anArc = model.lastSubFeature(aSketchFeature, "SketchArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point"))
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point"))
+verifyPointOnCircle(aEnd, aPrevArc)
+model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 10)
+model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 0)
+
+#=========================================================================
+# Test 7. Create one more arc by center and points coincident to other features
+#=========================================================================
+aPrevArcCenterXY = [aPrevArcCenter.x(), aPrevArcCenter.y()]
+aPrevArcStartXY = [aPrevArcStart.x(), aPrevArcStart.y()]
+aPrevArcEndXY = [aPrevArcEnd.x(), aPrevArcEnd.y()]
+# create new arc
+aSession.startOperation()
+anArc = aSketchFeature.addFeature("SketchMacroArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aCenterRef = anArc.refattr("center_point_ref")
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point_1"))
+aStartRef = anArc.refattr("start_point_ref")
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point_1"))
+aEndRef = anArc.refattr("end_point_ref")
+anArcType = anArc.string("arc_type")
+# initialize attributes
+anArcType.setValue("by_center_and_points")
+delta = [aPrevArcEndXY[0] - aPrevArcCenterXY[0], aPrevArcEndXY[1] - aPrevArcCenterXY[1]]
+aCenter.setValue(aPrevArcCenterXY[0] + 2 * delta[0], aPrevArcCenterXY[1] + 2 * delta[1])
+aStart.setValue(aPrevArcCenterXY[0] + 2 * delta[0] - delta[1], aPrevArcCenterXY[1] + 2 * delta[1] + delta[0])
+aEndRef.setObject(aPrevArc.lastResult())
+aEnd.setValue(aPrevArcCenterXY[0] + delta[0], aPrevArcCenterXY[1] + delta[1])
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 20), "Number of subs {}".format(aSketchFeature.numberOfSubs())
+# verify newly created arc
+anArc = model.lastSubFeature(aSketchFeature, "SketchArc")
+aCenter = geomDataAPI_Point2D(anArc.attribute("center_point"))
+aStart = geomDataAPI_Point2D(anArc.attribute("start_point"))
+aEnd = geomDataAPI_Point2D(anArc.attribute("end_point"))
+verifyPointOnCircle(aEnd, aPrevArc)
+model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 11)
+model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 0)
+
 #=========================================================================
 # End of test
 #=========================================================================
index 448f9ea3d6fd4ff02638f749a47b0c0c21f73ab2..d5ba3378ca4d7e890557b0e345323d1f50831c83 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateArc.py
index f6240ab205e4a91bc8c30484dc08213dc40abcb5..b5223dc7b54c6725fab49ebf57cf8bcc555b4ca7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateArcByThreePoints.py
index 851241a02a20a1cac14eceaade0c995cd3a1b65e..ddea172c08e7ad6aa5a6d0265d10750c58d38347 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateArcChangeType.py
index 6fbb6b34a77c87078acfee9dae969f3244fd27c6..9e27926d2620661a4347e246a0714410b8a21fda 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateCircleByCenterAndPassed.py
@@ -63,6 +62,12 @@ def verifyTangentCircles(theCircle1, theCircle2):
     aRDiff = math.fabs(aRadius1 - aRadius2)
     assert math.fabs(aRSum - aDistCC) < TOLERANCE or math.fabs(aRDiff - aDistCC) < TOLERANCE, "Circles do not tangent"
 
+def verifyTangentCircleLine(theCircle, theLine):
+    aCenter = geomDataAPI_Point2D(theCircle.attribute("circle_center"))
+    aRadius = theCircle.real("circle_radius").value()
+    aDistCL = model.distancePointLine(aCenter, theLine)
+    assert math.fabs(aDistCL - aRadius) < TOLERANCE, "Circle and line are not tangent"
+
 
 #=========================================================================
 # Start of test
@@ -221,6 +226,35 @@ verifyTangentCircles(aCircle, aPrevCircle)
 model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 3)
 model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 1)
 
+#=========================================================================
+# Test 5. Create a circle as a macro-feature by center and passed point on line
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCenter = geomDataAPI_Point2D(aCircle.attribute("center_point"))
+aCenterRef = aCircle.refattr("center_point_ref")
+aPassed = geomDataAPI_Point2D(aCircle.attribute("passed_point"))
+aPassedRef = aCircle.refattr("passed_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_center_and_passed_points")
+anExpectedCenter = [(aLineStart[0] + aLineEnd[0]) * 0.5 + 10., (aLineStart[1] + aLineEnd[1]) * 0.5]
+aCenter.setValue(anExpectedCenter[0], anExpectedCenter[1])
+aPassedRef.setObject(aLine.lastResult())
+aPassed.setValue(aLineStart[0], aLineStart[1])
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 12)
+# check connected features do not change their positions
+model.assertLine(aLine, aLineStart, aLineEnd)
+# verify newly created circle
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+aCenter = geomDataAPI_Point2D(aCircle.attribute("circle_center"))
+model.assertPoint(aCenter, anExpectedCenter)
+verifyTangentCircleLine(aCircle, aLine)
+model.testNbSubFeatures(aSketch, "SketchConstraintCoincidence", 3)
+model.testNbSubFeatures(aSketch, "SketchConstraintTangent", 2)
+
 #=========================================================================
 # Test 5. Create a circle as a macro-feature by center and passed point placed on the same line
 #         Check the circle is not created
@@ -244,7 +278,7 @@ assert aLastFeature.getKind() == "SketchMacroCircle", "ERROR: SketchMacroCircle
 aSession.startOperation()
 aDocument.removeFeature(aCircle)
 aSession.finishOperation()
-assert (aSketchFeature.numberOfSubs() == 10)
+assert (aSketchFeature.numberOfSubs() == 12)
 
 #=========================================================================
 # End of test
index 558f2f86f86b6341bc7cea0043c38b14aff7884c..f6d4b622ebb0862994f0da1600cc79045ed2847a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateCircleByThreePoints.py
@@ -258,7 +257,9 @@ aCirclePnt3.setValue(aLineEnd[0], aLineEnd[1])
 aSession.finishOperation()
 aLastFeature = aSketchFeature.subFeature(aSketchFeature.numberOfSubs() - 1)
 assert aLastFeature.getKind() == "SketchMacroCircle", "ERROR: SketchMacroCircle has NOT expected to be valid"
+aSession.startOperation()
 aDocument.removeFeature(aCircle)
+aSession.finishOperation()
 assert (aSketchFeature.numberOfSubs() == 12)
 
 #=========================================================================
@@ -285,12 +286,211 @@ aCirclePnt3.setValue(aLineEnd[0], aLineEnd[1])
 aSession.finishOperation()
 aLastFeature = aSketchFeature.subFeature(aSketchFeature.numberOfSubs() - 1)
 assert aLastFeature.getKind() == "SketchMacroCircle", "ERROR: SketchMacroCircle has NOT expected to be valid"
+aSession.startOperation()
 aDocument.removeFeature(aCircle)
+aSession.finishOperation()
 assert (aSketchFeature.numberOfSubs() == 12)
 
+
+#=========================================================================
+# Auxiliary objects for the following tests
+#=========================================================================
+from salome.shaper import model
+
+model.begin()
+Sketch_1 = model.addSketch(aDocument, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(20, -10, 20, 10)
+SketchLine_2 = Sketch_1.addLine(20, 10, 40, 10)
+SketchLine_3 = Sketch_1.addLine(40, 10, 40, -10)
+SketchCircle_1 = Sketch_1.addCircle(-10, 0, 20)
+SketchCircle_2 = Sketch_1.addCircle(30, 25, 5)
+SketchCircle_3 = Sketch_1.addCircle(50, 0, 10)
+model.do()
+model.end()
+aSketchFeature = featureToCompositeFeature(Sketch_1.feature())
+
+#=========================================================================
+# Test 6. Create a circle passing through a point and tangent to 2 lines
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1.setValue(0, 0)
+aCirclePnt2Ref.setObject(SketchLine_1.feature().lastResult())
+aCirclePnt2.setValue(SketchLine_1.startPoint().x(), SketchLine_1.startPoint().y())
+aCirclePnt3Ref.setObject(SketchLine_2.feature().lastResult())
+aCirclePnt3.setValue(SketchLine_2.startPoint().x(), SketchLine_2.startPoint().y())
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 9)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircleLine(aCircle, SketchLine_1.feature())
+verifyTangentCircleLine(aCircle, SketchLine_2.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 2)
+
+#=========================================================================
+# Test 7. Create a circle passing through a point and tangent to 2 circles
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1.setValue(0, 0)
+aCirclePnt2Ref.setObject(SketchCircle_3.feature().lastResult())
+aCirclePnt2.setValue(40, 0)
+aCirclePnt3Ref.setObject(SketchCircle_2.feature().lastResult())
+aCirclePnt3.setValue(30, 20)
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 12)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircles(aCircle, SketchCircle_3.feature())
+verifyTangentCircles(aCircle, SketchCircle_2.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 4)
+
+#=========================================================================
+# Test 8. Create a circle passing through a point and tangent to line and circle
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1.setValue(0, 0)
+aCirclePnt2Ref.setObject(SketchLine_3.feature().lastResult())
+aCirclePnt2.setValue(30, 0)
+aCirclePnt3Ref.setObject(SketchCircle_2.feature().lastResult())
+aCirclePnt3.setValue(30, 20)
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 15)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircles(aCircle, SketchCircle_2.feature())
+verifyTangentCircleLine(aCircle, SketchLine_3.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 6)
+
+#=========================================================================
+# Test 9. Create a circle tangent to 3 lines
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1Ref.setObject(SketchLine_1.feature().lastResult())
+aCirclePnt1.setValue(20, 0)
+aCirclePnt2Ref.setObject(SketchLine_2.feature().lastResult())
+aCirclePnt2.setValue(30, 10)
+aCirclePnt3Ref.setObject(SketchLine_3.feature().lastResult())
+aCirclePnt3.setValue(40, 0)
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 19)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircleLine(aCircle, SketchLine_1.feature())
+verifyTangentCircleLine(aCircle, SketchLine_2.feature())
+verifyTangentCircleLine(aCircle, SketchLine_3.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 9)
+
+#=========================================================================
+# Test 10. Create a circle tangent to a circle and 2 lines
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1Ref.setObject(SketchLine_1.feature().lastResult())
+aCirclePnt1.setValue(20, 0)
+aCirclePnt2Ref.setObject(SketchLine_2.feature().lastResult())
+aCirclePnt2.setValue(30, 10)
+aCirclePnt3Ref.setObject(SketchCircle_3.feature().lastResult())
+aCirclePnt3.setValue(40, 0)
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 23)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircleLine(aCircle, SketchLine_1.feature())
+verifyTangentCircleLine(aCircle, SketchLine_2.feature())
+verifyTangentCircles(aCircle, SketchCircle_3.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 12)
+
+#=========================================================================
+# Test 11. Create a circle tangent to 3 circles
+#=========================================================================
+# create new circle
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCirclePnt1Ref = aCircle.refattr("first_point_ref")
+aCirclePnt2Ref = aCircle.refattr("second_point_ref")
+aCirclePnt3Ref = aCircle.refattr("third_point_ref")
+aCircleType = aCircle.string("circle_type")
+# initialize attributes
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1Ref.setObject(SketchCircle_1.feature().lastResult())
+aCirclePnt1.setValue(10, 0)
+aCirclePnt2Ref.setObject(SketchCircle_2.feature().lastResult())
+aCirclePnt2.setValue(30, 20)
+aCirclePnt3Ref.setObject(SketchCircle_3.feature().lastResult())
+aCirclePnt3.setValue(40, 0)
+aSession.finishOperation()
+assert (aSketchFeature.numberOfSubs() == 27)
+# check newly created circle tangent to objects
+aCircle = model.lastSubFeature(aSketchFeature, "SketchCircle")
+verifyTangentCircles(aCircle, SketchCircle_1.feature())
+verifyTangentCircles(aCircle, SketchCircle_2.feature())
+verifyTangentCircles(aCircle, SketchCircle_3.feature())
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 0)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 15)
+
 #=========================================================================
 # End of test
 #=========================================================================
 
-from salome.shaper import model
 assert(model.checkPythonDump())
index 5a4677d6794175b9a49bd397b480294373a6a332..aa49c3a1e4e8235df7f3b833ba19a375c6da5490 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestCreateCircleChangeType.py
index e9b2cfca37ec80ba24c42e157512429905bc4fae..1698ee5d4a760b90cdd603ca67e1d6b9717dd8bc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
@@ -128,29 +127,26 @@ model.end()
 # case 1: undo the error
 model.begin()
 aCoincidence = Sketch_3.setCoincident(SketchArc_1.startPoint(), SketchArc_1.endPoint())
-model.do()
 model.end()
 model.checkSketchErrorDegenerated(Sketch_3)
 model.undo()
-model.do()
+model.begin()
 model.checkSketch(Sketch_3)
 
 # case 2: remove degeneracy-producting constraint
-model.begin()
+model.do()
 aCoincidence = Sketch_3.setCoincident(SketchArc_1.startPoint(), SketchArc_1.endPoint())
 model.do()
 model.checkSketchErrorDegenerated(Sketch_3)
 Part_1_doc.removeFeature(aCoincidence.feature())
 model.do()
-model.end()
 model.checkSketch(Sketch_3)
 
 # case 3: remove degenerated edge
-model.begin()
+model.do()
 aCoincidence = Sketch_3.setCoincident(SketchArc_1.startPoint(), SketchArc_1.endPoint())
 model.do()
 model.checkSketchErrorDegenerated(Sketch_3)
 ModelAPI.removeFeaturesAndReferences(FeatureSet([SketchArc_1.feature()]))
-model.do()
 model.end()
 assert(Sketch_3.solverError().value() == "")
index c8375f581a966489f2107273b4ba73f55eb4bdb2..54909019e0f3ebe6982ae853affe4e7affccfa47 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestDistanceDump.py
index 6ab1c23cd4ff46d7e51e2b4698f1d18d8d82db08..4f5a26036f42f485bdd169a15fc57d52d35f01bd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index f518caab7e4f1079051c1d96cc8752558759551d..72e132a994a5c07e97538c565502292b95b24e3f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index f05990017778ec4f82dfd3274ba83fd77fb32023..7f2eca3778a1d7ceb210037f5af47ce9064f354e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index e26fd422187051253c848cdd9eea4c63f9f46def..8592f4cb23a649b1577b685c0c9dc28a035cd036 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index 3d476c35d0d5c7c7e1e113e23107bac818e5fd52..efb978784de14b98a8decd48d33470aad21b5bae 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 from SketchAPI import *
index cc8ae38a72902b8a03c6994c1faa3a5891534cbc..cd88fb6996c9f56003fe61b50b2af6297348536a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Verify the order of sketch edges is the same after dump
@@ -55,26 +54,26 @@ Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
 Sketch_1.setLength(SketchLine_1.result(), 20)
 Sketch_1.setLength(SketchLine_2.result(), 40)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r")], model.selection(), 10, 0)
 
 # Extrude all lateral faces to check their area
 Extrusion_2 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"))
 SketchLine_5 = Sketch_2.addLine(0.7346748749771982, 2.736245541082907e-015, 0.7346748749771982, 10.00000000000001)
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"), False)
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchPoint_1.result())
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchPoint_2.result())
 SketchLine_6 = Sketch_2.addLine(0.7346748749771982, 10.00000000000001, -19.2653251250228, 10.00000000000001)
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"), False)
 SketchPoint_3 = SketchProjection_3.createdFeature()
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchPoint_3.result())
 SketchLine_7 = Sketch_2.addLine(-19.2653251250228, 10.00000000000001, -19.2653251250228, 2.775557561562891e-015)
 SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
-SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"), False)
 SketchPoint_4 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchPoint_4.result())
 SketchLine_8 = Sketch_2.addLine(-19.2653251250228, 2.775557561562891e-015, 0.7346748749771974, 3.386180225106727e-015)
@@ -83,22 +82,22 @@ SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_5.startPoint(
 Extrusion_2.setNestedSketch(Sketch_2)
 
 Extrusion_3 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 0)
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_2"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"))
 SketchLine_9 = Sketch_3.addLine(36.86324678550901, 2.286454635368208e-015, 36.86324678550901, 10)
-SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_5 = Sketch_3.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"), False)
 SketchPoint_5 = SketchProjection_5.createdFeature()
 SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_9.startPoint(), SketchPoint_5.result())
-SketchProjection_6 = Sketch_3.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_6 = Sketch_3.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"), False)
 SketchPoint_6 = SketchProjection_6.createdFeature()
 SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_9.endPoint(), SketchPoint_6.result())
 SketchLine_10 = Sketch_3.addLine(36.86324678550901, 10, -3.136753214490995, 10)
 SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
-SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_7 = Sketch_3.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
 SketchPoint_7 = SketchProjection_7.createdFeature()
 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_10.endPoint(), SketchPoint_7.result())
 SketchLine_11 = Sketch_3.addLine(-3.136753214490995, 10, -3.136753214490995, 2.275957200481571e-015)
 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
-SketchProjection_8 = Sketch_3.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_8 = Sketch_3.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"), False)
 SketchPoint_8 = SketchProjection_8.createdFeature()
 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchPoint_8.result())
 SketchLine_12 = Sketch_3.addLine(-3.136753214490995, 2.275957200481571e-015, 36.86324678550902, 1.387778780781446e-015)
@@ -107,22 +106,22 @@ SketchConstraintCoincidence_20 = Sketch_3.setCoincident(SketchLine_9.startPoint(
 Extrusion_3.setNestedSketch(Sketch_3)
 
 Extrusion_4 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 0)
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"))
 SketchLine_13 = Sketch_4.addLine(22.60959895285982, 4.420942808558057e-016, 22.60959895285982, 10)
-SketchProjection_9 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_9 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]"), False)
 SketchPoint_9 = SketchProjection_9.createdFeature()
 SketchConstraintCoincidence_21 = Sketch_4.setCoincident(SketchLine_13.startPoint(), SketchPoint_9.result())
-SketchProjection_10 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_10 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), False)
 SketchPoint_10 = SketchProjection_10.createdFeature()
 SketchConstraintCoincidence_22 = Sketch_4.setCoincident(SketchLine_13.endPoint(), SketchPoint_10.result())
 SketchLine_14 = Sketch_4.addLine(22.60959895285982, 10, -7.390401047140179, 10)
 SketchConstraintCoincidence_23 = Sketch_4.setCoincident(SketchLine_13.endPoint(), SketchLine_14.startPoint())
-SketchProjection_11 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_11 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"), False)
 SketchPoint_11 = SketchProjection_11.createdFeature()
 SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchLine_14.endPoint(), SketchPoint_11.result())
 SketchLine_15 = Sketch_4.addLine(-7.390401047140179, 10, -7.390401047140179, 8.881784197001252e-016)
 SketchConstraintCoincidence_25 = Sketch_4.setCoincident(SketchLine_14.endPoint(), SketchLine_15.startPoint())
-SketchProjection_12 = Sketch_4.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_12 = Sketch_4.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"), False)
 SketchPoint_12 = SketchProjection_12.createdFeature()
 SketchConstraintCoincidence_26 = Sketch_4.setCoincident(SketchLine_15.endPoint(), SketchPoint_12.result())
 SketchLine_16 = Sketch_4.addLine(-7.390401047140179, 8.881784197001252e-016, 22.60959895285983, 0)
@@ -131,22 +130,22 @@ SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchLine_13.startPoint
 Extrusion_4.setNestedSketch(Sketch_4)
 
 Extrusion_5 = model.addExtrusion(Part_1_doc, [], model.selection(), 10, 0)
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"))
 SketchLine_17 = Sketch_5.addLine(-10.64977324988603, -1.185841873934692e-016, -10.64977324988603, -10)
-SketchProjection_13 = Sketch_5.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_13 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]"), False)
 SketchPoint_13 = SketchProjection_13.createdFeature()
 SketchConstraintCoincidence_29 = Sketch_5.setCoincident(SketchLine_17.startPoint(), SketchPoint_13.result())
-SketchProjection_14 = Sketch_5.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_14 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"), False)
 SketchPoint_14 = SketchProjection_14.createdFeature()
 SketchConstraintCoincidence_30 = Sketch_5.setCoincident(SketchLine_17.endPoint(), SketchPoint_14.result())
 SketchLine_18 = Sketch_5.addLine(-10.64977324988603, -10, 39.35022675011398, -10)
 SketchConstraintCoincidence_31 = Sketch_5.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
-SketchProjection_15 = Sketch_5.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_15 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"), False)
 SketchPoint_15 = SketchProjection_15.createdFeature()
 SketchConstraintCoincidence_32 = Sketch_5.setCoincident(SketchLine_18.endPoint(), SketchPoint_15.result())
 SketchLine_19 = Sketch_5.addLine(39.35022675011398, -10, 39.35022675011398, 4.440892098500626e-016)
 SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchLine_18.endPoint(), SketchLine_19.startPoint())
-SketchProjection_16 = Sketch_5.addProjection(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+SketchProjection_16 = Sketch_5.addProjection(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"), False)
 SketchPoint_16 = SketchProjection_16.createdFeature()
 SketchConstraintCoincidence_34 = Sketch_5.setCoincident(SketchLine_19.endPoint(), SketchPoint_16.result())
 SketchLine_20 = Sketch_5.addLine(39.35022675011398, 4.440892098500626e-016, -10.64977324988603, 0)
index a8b1f08b3a1ea82e8c37d56ee83d81b1c6a495fd..7adec2348f9ed51dc636a0a5b79e8b1f88c596aa 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestFillet.py
@@ -25,7 +24,6 @@
     SketchPlugin_Fillet
         static const std::string MY_CONSTRAINT_FILLET_ID("SketchFillet");
         data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttrList::typeId());
         data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefList::typeId());
         data()->addAttribute(SketchPlugin_Constraint::ENTITY_C(), ModelAPI_AttributeRefAttrList::typeId());
 
index 557b74daa5b9af69c92028b2fb4f4e0dd69cf239..f265d09ae460ac64cab5d530f97fa35d6bf30c91 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Crash when creating fillet in sketch started after a folder
@@ -48,7 +47,7 @@ SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "Size")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_2.result(), "Size")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), "Size", 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), "Size", 0)
 
 Folder_1 = model.addFolder(Part_1_doc, Sketch_1, Extrusion_1)
 model.do()
index e1957462290a817e3f397ad19476385531951d6e..85d58b9474c04aa47a4142ec1bfaf19c2cbd997e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestFilletInteracting.py
index dc9c84bf7843a211bfcee010c3ee52faf1d7f089..63bbbbaa658471519c07cc9108f02fbf75b011a9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestHighload.py
index b6ef8dc27ca89ee4f179c75e6aa33f37955e2bc8..ed445cc78b253c09eb25f1df418c38478833671d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestIntersectionChangeEdge.py
@@ -51,11 +50,11 @@ SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_2.center(), Ske
 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 60)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 40)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchArc_2_2f-SketchLine_1f-SketchLine_2r")], model.selection(), 50, 50)
-Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1")])
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), False)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchArc_2_2f-SketchLine_2r-SketchArc_1_2r")], model.selection(), 50, 50)
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/To_Face]")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/From_Face]"), False)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_1-SketchArc_2-SketchProjection_1-SketchPoint_1"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchArc_1"), False)
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchLine_3 = Sketch_2.addLine(-70, 60, 70, 60)
 SketchLine_4 = Sketch_2.addLine(70, 60, 70, -60)
@@ -74,19 +73,19 @@ SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2)
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_4.result(), 70, True)
 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_6.result(), 70, True)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r")])
 Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("FACE", "Filling_1_1"), model.selection("FACE", "Face_1_1")])
 
 # set different edges used for intersection and check reference data: number of intersection points and their coordinates
-REF_DATA = [("Sketch_1/Edge-SketchArc_1_2", 1, [[30, 0]]),
-            ("Sketch_1/Edge-SketchLine_2", 1, [[-36.024358588836, 0]]),
-            ("Sketch_1/Edge-SketchArc_2_2", 2, [[60, 0], [-60, 0]]),
-            ("Sketch_1/Edge-SketchLine_1", 0, []),
-            ("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1", 1, [[30, 50]]),
-            ("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1", 1, [[-36.024358588836, 50]]),
-            ("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1", 2, [[60, 50], [-60, 50]]),
-            ("Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1", 0, []),
-            ("Intersection_1_1", 2, [[-0.0515933488223, -11.6181750315], [41.6438615258, -11.6181750315]])]
+REF_DATA = [("Sketch_1/SketchArc_1_2", 1, [[30, 0]]),
+            ("Sketch_1/SketchLine_2", 1, [[-36.024358588836, 0]]),
+            ("Sketch_1/SketchArc_2_2", 2, [[60, 0], [-60, 0]]),
+            ("Sketch_1/SketchLine_1", 0, []),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face]", 1, [[30, 50]]),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]", 1, [[-36.024358588836, 50]]),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/To_Face]", 2, [[60, 50], [-60, 50]]),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]", 0, []),
+            ("Intersection_1_1", 2, [[41.6438615258, -11.6181750315], [-0.0515933488223, -11.6181750315]])]
 TOLERANCE = 1.e-7
 
 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
index 47237e813efcc58ca049df377190d3b244541223..6af5e7e27c06251aafa77b350c8ebe541dac2b7c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestIntersectionWithCircle.py
@@ -56,10 +55,10 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 50)
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 10)
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchArc_1.center(), SketchLine_2.result(), 19, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchArc_1_2r")], model.selection(), 10, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), "D", True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchArc_1_2r")], model.selection(), 10, 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), "D", True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), True)
+SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face]"), True)
 SketchIntersectionPoint_1.result().setName("SketchIntersectionPoint_1")
 [SketchPoint_2, SketchPoint_3] = SketchIntersectionPoint_1.intersectionPoints()
 SketchCircle_1 = Sketch_2.addCircle(38.14142842854285, 10, 1)
@@ -83,7 +82,7 @@ SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchArc_2.endPoint(),
 SketchConstraintDistanceVertical_2 = Sketch_2.setVerticalDistance(SketchAPI_Point(SketchPoint_3).coordinates(), SketchArc_2.startPoint(), 5)
 SketchConstraintTangent_1 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_6.result())
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchArc_2_2f")], model.selection("EDGE", "Sketch_2/Edge-SketchLine_5"), 360, 0, [model.selection("SOLID", "Extrusion_1_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_6r-SketchArc_2_2f-SketchLine_5r")], model.selection("EDGE", "Sketch_2/SketchLine_5"), 360, 0, [model.selection("SOLID", "Extrusion_1_1")])
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_1_2f")], model.selection(), 5, 5, [model.selection("SOLID", "RevolutionCut_1_1")])
 model.do()
 
index a6b163ca27158b2c99eb24e46481286d03fce789..fe725790f3c126ac91a4e0b13f3fe8ee3e72aa3c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestIntersectionWithLine.py
@@ -67,10 +66,10 @@ SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_2.result(), 10)
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_1.startPoint(), SketchLine_4.startPoint(), "D")
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_1.endPoint(), SketchLine_7.startPoint(), 40, True)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 0)
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 5, 5, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_5"))
-SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"))
+SketchIntersectionPoint_1 = Sketch_2.addIntersectionPoint(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/To_Face]"), False)
 [SketchPoint_2] = SketchIntersectionPoint_1.intersectionPoints()
 SketchCircle_1 = Sketch_2.addCircle(40, 10, 5)
 SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchAPI_Point(SketchPoint_2).coordinates(), SketchCircle_1.center())
index a3f39656611fda9bfcfc348ce20b15ed63e9aa6d..bea00bb5a8dd7c84e870649b7b394f8f9974fef9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestIntersectionWithSpline.py
@@ -50,9 +49,9 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 65)
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchArc_1.center(), SketchAPI_Line(SketchLine_3).startPoint(), 20)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_1.result(), 55)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_1f-SketchLine_2f")], model.selection(), 25, 25)
-Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1")])
-Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_1f-SketchLine_2f")])
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_1f-SketchLine_2f")], model.selection(), 25, 25)
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face]")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2r-SketchLine_1f-SketchLine_2f")])
 Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("FACE", "Filling_1_1"), model.selection("FACE", "Face_1_1")])
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_4 = Sketch_2.addLine(-34.11217447219568, 40, 20, -37.28019411294778)
@@ -70,9 +69,9 @@ SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1)
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_4.result(), "D", True)
 SketchConstraintAngle_1 = Sketch_2.setAngle(SketchLine_5.result(), SketchLine_4.result(), 35)
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), 10, 10)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_4r-SketchLine_5f-SketchLine_6f")], model.selection(), 10, 10)
 ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [], model.selection(), 10, 0, [model.selection("SOLID", "Extrusion_2_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/Generated_Face_3"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_4"))
 SketchIntersectionPoint_1 = Sketch_3.addIntersectionPoint(model.selection("EDGE", "Intersection_1_1"), False)
 [SketchPoint_2, SketchPoint_3] = SketchIntersectionPoint_1.intersectionPoints()
 SketchCircle_1 = Sketch_3.addCircle(-33.22640570408476, 0, 5)
@@ -115,12 +114,12 @@ model.do();
 assert(SketchIntersectionPoint_1.feature().results().size() == 1)
 
 model.testNbResults(ExtrusionFuse_1, 1)
-model.testNbSubResults(ExtrusionFuse_1, [1])
+model.testNbSubResults(ExtrusionFuse_1, [0])
 model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.SOLID, [1])
-model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.FACE, [11])
-model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.EDGE, [42])
-model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.VERTEX, [84])
-model.testResultsVolumes(ExtrusionFuse_1, [89224.362837261898675933480262756])
+model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.FACE, [9])
+model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.EDGE, [30])
+model.testNbSubShapes(ExtrusionFuse_1, GeomAPI_Shape.VERTEX, [60])
+model.testResultsVolumes(ExtrusionFuse_1, [89638.890852351003559306263923645])
 
 # change parameter and check intersection is NOT valid now
 ParamD.setValue(50)
index 73d51f1e0fdc73c0b05b39527f4d43b763962ad7..7705a166726ca92b0505019394c76f663647257e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestConstraintMirror.py
index fab42aa61a3a5418f48f362e3c331e3f20f14031..621538e032c14eb5c0e445c6366f749156f0222d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test movement of the sketch arc of circle
index 61db0c56c338a6755bc6214b4e34cbea20ff2982..e777bf30d302f85464d53e480b58ab65ab21e8df 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test movement of the sketch circle
index d893559f17f0d1fddc5424ef11f7b412f8f6b3d0..77011d0846320ef8d0a89602dda9d06fe8c8609d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test movement of the sketch line
index 5616bd91177b2f02315ef00ae26bd3d48aeae6aa..5dab6a8d33690af5910a1f32907c92624770afc3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test movement of the sketch point
index 228f50427183247bc3af5d276d732706eeb46633..9b40f1c3ae3294438a4935a9b446223949147a90 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Test moving the entities in the complex sketch by the example of a clamp
@@ -202,7 +201,7 @@ for i in range(1, 10):
 assert(model.dof(Sketch_1) == 0)
 
 # Extrude main part of clamp
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchArc_1_2f-SketchCircle_1_2r")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_5r-SketchArc_1_2f-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r-SketchCircle_1_2r")], model.selection(), 10, 0)
 model.do()
 
 
@@ -210,7 +209,7 @@ model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchRectangle_1 = Sketch_2.addRectangle(20, 0, 100, 50)
 [SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchRectangle_1.lines()
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_10 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_7).startPoint(), SketchAPI_Line(SketchLine_10).startPoint())
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_8.result(), SketchLine_10.result())
@@ -337,12 +336,12 @@ SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_2.results()[1], 6.5)
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchCircle_2.center(), SketchLine_8.result(), 30)
 model.do()
 
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchCircle_2_2r-SketchArc_2_2r-SketchLine_13r-SketchLine_14f-SketchLine_15f-SketchArc_3_2r-SketchLine_16r")], model.selection(), -165, 155)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_14f-SketchLine_16r-SketchArc_3_2r-SketchLine_15f-SketchLine_13r-SketchArc_2_2r-SketchCircle_2_2r")], model.selection(), -165, 155)
 Boolean_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
 
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Fuse_1_1/Modified_Face_2"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "(Fuse_1_1/Modified_Face&Extrusion_1_1/To_Face)(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2)(Fuse_1_1/Modified_Face&Sketch_2/SketchLine_7&Sketch_1/SketchLine_5)"))
 SketchLine_17 = Sketch_3.addLine(145, 0, 165, 0)
-SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "Fuse_1_1/Modified_Face_divided_6_1&Fuse_1_1/Modified_Face_3&Fuse_1_1/Modified_Face_divided_5_1"))
+SketchProjection_2 = Sketch_3.addProjection(model.selection("VERTEX", "[Fuse_1_1/Modified_Face&Sketch_2/SketchLine_6&Extrusion_1_1/From_Face][Fuse_1_1/Modified_Face&Extrusion_2_1/To_Face&Sketch_1/SketchLine_1][Fuse_1_1/Modified_Face&Sketch_2/SketchLine_7&Sketch_1/SketchLine_5]"))
 SketchPoint_2 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_17.endPoint(), SketchAPI_Point(SketchPoint_2).result())
 SketchLine_18 = Sketch_3.addLine(165, 0, 165, -20)
@@ -365,12 +364,12 @@ SketchArc_5 = Sketch_3.addArc(145, -20, 155, -20, 145, -10, False)
 SketchConstraintCoincidence_31 = Sketch_3.setCoincident(SketchLine_19.endPoint(), SketchArc_5.center())
 SketchConstraintCoincidence_32 = Sketch_3.setCoincident(SketchLine_20.result(), SketchArc_5.endPoint())
 SketchConstraintCoincidence_33 = Sketch_3.setCoincident(SketchArc_5.startPoint(), SketchLine_19.result())
-SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "Fuse_1_1/Modified_Face_4&Fuse_1_1/Modified_Face_divided_2_1"))
+SketchLine_21 = Sketch_3.addLine(model.selection("EDGE", "[Fuse_1_1/Modified_Face&Extrusion_2_1/From_Face][(Fuse_1_1/Modified_Face&Extrusion_2_1/From_Face)(Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_8)(Fuse_1_1/Modified_Face&Sketch_2/SketchLine_7&Sketch_1/SketchLine_5)]"))
 SketchConstraintTangent_5 = Sketch_3.setTangent(SketchArc_5.results()[1], SketchLine_21.result())
 model.do()
 
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_17r-SketchLine_18r-SketchArc_4_2r")], model.selection(), model.selection("FACE", "Fuse_1_1/Modified_Face_divided_1_1"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")])
-ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_19r-SketchLine_20r-SketchArc_4_2f-SketchArc_5_2r")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchArc_4_2r-SketchLine_18r-SketchLine_17r")], model.selection(), model.selection("FACE", "Fuse_1_1/Modified_Face&Sketch_2/SketchLine_9&Sketch_1/SketchLine_2"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")])
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchArc_4_2f-SketchLine_20r-SketchArc_5_2r-SketchLine_19r")], model.selection(), model.selection("FACE", "(Fuse_1_1/Modified_Face&Extrusion_2_1/From_Face)(ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchLine_9&Sketch_1/SketchLine_2)(ExtrusionCut_1_1/Generated_Face&Sketch_3/SketchArc_4_2)(ExtrusionCut_1_1/Modified_Face&Extrusion_2_1/To_Face)(Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_8)"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
 model.do()
 
 model.end()
index 86f3a0f770cf61c17d9ba9c769cb9acfd2c5cb78..39c75a995e4833b1a6b68631a5dbe65a033fdfc1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestMultiRotation.py
index 4577e1bb9432854bc3fd77f5bc8a953f34bf8bcb..49b8bc8b1b29687b769867897e6cc125ed66c496 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
index 6a872a47869155351e92b009e697f04a49686fda..51b2a8a23b4f660511b44e7a6804a35ce0e13817 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
index a3d02b630360d549f5e6617fea0456f157e737e9..14708f6630994b28f4261ee4f86227be71204749 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeTools
 from SketchAPI import *
index 1feca4578b97ae02764c236b8b2f3739db58d0b7..be20799abebf82b16d3af1331c219581374639f7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeTools
 from SketchAPI import *
index a811f646fccde22a948c4a0a4f9deb83bc1236d1..9b94410834c29fc10231d78ec84990016d8e0320 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeTools
 from SketchAPI import *
index d69ce986b282e9ba8f8076acc38cb14766747966..5dca9653f259a626a7db445f0d5227bd96a70e54 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from GeomAlgoAPI import GeomAlgoAPI_ShapeTools
@@ -47,7 +46,7 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_1.createdFeature()
 model.do()
 SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_2.result()], SketchAPI_Point(SketchPoint_1).coordinates(), "360/N", "N")
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 10, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 10, 0)
 model.do()
 
 # change parameters
index 25c4e58accb01b17efb606219150e4cd0c30d9ec..c3258e17e435d133ed1b8b6e57d3e91ae9c558f5 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestMultiTranslation.py
diff --git a/src/SketchPlugin/Test/TestPresentation.py b/src/SketchPlugin/Test/TestPresentation.py
new file mode 100644 (file)
index 0000000..0265fd4
--- /dev/null
@@ -0,0 +1,129 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    TestPresentation.py
+    Test AIS presentations for constraints and macro-features
+"""
+
+from salome.shaper import model
+from GeomAPI import *
+from ModelAPI import *
+from GeomDataAPI import *
+
+from ConfigAPI import *
+Config_PropManager().registerProp("Visualization", "dimension_value_size", "Dimension value size", Config_Prop.IntSpin, "16")
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-1.492165138365909, 9.860293583877349, 21.86930170264727, 26.80555863006795)
+SketchLine_2 = Sketch_1.addLine(21.86930170264727, 26.80555863006795, 23.42558840321396, 11.88651135131589)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_1.result(), SketchLine_2.result(), 60)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_2.endPoint(), 25, True)
+SketchLine_3 = Sketch_1.addLine(23.50783486163409, 27.99407041552052, 34.45590553653152, 35.9352652297464)
+SketchConstraintCollinear_1 = Sketch_1.setCollinear(SketchLine_1.result(), SketchLine_3.result())
+SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_1.startPoint(), SketchLine_3.startPoint(), 25)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 15)
+SketchLine_4 = Sketch_1.addLine(53.74716193144771, -7.706985565972583, 35.95905823005196, -7.706985565972583)
+SketchLine_5 = Sketch_1.addLine(35.95905823005196, -7.706985565972583, 35.95905823005196, 16.71916358123427)
+SketchLine_6 = Sketch_1.addLine(35.95905823005196, 16.71916358123427, 53.74716193144771, 16.71916358123427)
+SketchLine_7 = Sketch_1.addLine(53.74716193144771, 16.71916358123427, 53.74716193144771, -7.706985565972583)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_7.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_5.result())
+SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_5.result(), SketchLine_7.result())
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_6.result(), SketchLine_7.result())
+SketchCircle_1 = Sketch_1.addCircle(20.43340729011699, -17.26699099051272, 10)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 10)
+SketchConstraintRigid_1 = Sketch_1.setFixed(SketchCircle_1.center())
+SketchArc_1 = Sketch_1.addArc(44.85311008074984, -7.706985565972585, 49.46781809225963, -16.57853954306742, 34.85430557643821, -7.861609252895618, False)
+SketchConstraintEqual_1 = Sketch_1.setEqual(SketchCircle_1.results()[1], SketchArc_1.results()[1])
+SketchConstraintMiddle_1 = Sketch_1.setMiddlePoint(SketchArc_1.center(), SketchLine_4.result())
+SketchLine_8 = Sketch_1.addLine(49.46781809225963, -16.57853954306742, 32.21747944141746, -25.55163221418553)
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_8.startPoint())
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_8.result())
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_1.result(), [SketchLine_2.result()])
+SketchMultiTranslation_1 = Sketch_1.addTranslation([SketchLine_2.result()], SketchLine_3.startPoint(), SketchLine_3.endPoint(), 3, True)
+SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_3.result()], SketchLine_3.endPoint(), 360, 4, True)
+model.do()
+
+assert(featureToPresentation(SketchConstraintAngle_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintCoincidence_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintCollinear_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintDistance_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintDistanceHorizontal_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintEqual_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintHorizontal_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintLength_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintMiddle_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintParallel_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintPerpendicular_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintRadius_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintRigid_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintTangent_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintVertical_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchConstraintMirror_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchMultiTranslation_1.feature()).getAISObject(None) is not None)
+assert(featureToPresentation(SketchMultiRotation_1.feature()).getAISObject(None) is not None)
+
+# Test presentation for Fillet on low-level
+aSession = ModelAPI_Session.get()
+aSketchFeature = featureToCompositeFeature(Sketch_1.feature())
+aSession.startOperation()
+aFillet = aSketchFeature.addFeature("SketchFillet")
+aFillet.refattr("fillet_point").setAttr(SketchLine_1.endPoint());
+assert(featureToPresentation(aFillet).getAISObject(None) is not None)
+aSession.finishOperation()
+
+# Test presentation for MacroCircle on low-level
+aSession.startOperation()
+aCircle = aSketchFeature.addFeature("SketchMacroCircle")
+aCirclePnt1 = geomDataAPI_Point2D(aCircle.attribute("first_point"))
+aCirclePnt2 = geomDataAPI_Point2D(aCircle.attribute("second_point"))
+aCirclePnt3 = geomDataAPI_Point2D(aCircle.attribute("third_point"))
+aCircleType = aCircle.string("circle_type")
+aCircleType.setValue("circle_type_by_three_points")
+aCirclePnt1.setValue(10, 0)
+aCirclePnt2.setValue(-10, 0)
+aCirclePnt3.setValue(0, 10)
+assert(featureToPresentation(aCircle).getAISObject(None) is not None)
+aSession.finishOperation()
+
+# Test presentation for MacroArc on low-level
+aSession.startOperation()
+anArc = aSketchFeature.addFeature("SketchMacroArc")
+anArcPnt1 = geomDataAPI_Point2D(anArc.attribute("start_point_2"))
+anArcPnt2 = geomDataAPI_Point2D(anArc.attribute("end_point_2"))
+anArcPnt3 = geomDataAPI_Point2D(anArc.attribute("passed_point"))
+anArcType = anArc.string("arc_type")
+anArcType.setValue("by_three_points")
+anArcPnt1.setValue(5, 0)
+anArcPnt2.setValue(-5, 0)
+anArcPnt3.setValue(0, 5)
+assert(featureToPresentation(anArc).getAISObject(None) is not None)
+aSession.finishOperation()
+
+model.end()
index 7e24e3ed5b3916a2794bcabc919992dafb416b42..5a67c4c549e508d62ec1f06d78201a52084ca8c8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestProjection.py
@@ -94,17 +93,17 @@ aSession.finishOperation()
 #=========================================================================
 aSession.startOperation()
 aLineProjector = aSketchFeature.addFeature("SketchProjection")
-aLineProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchLine_1")
+aLineProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/SketchLine_1")
 aLineProjector.boolean("IncludeToResult").setValue(False)
 aLineProjector.execute()
 
 aCircleProjector = aSketchFeature.addFeature("SketchProjection")
-aCircleProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchCircle_1_2")
+aCircleProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/SketchCircle_1_2")
 aCircleProjector.boolean("IncludeToResult").setValue(False)
 aCircleProjector.execute()
 
 anArcProjector = aSketchFeature.addFeature("SketchProjection")
-anArcProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchArc_1_2")
+anArcProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/SketchArc_1_2")
 anArcProjector.boolean("IncludeToResult").setValue(False)
 anArcProjector.execute()
 aSession.finishOperation()
index adfd8ebcc316eeaec98e351e605599b44e3e00ae..0ad4fb507f3d1e2f19c234431b54c544031a7fb6 100644 (file)
@@ -1,3 +1,27 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+"""
+    TestProjectionIntoResult.py
+    Unit test of SketchPlugin_Projection class
+"""
+
 from salome.shaper import model
 from GeomAPI import *
 
@@ -66,75 +90,75 @@ SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(),
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_2.startPoint(), SketchLine_7.endPoint())
 SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_7.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_2r-SketchLine_5r-SketchLine_6r-SketchLine_7r")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_2r")], model.selection(), 100, 0)
 model.do()
 
 #==============================================================================
 # Tests
 #==============================================================================
 
-aProjectedList = [("EDGE", "Sketch_1/Edge-SketchCircle_1_2"),
-                  ("EDGE", "Sketch_1/Edge-SketchArc_1_2"),
-                  ("EDGE", "Sketch_1/Edge-SketchLine_1"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchPoint_1"),
+aProjectedList = [("EDGE", "Sketch_1/SketchCircle_1_2"),
+                  ("EDGE", "Sketch_1/SketchArc_1_2"),
+                  ("EDGE", "Sketch_1/SketchLine_1"),
+                  ("VERTEX", "Sketch_1/SketchPoint_1"),
                   #
-                  ("VERTEX", "Sketch_1/Vertex-SketchCircle_1"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchLine_1e"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchLine_1s"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchArc_1_2s"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchArc_1_2e"),
-                  ("VERTEX", "Sketch_1/Vertex-SketchArc_1"),
+                  ("VERTEX", "Sketch_1/SketchCircle_1_2__cc"),
+                  ("VERTEX", "Sketch_1/SketchLine_1_EndVertex"),
+                  ("VERTEX", "Sketch_1/SketchLine_1_StartVertex"),
+                  ("VERTEX", "Sketch_1/SketchArc_1_2_StartVertex"),
+                  ("VERTEX", "Sketch_1/SketchArc_1_2_EndVertex"),
+                  ("VERTEX", "Sketch_1/SketchArc_1"),
                   #
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"),
-                  ("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/From_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/From_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/From_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/From_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/To_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/To_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/To_Face]"),
+                  ("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/To_Face]"),
                   #
-                  ("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/From_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/From_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/From_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/From_Face]"),
                   #
-                  ("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_3"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/Generated_Face_2"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6]"),
                   #
-                  ("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"),
-                  ("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1")
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5][Extrusion_1_1/To_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2][Extrusion_1_1/To_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_1_1/To_Face]"),
+                  ("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_1_1/To_Face]")
                   ]
 
 # Test projection to the same plane
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_2"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_5"))
 aFailedIDs = set([21, 29])
 testProjections(Part_1_doc, Sketch_3, aProjectedList, aFailedIDs)
 
 # Test projection to parallel plane
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_7"))
 testProjections(Part_1_doc, Sketch_4, aProjectedList, aFailedIDs)
 
 # Test projection to lower base of the prism
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
 aFailedIDs = set([0, 1, 22, 23, 24, 25])
 testProjections(Part_1_doc, Sketch_5, aProjectedList, aFailedIDs)
 
 # Test projection to upper base of the prism
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 testProjections(Part_1_doc, Sketch_6, aProjectedList, aFailedIDs)
 
 # Test projection to orthogonal side face of the prism
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_6"))
 aFailedIDs = set([0, 1, 18, 20, 26, 28])
 testProjections(Part_1_doc, Sketch_7, aProjectedList, aFailedIDs)
 
 # Test projection to slope side face of the prism
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"))
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2"))
 aFailedIDs = set([0, 1])
 testProjections(Part_1_doc, Sketch_8, aProjectedList, aFailedIDs)
 
index e3312d02e1ae274fdf948891aac30c866c1f55ae..f716f5b01476b3c4251244480518392ce8bc5d08 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     Check that there is no crash while changing the projecting feature
@@ -32,11 +31,15 @@ SketchLine_1 = Sketch_1.addLine(20, -50, 70, 50)
 model.do()
 
 Sketch_2 = model.addSketch(partSet, model.defaultPlane("YOZ"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s"), True)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), True)
 model.do()
 
 # change the feature projected (no crash expected)
-SketchProjection_1.setExternalFeature(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchProjection_1.setExternalFeature(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 model.do()
 
 model.end()
+
+from GeomAPI import GeomAPI_Shape
+
+model.testNbSubShapes(Sketch_2, GeomAPI_Shape.EDGE, [1])
index cbb9b3cc7d02bad28ceddec7d1334d39f3a8f606..dbd36b133877562b7eb526d08a0f067e2c63d0f8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestRectangle.py
index 4faa1e53f0d3783b0a6974ed9d132d9710e9a462..96375a59a6d3059ef02c4994d1b6e8c727c26e4c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestRemoveSketch.py
index 5339a7aa650eabf72801c3737eaa1d2db2848271..f5db7135fba19fb5dbf34e070e748b2ece622fce 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from salome.shaper import model
 import math
 
@@ -75,7 +93,7 @@ SketchConstraintDistance_8 = Sketch_1.setDistance(SketchPoint_1.coordinates(), S
 SketchConstraintDistance_9 = Sketch_1.setDistance(SketchPoint_2.coordinates(), SketchPoint_1.coordinates(), 50, True)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "length/8")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchArc_1_2r-SketchArc_2_2r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchArc_3_2f")], model.selection(), 500, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchArc_3_2f-SketchLine_3r-SketchLine_2r-SketchArc_2_2r")], model.selection(), 500, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")], model.selection(), 500, -400)
 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")], model.selection(), 100, 0)
 model.do()
index d2bca85b4fc41e6c4374acb77eb3d06d37c11b03..cd381895dc97a450e4f967a87b01bcf6233da83c 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from salome.shaper import model
 import math
 
@@ -75,7 +93,7 @@ SketchConstraintDistance_8 = Sketch_1.setDistance(SketchPoint_1.coordinates(), S
 SketchConstraintDistance_9 = Sketch_1.setDistance(SketchPoint_2.coordinates(), SketchPoint_1.coordinates(), 50, True)
 SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), "length/8")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchArc_1_2r-SketchArc_2_2r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchLine_9r-SketchArc_3_2f")], model.selection(), 500, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2r-SketchLine_9r-SketchLine_8r-SketchLine_7r-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchArc_3_2f-SketchLine_3r-SketchLine_2r-SketchArc_2_2r")], model.selection(), 500, 0)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")], model.selection(), 500, -400)
 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f")], model.selection(), 100, 0)
 model.do()
diff --git a/src/SketchPlugin/Test/TestSketchDrawer.py b/src/SketchPlugin/Test/TestSketchDrawer.py
new file mode 100644 (file)
index 0000000..00d1903
--- /dev/null
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from SketchAPI import *
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-14.48008258397498, -13.79591274114419, 5.519917416025022, -13.79591274114419)
+SketchLine_2 = Sketch_1.addLine(10.51991741602502, -8.795912741144186, 10.51991741602502, 18.20408725885581)
+SketchLine_3 = Sketch_1.addLine(10.51991741602502, 18.20408725885581, -14.48008258397498, 13.79591274114419)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_1.setName("SketchConstraintCoincidence_2")
+SketchLine_4 = Sketch_1.addLine(-14.48008258397498, 13.79591274114419, -14.48008258397498, -13.79591274114419)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_2.setName("SketchConstraintCoincidence_3")
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_4.endPoint())
+SketchConstraintCoincidence_3.setName("SketchConstraintCoincidence_4")
+SketchArc_1 = Sketch_1.addArc(5.519917416025022, -8.795912741144186, 5.519917416025022, -13.79591274114419, 10.51991741602502, -8.795912741144186, False)
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_1.endPoint())
+SketchConstraintCoincidence_4.setName("SketchConstraintCoincidence_5")
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_6")
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_1.result())
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_2.result())
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 5)
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_4.result(), SketchLine_3.result(), 100)
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_2.result(), 27)
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_1.startPoint(), SketchLine_2.result(), 25, True)
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 5)
+SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result())
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), 20, True)
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchLine_4.endPoint(), SketchCircle_1.center(), 20, True)
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchAPI_Point(SketchPoint_1).coordinates(), SketchCircle_1.center())
+SketchConstraintCoincidence_6.setName("SketchConstraintCoincidence_7")
+SketchConstraintRadius_2 = Sketch_1.setRadius(SketchCircle_1.results()[1], 5)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchCircle_1_2r")], model.selection(), 10, 0)
+model.do()
+# create a drawer feature of the extrusion and upper face, without dimensions
+Drawer1 = Part_1_doc.addFeature("SketchDrawer")
+Drawer1.selection("base_shape").setValue(Extrusion_1.feature(), None)
+Drawer1.boolean("add_dimensions").setValue(False)
+PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face")
+PlaneSelection.fillAttribute(Drawer1.selection("plane"))
+model.do()
+# create a drawer feature of the extrusion and upper face, with dimensions
+Drawer2 = Part_1_doc.addFeature("SketchDrawer")
+Drawer2.selection("base_shape").setValue(Extrusion_1.feature(), None)
+Drawer2.boolean("add_dimensions").setValue(True)
+PlaneSelection = model.selection("FACE", "Extrusion_1_1/To_Face")
+PlaneSelection.fillAttribute(Drawer2.selection("plane"))
+model.end()
+
+# check that a sketch is created with valid elements
+assert(Part_1_doc.size("Construction") == 3) # three sketches: base of extrusion and drawer's two
+
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+
+Sketch1 = objectToFeature(Part_1_doc.object("Features", 2)) # the first created sketch feature
+assert(aFactory.validate(Sketch1))
+assert(len(Sketch1.results()) == 1)
+
+Sketch2 = objectToFeature(Part_1_doc.object("Features", 3)) # the second created sketch feature
+assert(aFactory.validate(Sketch2))
+assert(len(Sketch2.results()) == 1)
index df9bc37e6300a9622a1a0c078fadab48966dc564..99db02246d764af75b6deb2dba8d8859c4475217 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #=========================================================================
 # Initialization of the test
index ebdcd2b11c67fcc0344da6ac7f053669aa4f8152..26ac4ab0a2e179947aac91b847d76245ab3c4332 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
     TestSnowflake.py
index 2adf4ddc58a49f1bad3fa156d4af20a17dcf25de..73cf81ac8b2511156064b403bac1bfaa8a518806 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
diff --git a/src/SketchPlugin/Test/TestSplitLine.py b/src/SketchPlugin/Test/TestSplitLine.py
new file mode 100644 (file)
index 0000000..034c58f
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from SketchAPI import *
+
+from salome.shaper import model
+from salome.shaper import geom
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-38.2842712474619, 18.28427124746191, -10, -10)
+SketchLine_2 = Sketch_1.addLine(-10, -10, -10, 20)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-10, 20, -25, 5)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 40)
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_2.result(), [SketchLine_1.result(), SketchLine_3.result()])
+[SketchLine_4, SketchLine_5] = SketchConstraintMirror_1.mirrored()
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchLine", 5)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 3)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintLength", 1)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintMirror", 1)
+
+#perform split
+SketchSplit = Sketch_1.addSplit(SketchLine_1, geom.Pnt2d(-12, -8))
+SketchSplit.execute()
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchLine", 6)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 5)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintLength", 1)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintMirror", 0)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/SketchPlugin/Test/TestSplitPreview.py b/src/SketchPlugin/Test/TestSplitPreview.py
new file mode 100644 (file)
index 0000000..f76b99e
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+from ModelAPI import *
+from GeomDataAPI import *
+
+from ConfigAPI import *
+Config_PropManager().registerProp("Visualization", "operation_remove_feature_color", "Color of removed feature in operation", Config_Prop.Color, "255, 174, 201")
+
+# base sketch
+model.begin()
+partSet = model.moduleDocument()
+Part = model.addPart(partSet)
+Part_doc = Part.document()
+Sketch = model.addSketch(Part_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch.addLine(0, 20, 100, 20)
+SketchLine_2 = Sketch.addLine(20, 0, 20, 40)
+SketchLine_3 = Sketch.addLine(80, 0, 80, 40)
+SketchCircle_1 = Sketch.addCircle(50, 50, 50)
+SketchPoint_1 = Sketch.addPoint(20, 20)
+SketchConstraintCoincidence_1 = Sketch.setCoincident(SketchPoint_1.coordinates(), SketchLine_2.result())
+SketchConstraintCoincidence_2 = Sketch.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result())
+SketchPoint_2 = Sketch.addPoint(80, 20)
+SketchConstraintCoincidence_3 = Sketch.setCoincident(SketchPoint_2.coordinates(), SketchLine_1.result())
+SketchConstraintCoincidence_4 = Sketch.setCoincident(SketchPoint_2.coordinates(), SketchLine_3.result())
+SketchPoint_3 = Sketch.addPoint(20, 10)
+SketchConstraintCoincidence_5 = Sketch.setCoincident(SketchPoint_3.coordinates(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_6 = Sketch.setCoincident(SketchPoint_3.coordinates(), SketchLine_2.result())
+SketchPoint_4 = Sketch.addPoint(80, 10)
+SketchConstraintCoincidence_7 = Sketch.setCoincident(SketchPoint_4.coordinates(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_8 = Sketch.setCoincident(SketchPoint_4.coordinates(), SketchLine_3.result())
+model.do()
+model.end()
+
+aSession = ModelAPI_Session.get()
+aSketchFeature = featureToCompositeFeature(Sketch.feature())
+
+# Create Split feature for a line
+aSession.startOperation()
+aSplit = aSketchFeature.addFeature("SketchSplit")
+aSelectedObj = aSplit.reference("SelectedObject")
+aSelectedObj.setValue(SketchLine_1.feature())
+aSelectedPoint = geomDataAPI_Point2D(aSplit.attribute("SelectedPoint"))
+aSelectedPoint.setValue(50, 20)
+aPreviewObj = aSplit.reference("PreviewObject")
+aPreviewObj.setValue(SketchLine_1.feature())
+aPreviewPoint = geomDataAPI_Point2D(aSplit.attribute("PreviewPoint"))
+aPreviewPoint.setValue(aSelectedPoint.pnt())
+assert(featureToPresentation(aSplit).getAISObject(None) is not None)
+aSession.finishOperation()
+
+model.testNbSubFeatures(Sketch, "SketchArc", 0)
+model.testNbSubFeatures(Sketch, "SketchCircle", 1)
+model.testNbSubFeatures(Sketch, "SketchLine", 5)
+model.testNbSubFeatures(Sketch, "SketchConstraintCoincidence", 12)
+
+# Create Split feature for a circle to perform its substitution by an arc
+aSession.startOperation()
+aSplit = aSketchFeature.addFeature("SketchSplit")
+aSelectedObj = aSplit.reference("SelectedObject")
+aSelectedObj.setValue(SketchCircle_1.feature())
+aSelectedPoint = geomDataAPI_Point2D(aSplit.attribute("SelectedPoint"))
+aSelectedPoint.setValue(50, 0)
+aPreviewObj = aSplit.reference("PreviewObject")
+aPreviewObj.setValue(SketchCircle_1.feature())
+aPreviewPoint = geomDataAPI_Point2D(aSplit.attribute("PreviewPoint"))
+aPreviewPoint.setValue(aSelectedPoint.pnt())
+assert(featureToPresentation(aSplit).getAISObject(None) is not None)
+aSession.finishOperation()
+
+model.testNbSubFeatures(Sketch, "SketchArc", 2)
+model.testNbSubFeatures(Sketch, "SketchCircle", 0)
+model.testNbSubFeatures(Sketch, "SketchLine", 5)
+model.testNbSubFeatures(Sketch, "SketchConstraintCoincidence", 16)
index 53898b39e925fa5c311e5393bca1cd844e965dc0..0da930d7cd83ce1996e7d24a1176d5832f7b8b7f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 9e30259beab9c657fd8015512e48b27606a2004e..dd54091da0e54644b9f1ea92288182738f41ec92 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 8073f4c97b9e1ef8b8ad0006e7f8de3e9a59e4d7..bc6fbae65853827ec85221ffda63ff8fd156a255 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 80679172dd005620d0f649056bd1d9dac880ea49..e5ecd00d579ef54db2165184b82e51bde43ca766 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 30ffb7d9e1d6c4ef4dcb04e5c6e7ca9f3ed1d72c..9ad0d32c4f688994746754921fc8fe1855f488dc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 1f73afb2b272ef39e2cacc5bb5a07e6d9d14e6cb..b5ef7993b7a5ad17e0969fb1791d628900cf9357 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index f20f22a389aeb24e597982b4e82164bb91770098..6398fac818f32dadc55f18abb23d855c75ef8d09 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
diff --git a/src/SketchPlugin/Test/TestTrimArc08.py b/src/SketchPlugin/Test/TestTrimArc08.py
new file mode 100644 (file)
index 0000000..922ef1f
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+from salome.shaper import geom
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(12, -8, -12, -8)
+SketchLine_2 = Sketch_1.addLine(-12, -8, -12, 20)
+SketchLine_3 = Sketch_1.addLine(-12, 20, 12, 20)
+SketchLine_4 = Sketch_1.addLine(12, 20, 12, -8)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchArc_1 = Sketch_1.addArc(0, -3, 20, -3, -20, -3, False)
+SketchLine_5 = Sketch_1.addLine(20, -3, 20, -30)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_5.startPoint())
+SketchLine_6 = Sketch_1.addLine(20, 17, 50, 17)
+SketchConstraintTangent_1 = Sketch_1.setTangent(SketchLine_5.result(), SketchArc_1.results()[1])
+SketchConstraintTangent_2 = Sketch_1.setTangent(SketchLine_6.result(), SketchArc_1.results()[1])
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchArc", 1)
+model.testNbSubFeatures(Sketch_1, "SketchLine", 6)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 5)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 2)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintEqual", 0)
+
+# perform trim
+SketchTrim = Sketch_1.addTrim(SketchArc_1, geom.Pnt2d(0, 17))
+SketchTrim.execute()
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchArc", 2)
+model.testNbSubFeatures(Sketch_1, "SketchLine", 6)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 8)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintTangent", 2)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintEqual", 1)
+
+model.end()
+
+assert(model.checkPythonDump())
index 3e3f29ce09277f05c8aa63a5f9f7d1df00fc7da4..1f0ac04a47a7b871858cbad7f82139d3b22642c4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index f966dd77c86ac2fa5dbab2d8e5c787025bad617e..dff98678853c9ab9e98827f8c7f1ecfb2f2aeee0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index c542d21354e830f26f1413d8b57bc4d608472be5..ccfc5b61554059801f7aac95e74e5872dbd7a9ef 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index b6736b9038cf4b70d15262136449acc97db8a642..649c399fce35c2978e494b0b143f8f3df5b1a96f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 535455a97c5d6564e4f6f46cb14239ed228a7601..ad4636f6d61c7b3d145a62e57d3a0be71f6b0f80 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index 15863b4ea84d80deeaf5bf1e1614a801ec93a65f..3be5bf87a3154a9cf31408128c65ba6e4b3779ea 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index e99261805156f2cff92b99aba2ee95912e5bb603..14b264988f9aec65d66ed78487cb97e2d3e3c5c3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
index b459a20c8e3c1ab071f6c72ec7590c2ef909e412..b0f7c093a5685dac40716eac05c711bcd00adc46 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
diff --git a/src/SketchPlugin/Test/TestTrimLine03.py b/src/SketchPlugin/Test/TestTrimLine03.py
new file mode 100644 (file)
index 0000000..505faa4
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from SketchAPI import *
+
+from salome.shaper import model
+from salome.shaper import geom
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(-38.2842712474619, 18.28427124746191, -10, -10)
+SketchLine_2 = Sketch_1.addLine(-10, -10, -10, 20)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-10, 20, -25, 5)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_1.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 40)
+SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_2.result(), [SketchLine_1.result(), SketchLine_3.result()])
+[SketchLine_4, SketchLine_5] = SketchConstraintMirror_1.mirrored()
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchLine", 5)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 3)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintLength", 1)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintMirror", 1)
+
+#perform trim
+SketchTrim = Sketch_1.addTrim(SketchLine_1, geom.Pnt2d(-12, -8))
+SketchTrim.execute()
+model.do()
+
+model.testNbSubFeatures(Sketch_1, "SketchLine", 5)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintCoincidence", 2)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintLength", 1)
+model.testNbSubFeatures(Sketch_1, "SketchConstraintMirror", 0)
+
+model.end()
+
+assert(model.checkPythonDump())
diff --git a/src/SketchPlugin/Test/TestTrimPreview.py b/src/SketchPlugin/Test/TestTrimPreview.py
new file mode 100644 (file)
index 0000000..d3b9e88
--- /dev/null
@@ -0,0 +1,80 @@
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from salome.shaper import model
+
+from ModelAPI import *
+from GeomDataAPI import *
+
+from ConfigAPI import *
+Config_PropManager().registerProp("Visualization", "operation_remove_feature_color", "Color of removed feature in operation", Config_Prop.Color, "255, 174, 201")
+
+# base sketch
+model.begin()
+partSet = model.moduleDocument()
+Part = model.addPart(partSet)
+Part_doc = Part.document()
+Sketch = model.addSketch(Part_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch.addLine(0, 20, 100, 20)
+SketchLine_2 = Sketch.addLine(20, 0, 20, 40)
+SketchLine_3 = Sketch.addLine(80, 0, 80, 40)
+SketchCircle_1 = Sketch.addCircle(50, 50, 50)
+model.do()
+model.end()
+
+aSession = ModelAPI_Session.get()
+aSketchFeature = featureToCompositeFeature(Sketch.feature())
+
+# Create Trim feature for a line
+aSession.startOperation()
+aTrim = aSketchFeature.addFeature("SketchTrim")
+aSelectedObj = aTrim.reference("SelectedObject")
+aSelectedObj.setValue(SketchLine_1.feature())
+aSelectedPoint = geomDataAPI_Point2D(aTrim.attribute("SelectedPoint"))
+aSelectedPoint.setValue(50, 20)
+aPreviewObj = aTrim.reference("PreviewObject")
+aPreviewObj.setValue(SketchLine_1.feature())
+aPreviewPoint = geomDataAPI_Point2D(aTrim.attribute("PreviewPoint"))
+aPreviewPoint.setValue(aSelectedPoint.pnt())
+assert(featureToPresentation(aTrim).getAISObject(None) is not None)
+aSession.finishOperation()
+
+model.testNbSubFeatures(Sketch, "SketchArc", 0)
+model.testNbSubFeatures(Sketch, "SketchCircle", 1)
+model.testNbSubFeatures(Sketch, "SketchLine", 4)
+model.testNbSubFeatures(Sketch, "SketchConstraintCoincidence", 2)
+
+# Create Trim feature for a circle to perform its substitution by an arc
+aSession.startOperation()
+aTrim = aSketchFeature.addFeature("SketchTrim")
+aSelectedObj = aTrim.reference("SelectedObject")
+aSelectedObj.setValue(SketchCircle_1.feature())
+aSelectedPoint = geomDataAPI_Point2D(aTrim.attribute("SelectedPoint"))
+aSelectedPoint.setValue(50, 0)
+aPreviewObj = aTrim.reference("PreviewObject")
+aPreviewObj.setValue(SketchCircle_1.feature())
+aPreviewPoint = geomDataAPI_Point2D(aTrim.attribute("PreviewPoint"))
+aPreviewPoint.setValue(aSelectedPoint.pnt())
+assert(featureToPresentation(aTrim).getAISObject(None) is not None)
+aSession.finishOperation()
+
+model.testNbSubFeatures(Sketch, "SketchArc", 1)
+model.testNbSubFeatures(Sketch, "SketchCircle", 0)
+model.testNbSubFeatures(Sketch, "SketchLine", 4)
+model.testNbSubFeatures(Sketch, "SketchConstraintCoincidence", 4)
diff --git a/src/SketchPlugin/Test/TestUpdateSketch.py b/src/SketchPlugin/Test/TestUpdateSketch.py
new file mode 100644 (file)
index 0000000..e66c4c1
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+ParamA = model.addParameter(Part_1_doc, "a", "200")
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(19.66215729983772, 107.3479424462301, -0.3378427001622813, 107.3479424462301)
+SketchLine_2 = Sketch_1.addLine(-0.3378427001622813, 107.3479424462301, -0.3378427001622813, 467.3479424462301)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(-0.3378427001622813, 467.3479424462301, 49.66215729983772, 467.3479424462301)
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchLine_4 = Sketch_1.addLine(-0.3378427001622813, 307.3479424462301, 29.66215729983772, 307.3479424462301)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_2.result())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_4.result())
+SketchConstraintHorizontal_3 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_3.result(), 50)
+SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), 30)
+SketchConstraintLength_3 = Sketch_1.setLength(SketchLine_1.result(), 20)
+SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_1.endPoint(), SketchLine_4.startPoint(), "a")
+SketchConstraintDistanceVertical_2 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchLine_2.endPoint(), "a*0.8")
+model.do()
+Edge_1_objects = [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1")]
+Edge_1 = model.addEdge(Part_1_doc, Edge_1_objects)
+Revolution_1_objects = [model.selection("EDGE", "Edge_1_1"), model.selection("EDGE", "Edge_1_2"), model.selection("EDGE", "Edge_1_3")]
+Revolution_1 = model.addRevolution(Part_1_doc, Revolution_1_objects, model.selection("EDGE", "Sketch_1/SketchLine_2"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_2"))
+SketchCircle_1 = Sketch_2.addCircle(-8.007012574805483, 5.997620437244276, 8.148502128958617)
+model.do()
+# change the height of the second sketch plane
+ParamA.setValue(50)
+model.end()
+# check that the second sketch result is recomputed: is located in the same plane as base
+referenceY = Sketch_2.feature().selection("External").value().middlePoint().y()
+resultY = Sketch_2.feature().results()[0].shape().middlePoint().y()
+assert(referenceY == resultY)
index fd95d68e97bc450310b7a027f0f2bc4b4db0b0ea..627ca479a579a2cbff2b742226fa3d06b2be60db 100644 (file)
@@ -154,3 +154,4 @@ The plug-in includes the following operations:
    mirrorFeature.rst
    translationFeature.rst
    rotationFeature.rst
+   sketchDrawer.rst
diff --git a/src/SketchPlugin/doc/images/SketchDrawer.png b/src/SketchPlugin/doc/images/SketchDrawer.png
new file mode 100644 (file)
index 0000000..e3f53d1
Binary files /dev/null and b/src/SketchPlugin/doc/images/SketchDrawer.png differ
diff --git a/src/SketchPlugin/doc/images/SketchDrawer_panel.png b/src/SketchPlugin/doc/images/SketchDrawer_panel.png
new file mode 100644 (file)
index 0000000..6d7db60
Binary files /dev/null and b/src/SketchPlugin/doc/images/SketchDrawer_panel.png differ
diff --git a/src/SketchPlugin/doc/images/SketchDrawer_res.png b/src/SketchPlugin/doc/images/SketchDrawer_res.png
new file mode 100644 (file)
index 0000000..b746e4e
Binary files /dev/null and b/src/SketchPlugin/doc/images/SketchDrawer_res.png differ
diff --git a/src/SketchPlugin/doc/sketchDrawer.rst b/src/SketchPlugin/doc/sketchDrawer.rst
new file mode 100644 (file)
index 0000000..f019f47
--- /dev/null
@@ -0,0 +1,58 @@
+  .. _create_sketch_drawer:
+
+Sketch Drawer
+=========
+
+Sketch Drawer featrure is a macro-feature, i.e. it is removed after its execution.
+It allows simplify creation of sketches basing on existing models without referencing to
+these models.
+
+For an example, to create a sketch on exising STEP file model planar face
+and then remove the original model, to keep only the sketch with copy of contour. So, to be
+able to remove the initial model, there are no references created by this feature.
+
+To add a new Sketch Drawing:
+
+#. select in the Main Menu *Macros - > Sketch drawer* item  or
+#. click **Sketch drawer** button in Macros toolbar:
+
+.. image:: images/SketchDrawer.png
+   :align: center
+
+.. centered::
+   **Sketch drawer**  button
+
+The following property panel appears:
+
+.. image:: images/SketchDrawer_panel.png
+  :align: center
+
+.. centered::
+   Sketch drawer
+
+Click in the view once to set the whole original model, then click a second time to set the
+plane or planar face - a base of sketch. This can be plane on the original model.
+
+Flag "Create dimensions" allows to disable creation of dimensional constraints in the resulting sketch.
+So, if it is disabled, then lengths and radiuses will be omitted. It allows to avoid overconstraint
+situation and simplify work of the sketch solver.
+
+On Apply button press the new sketch will be created in the Object Browser tree.
+
+Result
+""""""
+
+A resulting sketch will contain linear and circular edges as well as circular arcs corresponding to the
+original model edges that lay in the sketch plane. Other types of edges are not supported.
+
+Radius, length, vertical, horizontal and points-coincidence constraints will be created
+automatically where it is possible. The resulting sketch may be overconstrained or not fully
+constrained. So, it is just a helper for the sketch creation, not universal tool. After this
+sketch creation normally user must edit this sketch to input reasonable constraints and
+parametrization, or remove not needed constraints or sketch lements.
+
+.. image:: images/SketchDrawer_res.png
+          :align: center
+
+.. centered::
+   Drawn sketch
diff --git a/src/SketchPlugin/icons/drawer.png b/src/SketchPlugin/icons/drawer.png
new file mode 100644 (file)
index 0000000..e3f53d1
Binary files /dev/null and b/src/SketchPlugin/icons/drawer.png differ
index f901724080e90d661af4e81cb636b60f16cdc364..e44cc0171af97a581976aa6f2ea8de897435034e 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <plugin>
   <workbench id="Sketch">
     <group id="Linear geometry">
@@ -1053,8 +1032,6 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
         </sketch_shape_selector>
         <validator id="PartSet_CollinearSelection"/>
       </feature>
-
     </group>
-
   </workbench>
 </plugin>
diff --git a/src/SketchPlugin/plugin-SketchDrawer.xml b/src/SketchPlugin/plugin-SketchDrawer.xml
new file mode 100644 (file)
index 0000000..44a6bf7
--- /dev/null
@@ -0,0 +1,17 @@
+<plugin>
+  <workbench id="Macros" document="Part">
+    <group id="Samples">
+
+      <feature id="SketchDrawer" title="Sketch drawer" tooltip="Creates sketch using elements of selected shape belonging to selected plane"
+            icon="icons/Sketch/drawer.png"
+            helpfile="sketchDrawer.html">
+        <shape_selector id="base_shape" label="Shape:" tooltip="Select a shape for extraction to sketch."
+            shape_types="objects" concealment="false"/>
+        <shape_selector id="plane" label="Plane:" tooltip="Select plane for sketch" shape_types="face">
+          <validator id="GeomValidators_Face" parameters="plane"/>
+        </shape_selector>
+        <boolvalue id="add_dimensions" label="Create dimensions" default="true" tooltip="To add dimensions into created sketch" obligatory="0"/>
+      </feature>
+    </group>
+  </workbench>
+</plugin>
index 5dab71a4f86d93d4dd22b49ce7b8e601995e3f04..2c4b5899640a08abe9e1aeea2a8c2e2624923fea 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # Avoid using SolveSpace
 SET(NO_SolveSpace TRUE)
index 722d0ed24b14dec4cbaaf91d8e78323d1aaefab7..c6f99cecd3e6a2d810a34e39d61c46e7153cd991 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(PlaneGCS REQUIRED)
 
index 0bd5f58a295943bc4a12b35985e04361127da7c5..76cb37459f72118b5ac01c01f8b7723a95c5fd9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_AngleWrapper.h>
index ca65199e0411895c35e55d4853a7559c87d24762..d4e270f24ceb9ba8de87143a43585f48172c473f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_AngleWrapper_H_
index 25c5f28cec3beb23a70e75fea9e2b5ccc232171b..ea6eef78c0d289b9c0f6b0b698f5966c46bdf60a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_AngleWrapper.h>
index 7a1cdf15f242d478d434c7630fec5b0e9c169b47..7d21983b30337becddb0b02252bacd8b35bce714 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_AttributeBuilder_H_
index 4ab3b043d68175e985f2130975ad9be7b101b856..6e6a6642f44f92a1eb6fd814da61c010fe203f37 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_ConstraintWrapper.h>
index 8936c4fb415873d0560c208e08992c12e30c4caf..b99cc7c3b1bd00160a3d9cb2ea782555d15ca295 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_ConstraintWrapper_H_
index 0f31d2e2c7de02d706d70b2bd5273a063c2a7a36..fccd4d718b0cea8c7dd3eeb43275825a3f3fef60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_Defs_H_
index c3b0fbcf8ced0c35dcb52226943245b8e3120ae7..7ec36cf236a33507de548cfad7bde4f137c137a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_EdgeWrapper.h>
index 8bdb7cdd6648312646ce80f2689f31a05dcdb2ee..9cd5bc2cbe972483cda4a46702b463805656df6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_EdgeWrapper_H_
index 322ea32a6a475bee903b1ac1f795a02b17ab7733..33ba99004e9dacb3e03a69b8d1c268a1f27f1a56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_EntityBuilder_H_
index 4bfd117bd2ff9fc3a5862151753a44124a598932..841a1c2c33143d1e21f469f594358e2e378e377b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_EntityDestroyer.h>
index 5064b26b6869582f59784d66a0014a1bf047a6a0..1691c67786cd66258f20d7d53a5b8449f3ae5148 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_EntityDestroyer_H_
index 9d08e10a36fb122238ad9504fdfe2ca7ffb8c059..0d224cbdb017bdd434389665fa2e8abb3e66263b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_EntityWrapper_H_
index 376bab37f6f266909a94645cd3e89b84d65c03e2..c2965e3eed652e0ada68cbee33756ff294a85b8d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_FeatureBuilder.h>
index e13b0860b97958b69c41462e79b5888ba391af6a..78675e33bcc9e0a9fedfcf83651c091b17526e85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_FeatureBuilder_H_
index 92008e01eeb94c3ba2fd8aa8aa1d1667ca19a0e4..bfb662590ad96dd2bdfe647a1404b7518b5ff179 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_PointWrapper.h>
index 950e30c366b185f41fc7e5f7cecd1dde469d20d9..3cb05e124f04505181e834b2cbbf6fc29bd1716d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_PointWrapper_H_
index 358c811159b25feaa6275d39405b2d3ab463f1d0..439bc8184c4f85bbf557ac6b55d0b138cc185fb1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_ScalarWrapper.h>
index 74c03f0a65e8bf920b46baa57b9846eaef0b572f..454f5ea01159642431862ca71c6022d090ed7fa3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_ScalarWrapper_H_
index 10e453599057adbcbb54e41aeb738a4a850e9684..4e34e8badda0541b1bc291469cb213063b7b342a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_Solver.h>
index 6e1c7740a40b9999e80185c8ce994e6986a0fbb2..4fb2abce9eafd65f615cecdbf8d6941eb84a0430 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_Solver_H_
index 93399ff9a239bae7a5fe5fb96eb56a5e4e423ba2..a01474bacb2756d6e77460e4a6b179973186834f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_Storage.h>
index 1b6ab890c474a587848cad04ec089205d6fc4642..3ac8e201e31be774171630d7be1a479b68af647b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_Storage_H_
index a4e461ada6afe7a04c830f84d2eedcdf19a214eb..ac112699d06ab45ca2f90a652d53c559760b17cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_Tools.h>
index 69cc966803ecd95cb9b401e6a815ece98358aaf4..4e5b666b67268986f7f77026cfd8058f12e10a1c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_Tools_H_
index 04e45d88f097d797a1ee8a287a2754dccd00e8ea..806a54c47a6a22a86bcbc1dd095dce13cbec3fd3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_Update_H_
index c4e2b298ca080424741a528c354ad3fe6c347913..4ed6b81e992743639bcd0e6c310473ba7e71a9c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_UpdateCoincidence.h>
index c7c2421a3756d70a0969e6e315475aff16e2fed6..29247709f45053988ffbcf07bfa5091a09a0c45c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_UpdateCoincidence_H_
index b4a4714022831fc3f9842b5cfd81077455585ef2..5ff5190b46ab76e751165d0bd8317cbe361cfde6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <PlaneGCSSolver_UpdateFeature.h>
index 2dd394a888acc9280958cd044b7ce061a5371590..fa1725b8a56b098ec03afa076d26c680ad4fbbcb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PlaneGCSSolver_UpdateFeature_H_
index 4a78cc548d772a7ea1c7bde38680abc5018b83cd..7d047ac8091f1a83ecf5bc37098628918dbcbae1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_Constraint.h>
index ede942603ddc26a3c7b2f86316b723bb904ccdc7..e4081174610fa7843e0bb87da9f2487a7cbf4cf6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_Constraint_H_
index 39877af86d43b13cb45ef41a58d2bf44d494b519..d51be3f9d98adedaf48f54120292bd74c4b568fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintAngle.h>
index cd7bc1efef601ad50884d2b597e1b3dc6522ef55..ba9771e19c6545f78e265bdde0ec08503058a91d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintAngle_H_
index ae4a89bcc63d3d457fab1f59da8ce078b4b2a7ba..9903b850efdb4ab8bee4b67503465c0bd7419456 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintCoincidence.h>
index 965c4d7e6cd709b77b2f7268651b9e5e6a0ce70a..871314b926afa2d6993b1667e725eb66158eb3d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintCoincidence_H_
index e36d14e1cb6bbc743554d56a4a479525a2746fe4..6ca71f8e6bf72e70db447227ffb5ba93375510fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintCollinear.h>
index 035df10476bc333d58c4b4d08ff6b1f6f9f26e1a..725e9bbc568a312c70914024418deab8259eae01 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintCollinear_H_
index 44daa41fa087f4bc2ca6f908497ea2bdb69a7be5..c3828b79405be5ae32b083a47f5a975fe0b2722b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintDistance.h>
 #include <math.h>
 
 
+static void getPointAndLine(const ConstraintPtr& theConstraint, const StoragePtr& theStorage,
+                            EntityWrapperPtr& thePoint, EntityWrapperPtr& theLine)
+{
+  for (int i = 0; i < 2; ++i) {
+    AttributePtr anAttr = theConstraint->attribute(SketchPlugin_Constraint::ATTRIBUTE(i));
+    EntityWrapperPtr anEntity = theStorage->entity(anAttr);
+    if (anEntity->type() == ENTITY_POINT)
+      thePoint = anEntity;
+    else if (anEntity->type() == ENTITY_LINE)
+      theLine = anEntity;
+  }
+}
+
+static void adjustOddPoint(const EntityWrapperPtr& theDistPoint,
+                           const EntityWrapperPtr& theDistLine,
+                           GCSPointPtr& theOddPoint)
+{
+  if (!theOddPoint)
+    return;
+
+  std::shared_ptr<GeomAPI_Lin2d> aLine = PlaneGCSSolver_Tools::line(theDistLine);
+  std::shared_ptr<GeomAPI_Pnt2d> aPoint = PlaneGCSSolver_Tools::point(theDistPoint);
+
+  std::shared_ptr<GeomAPI_XY> aLineVec = aLine->direction()->xy();
+  std::shared_ptr<GeomAPI_XY> aPtLineVec = aPoint->xy()->decreased(aLine->location()->xy());
+
+  double aDot = aPtLineVec->dot(aLineVec);
+  std::shared_ptr<GeomAPI_XY> aProjectedPnt =
+    aLine->location()->xy()->added(aLineVec->multiplied(aDot));
+
+  *(theOddPoint->x) = aProjectedPnt->x();
+  *(theOddPoint->y) = aProjectedPnt->y();
+}
+
+
 void SketchSolver_ConstraintDistance::getAttributes(
     EntityWrapperPtr& theValue,
     std::vector<EntityWrapperPtr>& theAttributes)
@@ -67,14 +101,21 @@ void SketchSolver_ConstraintDistance::adjustConstraint()
 {
   if (getType() == CONSTRAINT_PT_LINE_DISTANCE) {
     bool isSigned = myBaseConstraint->boolean(SketchPlugin_ConstraintDistance::SIGNED())->value();
-    if (myIsSigned == isSigned)
-      return; // distance type is not changed => nothing to adjust
-
-    // Adjust point-line distance by setting/removing additional constraints
-    if (isSigned)
-      addConstraintsToKeepSign();
-    else
-      removeConstraintsKeepingSign();
+    if (myIsSigned == isSigned) {
+      // adjust auxiliary point for sign-keeping
+      if (isSigned) {
+        EntityWrapperPtr aDistPoint, aDistLine;
+        getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine);
+        adjustOddPoint(aDistPoint, aDistLine, myOddPoint);
+      }
+    }
+    else {
+      // Adjust point-line distance by setting/removing additional constraints
+      if (isSigned)
+        addConstraintsToKeepSign();
+      else
+        removeConstraintsKeepingSign();
+    }
     myIsSigned = isSigned;
   }
 }
@@ -103,14 +144,8 @@ void SketchSolver_ConstraintDistance::addConstraintsToKeepSign()
 
   // calculate projection of the point on the line and find a sign of a distance
   EntityWrapperPtr aDistPoint, aDistLine;
-  for (int i = 0; i < 2; ++i) {
-    AttributePtr anAttr = myBaseConstraint->attribute(SketchPlugin_Constraint::ATTRIBUTE(i));
-    EntityWrapperPtr anEntity = myStorage->entity(anAttr);
-    if (anEntity->type() == ENTITY_POINT)
-      aDistPoint = anEntity;
-    else if (anEntity->type() == ENTITY_LINE)
-      aDistLine = anEntity;
-  }
+  getPointAndLine(myBaseConstraint, myStorage, aDistPoint, aDistLine);
+
   std::shared_ptr<GeomAPI_Lin2d> aLine = PlaneGCSSolver_Tools::line(aDistLine);
   std::shared_ptr<GeomAPI_Pnt2d> aPoint = PlaneGCSSolver_Tools::point(aDistPoint);
 
@@ -120,16 +155,12 @@ void SketchSolver_ConstraintDistance::addConstraintsToKeepSign()
     mySignValue = PI/2.0;
   else
     mySignValue = - PI/2.0;
-  double aDot = aPtLineVec->dot(aLineVec);
-  std::shared_ptr<GeomAPI_XY> aProjectedPnt =
-      aLine->location()->xy()->added(aLineVec->multiplied(aDot));
 
   // create auxiliary point on the line and set auxiliary constraints
   myOddPoint = GCSPointPtr(new GCS::Point);
   myOddPoint->x = aStorage->createParameter();
   myOddPoint->y = aStorage->createParameter();
-  *(myOddPoint->x) = aProjectedPnt->x();
-  *(myOddPoint->y) = aProjectedPnt->y();
+  adjustOddPoint(aDistPoint, aDistLine, myOddPoint);
 
   PointWrapperPtr aPointWr = std::dynamic_pointer_cast<PlaneGCSSolver_PointWrapper>(aDistPoint);
   EdgeWrapperPtr anEdgeWr = std::dynamic_pointer_cast<PlaneGCSSolver_EdgeWrapper>(aDistLine);
@@ -167,8 +198,12 @@ void SketchSolver_ConstraintDistance::removeConstraintsKeepingSign()
   aParams.insert(myOddPoint->y);
   aStorage->removeParameters(aParams);
 
-  aGCSConstraints.pop_back();
-  aGCSConstraints.pop_back();
+  // remove constraints keeping sign of point-line distance,
+  // not more than 2 additional constraints is possible
+  if (!aGCSConstraints.empty())
+    aGCSConstraints.pop_back();
+  if (!aGCSConstraints.empty())
+    aGCSConstraints.pop_back();
   aConstraint->setConstraints(aGCSConstraints);
   aStorage->addConstraint(myBaseConstraint, aConstraint);
 
index 5ab3b011ee2c6fed3ef7f550299e1867ac13b50d..7ea85d213850278e0c33cdffe7738a2b45b10c99 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintDistance_H_
index d611b6f4faead9a23770c844015b3bb6bd099fa4..2cb98d4a52ec8bf1ca09e79a4a06e43c0ae423ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintEqual.h>
index 99a4a2eb52f0787760478bf79d38fd06b081b95e..b7495d2d8d3f111870af70ff2b977c632d346d7f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintEqual_H_
index 677ef229dea43e7d7c723006b5b3329b56624a96..f61c8a49a73f0c2fef25146bdd5bd1fc72f989c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintFixed.h>
index 1d005c1b55b9d764125e644620524b04144cbcbf..bb19cb84a9f5541ab5dae74973fb20cef833e44b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintFixed_H_
index 4e423b2cd426bee427a8e790dc0f367edff799c9..acc099d25418e2ce7222a11b9cb25df322a6d510 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintLength.h>
index dc21c131f25032010be6a3f1c77b49750266b1a4..b10da452e754e5a85a0183709d286cf7921b1492 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintLength_H_
index 4865f4dd9941696d67c0fc16c40320c9f0af3b69..9643b2aafc7a8f6e180b5ddb81ce2fdb3ec1d075 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMiddle.h>
index 2f605a2a3af6942f7d6d0fde5a0e0666bfe1ab5f..48e11560aebad9cd83b55bda5b00d2d012884fa8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintMiddle_H_
index 4f2c69b866f193dc1cdb189a215e3f1ff9dbe863..cbf025ed5d6e154a7831988e6c4a7ff152dfb5ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMirror.h>
index 2b9136a68a601b1aa11044bc4ab4e92ef0b66852..1039370372f4fdc8f46406b857f87fbfc162b83f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintMirror_H_
index bbaf6ac24a33074bf48e4a4917683609b8b2761e..fdc4b0e78ff85afa6e34be69fb70fc3341219d67 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMovement.h>
index 8614f309ac064177045d915bad8d86d234c199fb..1735a70b0488bc1c5e562cbd1fd4bb06495166cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:    SketchSolver_ConstraintMovement.h
index 58634795baca9d49a923dfb0cf48ebc978b48286..7b8cbd68eee6adb4f12f00156d4c176a55ba0bb0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMulti.h>
index e5b296cc0a30ad8c835d47e34a22ad9ee4d67eec..d077aab7e43fea658a389463a901c8df8e98c5e2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintMulti_H_
index fba148a7ae0f015dae4258fae73ebb465979af88..cf2cac48aab28cee9cf02c1e0e9a49e9574ff8d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMultiRotation.h>
index f2c74237074c3b443b5291cd3186a1ca3dccb693..eb00cc6d858ce8a3a3dad225a53a5da58d2ec1ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintMultiRotation_H_
index a16619076004ab610d885c29d606a6d642839b6f..35c9aad31610e80fdcc5cab0471f8c23f5147315 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMultiTranslation.h>
index 2a9bd92f4a984f85f7190a6bc7ce626c7af9ac01..dde843ccbbaa26033b1c1b27344df3d73bf4ba53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintMultiTranslation_H_
index e104db4392383c1b52d313f6ed951bb3e72f468d..eaa0e2c41696068e8d5507a1b17dc759beccc3b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintTangent.h>
index 568c15c4311f8bedaab4244da83bb28ebc7e392a..6af491ec770e5452bb4550a2da9a729b6685d33d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_ConstraintTangent_H_
index bac5b642ad56d0ddfac7353cddee6d92ba1fd7bb..a4f9ea53cfbc84a6845cb17e2c0f254c6e73f8dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_Error_H_
index d4b96d1c50691e49bdce16004ee617d8d9b57d9c..6e2e4ed6e83a57a4f4571abacc19fc38679d7228 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchSolver_Group.h"
@@ -333,7 +332,7 @@ void SketchSolver_Group::computeDoF()
 
   if (aDoF > 0 && myDOF <= 0)
     sendMessage(EVENT_SKETCH_UNDER_CONSTRAINED, mySketch, aDoF);
-  else if (aDoF == 0/* && myDOF > 0*/)
+  else if (aDoF == 0 && myDOF != 0)
     sendMessage(EVENT_SKETCH_FULLY_CONSTRAINED, mySketch, aDoF);
   else if (aDoF < 0)
     sendMessage(EVENT_SKETCH_OVER_CONSTRAINED, mySketch, aDoF);
index 4a65bf258f37c50a4d26bee21eec46add297d355..69ea919dc45e93f368d671fcec63c9d523554451 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_Group_H_
index 8e976d02b9dd8d370fc3f515ddd47be4e2c30900..f1347a622b1a2c799d1cea45fc284713ad17d856 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketchSolver_Manager.h"
@@ -43,6 +42,42 @@ static bool isFeatureValid(FeaturePtr theFeature)
   return aFactory->validate(theFeature);
 }
 
+typedef std::map<int, std::shared_ptr<SketchPlugin_Feature>> IndexedFeatureMap;
+
+static void featuresOrderedByCreation(const std::set<ObjectPtr>& theOriginalFeatures,
+                                      IndexedFeatureMap& theOrderedFeatures)
+{
+  std::set<ObjectPtr>::iterator aFeatIter = theOriginalFeatures.begin();
+  for (; aFeatIter != theOriginalFeatures.end(); aFeatIter++) {
+    std::shared_ptr<SketchPlugin_Feature> aFeature =
+        std::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
+    if (aFeature && !aFeature->isMacro() && aFeature->data() && aFeature->data()->isValid()) {
+      theOrderedFeatures[aFeature->data()->featureId()] = aFeature;
+    }
+  }
+}
+
+static void featuresOrderedByType(const std::set<ObjectPtr>& theOriginalFeatures,
+                                  IndexedFeatureMap& theOrderedFeatures)
+{
+  int aFeatureIndex = 0;
+  int aConstraintIndex = (int)theOriginalFeatures.size();
+
+  std::set<ObjectPtr>::iterator aFeatIter = theOriginalFeatures.begin();
+  for (; aFeatIter != theOriginalFeatures.end(); aFeatIter++) {
+    std::shared_ptr<SketchPlugin_Feature> aFeature =
+        std::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
+    if (aFeature && !aFeature->isMacro() && aFeature->data() && aFeature->data()->isValid()) {
+      std::shared_ptr<SketchPlugin_Constraint> aConstraint =
+          std::dynamic_pointer_cast<SketchPlugin_Constraint>(aFeature);
+      if (aConstraint)
+        theOrderedFeatures[++aConstraintIndex] = aFeature;
+      else
+        theOrderedFeatures[++aFeatureIndex] = aFeature;
+    }
+  }
+}
+
 
 
 // ========================================================
@@ -115,29 +150,17 @@ void SketchSolver_Manager::processEvent(
 
     // update sketch features only
     const std::set<ObjectPtr>& aFeatures = anUpdateMsg->objects();
+    IndexedFeatureMap anOrderedFeatures;
     // try to keep order as features were created if there are several created features: #2229
     if (theMessage->eventID() == aCreatedEvent && aFeatures.size() > 1) {
-      std::map<int, std::shared_ptr<SketchPlugin_Feature>> anOrderedFeatures;
-      std::set<ObjectPtr>::iterator aFeatIter;
-      for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) {
-        std::shared_ptr<SketchPlugin_Feature> aFeature =
-            std::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
-        if (aFeature && !aFeature->isMacro() && aFeature->data() && aFeature->data()->isValid()) {
-          anOrderedFeatures[aFeature->data()->featureId()] = aFeature;
-        }
-      }
-      std::map<int, std::shared_ptr<SketchPlugin_Feature>>::iterator aFeat;
-      for(aFeat = anOrderedFeatures.begin(); aFeat != anOrderedFeatures.end(); aFeat++) {
-        updateFeature(aFeat->second);
-      }
-    } else { // order is not important
-      std::set<ObjectPtr>::iterator aFeatIter;
-      for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) {
-        std::shared_ptr<SketchPlugin_Feature> aFeature =
-            std::dynamic_pointer_cast<SketchPlugin_Feature>(*aFeatIter);
-        if (aFeature && !aFeature->isMacro())
-          updateFeature(aFeature);
-      }
+      featuresOrderedByCreation(aFeatures, anOrderedFeatures);
+    } else { // order is not important, just process features before constraints
+      featuresOrderedByType(aFeatures, anOrderedFeatures);
+    }
+
+    IndexedFeatureMap::iterator aFeat;
+    for (aFeat = anOrderedFeatures.begin(); aFeat != anOrderedFeatures.end(); aFeat++) {
+      updateFeature(aFeat->second);
     }
 
   } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_MOVED)) {
index 105cc0e97ae1b503195b9efddd7b7969107ffbd9..c80f0fc7f0210a7fef83863aa214a476c118f61d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_Manager_H_
index 33fea2149611d6a8e910979e0824d0b4e8ee41b5..9fb0369d59208b274ce90c4b7cb47966636bd16b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_Storage.h>
@@ -94,41 +93,12 @@ void SketchSolver_Storage::addConstraint(ConstraintPtr        theConstraint,
     theConstraint->data()->blockSendAttributeUpdated(myEventsBlocked);
 }
 
-static std::list<AttributePtr> pointAttributes(FeaturePtr theFeature)
-{
-  std::list<AttributePtr> aPoints;
-  if (!theFeature->data() || !theFeature->data()->isValid())
-    return aPoints;
-  if (theFeature->getKind() == SketchPlugin_Arc::ID()) {
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Arc::CENTER_ID()));
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Arc::START_ID()));
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Arc::END_ID()));
-  }
-  else if (theFeature->getKind() == SketchPlugin_Circle::ID())
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Circle::CENTER_ID()));
-  else if (theFeature->getKind() == SketchPlugin_Line::ID()) {
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Line::START_ID()));
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Line::END_ID()));
-  }
-  else if (theFeature->getKind() == SketchPlugin_Point::ID() ||
-           theFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
-    aPoints.push_back(theFeature->attribute(SketchPlugin_Point::COORD_ID()));
-  return aPoints;
-}
-
 void SketchSolver_Storage::addEntity(FeaturePtr       theFeature,
                                      EntityWrapperPtr theSolverEntity)
 {
   if (theSolverEntity) {
     myFeatureMap[theFeature] = theSolverEntity;
     setNeedToResolve(true);
-  } else {
-    // feature links to the empty entity, add its attributes
-    std::list<AttributePtr> aPntAttrs = pointAttributes(theFeature);
-    std::list<AttributePtr>::const_iterator anAttrIt = aPntAttrs.begin();
-    for (; anAttrIt != aPntAttrs.end(); ++anAttrIt)
-      addEntity(*anAttrIt, EntityWrapperPtr());
-    myFeatureMap[theFeature] = theSolverEntity;
   }
 
   // block events if necessary
index 28a3370ee6f61fb0052b7e3246122856927a66d1..4d483105843642a9bff4be766c9ff31b0983c3c1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchSolver_Storage_H_
old mode 100755 (executable)
new mode 100644 (file)
index 073c74d4c99b22b5f58606de78fe8bc4d4b0afc0..90b50e160d64f83c26a56631680acf3e957b3d78 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 FIND_PACKAGE(SolveSpace REQUIRED)
 
index b3e2320ecd371f1c315aa32c307303cee44d2baa..616e6cb385d3c0b188ec5f06a67283e3f8854ca1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SolveSpaceSolver_Builder.h>
index ab242bdd4afcbede27acaa9b083e24dba555f7d2..b8bbb35e7c1e3538591004f43366bbb1722a7d3a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_Builder_H_
index 9b12e2a3d4883cc3b8b9cb3fa5b77e11af304e3e..6dbdb0d984e73a11239294a243825fc61ffbd605 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_ConstraintType_H_
index c8bfe7b3e9925fd0ba495c1ac22b983c21b19132..4cae64a34aa1aab2e6209b7ecaac4cdbb1333ef4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SolveSpaceSolver_ConstraintWrapper.h>
index 71d28b673872d5368ea40126e835b4823d58a5a7..56c9e4b065205019efba78478032c907c3a822d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_ConstraintWrapper_H_
index bcb37c9817c16cb91530bebcf4bf14aa6d3713ed..32b60bcc5a38036ef353d8f1a059d1025da952b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SolveSpaceSolver_EntityWrapper.h>
index 5ad7509317dd60bc673a5d4194ced719ce4b7fdc..789c5173a3b02da1b70d2bd2840eb3bee920c3c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_EntityWrapper_H_
index 6684ab31484bc315fd3bcfc09c0da2335badd808..59239a435d502d745ef4aa5e2199adb1718697c9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SolveSpaceSolver_ParameterWrapper.h>
index 876f7499ba8def30f5435cbb90d73028e28c4acc..6f2c7f96fe68459dd6374f7cb39b43d9b5aaedbe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_ParameterWrapper_H_
index ddc36ccb67b8eaea7700266d3bd073f58370d284..f136768d8aaf8f1d169e79481a7f663ee460fe20 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SolveSpaceSolver_Solver.h"
index d69d3c8089f3147d03a294a11c805f0dd412e240..ea39b2f1c6c5d202db11e117be0cda3eae18af05 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_Solver_H_
index bf3e85508aae3465d941055d612a9e706cddce85..3aabbecbd177487891e926fd0931df7c3d7d46d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SolveSpaceSolver_Storage.h>
index c80763fb02e9c6b70150e0ee0f7d8971b0c3deb2..72764872441d00e0db1d20ccbd18a286b06daf16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SolveSpaceSolver_Storage_H_
index 48d35ffb6ff60fed0120c06d2867be7644bf0bfd..f84bb43220f1cee2fcf8334c8779f1ea818ca7f6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 IF(NOT DEFINED ENV{FREETYPE_DIR})
     SET(ENV{FREETYPE_DIR} $ENV{FREETYPE_ROOT_DIR})
index a15ac04f6726fbc231f2ceadbb41d8d6db170d6f..1868c607370d420b9d7a85379408218da4a1e20c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SKETCHERPRS_H
index 79014c40b8dbf2181b61598483fdea7a84ea1e2a..a7f366dd9714c0aab15eee3757b6b5c727c76221 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Angle.h"
index 5ab721903b9be2e0dca231d124a9236d76511f59..98f70d403b780ac5490534aa5e82346d7dd73c71 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Angle_H
index acf5d24a7d3a93df5e5b9582523b5c81c5b89178..9397f212a48e51f6d80cf332eccd5b90044d2e6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Coincident.h"
@@ -124,7 +123,8 @@ void SketcherPrs_Coincident::Compute(
     std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincidencePoint(myConstraint);
     std::shared_ptr<GeomAPI_Pnt2d> aP;
     FeaturePtr aSub;
-    for (int i = 0; i < mySketch->numberOfSubs(); i++) {
+    int aNumberOfSubs = mySketch->numberOfSubs();
+    for (int i = 0; i < aNumberOfSubs; i++) {
       aSub = mySketch->subFeature(i);
       if (aSub->getKind() == SketchPlugin_ConstraintCoincidence::ID() &&
         aSub.get() != myConstraint) {
index b33ba40ccb1811cb752f20cc5c65155c44df3c8e..9890cc35ecd11c5501340157be75c18e73c8cd90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Coincident_H
old mode 100755 (executable)
new mode 100644 (file)
index 9e98f21..056d5ab
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Collinear.h"
old mode 100755 (executable)
new mode 100644 (file)
index 7e42b0e..63ea32c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Collinear_H
old mode 100755 (executable)
new mode 100644 (file)
index fcb1aef..e00f81a
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_DimensionStyleListener.h"
old mode 100755 (executable)
new mode 100644 (file)
index 60e0a21..5e62399
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_DimensionStyleListener_H
index 3c9d261680ebe555e4b7e67b2138b26759339c5d..959f8ca862a77297b5bc3a12dececd24517a7027 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Equal.h"
index b56a6e9b9c2574cb3d89e4f019683d4514a8351d..4d4b1d74734b042d0cbf7b0bdac58637494f7009 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Equal_H
index 68e05f94c510aea42a665b9032f6db1705798317..ebbe5b6bf3390df85755b6930d30212609fe47fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Factory.h"
index ef6908daee0320d9783247bf9afc9e9a6439e7fe..e9413fc091b60315006fda613b3cea952590308c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Factory_H_
index e9d1d14130b27935e295db091cbebeedbb1a15ee..2f4ca10a3ccf8564fbb7d05b471fffc3c6559a29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_HVDirection.h"
index 15f8f7c9e75ade4614a08e2573fb0c17b5b5f61a..d695868e0c2771e3222df2798fb1a7670058ed86 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_HVDirection_H
index 34c7401d2d23bb865c528357a6c0d9cd633390d6..01c0659db27ee1cc5b914b4bfdfef88807d08c6a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_LengthDimension.h"
index dc83f8d1d0143f740db72b94b4950760e70bc66d..e67b44efa4ae37f6c1379f23cdbd9b8e1230fdb6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_LinearDimension_H
old mode 100755 (executable)
new mode 100644 (file)
index 00b8263..224d72f
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Middle.h"
old mode 100755 (executable)
new mode 100644 (file)
index 4f3352b..cfbde7e
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Middle_H
index 684669486423b5d46dcb3f3d6b7e3d57782282b9..299a4888595a20a13e615859f5b476b7d9e5bb5e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Mirror.h"
index fc7624c66af65c2a62f8308c85837e861504d778..d8a6fcf1155247825aaa8f9abba75f706222bdc9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Mirror_H
index 0860b6e687e227a37272c537228b302ce80560a4..973a972b2ec00fb70a49b9948cce383432ceac2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Parallel.h"
index 767688c568d6de6117ec7f0f8b6233efb88fc73f..1e3a11fb681275c705610ee05a11370d5cdae85a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Parallel_H
index 7c94af55a221a3e864896c118abe0866f12c04c9..b746818845038050df64feef06b34237c2b3ca77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Perpendicular.h"
index c0c7a4448daa1d37729465e2e37ca902ba0c4215..66858967d89eafc312a52d4d082276f2d9bcbc77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Perpendicular_H
index dfa3103dd11863a972e5c6ce5dd98a3ec110debe..d98ffa0ac766fa1dc54d7ddf7629e8c1a4c06b30 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_PositionMgr.h"
@@ -151,14 +150,17 @@ const std::array<int, 2>& SketcherPrs_PositionMgr::getPositionIndex(GeomPointPtr
       if (aUseFeature) {
         DataPtr aData = aFeature->data();
         AttributeRefAttrPtr aObjRef = aData->refattr(SketchPlugin_Constraint::ENTITY_A());
-        FeaturePtr aObj = ModelAPI_Feature::feature(aObjRef->object());
+        FeaturePtr aObj;
+        if (aObjRef)
+          aObj = ModelAPI_Feature::feature(aObjRef->object());
         bool aContains = false;
-        if (containsPoint(aObj, aPnt2d, thePos)) {
+        if (aObj && containsPoint(aObj, aPnt2d, thePos)) {
           aContains = true;
         } else {
           aObjRef = aData->refattr(SketchPlugin_Constraint::ENTITY_B());
-          aObj = ModelAPI_Feature::feature(aObjRef->object());
-          if (containsPoint(aObj, aPnt2d, thePos)) {
+          if (aObjRef)
+            aObj = ModelAPI_Feature::feature(aObjRef->object());
+          if (aObj && containsPoint(aObj, aPnt2d, thePos)) {
             aContains = true;
           }
         }
index 7acc36e1150d9c56bc2031fc26df6711499f5190..a0e8fe137629328a2082bb7ba2159180720cb426 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_PositionMgr_H
index 0219e2f37f9b9b2c0ec3d2c26f8c30056f4dbc87..f57a08db062d3987375907d1b1b238da14429db0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Radius.h"
index 9fcec1fd897a29be4a377bb6d8ea2f90ae827df2..b4cf70e5e6f16e5515889d77b5af0be6f31e9627 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Radius_H
index 19c8fa211d4e4543a010f11596b0ce3209744f2b..9ecca54e4a3caa20e6cda911e0b2cf70db6a1ceb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Rigid.h"
index af9dec23b9799ca57a1cd042b1d4571e2a878d62..482c555fbf82081f749c133d7c60fbedafbb54ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Rigid_H
index 6f1450c95ce9fa484e6388d84b82f0a9060a017b..753cff52ddb87012102ed44529acf4b593bfc0fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_SensitivePoint.h"
index 281c823a60ddcfac3ea22af4200add33f3d5e1f4..e4e0a8bcd1979b1a909902bb30cfc9dba67ea0a9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_SensitivePoint_H
index b8bdd9db71111e3cfbf3e5e3ca2bc6330fc25bbf..03d1e26f7b65f3a0488c1f5f11287c58192c451c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_SymbolPrs.h"
index b552bf612df2920d3e3668f2544727fcd5f2d775..ba91cd8f86bea6e55e794801363eb2904876e4b0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_SymbolPrs_H
index 46db38c8ef55af4bc0c1114852f026dbb61e4ca9..183256a0a1f0f48b86c5933a69a2a60ce65fdaed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Tangent.h"
index d8e06aac61d028e132ab0a6f62934eb091bc7255..3fa1bc697efee9542b1dd4914342d212d5568c7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Tangent_H
index 1054f66c75c81760dc1a013779e95642e872fa7e..5e58787ddd08ddc02679639286ce0e4657e46edd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Tools.h"
index f119a302771ea11f6eb83423bf53013ff24ab340..c8f8ea05625359c855db3a4116372e88c492c993 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Tools_H
index 78d35e00821b41b0a44b694535449e682c9abc20..4441f39349d94491dba4b7112facaa6a7151ffe6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "SketcherPrs_Transformation.h"
index 1119c4516a00689f6b3aaf3c75f1c6b784dd5267..35395dddbfe99693b5a7e061bcfa733103344325 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketcherPrs_Transformation_H
old mode 100755 (executable)
new mode 100644 (file)
index 6cfdc4a..6767e35
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 80fac0062b4337901d40a5b40cf83749315c3df5..b09c301d05d934d88f15a3233500d8422fdef7aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25b4d66ed5c47bc94cf5ef4aedfcfd323c38508b..52d1a2f960daa243b04ba8489f3d09913d53ca91 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6f4962bd8c5f589051b52f231eadec2254719a9d..84a4c9dde5ab5c4448d36d6ddd86566748ed70b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7c767f3a7729e15ca3ce4d7272d3cedba27d52d5..b227df304c64f890599835ccbbf7f68682137ff1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f59edc305ecf375b2fed54ce5c62571c59669e33..c608b8327f6b92eafc3a4d0fa5cab4416ab14ed8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e5782338495b1da42bc87e177807d1ca8fd4d950..a70dd3ac1074dd3ca2d9cd53cea61b4f82106555 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 94b6c51052db7c0104a4c202a1a1d1bc9791138e..e0a66493544994ca8ae473d5e24e7990d004b98c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7432f5f37724becd97d2b31cfb3423f6936dfa0e..2b42d4a5016032eb9e171fdbd854fecb401a66ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1ea899ae86f078cc947904c36f9ba504f789fe55..544c01b3d8a43d809affcccaa384941812004875 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9266c6b7d1f553dcd0ab3b48225b19ccebe555e8..0c7140e09e4985117a04419131efc00a8cbd2b24 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 73178489e18fe9790d283755a0cff434d6637306..62b95badfb3e1795f63469ebccd61c89bff52134 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0ef35b169edc08f13262ec80dceff3b923e6a741..6daea020750693da6138265c1d30012c820e414a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index be5dcff2a7d7faf66b4e00177bb7d01fc9a07471..6560063329212ce58233668cce409ba9e3b185ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0c92c40eab21970104f863303dc352402185eb9a..be9db1cc4b605489a74e82891e0da92c8a290401 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 18eb8196feef640b0e61370e5c84d8b35070372e..a4ac2fbab9d3f7324312b0196c585284d67c2b03 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 42699912911bd3564c17766e8bf253d4b31dbc1c..4447a9de70ba276c56ccd8907b26a01f3e0515ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 34760ca345bb0496646a8bca72379f22a8d4a0a7..0485d1c46935b8329b49fe2ed3a7aca90760ea13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3ca39684c90763ad92a34c15d346f04184a29158..f110a6efd29d65e1561c48adf5cb830fc30a8bff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25c10fec2eaa5790b5451a6b092ba0f60fa1de7c..5111b2862cd2fc51767c3186e60467e13722cf71 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e5b42baa04b94441ed3a48b667d17e93e235a21c..858447bc7ccecf4eb6dbdcc07881e675f1d06441 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5fab23272f84d64ba6b627ff17f8a040e9a8bb02..4a43616f0cfa382c37b5ff556a2105544cb5c3c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f986af3ed84e887361772ec9cd58f3a347933ccf..1fcc05f0e4c463a57ae876817fa92a70cd2ecb39 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 79b9fc8be5b48d3ae3239671a5deae3ce79d4026..bf19e477a035256981da91af669b5ff4c8452f37 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 998baddd20a868919ac89d4f06ebfb12190e9f50..1a362a20dade3479626a6dfcd9e80ef4460fa6fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 047b786918c4dc97be1238df30c15f60da37114a..f501a388c8bbefd1f93e58100e5c484215a221e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c4f675032689c0e15c7649ec2b39f9a8f48ce225..9023da7a799043ba54fbddb61608dca994d3740a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fef5e0c07e3d93e37d35c20e87079131b2576653..c3f2d67b814686cb0a70f30af991fcb4f92c3b3e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fe117e92f898b4a7dd71829c981c2442aa5d314c..cb796a1689ac9a5ee790846c9508e33b60518e72 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7b4d8fa9d0396bd1790f6f82a69dc97148a6613c..7be74836df47e040c8c4f05f01574de1e9b4a150 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1ec749b35829bbca38add6827f87f3f72dd4acba..c479649d2f753cf4d82d2b14b6c678fb1911b08d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c7d839c3f50c819292e4698321b653d8299a93c9..766c6e73b6cf902c4ca57e38a37d6597a364e85e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fd13841b85f8625e28c25d2a5b7bdb974fc43570..537340c7d7146ba9de900f9d6e00fc85702cd5cb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d633ecb0832e7061d97ed79bb1d5c11a104d334b..c1d82c996a7aeea7e3a4777dccbdff5eac51d80a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 52076280fe31803a6c59a1439491bb318bc6019c..16af5f1dd07d076be9b939708b82f20076aa9434 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3216a642e757d5b739897849e37abe47c081f85a..7cc744f3a9fb1102501ebba9d49555051069036e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0c39997a7058674b373db10aba22cd44d9450d42..6b44b5a67bf8bcc3617e2627a587e105d301482c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7dc8bc70429eeac81acc2376f055f4cf57991998..a5fe18d09b1de81682925434fd1beb224ed2e6a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f68eb49fda3b4cc5a6eb6afbaed2f217390d32dc..e504210394791163fc87c975212456406e5ef82b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9bd54fbce87a1c2c2751fdd3541479d6c73e2f0d..a9f4a24fd0b9176628a515e0cbf938b5713b7d31 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 87a37cf4623a1608ba57f4b399759e3c36b2f6be..527b3aa8738e7d78f4592a2bbf6de2b7b309830f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b4f622f37edc9801553d5f33424eb7a7d793f281..bee4e770bb016ac913de1bb2aa63adaf4451e843 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 70e87c25408fb80ff1dd75ca79789dc386d970e6..e11a469535f57834d5634537201bded491100549 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f2ffaf073d3c26e87af77efc89167fd74327ab4f..3ed869bf368d440ff1cad1c1f3c8a26cbc72f977 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 75f17d74c1f2ca02bfff7f732d25cf3885dda8a3..b7dcd512cf612be53dc7591aa3e59b9c56af7297 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e84d2218e05ba73a6c1f5d13c2dced0f5ea988aa..728043bd6baa2ae97218bbb3bea1439fb695594a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5a4340896f698331d4b1b06114f1e542e3694703..eab29cddae1b8faf38dae6f86e1e2de34a43cd10 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index aa1f5d104ba3eb33044f77234de257af525926a5..a5c8ff8780874ad7e05478578a019826d1a82c33 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1dc61d5d1d8b607daf54dc00e4d294af6ebfd154..fee28df6980831b4967551d7bc651a1aafbe0f4d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1cb23bcd6bded4e99f83be4e7dfa4ff163bd257b..756dec84667639bfe34b4ee02548fa064a6ed0c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0b2a1ff72a39873c6affa853d53beaa1ef03b630..1afeee067837b3fd341e0dfe8cf04adfe32b7d98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d617699e3bd18cc32ec5210f2ab88716e73c2be6..c897421ca5e153f116938e279efa482033307648 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3c7dab127cae11ee1337969cb310c79664b90176..93706f91f94ed7b43c3d99f722e837dfff4efbc4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7efe932c237c75c8d871f4275ce029d6584c145b..33a5c892579c2836e10f50dd391f8cb4c96c8f1b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 502bd7d040125fcc3b19f3e99bd8b6380eabab92..d9178afe1674ec1a03558eba3672fa07903239fc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(UseQtExt)
 
index 53e5dad6577a095779253ea74bce5cd2ec0441f5..954153eedec246b850334db4c79a5d62a24ba24f 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <document>
   <section name="language">
     <!-- Language settings (resource manager)-->
index 3e9486d611f8f64747416bb1d8caa6f70d2dc195..0bc7223e3b89a0b311175b635864babce6aae95b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_H
index 0d7a57d33a3d337f815ac27dc47066eaf13d84ea..644027633cb26a7673b98cdf51769f905a44f937 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef HAVE_SALOME
index 3773ae9bac0b423261ac87ee44d34cca0b47fa55..ed77da84091df7a6728103cf61c1d43b3e2d4944 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ActionsMgr_H
index 7176e061e45c8bbb407b245b285853a173b85e01..beffebcee689835db9609a7215e0cb397c42a781 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ActiveControlMgr.h"
index 7b0703a5d598d2e1fa31bb7ac648301a8f8d3a54..863fa1bc67e5b638fde7eac314fe2178a7d51f34 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ActiveControlMgr_H
index c0a3e1511532438d0636f976e9b0a4e525e9e5d4..eb45000843cabc9a0dc932926b66670c1c6901f5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ActiveControlSelector_H
index 244a515c7759b7668753e91e77652366e9237280..625bc9fe437be7af90daa2c8cb025204bc57a86f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_ColorDialog.h>
index bd3f0c157050d6f211b4ff4a4bb84e05b1f6ac8f..c1c01d997339b5f84b712cfc9fc498fa3d877bd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ColorDialog_H
index ebcddc95fe72297637e37d2dc18f53ccf934c182..83ccb93246acbd091c623dd96f2075d31dbf00ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_CompressFiles.h"
index e95b4ab041dcd35799148b6e09cd870864d308c5..98fb937dc8f8fe79cf6f24336faf4b9c2befb366 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_CompressFiles_H
index 87c91f9753ec01b48737e0a66f23e9cdd044b48b..8efbae6c6b5adf79876d91702b32587744b81551 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ContextMenuMgr.h"
@@ -803,6 +802,7 @@ void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const
         aActions = myViewerMenu[aName];
     }
   } else if (aSelected > 1) {
+    aActions.append(action("SHOW_ONLY_CMD"));
     aActions.append(action("HIDE_CMD"));
   }
   // hide all is shown always even if selection in the viewer is empty
index cc5dcf614996f9f1522201ca9a7ea56a5497b839..247cb6889c1471acf21c59c0d060f1ef97877cc2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ContextMenuMgr_H
index fe9fbfcdcca1d35c1e1f0cc282f3f7c7fe78fa0c..316d3cd73bf6a5c2d280133ef9457c8361f1f6f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_CustomPrs.h>
index 6a2af267c0e7d73b876b162f7aa9a22c2bb439c0..62d18d3356ec66a8188d1100a628c01b7abb3520 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_CustomPrs_H
index ee7f934575be45e96d283c0059cd48470785725e..7da65684d112a024bfa6b9f37ade0a19edb5a5ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_DataModel.h"
@@ -73,13 +72,21 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
     ModuleBase_ITreeNode* aParent;
     int aRow = 0;
     QModelIndex aParentIndex1, aParentIndex2;
+    ObjectPtr aObj;
     foreach(ModuleBase_ITreeNode* aNode, aNodes) {
+      aObj = aNode->object();
       aParent = aNode->parent();
-      aRow = aParent->nodeRow(aNode);
-      aParentIndex1 = getParentIndex(aNode, 0);
-      aParentIndex2 = getParentIndex(aNode, 2);
-      insertRows(aRow, 1, aParentIndex1);
-      dataChanged(aParentIndex1, aParentIndex2);
+      if (aObj.get() && (aObj->groupName() == ModelAPI_Folder::group())) {
+        aParent->update();
+        rebuildDataTree();
+      }
+      else {
+        aRow = aParent->nodeRow(aNode);
+        aParentIndex1 = getParentIndex(aNode, 0);
+        aParentIndex2 = getParentIndex(aNode, 2);
+        insertRows(aRow, 1, aParentIndex1);
+        dataChanged(aParentIndex1, aParentIndex2);
+      }
     }
   }
   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) {
@@ -92,7 +99,14 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
     for (aIt = aMsgGroups.cbegin(); aIt != aMsgGroups.cend(); aIt++) {
       aList.append(myRoot->objectsDeleted(aIt->first, aIt->second.c_str()));
     }
+    // Remove obsolete nodes
+    QTreeNodesList aRemaining;
     foreach(ModuleBase_ITreeNode* aNode, aList) {
+      if (myRoot->hasSubNode(aNode))
+        aRemaining.append(aNode);
+    }
+    // Update remaining nodes
+    foreach(ModuleBase_ITreeNode* aNode, aRemaining) {
       if (aNode->parent())
         aNode->parent()->update();
     }
@@ -124,28 +138,27 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
       rebuildDataTree();
     }
     else {
+      QSet<ModuleBase_ITreeNode*> aParents;
       foreach(ObjectPtr aObj, aCreated) {
         ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj);
         if (aNode) {
-          int aOldNb = aNode->childrenCount();
-          aNode->update();
-          int aNewNb = aNode->childrenCount();
-
-          QModelIndex aFirstIdx = getIndex(aNode, 0);
-          QModelIndex aLastIdx = getIndex(aNode, 2);
-
-          if (aNewNb > aOldNb) {
-            insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
-          }
-          else if (aNewNb < aOldNb) {
-            if (aNewNb)
-              removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
-            else if (aOldNb)
-              removeRows(0, aOldNb, aFirstIdx);
+          if (aNode->parent()) {
+            if (aNode->parent() == myRoot) {
+              aParents.clear();
+              aParents.insert(myRoot);
+              break;
+            }
+            else {
+              aNode = aNode->parent();
+            }
           }
-          dataChanged(aFirstIdx, aLastIdx);
+          aParents.insert(aNode);
         }
       }
+      foreach(ModuleBase_ITreeNode* aNode, aParents) {
+        aNode->update();
+      }
+      rebuildDataTree();
     }
   }
   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_ORDER_UPDATED)) {
index 929f3afb3467d003abc59f63f8dd1f0819923c53..f5805c328f57788d7aa0d7ef47455f6c8b248cdd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_DataModel_H
old mode 100755 (executable)
new mode 100644 (file)
index b48df69..598d33e
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_DeflectionDialog.h>
old mode 100755 (executable)
new mode 100644 (file)
index db9ff6c..5cf2376
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_DeflectionDialog_H
index 7910ec06a677458604f8f7decec0eb1604e80ffb..e83f1f14328bbe221d9e655f12e29f123d3bd95c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_Displayer.h"
@@ -38,6 +37,7 @@
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultConstruction.h>
 
 #include <ModuleBase_BRepOwner.h>
 #include <ModuleBase_IModule.h>
@@ -86,6 +86,7 @@
 
 #include <Events_Loop.h>
 #include <ModelAPI_Events.h>
+#include <Config_PropManager.h>
 
 #include <set>
 
@@ -454,8 +455,9 @@ bool XGUI_Displayer::isVisible(XGUI_Displayer* theDisplayer, const ObjectPtr& th
     if (!aVisible && aResult.get() && aResult->groupName() == ModelAPI_ResultBody::group()) {
       ResultBodyPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
       if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids
-        bool anAllSubsVisible = aCompsolidResult->numberOfSubs() > 0;
-        for(int i = 0; i < aCompsolidResult->numberOfSubs() && anAllSubsVisible; i++) {
+        int aNumberOfSubs = aCompsolidResult->numberOfSubs();
+        bool anAllSubsVisible = aNumberOfSubs > 0;
+        for(int i = 0; i < aNumberOfSubs && anAllSubsVisible; i++) {
           anAllSubsVisible = theDisplayer->isVisible(aCompsolidResult->subResult(i));
         }
         aVisible = anAllSubsVisible;
@@ -692,7 +694,18 @@ Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
       selectionActivate()->deactivateTrihedron(true);
     aContext->DefaultDrawer()->VIsoAspect()->SetNumber(0);
     aContext->DefaultDrawer()->UIsoAspect()->SetNumber(0);
+
     ModuleBase_IViewer::DefaultHighlightDrawer = aContext->HighlightStyle();
+    // Commented out according to discussion in bug #2825
+    //Handle(Prs3d_Drawer) aSelStyle = aContext->SelectionStyle();
+    //double aDeflection =
+    //  QString(ModelAPI_ResultConstruction::DEFAULT_DEFLECTION().c_str()).toDouble();
+    //try {
+    //  aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+    //} catch (...) {}
+
+    //ModuleBase_IViewer::DefaultHighlightDrawer->SetDeviationCoefficient(aDeflection);
+    //aSelStyle->SetDeviationCoefficient(aDeflection);
   }
   return aContext;
 }
index d409df9272a066f98dc93d8ddbb9fd30024c5539..cf1f5edc2dedf66f6caf8dd8a6d98ba06b5f5b96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_Displayer_H
index ff50a947536a6885ed37e5564809c0b5b4bdd880..27b2c0e408db7091ddc719e0d8883b835b50b1d2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_ErrorDialog.h>
index e1f15cc4b601777f3e05ce240e971070805e4eb7..ae9b929eaf06465812edcf257181d5ea7e49d2a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ERRORDIALOG_H_
index 19c1135b9c8c142986d787eba46b2bebee8c625e..1f945e65d0295150e6e7419f88649ee939a1fa29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ErrorMgr.h"
index f4c60a4a74f20c6dbb3b759ed6485ed33914747b..72fe886a01c8d3400e5c54b8fbbfa98ef0970a5b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ErrorMgr_H
index 2a1624da88adccfa72d99557287b703a348729a4..ba5e5f82a87eeb2442f8656db1d934e708747b2b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_FacesPanel.h"
index be9b5ab02ccd70aff6d5239ffd69c00fbf3df92e..d4a0b04dae171cd5badcb5fba7e4715ee69f0c63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_FacesPanel_H_
index 7d496992b1ef28ae90edad1620362a623adabd03..2e93d60939fa6bd3831a4262e0f97004e1330dd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_FacesPanelSelector.h>
index fc16b36c3461e3b3a09fde697b0977d134b31fe8..081e7a3606359554e07dd4604bda7c4139189067 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_FacesPanelSelector_H
index 9e41deda7be11800bc2a09c28c1cae44515e793a..18332d5a209b5ec7da4471b23e1d4bbdb7541041 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_HistoryMenu.h>
index 91f13aba0a1fffba4ca9770c4b7f7138d7cd63bd..535003eb75f14123fef9897570e21d563d872415 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_HISTORYMENU_H_
index 8764568f800b05971645ff8d028bbfa821c3a554..c77f750b8524e48113a57d159d2d98006cf6ee26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_InspectionPanel.h"
index e8a6f7ba6f38ead416353a2f654ce1e2e514d343..3f980ea42071aecdc69ee4e293b909f51ef6fdae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_INSPECTIONPANEL_H_
old mode 100755 (executable)
new mode 100644 (file)
index 921ae16..0ce5e9c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_MenuGroup.h>
old mode 100755 (executable)
new mode 100644 (file)
index 7166d9b..5309b18
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_MENUGROUP_H_
old mode 100755 (executable)
new mode 100644 (file)
index 577685a..8a6fce0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_MenuMgr.h>
old mode 100755 (executable)
new mode 100644 (file)
index d122d8b..9d39748
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_MENUMGR_H_
old mode 100755 (executable)
new mode 100644 (file)
index 84309c5..2a14d6f
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_MenuWorkbench.h>
old mode 100755 (executable)
new mode 100644 (file)
index 56facf9..4114fc4
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_MENUWORKBENCH_H_
index 5c67a3d5037b62d454236c5de5ec2b8b403b1c11..2f41e3659dc0975cffe816a114b9e76c65df80cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ModuleConnector.h"
@@ -137,9 +136,7 @@ void XGUI_ModuleConnector::setSelected(const QList<ModuleBase_ViewerPrsPtr>& the
     foreach(ModuleBase_ViewerPrsPtr aVal, theValues) {
       anObjects.append(aVal->object());
     }
-    bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
     aBrowser->setObjectsSelected(anObjects);
-    myWorkshop->objectBrowser()->blockSignals(aBlocked);
   }
 }
 
index 409c6edee4eb305688782e69a30dfc2afd0979bc..ca97352fbc2dc4511a94f63606ae265f8a3ed453 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ModuleConnector_H
index b08ccc36e8fd56b2ca403aef51190fc6f529b660..913d35eef5e7dceb1875ec4838da09c30a727a74 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ObjectsBrowser.h"
@@ -40,6 +39,7 @@
 #include <QAction>
 #include <QStyledItemDelegate>
 #include <QMessageBox>
+#include <QApplication>
 
 #ifdef DEBUG_INDXES
 #include <QToolTip>
@@ -243,8 +243,11 @@ void XGUI_DataTree::processEyeClick(const QModelIndex& theIndex)
       bool hasHiddenState = aModel->hasHiddenState(theIndex);
       if (aObjBrowser && hasHiddenState && !aObjBrowser->workshop()->prepareForDisplay(anObjects))
         return;
-      if (hasHiddenState) // #issue 2335(hide all faces then show solid problem)
+      if (hasHiddenState) { // #issue 2335(hide all faces then show solid problem)
+        if (aResObj->isDisplayed())
+          aResObj->setDisplayed(false);
         aResObj->setDisplayed(true);
+      }
       else
         aResObj->setDisplayed(!aResObj->isDisplayed());
       Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
@@ -488,10 +491,12 @@ void XGUI_ObjectsBrowser::onEditItem()
       // Find index which corresponds the feature
       QModelIndex aIndex;
       foreach(QModelIndex aIdx, selectedIndexes()) {
-        ObjectPtr aFea = dataModel()->object(aIdx);
-        if (dataModel()->object(aIdx)->isSame(anObject)) {
-          aIndex = aIdx;
-          break;
+        if (aIdx.column() == 1) {
+          ObjectPtr aFea = dataModel()->object(aIdx);
+          if (dataModel()->object(aIdx)->isSame(anObject)) {
+            aIndex = aIdx;
+            break;
+          }
         }
       }
       if (aIndex.isValid()) {
@@ -533,17 +538,61 @@ void XGUI_ObjectsBrowser::rebuildDataTree()
 //***************************************************
 void XGUI_ObjectsBrowser::setObjectsSelected(const QObjectPtrList& theObjects)
 {
-  QList<QModelIndex> theIndexes;
   QItemSelectionModel* aSelectModel = myTreeView->selectionModel();
-  aSelectModel->clear();
+  QModelIndexList aIndexes = aSelectModel->selectedIndexes();
+  if (theObjects.size() == 0) {
+    bool aIsBlock = aSelectModel->blockSignals(true);
+    aSelectModel->clear();
+    aSelectModel->blockSignals(aIsBlock);
+    foreach(QModelIndex aIdx, aIndexes) {
+      myTreeView->update(aIdx);
+    }
+    return;
+  }
 
-  foreach(ObjectPtr aFeature, theObjects)
-  {
-    QModelIndex aIndex = myDocModel->objectIndex(aFeature);
-    if (aIndex.isValid()) {
-      aSelectModel->select(aIndex, QItemSelectionModel::Select);
+  ObjectPtr aObject;
+  QModelIndexList aUnselect;
+  QObjectPtrList aToSelect = theObjects;
+  QHash<qint64, ObjectPtr> aNotChanged;
+  foreach(QModelIndex aIdx, aIndexes) {
+    aObject = myDocModel->object(aIdx);
+    if (aObject.get()) {
+      if (aToSelect.contains(aObject)) {
+        aNotChanged.insert((qint64)aObject.get(), aObject);
+      } else {
+        aUnselect.append(aIdx);
+      }
+    }
+    else {
+      aUnselect.append(aIdx);
     }
   }
+
+  foreach(ObjectPtr aObj, aNotChanged)
+    aToSelect.removeAll(aObj);
+
+  bool aIsBlock = aSelectModel->blockSignals(true);
+  foreach(QModelIndex aIdx, aUnselect) {
+    aSelectModel->select(aIdx, QItemSelectionModel::Deselect);
+    myTreeView->update(aIdx);
+  }
+
+  QModelIndex aIndex0, aIndex1, aIndex2, aCurrent;
+  foreach(ObjectPtr aFeature, aToSelect) {
+    aIndex1 = myDocModel->objectIndex(aFeature, 1);
+    if (aIndex1.isValid()) {
+      if (!aCurrent.isValid())
+        aCurrent = aIndex1;
+      aIndex0 = myDocModel->objectIndex(aFeature, 0);
+      aIndex2 = myDocModel->objectIndex(aFeature, 2);
+      aSelectModel->select(aIndex1, QItemSelectionModel::Select | QItemSelectionModel::Rows);
+      myTreeView->update(aIndex0);
+      myTreeView->update(aIndex1);
+      myTreeView->update(aIndex2);
+    }
+  }
+  aSelectModel->setCurrentIndex(aCurrent, QItemSelectionModel::NoUpdate);
+  aSelectModel->blockSignals(aIsBlock);
 }
 
 //***************************************************
@@ -585,14 +634,14 @@ QObjectPtrList XGUI_ObjectsBrowser::selectedObjects(QModelIndexList* theIndexes)
   QObjectPtrList aList;
   QModelIndexList aIndexes = selectedIndexes();
   XGUI_DataModel* aModel = dataModel();
-  QModelIndexList::const_iterator aIt;
-  for (aIt = aIndexes.constBegin(); aIt != aIndexes.constEnd(); ++aIt) {
-    if ((*aIt).column() == 1) {
-      ObjectPtr aObject = aModel->object(*aIt);
+
+  foreach(QModelIndex aIdx, aIndexes) {
+    if (aIdx.column() == 1) {
+      ObjectPtr aObject = aModel->object(aIdx);
       if (aObject) {
         aList.append(aObject);
         if (theIndexes)
-          theIndexes->append(*aIt);
+          theIndexes->append(aIdx);
       }
     }
   }
index e2a4579404b2eaa8217652c051bf1d578a22e85a..1f43c899ce3a18e7e24a32b828b5e77614117f22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ObjectsBrowser_H
index a5f5b1bd6b26a758b39986debe0336583d23c17e..e00490f8e16789f31d2ae213fe75a0857a207d2d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_OperationMgr.h"
old mode 100755 (executable)
new mode 100644 (file)
index 07ed810..503c79c
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_OperationMgr_H
index ab15ae8121163e4b9a9a9abf938d71fb1c1a8a05..226d73a7d3cfdbadb1480ca70e3ae93a7d874e40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_PropertyDialog.h>
index 647340f6905784b4342801b18809a4766ddd302b..a53913850845685721d1837d296c0f04452ddacf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_PropertyDialog_H
old mode 100755 (executable)
new mode 100644 (file)
index 3ce0ed1..d2c31c0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_ActionsMgr.h>
index 62b87e9be11736b34cba701cf84a7a483166bb26..3198a9457d3cd862c57a95a3e221f05e83e18f62 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_PROPERTYPANEL_H_
index 30fc0f9b2d659f853cec695b94575173423ea441..8e797ebc58d7d2cbe0c0056f27528d5491fccc40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_PropertyPanelSelector.h>
index 37b5e27068a4664328270cdad258940eaf9f315f..2341f0913ddbd62f8ee377d898b40902d7029bf4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_PropertyPanelSelector_H
index 675dbad1ce6a46122f1b4b00ff27de333e3f70c5..ffcfeb742312940db748a0e2006d1caa91d949b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_QtEvents.h"
index 04af0ce7a0257ad252722088687a33f25c59d55b..985a43e9a7095de66d4c5d325c8a6ec96c743c6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_QTEVENTS_H_
index 46e792f5487010d3f017d4824d38277b22ed02fe..5998c5c16ba68c21bae0a6494304f2f62437d37d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_SalomeConnector.h"
index bca5d2b5b366b745599747ae6464547443559f9e..acf23e2bedad624445c442cd055e52efed61845f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_SALOMECONNECTOR_H
index 6962a47ac258331a7a4351b83ad2e13cefee7f17..9e29e8b1b08bf729dd70ae701143b374d9bef318 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_Selection.h"
@@ -63,6 +62,7 @@ XGUI_Selection::XGUI_Selection(XGUI_Workshop* theWorkshop)
 QList<ModuleBase_ViewerPrsPtr> XGUI_Selection::getSelected(const SelectionPlace& thePlace) const
 {
   QList<ModuleBase_ViewerPrsPtr> aPresentations;
+  QList<ModuleBase_ViewerPrsPtr> aToRemove;
 
   switch (thePlace) {
     case Browser:
@@ -72,8 +72,62 @@ QList<ModuleBase_ViewerPrsPtr> XGUI_Selection::getSelected(const SelectionPlace&
       getSelectedInViewer(aPresentations);
     break;
   case AllControls:
-      getSelectedInViewer(aPresentations);
-      getSelectedInBrowser(aPresentations);
+    // Get selection from object browser
+    getSelectedInBrowser(aPresentations);
+
+    // Filter out all objects except feature if there is no selected results in object browser
+    // Filter out all features if in object browser there are selected features and their results
+    bool aHasFeature = false;
+    bool aHasResult = false;
+    foreach(ModuleBase_ViewerPrsPtr aVal, aPresentations) {
+      if (aVal->object().get()) {
+        FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aVal->object());
+        if (aFeature.get()) {
+          aHasFeature = true;
+          std::list<ResultPtr> aResList = aFeature->results();
+          std::list<ResultPtr>::const_iterator aIt;
+          for (aIt = aResList.cbegin(); aIt != aResList.cend(); aIt++) {
+            foreach(ModuleBase_ViewerPrsPtr aSel, aPresentations) {
+              if (aSel->object() == (*aIt)) {
+                aHasResult = true;
+                break;
+              }
+            }
+            if (aHasResult)
+              break;
+          }
+        }
+      }
+      if (aHasFeature && aHasResult)
+        break;
+    }
+    //Get selection from a viewer
+    getSelectedInViewer(aPresentations);
+
+    // Filter out extra objects
+    if (aHasFeature && aHasResult) {
+      foreach(ModuleBase_ViewerPrsPtr aVal, aPresentations) {
+        if (aVal->object().get()) {
+          FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aVal->object());
+          if (aFeature.get()) {
+            aToRemove.append(aVal);
+          }
+        }
+      }
+    }
+    else if (aHasFeature && (!aHasResult)) {
+      foreach(ModuleBase_ViewerPrsPtr aVal, aPresentations) {
+        if (aVal->object().get()) {
+          FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aVal->object());
+          if (!aFeature.get()) {
+            aToRemove.append(aVal);
+          }
+        }
+      }
+    }
+    foreach(ModuleBase_ViewerPrsPtr aVal, aToRemove) {
+      aPresentations.removeAll(aVal);
+    }
     break;
   }
   return aPresentations;
index 8d9a0a24f82c5e99087e69e60dd9b4acffe1001e..c48a9e0506fb3a5f193490e0a03b03eba20afbf4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_Selection_H
index 3c6fc2f7191ea1a578c8113b588cb4374cbb7ec1..62433d9f380451aef343020b9b7ee09017f3fa8b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_SelectionActivate.h"
index 93f65e46ddc38a6e4b5e5813ff9b5379a3b3172c..e1dce511dbe1317251e11f45706e0ea62a922e9e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_ISelectionActivate_H
index 17a7ad6a1b694c1b760f0eec30e3307268963e51..8bc9f81dec4f2dee6e1a7db228c0aa227ab789e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_SelectionFilterType_H
old mode 100755 (executable)
new mode 100644 (file)
index 6ea5394..78b20ee
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_SelectionMgr.h"
@@ -111,7 +110,6 @@ void XGUI_SelectionMgr::onObjectBrowserSelection()
   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
   if (!myWorkshop->operationMgr()->hasOperation()) {
 
-    QList<ModuleBase_ViewerPrsPtr> aTmpList = aSelectedPrs;
     ObjectPtr aObject;
     FeaturePtr aFeature;
     // Select all results of a selected feature in viewer
@@ -120,19 +118,18 @@ void XGUI_SelectionMgr::onObjectBrowserSelection()
       if (aObject.get()) {
         aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
         if (aFeature.get()) {
-        std::list<ResultPtr> allRes;
-        ModelAPI_Tools::allResults(aFeature, allRes);
-        for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
-          aSelectedPrs.append(std::shared_ptr<ModuleBase_ViewerPrs>(
-            new ModuleBase_ViewerPrs(*aRes, GeomShapePtr(), NULL)));
+          std::list<ResultPtr> allRes;
+          ModelAPI_Tools::allResults(aFeature, allRes);
+          std::list<ResultPtr>::iterator aRes;
+          for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
+            aSelectedPrs.append(std::shared_ptr<ModuleBase_ViewerPrs>(
+              new ModuleBase_ViewerPrs(*aRes, GeomShapePtr(), NULL)));
           }
         }
       }
     }
-    aDisplayer->setSelected(aTmpList);
-  } else {
-    aDisplayer->setSelected(aSelectedPrs);
   }
+  aDisplayer->setSelected(aSelectedPrs);
   emit selectionChanged();
 }
 
@@ -146,10 +143,7 @@ void XGUI_SelectionMgr::onViewerSelection()
 
   QObjectPtrList anObjects;
   convertToObjectBrowserSelection(aValues, anObjects);
-
-  bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
   myWorkshop->objectBrowser()->setObjectsSelected(anObjects);
-  myWorkshop->objectBrowser()->blockSignals(aBlocked);
 
   emit selectionChanged();
 }
@@ -191,9 +185,7 @@ void XGUI_SelectionMgr::updateSelectionBy(const ModuleBase_ISelection::Selection
 void XGUI_SelectionMgr::clearSelection()
 {
   QObjectPtrList aFeatures;
-  bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
   myWorkshop->objectBrowser()->setObjectsSelected(aFeatures);
-  myWorkshop->objectBrowser()->blockSignals(aBlocked);
 
   QList<ModuleBase_ViewerPrsPtr> aSelectedPrs =
              myWorkshop->selector()->selection()->getSelected(ModuleBase_ISelection::Browser);
@@ -211,12 +203,9 @@ void XGUI_SelectionMgr::setSelected(const QList<ModuleBase_ViewerPrsPtr>& theVal
   aDisplayer->setSelected(theValues);
 
   // update selection in Object Browser
-  bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true);
   QObjectPtrList anObjects;
   convertToObjectBrowserSelection(theValues, anObjects);
-
   myWorkshop->objectBrowser()->setObjectsSelected(anObjects);
-  myWorkshop->objectBrowser()->blockSignals(aBlocked);
 }
 
 //**************************************************************
index 46650ef60adbfd5c23591311881224b76c958824..1a4e519b3a2ad1a5e2a6323c724ba169b993a34b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_SelectionMgr_H
index e5bc7a30829b394cd07d8a7159c7a814285b77b0..104eee4565aa06994c9a8292b62b552baaf564cb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_Tools.h"
@@ -36,6 +35,8 @@
 #include <ModelAPI_ResultPart.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Tools.h>
+#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultBody.h>
 #include <Events_InfoMessage.h>
 
 #include <GeomAPI_Shape.h>
@@ -149,14 +150,29 @@ bool canRemoveOrRename(QWidget* theParent, const std::set<FeaturePtr>& theFeatur
 //******************************************************************
 bool canRename(const ObjectPtr& theObject, const QString& theName)
 {
-  if (std::dynamic_pointer_cast<ModelAPI_ResultParameter>(theObject).get()) {
+  std::string aType = theObject->groupName();
+  if (aType == ModelAPI_ResultParameter::group()) {
     double aValue;
     ResultParameterPtr aParam;
     if (ModelAPI_Tools::findVariable(theObject->document(),
           FeaturePtr(), qPrintable(theName), aValue, aParam)) {
       const char* aKeyStr = "Selected parameter can not be renamed to: %1. "
                             "There is a parameter with the same name. Its value is: %2.";
-      QString aErrMsg(QObject::tr(aKeyStr).arg(qPrintable(theName)).arg(aValue));
+      QString aErrMsg(QObject::tr(aKeyStr).arg(theName).arg(aValue));
+      // We can not use here a dialog box for message -
+      // it will crash editing process in ObjectBrowser
+      Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send();
+      return false;
+    }
+  }
+  else {
+    DocumentPtr aDoc = theObject->document();
+    ObjectPtr aObj =
+      aDoc->objectByName(aType, theName.toStdString());
+
+    if (aObj.get() && theObject != aObj) {
+      QString aErrMsg(QObject::tr("Name %2 already exists in %1.").
+        arg(aType.c_str()).arg(theName));
       // We can not use here a dialog box for message -
       // it will crash editing process in ObjectBrowser
       Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send();
index b6ede361b89ca0367311e3d1921c93ce4a99ecb5..98178651f21436633800594fa3a82809b4161985 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_Tools_H
index 76ec83d8247ec5b7d6838cc1b811f5b4c043e70c..0814a34467bff6d4ac195177f8a46a2afb759719 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_TransparencyWidget.h"
index 006d1297aa85749f8c2fd91b3f9b9880a49e5631..a3f5b23b0245aed38ea39d34c303d49a2a238d73 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_TransparencyWidget_H
index 7c9af296a12d98afc75201f8e7525dac9172511e..6105a6fb600a9df4cbfc6eb73aff2445314ab983 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_ViewerProxy.h"
 #include <GeomAPI_Shape.h>
 #include <ModelAPI_ResultConstruction.h>
 
+#include <Config_PropManager.h>
+
 #include <AIS_Shape.hxx>
+#include <StdSelect_BRepOwner.hxx>
 
 #include <QEvent>
 
@@ -184,6 +186,7 @@ void XGUI_ViewerProxy::connectToViewer()
 
   connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), this,
           SIGNAL(contextMenuRequested(QContextMenuEvent*)));
+
 #else
   AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
 
@@ -239,9 +242,7 @@ bool XGUI_ViewerProxy::eventFilter(QObject *theObject, QEvent *theEvent)
 void XGUI_ViewerProxy::onViewCreated(ModuleBase_IViewWindow* theWnd)
 {
   theWnd->viewPort()->installEventFilter(this);
-
   myWindowScale.insert (theWnd->v3dView(), theWnd->v3dView()->Camera()->Scale());
-
   emit viewCreated(theWnd);
 }
 
@@ -406,26 +407,31 @@ bool XGUI_ViewerProxy::canDragByMouse() const
 }
 
 //***************************************
-void XGUI_ViewerProxy::displayHighlight()
+void XGUI_ViewerProxy::displayHighlight(FeaturePtr theFeature, const TopoDS_Shape& theIgnoreShape)
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
 
+  double aDeflection;
   if (myResult->groupName() == ModelAPI_ResultConstruction::group()) {
-    FeaturePtr aFeature = ModelAPI_Feature::feature(myResult);
-    if (aFeature.get()) {
-      std::list<ResultPtr> aResults = aFeature->results();
+    //FeaturePtr aFeature = ModelAPI_Feature::feature(myResult);
+    if (theFeature.get()) {
+      std::list<ResultPtr> aResults = theFeature->results();
       std::list<ResultPtr>::const_iterator aIt;
       ResultPtr aRes;
       Handle(AIS_Shape) aAis;
       for (aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
         aRes = (*aIt);
         TopoDS_Shape aTShape = aRes->shape()->impl<TopoDS_Shape>();
-        aAis = new AIS_Shape(aTShape);
-        aAis->SetColor(HIGHLIGHT_COLOR);
-        aAis->SetZLayer(1); //Graphic3d_ZLayerId_Topmost
-        myHighlights.Append(aAis);
-        aContext->Display(aAis, false);
-        aContext->Deactivate(aAis);
+        if (!aTShape.IsSame(theIgnoreShape)) {
+          aAis = new AIS_Shape(aTShape);
+          aAis->SetColor(HIGHLIGHT_COLOR);
+          aAis->SetZLayer(Graphic3d_ZLayerId_Top); //Graphic3d_ZLayerId_Topmost
+          aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
+          aAis->Attributes()->SetDeviationCoefficient(aDeflection);
+          myHighlights.Append(aAis);
+          aContext->Display(aAis, false);
+          aContext->Deactivate(aAis);
+        }
       }
     }
   }
@@ -433,7 +439,9 @@ void XGUI_ViewerProxy::displayHighlight()
     TopoDS_Shape aTShape = myResult->shape()->impl<TopoDS_Shape>();
     Handle(AIS_Shape) aAis = new AIS_Shape(aTShape);
     aAis->SetColor(HIGHLIGHT_COLOR);
-    aAis->SetZLayer(1); //Graphic3d_ZLayerId_Topmost
+    aAis->SetZLayer(Graphic3d_ZLayerId_Top); //Graphic3d_ZLayerId_Topmost
+    aDeflection = Config_PropManager::real("Visualization", "body_deflection");
+    aAis->Attributes()->SetDeviationCoefficient(aDeflection);
     myHighlights.Append(aAis);
     aContext->Display(aAis, false);
     aContext->Deactivate(aAis);
@@ -456,22 +464,33 @@ void XGUI_ViewerProxy::updateHighlight()
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
   if (!aContext.IsNull()) {
-    Handle(SelectMgr_EntityOwner) aOwner;
+    Handle(StdSelect_BRepOwner) aOwner;
     Handle(AIS_InteractiveObject) anIO;
     bool isDisplayed = false;
+    TopoDS_Shape aShape, aShp;
     ResultPtr aRes;
     XGUI_Displayer* aDisplayer = myWorkshop->displayer();
     for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
-      aOwner = aContext->DetectedOwner();
-      anIO = Handle(AIS_InteractiveObject)::DownCast(aOwner->Selectable());
-      aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aDisplayer->getObject(anIO));
-      if (aRes.get() && (aRes != myResult)) {
-        eraseHighlight();
-        myResult = aRes;
-        displayHighlight();
-        aContext->UpdateCurrentViewer();
+      aOwner = Handle(StdSelect_BRepOwner)::DownCast(aContext->DetectedOwner());
+      if ((!aOwner.IsNull()) && aOwner->HasShape()) {
+        aShape = aOwner->Shape();
+        anIO = Handle(AIS_InteractiveObject)::DownCast(aOwner->Selectable());
+        aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aDisplayer->getObject(anIO));
+        if (aRes.get() && (aRes != myResult)) {
+          eraseHighlight();
+          FeaturePtr aFeature = ModelAPI_Feature::feature(aRes);
+          aShp = aRes->shape()->impl<TopoDS_Shape>();
+          if ((aFeature->results().size() > 1) || (!aShp.IsSame(aShape))) {
+            myResult = aRes;
+            displayHighlight(aFeature, aShape);
+          }
+          else {
+            myResult = ResultPtr();
+          }
+          aContext->UpdateCurrentViewer();
+        }
+        isDisplayed = aRes.get();
       }
-      isDisplayed = aRes.get();
     }
     if (!isDisplayed) {
       eraseHighlight();
index f9f104ff35520301eef89e71353a813a8dacb191..3e78f0c9a534318364cba1943cf829a4213cfe25 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_VIEWERPROXY_H
@@ -159,7 +158,7 @@ private slots:
 #endif
 
  private:
-   void displayHighlight();
+   void displayHighlight(FeaturePtr theFeature, const TopoDS_Shape& theIgnoreShape);
    void eraseHighlight();
 
   XGUI_Workshop* myWorkshop;
old mode 100755 (executable)
new mode 100644 (file)
index 2e135c8..2660cb9
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_Workshop.h"
@@ -170,8 +169,15 @@ QString XGUI_Workshop::MOVE_TO_END_COMMAND = QObject::tr("Move to the end");
 //#define DEBUG_FEATURE_NAME
 //#define DEBUG_CLEAN_HISTORY
 
-
-static QString MyFilter(QObject::tr("OpenParts files (*.opp)"));
+#ifdef HAVE_SALOME
+static QString MyFilter(QObject::tr("SHAPER files (*.shaper *.opp)"));
+static QString MyFilter2(QObject::tr("SHAPER files (*.shaper)"));
+static QString MyExtension(".shaper");
+#else
+static QString MyFilter(QObject::tr("OpenParts files (*.opp);;All files (*.*)"));
+static QString MyFilter2(QObject::tr("OpenParts files (*.opp)"));
+static QString MyExtension(".opp");
+#endif
 
 
 //******************************************************
@@ -303,6 +309,8 @@ XGUI_Workshop::~XGUI_Workshop(void)
 
   delete myDisplayer;
   delete myDataModelXMLReader;
+  delete mySelectionActivate;
+  delete myMenuMgr;
   clearTemporaryDir();
 }
 
@@ -433,13 +441,13 @@ void XGUI_Workshop::initMenu()
 
   salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
 
-  aAction = salomeConnector()->addDesktopCommand("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
-                                              tr("Blocks immediate apply of modifications"),
-                                              QIcon(":pictures/autoapply.png"), QKeySequence(),
-                                              false, "MEN_DESK_EDIT");
-  salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
+  //aAction = salomeConnector()->addDesktopCommand("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
+  //                                            tr("Blocks immediate apply of modifications"),
+  //                                            QIcon(":pictures/autoapply.png"), QKeySequence(),
+  //                                            false, "MEN_DESK_EDIT");
+  //salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
 
-  connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onAutoApply()));
+  //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onAutoApply()));
 
   salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
 
@@ -499,7 +507,7 @@ void XGUI_Workshop::initMenu()
   aCommand = aGroup->addFeature("AUTOCOMPUTE_CMD", tr("Auto rebuild"),
                                 tr("Blocks immediate apply of modifications"),
                                 QIcon(":pictures/autoapply_start.png"), QKeySequence());
-  //aCommand->setChecked(ModelAPI_Session::get()->isAutoUpdateBlocked());
+  aCommand->setChecked(ModelAPI_Session::get()->isAutoUpdateBlocked());
   aCommand->connectTo(this, SLOT(onAutoApply()));
 
   aCommand = aGroup->addFeature("PREF_CMD", tr("Preferences"), tr("Edit preferences"),
@@ -1082,10 +1090,10 @@ bool XGUI_Workshop::onSaveAs()
   if(!myOperationMgr->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage))
     return false;
   myCurrentFile = QFileDialog::getSaveFileName(desktop(), tr("Select name to save file..."),
-    QString(), MyFilter);
+    QString(), MyFilter2);
   if (!myCurrentFile.isNull()) {
-    if (!myCurrentFile.endsWith(".opp")) {
-      myCurrentFile += ".opp";
+    if (!myCurrentFile.endsWith(MyExtension)) {
+      myCurrentFile += MyExtension;
     }
   }
   else
@@ -1323,7 +1331,6 @@ void XGUI_Workshop::updateCommandStatus()
           aCmd->setEnabled(myModule->canRedo());
       }
       else if (aId == "AUTOCOMPUTE_CMD") {
-        //aCmd->setChecked(aMgr->isAutoUpdateBlocked());
         aCmd->setIcon(aMgr->isAutoUpdateBlocked() ?
           QIcon(":pictures/autoapply_stop.png") :
           QIcon(":pictures/autoapply_start.png"));
@@ -2207,6 +2214,9 @@ void setColor(ResultPtr theResult, const std::vector<int>& theColor)
     aColorAttr->setValue(1, theColor[1]);
     aColorAttr->setValue(2, theColor[2]);
   }
+  static const Events_ID kRedisplayEvent =
+    Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  ModelAPI_EventCreator::get()->sendUpdated(theResult, kRedisplayEvent);
 }
 
 //**************************************************************
@@ -2285,6 +2295,9 @@ void setDeflection(ResultPtr theResult, const double theDeflection)
   AttributeDoublePtr aDeflectionAttr = theResult->data()->real(ModelAPI_Result::DEFLECTION_ID());
   if (aDeflectionAttr.get() != NULL)
     aDeflectionAttr->setValue(theDeflection);
+  static const Events_ID kRedisplayEvent =
+    Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  ModelAPI_EventCreator::get()->sendUpdated(theResult, kRedisplayEvent);
 }
 
 //**************************************************************
@@ -2296,6 +2309,9 @@ void setTransparency(ResultPtr theResult, double theTransparency)
   AttributeDoublePtr anAttribute = theResult->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
   if (anAttribute.get() != NULL)
     anAttribute->setValue(theTransparency);
+  static const Events_ID kRedisplayEvent =
+    Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  ModelAPI_EventCreator::get()->sendUpdated(theResult, kRedisplayEvent);
 }
 
 //**************************************************************
@@ -2714,9 +2730,7 @@ void XGUI_Workshop::highlightResults(const QObjectPtrList& theObjects)
   }
   if (aSelList.count() > theObjects.count()) {
     // if something was found
-    bool aBlocked = objectBrowser()->blockSignals(true);
     objectBrowser()->setObjectsSelected(aSelList);
-    objectBrowser()->blockSignals(aBlocked);
     objectBrowser()->ensureVisible(aNewSel.first());
   }
   if (aHasHidden)
@@ -2743,9 +2757,7 @@ void XGUI_Workshop::highlightFeature(const QObjectPtrList& theObjects)
   }
   if (aSelList.count() > theObjects.count()) {
     // if something was found
-    bool aBlocked = objectBrowser()->blockSignals(true);
     objectBrowser()->setObjectsSelected(aSelList);
-    objectBrowser()->blockSignals(aBlocked);
     objectBrowser()->ensureVisible(aNewSel.first());
   }
 }
@@ -2835,16 +2847,16 @@ void XGUI_Workshop::updateAutoComputeState()
   SessionPtr aMgr = ModelAPI_Session::get();
   bool isComputeBlocked = aMgr->isAutoUpdateBlocked();
 #ifdef HAVE_SALOME
-  QAction* aUpdateCmd;
-  QList<QAction*> aCommands = mySalomeConnector->commandList();
-  foreach(QAction* aCmd, aCommands) {
-    if (aCmd->data().toString() == "AUTOCOMPUTE_CMD") {
-      aUpdateCmd = aCmd;
-      break;
-    }
-  }
-  aUpdateCmd->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
-    QIcon(":pictures/autoapply_start.png"));
+//  QAction* aUpdateCmd;
+//  QList<QAction*> aCommands = mySalomeConnector->commandList();
+//  foreach(QAction* aCmd, aCommands) {
+//    if (aCmd->data().toString() == "AUTOCOMPUTE_CMD") {
+//      aUpdateCmd = aCmd;
+//      break;
+//    }
+//  }
+//  aUpdateCmd->setIcon(isComputeBlocked? QIcon(":pictures/autoapply_stop.png") :
+//    QIcon(":pictures/autoapply_start.png"));
 #else
   AppElements_MainMenu* aMenuBar = myMainWindow->menuObject();
   AppElements_Command* aUpdateCmd = aMenuBar->feature("AUTOCOMPUTE_CMD");
old mode 100755 (executable)
new mode 100644 (file)
index 2955efa..ea1ecf0
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_WORKSHOP_H
old mode 100755 (executable)
new mode 100644 (file)
index 7701c22..5796dde
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "XGUI_WorkshopListener.h"
old mode 100755 (executable)
new mode 100644 (file)
index cece7d9..f6ab5a6
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_WORKSHOP_LISTENER_H
index ea9614f94e2b2d4bee5d4c0483a7c3b01981548b..c499b468f6c8a9b97441fb0f79326ad51ed55565 100644 (file)
      <file>pictures/autoapply_start.png</file>
      <file>pictures/autoapply_stop.png</file>
      <file>pictures/whatis.png</file>
+
+     <file>pictures/arrow-left.png</file>
+     <file>pictures/arrow-right.png</file>
+     <file>pictures/arrow-up.png</file>
+     <file>pictures/arrow-down.png</file>
+     <file>pictures/configure_toolbars.png</file>
  </qresource>
  </RCC>
diff --git a/src/XGUI/pictures/arrow-down.png b/src/XGUI/pictures/arrow-down.png
new file mode 100644 (file)
index 0000000..b5d69ba
Binary files /dev/null and b/src/XGUI/pictures/arrow-down.png differ
diff --git a/src/XGUI/pictures/arrow-left.png b/src/XGUI/pictures/arrow-left.png
new file mode 100644 (file)
index 0000000..7895091
Binary files /dev/null and b/src/XGUI/pictures/arrow-left.png differ
diff --git a/src/XGUI/pictures/arrow-right.png b/src/XGUI/pictures/arrow-right.png
new file mode 100644 (file)
index 0000000..7d8f9ba
Binary files /dev/null and b/src/XGUI/pictures/arrow-right.png differ
diff --git a/src/XGUI/pictures/arrow-up.png b/src/XGUI/pictures/arrow-up.png
new file mode 100644 (file)
index 0000000..0ec1e0d
Binary files /dev/null and b/src/XGUI/pictures/arrow-up.png differ
diff --git a/src/XGUI/pictures/configure_toolbars.png b/src/XGUI/pictures/configure_toolbars.png
new file mode 100644 (file)
index 0000000..341fa2e
Binary files /dev/null and b/src/XGUI/pictures/configure_toolbars.png differ
index 72ca9e7d4316ceb6caed3241f7471de66986f4e5..f2d685503a30ad423c2660085a8d502c57621f82 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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(UnitTest)
 
@@ -27,9 +26,13 @@ ADD_UNIT_TESTS_API(
   Primitives/TestSphere.py
   Primitives/TestTorus.py
   Primitives/TestAPI_Box.py
+  Primitives/TestAPI_Cone.py
   Primitives/TestAPI_Cylinder.py
-  GDML/TestConeSegment.py
-  GDML/TestAPI_ConeSegment.py
+  Primitives/TestAPI_Sphere.py
+  Primitives/TestAPI_Torus.py
+  #GDML/TestConeSegment.py
+  #GDML/TestAPI_ConeSegment.py
+  Transformations/TestAPI_MultiRotation.py
   Transformations/TestAPI_MultiTranslation.py
   Transformations/TestAPI_Rotation.py
   Transformations/TestAPI_Scale.py
index 6b6205fabdd01e4dabf03fb86a57c4c14085b6fd..72d04433f46b17f820e2e5ca262be60320e7b7bc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
index f0deb9ef7c7c066a0e2c83afdeb869810d297eb1..f0132c6986aa371b13aeacbe59e8e07419b3e57e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for GDML Primitive Cone Segment feature.
index 8ea9d29dc2ac578474ef6a5b76d1f3b048398bc8..726b0726049383d949ff8bae337ee630167c5527 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
diff --git a/test.API/SHAPER/Primitives/TestAPI_Cone.py b/test.API/SHAPER/Primitives/TestAPI_Cone.py
new file mode 100644 (file)
index 0000000..774faef
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Ax1 as axis
+from GeomAPI import GeomAPI_Dir as direction
+
+# Points
+pnt1 = pnt(0., 0., 0.)
+pnt2 = pnt(10., 10., 10.)
+
+# Axis
+yDir = direction(0.,10.,0.)
+ax1 = axis(pnt1, yDir)
+
+# Edges
+edgaxis = edgeBuilder.line(ax1.dir().x(), ax1.dir().y(), ax1.dir().z())
+
+Cone_1 = shaperpy.makeCone(5., 10., 10.)
+Cone_2 = shaperpy.makeCone(0., 10., 10.)
+Cone_3 = shaperpy.makeCone(5., 0., 10.)
+
+try:
+  Cone_4 = shaperpy.makeCone(5., 10., 0.)
+except myExcept as ec:
+  assert(ec.what() == "Cone builder :: height is negative or null.")
+
+Cone_5 = shaperpy.makeCone(pnt2, edgaxis, 5., 10., 10.)
+Cone_6 = shaperpy.makeCone(pnt2, edgaxis, 0., 10., 10.)
+Cone_7 = shaperpy.makeCone(pnt2, edgaxis, 5., 0., 10.)
+
+try:
+  Cone_8 = shaperpy.makeCone(None, edgaxis, 5., 10., 10.)
+except myExcept as ec:
+  assert(ec.what() == "Cone builder :: the base point is not valid.")
+
+try:
+  Cone_9 = shaperpy.makeCone(pnt2, None, 5., 10., 10.)
+except myExcept as ec:
+  assert(ec.what() == "Cone builder :: the axis is not valid.")
+
+try:
+  Cone_10 = shaperpy.makeCone(pnt2, edgaxis, 5., 10., 0.)
+except myExcept as ec:
+  assert(ec.what() == "Cone builder :: height is negative or null.")
index 95cb08f9520cb2aaaf5edc087f987f15d0d5e0d1..eed8621a2a8f0126c85b9a7942614d01f04c8edd 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
diff --git a/test.API/SHAPER/Primitives/TestAPI_Sphere.py b/test.API/SHAPER/Primitives/TestAPI_Sphere.py
new file mode 100644 (file)
index 0000000..1717a72
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Pnt as pnt
+
+# Points
+pnt1 = pnt(10., 10., 10.)
+
+Sphere_1 = shaperpy.makeSphere(pnt1, 10.)
+Sphere_2 = shaperpy.makeSphere(10.)
+
+try:
+  Sphere_3 = shaperpy.makeSphere(pnt1, 0.)
+except myExcept as ec:
+  assert(ec.what() == "Sphere builder :: radius is negative or null.")
+
+try:
+  Sphere_4 = shaperpy.makeSphere(0.)
+except myExcept as ec:
+  assert(ec.what() == "Sphere builder :: radius is negative or null.")
+
+try:
+  Sphere_5 = shaperpy.makeSphere(None, 10.)
+except myExcept as ec:
+  assert(ec.what() == "Sphere builder :: center is not valid.")
diff --git a/test.API/SHAPER/Primitives/TestAPI_Torus.py b/test.API/SHAPER/Primitives/TestAPI_Torus.py
new file mode 100644 (file)
index 0000000..d3f1789
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAlgoAPI import GeomAlgoAPI_EdgeBuilder as edgeBuilder
+from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Ax1 as axis
+from GeomAPI import GeomAPI_Dir as direction
+
+# Points
+pnt1 = pnt(0., 0., 0.)
+pnt2 = pnt(10., 10., 10.)
+
+# Axis
+yDir = direction(0.,10.,0.)
+ax1 = axis(pnt1, yDir)
+
+# Edges
+edgaxis = edgeBuilder.line(ax1.dir().x(), ax1.dir().y(), ax1.dir().z())
+
+Torus_1 = shaperpy.makeTorus(10., 5.)
+
+try:
+  Torus_2 = shaperpy.makeTorus(0., 5.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: radius is negative or null.")
+
+try:
+  Torus_3 = shaperpy.makeTorus(10., 0.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: ring radius is negative or null.")
+
+try:
+  Torus_4 = shaperpy.makeTorus(5., 10.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: ring radius is greater than the radius.")
+
+Torus_5 = shaperpy.makeTorus(pnt2, edgaxis, 10., 5.)
+
+try:
+  Torus_6 = shaperpy.makeTorus(None, edgaxis, 10., 5.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: the base point is not valid.")
+
+try:
+  Torus_7 = shaperpy.makeTorus(pnt2, None, 10., 5.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: the axis is not valid.")
+
+try:
+  Torus_8 = shaperpy.makeTorus(pnt2, edgaxis, 0., 5.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: radius is negative or null.")
+
+try:
+  Torus_8 = shaperpy.makeTorus(pnt2, edgaxis, 10., 0.)
+except myExcept as ec:
+  assert(ec.what() == "Torus builder :: ring radius is negative or null.")
index 772056c0a4731b86c15ddd631a455f69598adbed..9dded65b070fc49b38ea79c85952f26d93003086 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Primitive Box feature.
@@ -54,8 +53,8 @@ SketchLine_7 = Sketch_2.addLine(40, 20, 20, 20)
 SketchLine_8 = Sketch_2.addLine(20, 20, 20, 10)
 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchLine_5.startPoint(), SketchLine_8.endPoint())
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e")])
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_2/SketchLine_6_EndVertex")])
 
 # Extrusion
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection("EDGE", "PartSet/OZ"), 100, 0)
@@ -81,8 +80,8 @@ Box_11 = model.addBox(Part_1_doc, Point_1, Point_4)
 Box_12 = model.addBox(Part_1_doc, Point_1, Point_5)
 Box_13 = model.addBox(Part_1_doc, Vertex_3, Point_2)
 Box_14 = model.addBox(Part_1_doc, Point_2, Vertex_3)
-Box_15 = model.addBox(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_4e"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_7s-SketchLine_6e"))
-Box_16 = model.addBox(Part_1_doc, model.selection("VERTEX", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_2&Extrusion_2_1/To_Face_1"))
+Box_15 = model.addBox(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_2/SketchLine_6_EndVertex"))
+Box_16 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_6][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_7][Extrusion_2_1/To_Face]"))
 Box_17 = model.addBox(Part_1_doc, model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_2_1"))
 Box_18 = model.addBox(Part_1_doc, "dx", "dy", "dz")
 model.do()
index ebe3d508696ac40e9d7e19ebb440dadafe0fd070..a1a59443bb5a80724bdf852779b87673457d145c 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from salome.shaper import model
 
 model.begin()
@@ -33,6 +51,9 @@ Cone_13 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"),
 Cone_14 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10., 10., 15.)
 Cone_15 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), "baseRadius", "topRadius", "h")
 
+Cone_16 = model.addCone(Part_1_doc, 5., 10., 15.)
+Cone_16.setRadius(10., 15.)
+
 model.do()
 model.end()
 
@@ -81,6 +102,12 @@ model.testNbSubShapes(Cone_15, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Cone_15, GeomAPI_Shape.FACE, [3])
 model.testHaveNamingFaces(Cone_15, model, Part_1_doc)
 
+model.testNbResults(Cone_16, 1)
+model.testNbSubResults(Cone_16, [0])
+model.testNbSubShapes(Cone_16, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Cone_16, GeomAPI_Shape.FACE, [3])
+model.testHaveNamingFaces(Cone_16, model, Part_1_doc)
+
 model.testNbResults(Cone_4, 0)
 assert(Cone_4.feature().error() == "Cone builder :: base radius is negative.")
 
index 850ce6733b0b66a0de2ab75bc687f1dcf57192c8..d271186178f13322fb3e13545046e31989df83d6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Primitive Cylinder feature.
@@ -46,12 +45,12 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint()
 model.do()
 
 # Extrusion
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0)
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 100, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")], model.selection(), 100, 0)
 
 # Edge
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3")])
 
 # Axis
 Axis_1 = model.addAxis(Part_1_doc, 0, 10, 0)
@@ -74,9 +73,9 @@ Cylinder_6 = model.addCylinder(Part_1_doc, 5, 0)
 Cylinder_7 = model.addCylinder(Part_1_doc, 5, -10)
 Cylinder_8 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "InvalidName"), model.selection("EDGE", "PartSet/OX"), 5, 10)
 Cylinder_9 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "InvalidName"), 5, 10)
-Cylinder_10 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_3s-SketchLine_2e"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), 50, 120)
+Cylinder_10 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchLine_2_EndVertex"), model.selection("EDGE", "Sketch_1/SketchLine_3"), 50, 120)
 Cylinder_11 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Vertex_1_1"), model.selection("EDGE", "Edge_1_1"), 60, 100)
-Cylinder_12 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"), 5, 10)
+Cylinder_12 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"), model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), 5, 10)
 Cylinder_13 = model.addCylinder(Part_1_doc, "r", "h")
 Cylinder_14 = model.addCylinder(Part_1_doc, 5, 10, 45)
 Cylinder_15 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("EDGE", "PartSet/OX"), 5, 10, 90)
@@ -91,9 +90,9 @@ Cylinder_23 = model.addCylinder(Part_1_doc, 5, 10, -45)
 Cylinder_24 = model.addCylinder(Part_1_doc, 5, 10, 450)
 Cylinder_25 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "InvalidName"), model.selection("EDGE", "PartSet/OX"), 5, 10, 90)
 Cylinder_26 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "InvalidName"), 5, 10, 90)
-Cylinder_27 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchLine_1e"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), 50, 120, 90)
+Cylinder_27 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), model.selection("EDGE", "Sketch_1/SketchLine_3"), 50, 120, 90)
 Cylinder_28 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Vertex_1_1"), model.selection("EDGE", "Edge_2_1"), 60, 100, 180)
-Cylinder_29 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_2&Extrusion_2_1/To_Face_1"), model.selection("EDGE", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/To_Face_1"), 5, 10, 120)
+Cylinder_29 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "[Extrusion_2_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_2_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_2_1/To_Face]"), model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_2_1/To_Face]"), 5, 10, 120)
 Cylinder_30 = model.addCylinder(Part_1_doc, "r2", "h2", "angle")
 
 model.do()
index cf80aab10c0eea6dc6390dfb500ee63520e93bbb..d7e599aa5ce041bf1c55854fbf449013b904fb19 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from salome.shaper import model
 
 model.begin()
@@ -20,6 +38,9 @@ Sphere_4 = model.addSphere(Part_1_doc, Point_1, 10)
 Sphere_5 = model.addSphere(Part_1_doc, Point_2, 10)
 Sphere_6 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), "r")
 
+Sphere_7 = model.addSphere(Part_1_doc, 10)
+Sphere_7.setCenterPoint(Point_1)
+
 model.do()
 model.end()
 
@@ -42,7 +63,13 @@ model.testNbResults(Sphere_6, 1)
 model.testNbSubResults(Sphere_6, [0])
 model.testNbSubShapes(Sphere_6, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Sphere_6, GeomAPI_Shape.FACE, [1])
-model.testHaveNamingFaces(Sphere_4, model, Part_1_doc)
+model.testHaveNamingFaces(Sphere_6, model, Part_1_doc)
+
+model.testNbResults(Sphere_7, 1)
+model.testNbSubResults(Sphere_7, [0])
+model.testNbSubShapes(Sphere_7, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Sphere_7, GeomAPI_Shape.FACE, [1])
+model.testHaveNamingFaces(Sphere_7, model, Part_1_doc)
 
 model.testNbResults(Sphere_2, 0)
 assert(Sphere_2.feature().error() == "Sphere builder :: radius is negative or null.")
index a60d9daf35ee265dc1282eea362cd13230c7d42c..a63408a7a7b39e55740666a9ca895c300fcf1fc9 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 from salome.shaper import model
 
 model.begin()
@@ -27,6 +45,7 @@ Torus_8 = model.addTorus(Part_1_doc, Point_1, Axis_1, 15, 4)
 Torus_9 = model.addTorus(Part_1_doc, Point_2, model.selection("EDGE", "PartSet/OZ"), 15, 4)
 Torus_10 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), Axis_2, 15, 4)
 Torus_11 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), "r", "ring")
+Torus_12 = model.addTorus(Part_1_doc, 15, 4)
 
 model.do()
 model.end()
@@ -58,6 +77,12 @@ model.testNbSubShapes(Torus_11, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Torus_11, GeomAPI_Shape.FACE, [1])
 model.testHaveNamingFaces(Torus_11, model, Part_1_doc)
 
+model.testNbResults(Torus_12, 1)
+model.testNbSubResults(Torus_12, [0])
+model.testNbSubShapes(Torus_12, GeomAPI_Shape.SOLID, [1])
+model.testNbSubShapes(Torus_12, GeomAPI_Shape.FACE, [1])
+model.testHaveNamingFaces(Torus_12, model, Part_1_doc)
+
 model.testNbResults(Torus_2, 0)
 assert(Torus_2.feature().error() == "Torus builder :: ring radius is greater than the radius.")
 
diff --git a/test.API/SHAPER/Transformations/TestAPI_MultiRotation.py b/test.API/SHAPER/Transformations/TestAPI_MultiRotation.py
new file mode 100644 (file)
index 0000000..f20b8b1
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
+from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
+from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
+from GeomAPI import GeomAPI_Ax1 as axis, GeomAPI_Pnt as pnt, GeomAPI_Dir as direction
+
+# Create Boxes
+Box_1 = shaperpy.makeBox(10.,10.,10.)
+Box_2 = shaperpy.makeBox(10.,10.,10.)
+Box_3 = shaperpy.makeBox(10.,10.,10.)
+Box_4 = shaperpy.makeBox(10.,10.,10.)
+Box_5 = shaperpy.makeBox(10.,10.,10.)
+Box_6 = shaperpy.makeBox(10.,10.,10.)
+Box_7 = shaperpy.makeBox(10.,10.,10.)
+
+# Points
+pntOrigin = pnt(0.,0.,0.)
+pnt1 = pnt(10.,0.,0.)
+
+# Axis
+xDir = direction(10., 0., 0.)
+ax1 = axis(pntOrigin, xDir)
+
+# Create MultiRotations
+MultiRotation_1 = shaperpy.makeMultiRotation(Box_1, ax1, 45., 5)
+MultiRotation_2 = shaperpy.makeMultiRotation(Box_2, ax1, 0., 5)
+
+try:
+  MultiRotation_3 = shaperpy.makeMultiRotation(Box_3, ax1, 45., -5)
+except myExcept as ec:
+  assert(ec.what() == "Multirotation builder :: the number of copies is null or negative.")
+
+try:
+  MultiRotation_4 = shaperpy.makeMultiRotation(None, ax1, 45., 5)
+except myExcept as ec:
+  assert(ec.what() == "Rotation builder :: source shape is not valid.")
+
+try:
+  MultiRotation_5 = shaperpy.makeMultiRotation(Box_4, None, 45., 5)
+except myExcept as ec:
+  assert(ec.what() == "Multirotation builder :: the axis is not valid")
+
+MultiRotation_6 = shaperpy.makeMultiRotation(Box_5, ax1, 5)
+
+try:
+  MultiRotation_7 = shaperpy.makeMultiRotation(Box_6, ax1, -5)
+except myExcept as ec:
+  assert(ec.what() == "Multirotation builder :: the number of copies is null or negative.")
+
+try:
+  MultiRotation_8 = shaperpy.makeMultiRotation(None, ax1, 5)
+except myExcept as ec:
+  assert(ec.what() == "Rotation builder :: source shape is not valid.")
+
+try:
+  MultiRotation_9 = shaperpy.makeMultiRotation(Box_7, None, 5)
+except myExcept as ec:
+  assert(ec.what() == "Multirotation builder :: the axis is not valid")
index 0a3ac761925f4a846088b0b865c4af39edd167ee..adf45289dfcd11ba8396fa258689cb0e709ac2c1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
@@ -58,18 +57,27 @@ MultiTranslation_5 = shaperpy.makeMultiTranslation(Box_5, ax1, 10., 5, ax2, 10.,
 MultiTranslation_6 = shaperpy.makeMultiTranslation(Box_6, ax1, 15., 5, ax2, -10., 5)
 
 # Tests en erreur
-#try:
-#    MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2)
-#except myExcept,ec:
-#    assert(ec.what() == "Multitranslation builder :: the first axis is not valid.")
+try:
+    MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the first axis is not valid")
 
 # Pas d'exception levee alors qu'une devrait y en avoir une
 try:
     MultiTranslation_7 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., 5, ax2, 10., -2)
 except myExcept as ec:
     assert(ec.what() == "Multitranslation builder :: the number of copies for the second direction is null or negative.")
+try:
+    MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., -2, ax2, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the number of copies for the first direction is null or negative.")
 
-#try:
-#    MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5)
-#except myExcept,ec:
-#    assert(ec.what() == "Multitranslation builder :: the second axis is not valid.")
+try:
+    MultiTranslation_9 = shaperpy.makeMultiTranslation(Box_8, None, 15., 5, ax2, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the first axis is not valid")
+
+try:
+    MultiTranslation_10 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the second axis is not valid")
index 1e9323572fd0799746e25dc9cfef4d4e45913cd1..3ebc9248fed1af040cde4c224732211140b02a6d 100644 (file)
@@ -1,26 +1,26 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
 from GeomAPI import GeomAPI_Ax1 as axis, GeomAPI_Pnt as pnt, GeomAPI_Dir as direction
+from GeomAPI import GeomAPI_Shape as shape
 
 # Create Boxes
 Box_1 = shaperpy.makeBox(10.,10.,10.)
@@ -113,3 +113,8 @@ try:
     Rotation_17 = shaperpy.makeRotation(None, pntOrigin, pnt3, pnt2)
 except myExcept as ec:
     assert(ec.what() == "Rotation builder :: source shape is not valid.")
+
+try:
+    Rotation_18 = shaperpy.makeRotation(shape(), ax1, 450)
+except myExcept as ec:
+    assert(ec.what() == "Rotation builder :: source shape does not contain any actual shape.")
index 8fc2c52449a0f10ecb08347570a6b6a16dd6e095..bc2c41a7fd112784b0c78b3434a86baddcb7c208 100644 (file)
@@ -1,26 +1,25 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
-from GeomAPI import GeomAPI_Pnt as pnt
+from GeomAPI import GeomAPI_Pnt as pnt, GeomAPI_Shape as shape
 
 # Create Boxes
 Box_1 = shaperpy.makeBox(10.,10.,10.)
@@ -77,4 +76,19 @@ Scale_17 = shaperpy.makeScale(Box_11, pntOrigin, -2., -3., 0.5)
 try :
     Scale_18 = shaperpy.makeScale(Box_12, None, 2., 3., 1.)
 except myExcept as ec :
-    assert(ec.what() == "Scale builder :: center point is not valid.")
\ No newline at end of file
+    assert(ec.what() == "Scale builder :: center point is not valid.")
+
+try :
+    Scale_19 = shaperpy.makeScale(None, pntOrigin, 2., 3., 1.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape is not valid.")
+
+try :
+    Scale_20 = shaperpy.makeScale(shape(), pntOrigin, 2.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape does not contain any actual shape.")
+
+try :
+    Scale_21 = shaperpy.makeScale(shape(), pntOrigin, 2., 3., 1.)
+except myExcept as ec :
+    assert(ec.what() == "Scale builder :: source shape does not contain any actual shape.")
index 6356d227ff47461a8aea6fbcc464029a9b1c04d7..3c50f4298d576292a3ca78826bb95af71dc34fa7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
@@ -24,6 +23,7 @@ from GeomAPI import GeomAPI_Pnt as pnt
 from GeomAPI import GeomAPI_Dir as direction
 from GeomAPI import GeomAPI_Ax1 as axis
 from GeomAPI import GeomAPI_Ax2 as plane
+from GeomAPI import GeomAPI_Shape as shape
 
 # Create boxes
 Box_1 = shaperpy.makeBox(10., 10., 10.)
@@ -63,10 +63,30 @@ Symmetry_1 = shaperpy.makeSymmetry(Box_1, origin)
 Symmetry_2 = shaperpy.makeSymmetry(Box_2, pnt1)
 
 try :
-    Symmetry_6 = shaperpy.makeSymmetry(Box_2, None)
+    Symmetry_3 = shaperpy.makeSymmetry(Box_3, None)
 except myExcept as ec :
     assert(ec.what() == "Symmetry builder :: point is not valid.")
 
-Symmetry_7 = shaperpy.makeSymmetry(Box_7, axZ)
-Symmetry_8 = shaperpy.makeSymmetry(Box_8, ax1)
-Symmetry_13 = shaperpy.makeSymmetry(Box_13, planeXOY)
+Symmetry_4 = shaperpy.makeSymmetry(Box_4, axZ)
+Symmetry_5 = shaperpy.makeSymmetry(Box_5, ax1)
+Symmetry_6 = shaperpy.makeSymmetry(Box_6, planeXOY)
+
+try :
+    Symmetry_7 = shaperpy.makeSymmetry(None, pnt1)
+except myExcept as ec :
+    assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+
+try :
+    Symmetry_8 = shaperpy.makeSymmetry(None, axZ)
+except myExcept as ec :
+    assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+
+try :
+    Symmetry_9 = shaperpy.makeSymmetry(None, planeXOY)
+except myExcept as ec :
+    assert(ec.what() == "Symmetry builder :: source shape is not valid.")
+
+try :
+    Symmetry_10 = shaperpy.makeSymmetry(shape(), pnt1)
+except myExcept as ec :
+    assert(ec.what() == "Symmetry builder :: source shape does not contain any actual shape.")
index 1d6a18c1f987085a7dcd2ada52a7b7191c78dbd8..02bd3161882085ad7e41184004886be033a161e1 100644 (file)
@@ -1,28 +1,28 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
 from GeomAPI import GeomAPI_Ax1 as axis
 from GeomAPI import GeomAPI_Pnt as pnt
 from GeomAPI import GeomAPI_Dir as direction
+from GeomAPI import GeomAPI_Shape as shape
 
 # Points
 pntOrigin = pnt(0.,0.,0.)
@@ -72,49 +72,69 @@ try:
 except myExcept as ec:
     assert(ec.what() == "Translation builder :: axis is not valid.")
 
-Translation_9 = shaperpy.makeTranslation(Box_5, ax4, 15.)
+Translation_5 = shaperpy.makeTranslation(Box_5, ax4, 15.)
 
 MultiTranslation_1 = shaperpy.makeMultiTranslation(Box_6, ax1, 15., 3, ax2, 15., 3)
-Translation_10 = shaperpy.makeTranslation(MultiTranslation_1, ax3, 15.)
+Translation_6 = shaperpy.makeTranslation(MultiTranslation_1, ax3, 15.)
 
 MultiTranslation_2 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., 3, ax2, 15., 3)
-Translation_11 = shaperpy.makeTranslation(MultiTranslation_2, ax3, 0.)
+Translation_7 = shaperpy.makeTranslation(MultiTranslation_2, ax3, 0.)
 
 MultiTranslation_3 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 3, ax2, 15., 3)
-Translation_12 = shaperpy.makeTranslation(MultiTranslation_3, ax3, -15.)
+Translation_8 = shaperpy.makeTranslation(MultiTranslation_3, ax3, -15.)
 
 MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_9, ax1, 15., 3, ax2, 15., 3)
 try:
-    Translation_13 = shaperpy.makeTranslation(MultiTranslation_4, None, 15.)
+    Translation_9 = shaperpy.makeTranslation(MultiTranslation_4, None, 15.)
 except myExcept as ec:
     assert(ec.what() == "Translation builder :: axis is not valid.")
 
 MultiTranslation_5 = shaperpy.makeMultiTranslation(Box_10, ax1, 15., 3, ax2, 15., 3)
-Translation_18 = shaperpy.makeTranslation(MultiTranslation_5, ax4, 15.)
+Translation_10 = shaperpy.makeTranslation(MultiTranslation_5, ax4, 15.)
 
 # Translations "By dimensions in X, in Y and in Z"
-Translation_91 = shaperpy.makeTranslation(Box_11, 10., 20., 15.)
-Translation_92 = shaperpy.makeTranslation(Box_11, 0., 20., 15.)
-Translation_93 = shaperpy.makeTranslation(Box_11, 10., 0., 15.)
-Translation_94 = shaperpy.makeTranslation(Box_11, 10., 20., 0.)
-Translation_95 = shaperpy.makeTranslation(Box_11, -10., 20., 15.)
-Translation_96 = shaperpy.makeTranslation(Box_11, 10., -20., 15.)
-Translation_97 = shaperpy.makeTranslation(Box_11, 10., 20., -15.)
+Translation_11 = shaperpy.makeTranslation(Box_11, 10., 20., 15.)
+Translation_12 = shaperpy.makeTranslation(Box_11, 0., 20., 15.)
+Translation_13 = shaperpy.makeTranslation(Box_11, 10., 0., 15.)
+Translation_14 = shaperpy.makeTranslation(Box_11, 10., 20., 0.)
+Translation_15 = shaperpy.makeTranslation(Box_11, -10., 20., 15.)
+Translation_16 = shaperpy.makeTranslation(Box_11, 10., -20., 15.)
+Translation_17 = shaperpy.makeTranslation(Box_11, 10., 20., -15.)
 
 # Translations "By two points"
-Translation_99 = shaperpy.makeTranslation(Box_11, pnt1, pnt2)
+Translation_18 = shaperpy.makeTranslation(Box_11, pnt1, pnt2)
 
 try:
-    Translation_100 = shaperpy.makeTranslation(Box_11, pnt1, pnt1)
+    Translation_19 = shaperpy.makeTranslation(Box_11, pnt1, pnt1)
 except myExcept as ec:
     assert(ec.what() == "Translation builder :: start point and end point coincide.")
 
 try:
-    Translation_101 = shaperpy.makeTranslation(Box_11, None, pnt1)
+    Translation_20 = shaperpy.makeTranslation(Box_11, None, pnt1)
 except myExcept as ec:
     assert(ec.what() == "Translation builder :: start point is not valid.")
 
 try:
-    Translation_102 = shaperpy.makeTranslation(Box_11, pnt1, None)
+    Translation_21 = shaperpy.makeTranslation(Box_11, pnt1, None)
 except myExcept as ec:
-    assert(ec.what() == "Translation builder :: end point is not valid.")
\ No newline at end of file
+    assert(ec.what() == "Translation builder :: end point is not valid.")
+
+try:
+    Translation_22 = shaperpy.makeTranslation(None, ax1, 15.)
+except myExcept as ec:
+    assert(ec.what() == "Translation builder :: source shape is not valid.")
+
+try:
+    Translation_23 = shaperpy.makeTranslation(None, 10., 20., 15.)
+except myExcept as ec:
+    assert(ec.what() == "Translation builder :: source shape is not valid.")
+
+try:
+    Translation_24 = shaperpy.makeTranslation(None, pnt1, pnt2)
+except myExcept as ec:
+    assert(ec.what() == "Translation builder :: source shape is invalid.")
+
+try:
+    Translation_25 = shaperpy.makeTranslation(shape(), ax1, 15.)
+except myExcept as ec:
+    assert(ec.what() == "Translation builder :: source shape does not contain any actual shape.")
index 6cfb62529620c11cd45c90e941cbf0ab32f7f393..fd89b88269559fd7feb21f41bb1ebfa230493f3a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for MultiRotation feature.
index bcfd1db29febc7eb1e6b7b78168e2d363a8d683e..8fcce7cac5cb26df40fa8019f15494d16df30f0a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for MultiTranslation feature.
@@ -55,11 +54,11 @@ SketchCircle_1 = Sketch_2.addCircle(3.420516499282639, 6.702654232424678, 2.6604
 model.do()
 
 # Create Wire & Extrusion
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_3")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
 
 # Revolution of the circle
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 
 # Create MultiTranslations
 MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), 15, 5)
@@ -175,4 +174,4 @@ assert(MultiTranslation_8.feature().error() == 'Attribute "axis_second_dir" is n
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SOLID, [0])
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SHELL, [10])
 #model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.FACE, [30])
-#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)
\ No newline at end of file
+#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)
index d078b73aff40e15499e7a44926aeba990ad8c2d0..b7343407fe2a363d9cc5fa360337de226bcca012 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Rotation feature.
index 0df7c1b982a197ba3227ac2923d5de54369320e8..55fe459ab5e98e3ee250a033ae3800726e512e9a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Scale feature.
@@ -70,25 +69,25 @@ model.do()
 Point_1 = model.addPoint(Part_1_doc, -10, -10, -10)
 
 # Create Vertexes
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")])
 
 # Create Wire & Extrusion
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f_wire")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 50, 0)
 
 # Create Scales
 Scale_1 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_1_1")] , model.selection("VERTEX", "PartSet/Origin"), 2)
 Scale_2 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_2_1")] , model.selection("VERTEX", "Point_1"), 2)
-Scale_3 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_3_1")] , model.selection("VERTEX", "Box_3_1/Back&Box_3_1/Left&Box_3_1/Top"), 2)
-Scale_4 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_4_1")] , model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e"), 2)
+Scale_3 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_3_1")] , model.selection("VERTEX", "[Box_3_1/Back][Box_3_1/Left][Box_3_1/Top]"), 2)
+Scale_4 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_4_1")] , model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), 2)
 Scale_5 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_5_1")] , model.selection("VERTEX", "Vertex_1_1"), 2)
 Scale_6 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_6_1")] , model.selection("VERTEX", "PartSet/Origin"), 0)
 Scale_7 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_7_1")] , model.selection("VERTEX", "PartSet/Origin"), -3)
 Scale_8 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_8_1")] , model.selection("VERTEX", "InvalidName"), 2)
 Scale_9 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_9_1")] , model.selection("VERTEX", "PartSet/Origin"), 2 , 3, 1)
 Scale_10 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_10_1")] , model.selection("VERTEX", "Point_1"), 2 , 3, 1)
-Scale_11 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_11_1")] , model.selection("VERTEX", "Box_11_1/Back&Box_11_1/Right&Box_11_1/Top"), 2 , 3, 1)
-Scale_12 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_12_1")] , model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e"), 2 , 3, 1)
+Scale_11 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_11_1")] , model.selection("VERTEX", "[Box_11_1/Back][Box_11_1/Right][Box_11_1/Top]"), 2 , 3, 1)
+Scale_12 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_12_1")] , model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"), 2 , 3, 1)
 Scale_13 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_13_1")] , model.selection("VERTEX", "Vertex_1_1"), 2 , 3, 1)
 Scale_14 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_14_1")] , model.selection("VERTEX", "PartSet/Origin"), 0 , 3, 1)
 Scale_15 = model.addScale(Part_1_doc, [model.selection("SOLID", "Box_15_1")] , model.selection("VERTEX", "PartSet/Origin"), 2 , 0, 1)
@@ -201,4 +200,4 @@ assert(Scale_18.feature().error() == 'Attribute "center_point" is not initialize
 #model.testNbSubShapes(Scale_19, GeomAPI_Shape.SHELL, [1])
 #model.testNbSubShapes(Scale_19, GeomAPI_Shape.SOLID, [0])
 #model.testNbSubShapes(Scale_19, GeomAPI_Shape.FACE, [5])
-#model.testHaveNamingFaces(Scale_19, model, Part_1_doc)
\ No newline at end of file
+#model.testHaveNamingFaces(Scale_19, model, Part_1_doc)
index e32052e06835f161a7497853b346354d793df1c6..d67b02b51a7210cfddd89157c5ae156aef7c3437 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Symmetry feature.
@@ -89,13 +88,13 @@ SketchConstraintCoincidence_5 = Sketch_3.setCoincident(SketchLine_6.startPoint()
 model.do()
 
 # Vertexes
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")])
 
 # Edges
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
 
 # Wire & Extrusion
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f_wire")])
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection(), 50, 0)
 
 # Planes
@@ -103,22 +102,22 @@ Plane_1 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_14_1/Top"), 10
 Plane_2 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOZ"), 40, False)
 
 # Faces
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f_wire")])
 
 
 # Symmetries
 Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "PartSet/Origin"))
 Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("VERTEX", "Point_1"))
-Symmetry_3 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("VERTEX", "Box_3_1/Front&Box_3_1/Right&Box_3_1/Top"))
-Symmetry_4 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e"))
+Symmetry_3 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("VERTEX", "[Box_3_1/Front][Box_3_1/Right][Box_3_1/Top]"))
+Symmetry_4 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"))
 Symmetry_5 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_5_1")], model.selection("VERTEX", "Vertex_1_1"))
 Symmetry_6 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_6_1")], model.selection("VERTEX", "InvalidName"))
 Symmetry_7 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_7_1")], model.selection("VERTEX", "PartSet/Origin"), False)
 
 Symmetry_8 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_8_1")], model.selection("EDGE", "PartSet/OZ"))
 Symmetry_9 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_9_1")], model.selection("EDGE", "Axis_1"))
-Symmetry_10 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_10_1")], model.selection("EDGE", "Box_9_1/Front&Box_9_1/Top"))
-Symmetry_11 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_11_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+Symmetry_10 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_10_1")], model.selection("EDGE", "[Box_9_1/Front][Box_9_1/Top]"))
+Symmetry_11 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_11_1")], model.selection("EDGE", "Sketch_1/SketchLine_1"))
 Symmetry_12 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_12_1")], model.selection("EDGE", "Edge_1_1"))
 Symmetry_13 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_13_1")], model.selection("EDGE", "InvalidName"))
 Symmetry_14 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_14_1")], model.selection("EDGE", "PartSet/OZ"), False)
@@ -185,7 +184,11 @@ model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.SOLID, [2])
 model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.FACE, [12])
 model.testHaveNamingFaces(Symmetry_9, model, Part_1_doc)
 
-model.testNbResults(Symmetry_10, 0)
+model.testNbResults(Symmetry_10, 1)
+model.testNbSubResults(Symmetry_10, [2])
+model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.FACE, [12])
+model.testHaveNamingFaces(Symmetry_10, model, Part_1_doc)
 
 model.testNbResults(Symmetry_11, 1)
 model.testNbSubResults(Symmetry_11, [2])
@@ -217,7 +220,11 @@ model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.SOLID, [2])
 model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.FACE, [12])
 model.testHaveNamingFaces(Symmetry_16, model, Part_1_doc)
 
-model.testNbResults(Symmetry_17, 0)
+model.testNbResults(Symmetry_17, 1)
+model.testNbSubResults(Symmetry_17, [2])
+model.testNbSubShapes(Symmetry_17, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Symmetry_17, GeomAPI_Shape.FACE, [12])
+model.testHaveNamingFaces(Symmetry_17, model, Part_1_doc)
 
 model.testNbResults(Symmetry_18, 1)
 model.testNbSubResults(Symmetry_18, [2])
index 451b433b2df8c1837300118478dc8887f97a2cb5..89db2307038331b98bf7d000891a24aa0c53b6a7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
index fcd1406ab78bcd4e861c805a1b7bf62230a992c1..acce28e4bf0e39183b2cf2baaf63e4b3095c8fa7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
@@ -140,19 +139,19 @@ SketchLine_12 = Sketch_10.addLine(2.442711482557598, 6.454964041059345, 8.035432
 model.do()
 
 # Extrusions
-Extrusion_1 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_3 = model.addExtrusion(Part_3_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_4 = model.addExtrusion(Part_4_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_5 = model.addExtrusion(Part_5_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_6 = model.addExtrusion(Part_6_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_7 = model.addExtrusion(Part_7_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_8 = model.addExtrusion(Part_8_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_9 = model.addExtrusion(Part_9_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
+Extrusion_1 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_3 = model.addExtrusion(Part_3_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_4 = model.addExtrusion(Part_4_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_5 = model.addExtrusion(Part_5_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_6 = model.addExtrusion(Part_6_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_7 = model.addExtrusion(Part_7_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_8 = model.addExtrusion(Part_8_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_9 = model.addExtrusion(Part_9_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
 
 # Edges
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Edge_2 = model.addEdge(Part_7_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Edge_2 = model.addEdge(Part_7_doc, [model.selection("EDGE", "Sketch_1/SketchLine_1")])
 
 # Axis
 Axis_1 = model.addAxis(partSet, 10, 10, 10)
@@ -177,19 +176,18 @@ Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_
 Translation_3 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_4 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_5 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_5_1")], model.selection("EDGE", "PartSet/OY"), "d")
-Translation_6 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_6_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), 15)
+Translation_6 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_6_1")], model.selection("EDGE", "Sketch_1/SketchLine_3"), 15)
 Translation_7 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_7_1")], model.selection("EDGE", "Edge_1_1"), 15)
-Translation_8 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_8_1")], model.selection("EDGE", "Box_8_1/Right&Box_8_1/Top"), 15)
+Translation_8 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_8_1")], model.selection("EDGE", "[Box_8_1/Right][Box_8_1/Top]"), 15)
 Translation_9 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_9_1")], model.selection("EDGE", "PartSet/Axis_4"), 15)
 Translation_10 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_1_1")], model.selection("EDGE", "PartSet/OZ"), 15)
 Translation_11 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_2_1")], model.selection("EDGE", "PartSet/OZ"), 0)
 Translation_12 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_3_1")], model.selection("EDGE", "PartSet/OZ"), -15)
 Translation_13 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_4_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_14 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_5_1")], model.selection("EDGE", "PartSet/OZ"), "d")
-Translation_15 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_6_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 50)
+Translation_15 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_6_1")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 50)
 Translation_16 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_7_1")], model.selection("EDGE", "Edge_1_1"), 50)
-#Translation_17 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_8_1")], model.selection("EDGE", "LinearCopy_8_1/Translated_Edge_8_8"), 50)
-Translation_17 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_8_1")], model.selection("EDGE", "LinearCopy_8_1/Translated_Face_3_4&LinearCopy_8_1/Translated_Face_3_1"), 50)
+Translation_17 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_8_1")], model.selection("EDGE", "[LinearCopy_8_1_3/MF:Translated_Face&Box_17_1/Left][LinearCopy_8_1_3/MF:Translated_Face&Box_17_1/Top]"), 50)
 Translation_18 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "LinearCopy_9_1")], model.selection("EDGE", "PartSet/Axis_4"), 50)
 Translation_19 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_2/")], model.selection("EDGE", "OX"), 15)
 Translation_20 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_3/")], model.selection("EDGE", "OX"), 0)
@@ -197,7 +195,7 @@ Translation_21 = model.addTranslation(partSet, [model.selection("COMPOUND", "Par
 Translation_22 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_5/")], model.selection("EDGE", "InvalidName"), 15)
 Translation_23 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_6/")], model.selection("EDGE", "OX"), "d")
 Translation_24 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_7/")], model.selection("EDGE", "Part_7/Edge_1_1"), 15)
-Translation_25 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_8/")], model.selection("EDGE", "Part_8/Box_1_1/Front&Box_1_1/Left"), 15)
+Translation_25 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_8/")], model.selection("EDGE", "Part_8/[Box_1_1/Front][Box_1_1/Left]"), 15)
 Translation_26 = model.addTranslation(partSet, [model.selection("COMPOUND", "Part_9/")], model.selection("EDGE", "Axis_4"), 15)
 model.do()
 model.end()
@@ -376,4 +374,4 @@ model.testNbResults(Translation_26, 1)
 #model.testNbSubShapes(Translation_26, GeomAPI_Shape.COMPOUND, [1])
 #model.testNbSubShapes(Translation_26, GeomAPI_Shape.SOLID, [2])
 #model.testNbSubShapes(Translation_26, GeomAPI_Shape.FACE, [9])
-#model.testHaveNamingFaces(Translation_26, model, Part_9_doc)
\ No newline at end of file
+#model.testHaveNamingFaces(Translation_26, model, Part_9_doc)
index 152f759ac6b5aaba12244b175c038c62255cb274..a91240f692a41183ebd103c0586edde4f6e6f789 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
@@ -81,7 +80,7 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_1.startPoint()
 model.do()
 
 # Edges
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2")])
 
 # Axis
 Axis_1 = model.addAxis(Part_1_doc, 10, 10, 10)
@@ -117,7 +116,7 @@ Translation_31 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "
 # Translation 32
 Translation_32_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_11_1")], model.selection("EDGE", "PartSet/OX"), 5)
 Intersection_6 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Box_12_1"), model.selection("SOLID", "Translation_11_1")])
-Translation_32 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "Intersection_6_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 15)
+Translation_32 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "Intersection_6_1")], model.selection("EDGE", "Sketch_1/SketchLine_1"), 15)
 
 # Translation 33
 Translation_33_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_13_1")], model.selection("EDGE", "PartSet/OX"), 5)
@@ -162,7 +161,7 @@ Translation_40 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID",
 # Translation 41
 Translation_41_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_29_1")], model.selection("EDGE", "PartSet/OX"), 5)
 Partition_6 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_30_1"), model.selection("SOLID", "Translation_29_1")])
-Translation_41 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Partition_6_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), 15)
+Translation_41 = model.addTranslation(Part_1_doc, [model.selection("COMPSOLID", "Partition_6_1")], model.selection("EDGE", "Sketch_1/SketchLine_1"), 15)
 
 # Translation 42
 Translation_42_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_31_1")], model.selection("EDGE", "PartSet/OX"), 5)
index 0a089ea94c30a8f1da5c6609c2a17913c2291129..ced50945ad65b02c9c4966e2adb1b68fa44fe64d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
@@ -103,62 +102,62 @@ SketchCircle_2 = Sketch_8.addCircle(5.043472022955523, 6.180989956958394, 2.6548
 model.do()
 
 # Extrusions
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 15, 0)
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_8/Wire-SketchCircle_2_2f")], model.selection(), 15, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection(), 15, 0)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_8/Face-SketchCircle_2_2r_wire")], model.selection(), 15, 0)
 
 # Edges
-Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2")])
-Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
-Edge_3 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
-Edge_4 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
-Edge_5 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
-Edge_6 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/Edge-SketchLine_5")])
-Edge_7 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
-Edge_8 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_6")])
-Edge_9 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
-Edge_10 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/Edge-SketchLine_7")])
-Edge_11 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_5/Edge-SketchLine_11")])
-Edge_12 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_7/Edge-SketchLine_22")])
+Edge_1 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2")])
+Edge_2 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_5")])
+Edge_3 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_5")])
+Edge_4 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_5")])
+Edge_5 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_5")])
+Edge_6 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_3/SketchLine_5")])
+Edge_7 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/SketchLine_7")])
+Edge_8 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/SketchLine_6")])
+Edge_9 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/SketchLine_7")])
+Edge_10 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_4/SketchLine_7")])
+Edge_11 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_5/SketchLine_11")])
+Edge_12 = model.addEdge(Part_1_doc, [model.selection("EDGE", "Sketch_7/SketchLine_22")])
 
 # Axis
 Axis_1 = model.addAxis(Part_1_doc, 10, 10, 10)
 
 # Vertex
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_5 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_6 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_7 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_8 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
-Vertex_9 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/Vertex-SketchLine_5e")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_3 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_4 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_5 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_6 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_7 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_8 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
+Vertex_9 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_3/SketchLine_5_EndVertex")])
 
 # Wires
-Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_3 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_4 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_5 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_6 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
-Wire_7 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
-Wire_8 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Wire_9 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_2 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_3 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_4 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_5 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_6 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f_wire")])
+Wire_7 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f_wire")])
+Wire_8 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Wire_9 = model.addWire(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
 
 # Faces
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_6 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
-Face_7 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_8f-SketchLine_9f-SketchLine_10f")])
-Face_8 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_9 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_2f-SketchLine_3f")])
-Face_10 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_12f-SketchLine_13f-SketchLine_14f")])
-Face_11 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r")])
-Face_12 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_17f-SketchLine_18f-SketchLine_19f")])
-Face_13 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchLine_19r-SketchLine_20r-SketchLine_21r")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_4 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_5 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_6 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f_wire")])
+Face_7 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_8r-SketchLine_9f-SketchLine_10f_wire")])
+Face_8 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_9 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_3r-SketchLine_2r-SketchLine_1r_wire")])
+Face_10 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Face-SketchLine_12r-SketchLine_13f-SketchLine_14f_wire")])
+Face_11 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_6/Face-SketchLine_16r-SketchLine_15r-SketchLine_14r_wire")])
+Face_12 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Face-SketchLine_17r-SketchLine_18f-SketchLine_19f_wire")])
+Face_13 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Face-SketchLine_21r-SketchLine_20r-SketchLine_19r_wire")])
 
 # Shells
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
@@ -203,45 +202,45 @@ Translation_46 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Ve
 Translation_47 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_48 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_4_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_49 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
-Translation_50 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_6_1")], model.selection("EDGE", "Sketch_3/Edge-SketchLine_5"), 15)
+Translation_50 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_6_1")], model.selection("EDGE", "Sketch_3/SketchLine_5"), 15)
 Translation_51 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_7_1")], model.selection("EDGE", "Edge_2_1"), 15)
-Translation_52 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
+Translation_52 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_8_1")], model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), 15)
 Translation_53 = model.addTranslation(Part_1_doc, [model.selection("VERTEX", "Vertex_9_1")], model.selection("EDGE", "Axis_1"), 15)
 Translation_54 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_2_1")], model.selection("EDGE", "PartSet/OX"), 15)
 Translation_55 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_3_1")], model.selection("EDGE", "PartSet/OX"), 0)
 Translation_56 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_4_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_57 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_5_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_58 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_6_1")], model.selection("EDGE", "PartSet/OY"), "d")
-Translation_59 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_7_1")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_6"), 15)
+Translation_59 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_7_1")], model.selection("EDGE", "Sketch_4/SketchLine_6"), 15)
 Translation_60 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_8_1")], model.selection("EDGE", "Edge_9_1"), 15)
-Translation_61 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_9_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
+Translation_61 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_9_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), 15)
 Translation_62 = model.addTranslation(Part_1_doc, [model.selection("EDGE", "Edge_10_1")], model.selection("EDGE", "Axis_1"), 15)
 Translation_63 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
 Translation_64 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
 Translation_65 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_66 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_4_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_67 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_5_1")], model.selection("EDGE", "PartSet/OY"), "d")
-Translation_68 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
+Translation_68 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_6_1")], model.selection("EDGE", "Sketch_5/SketchLine_11"), 15)
 Translation_69 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
-Translation_70 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_8_1")], model.selection("EDGE", "Box_1_1/Back&Box_1_1/Right"), 15)
+Translation_70 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_8_1")], model.selection("EDGE", "[Box_1_1/Back][Box_1_1/Right]"), 15)
 Translation_71 = model.addTranslation(Part_1_doc, [model.selection("WIRE", "Wire_9_1")], model.selection("EDGE", "Axis_1"), 15)
 Translation_72 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
 Translation_73 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
 Translation_74 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_75 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_4_1")], model.selection("EDGE", "InvalidName"), -15)
 Translation_76 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
-Translation_77 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_6_1")], model.selection("EDGE", "Sketch_5/Edge-SketchLine_11"), 15)
+Translation_77 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_6_1")], model.selection("EDGE", "Sketch_5/SketchLine_11"), 15)
 Translation_78 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_7_1")], model.selection("EDGE", "Edge_11_1"), 15)
-Translation_79 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
+Translation_79 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_8_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), 15)
 Translation_80 = model.addTranslation(Part_1_doc, [model.selection("FACE", "Face_9_1")], model.selection("EDGE", "Axis_1"), 15)
 Translation_81 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OX"), 15)
 Translation_82 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_2_1")], model.selection("EDGE", "PartSet/OX"), 0)
 Translation_83 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_3_1")], model.selection("EDGE", "PartSet/OX"), -15)
 Translation_84 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_4_1")], model.selection("EDGE", "InvalidName"), 15)
 Translation_85 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_5_1")], model.selection("EDGE", "PartSet/OX"), "d")
-Translation_86 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_6_1")], model.selection("EDGE", "Sketch_7/Edge-SketchLine_22"), 15)
+Translation_86 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_6_1")], model.selection("EDGE", "Sketch_7/SketchLine_22"), 15)
 Translation_87 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_7_1")], model.selection("EDGE", "Edge_12_1"), 15)
-Translation_88 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_8_1")], model.selection("EDGE", "Box_1_1/Front&Box_1_1/Right"), 15)
+Translation_88 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_8_1")], model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Right]"), 15)
 Translation_89 = model.addTranslation(Part_1_doc, [model.selection("SHELL", "Shell_9_1")], model.selection("EDGE", "Axis_1"), 15)
 Translation_90 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Extrusion_2_1")], model.selection("EDGE", "PartSet/OY"), 15)
 model.do()
index 119a0441409b3b2177ade6c718428e08cba16760..d8e1aa1cd0067b09466c717b6ae73de66fc8787f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
index a903dc4772d13b335cbc10daadfbb55e7ffb5a98..b05d2c654a0c800c1ae385d937f34076a842b8b1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 """
 Test case for Translation feature.
@@ -50,17 +49,17 @@ Point_1 = model.addPoint(Part_1_doc, 10, 0, 0)
 Point_2 = model.addPoint(Part_1_doc, 10, 10, 0)
 
 # Vertex
-Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_3e")])
-Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchLine_1e")])
+Vertex_1 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")])
+Vertex_2 = model.addVertex(Part_1_doc, [model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex")])
 
 # Translations
 Translation_99 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"))
-Translation_100 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_1"))
-Translation_101 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "InvalidName"), model.selection("VERTEX", "Point_1"))
-Translation_102 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "InvalidName"))
-Translation_103 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_3e"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchLine_1e"))
+Translation_100 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_1"))
+Translation_101 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("VERTEX", "InvalidName"), model.selection("VERTEX", "Point_1"))
+Translation_102 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "InvalidName"))
+Translation_103 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"), model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"))
 Translation_104 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("VERTEX", "Vertex_1_1"), model.selection("VERTEX", "Vertex_2_1"))
-Translation_105 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "Box_4_1/Back&Box_4_1/Left&Box_4_1/Bottom"), model.selection("VERTEX", "Box_4_1/Front&Box_4_1/Right&Box_4_1/Top"))
+Translation_105 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "[Box_4_1/Back][Box_4_1/Left][Box_4_1/Bottom]"), model.selection("VERTEX", "[Box_4_1/Front][Box_4_1/Right][Box_4_1/Top]"))
 model.do()
 model.end()
 
@@ -99,4 +98,4 @@ model.testNbResults(Translation_101, 0)
 assert(Translation_101.feature().error() == 'Attribute "start_point" is not initialized.')
 
 model.testNbResults(Translation_102, 0)
-assert(Translation_102.feature().error() == 'Attribute "end_point" is not initialized.')
\ No newline at end of file
+assert(Translation_102.feature().error() == 'Attribute "end_point" is not initialized.')
index abd4f661c79652edf334e9a9bc8b24b094d8c733..c34813269dcfa525bb6ae36fa547732b65427f93 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 ENABLE_TESTING()
 
index b1f5181dc90fe3882d6641dc27e0fd7cd969422a..eb0e44fa56550a65198b6b8a6579ee89d408a2ea 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -93,24 +92,24 @@ SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchPoint_1.coordinates())
 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_15")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchLine_10f-SketchArc_1_2r-SketchArc_2_2r")], model.selection(), "b/2", "b/2")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchArc_2_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f-SketchLine_9f-SketchArc_1_2r-SketchLine_10f")], model.selection(), "b/2", "b/2")
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/To_Face]"))
 SketchCircle_1 = Sketch_2.addCircle(-15, 35.00000000000001, 25)
 SketchConstraintCoincidence_15 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchCircle_1.center())
 SketchConstraintCoincidence_15.setName("SketchConstraintCoincidence_16")
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_1.results()[1], "50/2")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 0, 13, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"))
-SketchPoint_3 = Sketch_3.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_4"))
-SketchLine_11 = Sketch_3.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_4"))
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2f_wire")], model.selection(), 0, 13, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&ExtrusionCut_1_1/From_Face"))
+SketchPoint_3 = Sketch_3.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Generated_Vertex&ExtrusionCut_1_1/From_Face"))
+SketchLine_11 = Sketch_3.addLine(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2"))
 SketchArc_3 = Sketch_3.addArc(-15, 35.00000000000001, -15, 46.0103340429751, -17.02045759563166, 24.17663606626138, True)
 SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchPoint_3.result(), SketchArc_3.center())
 SketchConstraintCoincidence_16.setName("SketchConstraintCoincidence_17")
 SketchConstraintCoincidence_17 = Sketch_3.setCoincident(SketchLine_11.result(), SketchArc_3.startPoint())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_18")
-SketchArc_4 = Sketch_3.addArc(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"))
+SketchArc_4 = Sketch_3.addArc(model.selection("EDGE", "([ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_9])2([Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2([ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_1_2])2"))
 SketchConstraintCoincidence_18 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchArc_4.results()[1])
 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_19")
 SketchLine_12 = Sketch_3.addLine(-15, 46.0103340429751, -15, 35.00000000000001)
@@ -127,20 +126,20 @@ SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchArc_3.results()[1]
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_24")
 model.do()
 ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchArc_3_2f-SketchLine_12f-SketchArc_5_2r")], model.selection(), 5, 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_1_1/To_Face_1"))
-SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "ExtrusionFuse_1_1/Modfied_4&ExtrusionFuse_1_1/Modfied_5&ExtrusionFuse_1_1/To_Face_1"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_1_1/To_Face"))
+SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[ExtrusionFuse_1_1/Generated_Face&Sketch_3/SketchArc_5_2][ExtrusionFuse_1_1/Generated_Face&Sketch_3/SketchLine_12][ExtrusionFuse_1_1/To_Face]"))
 SketchCircle_2 = Sketch_4.addCircle(-15, 35.00000000000001, 5)
 SketchConstraintCoincidence_24 = Sketch_4.setCoincident(SketchPoint_4.result(), SketchCircle_2.center())
 SketchConstraintCoincidence_24.setName("SketchConstraintCoincidence_25")
 SketchConstraintRadius_4 = Sketch_4.setRadius(SketchCircle_2.results()[1], "10/2")
 model.do()
 ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_2_2f")], model.selection(), 8, 0, [model.selection("SOLID", "ExtrusionFuse_1_1")])
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_1"))
-SketchArc_6 = Sketch_5.addArc(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&ExtrusionFuse_1_1/Modfied_3"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face"))
+SketchArc_6 = Sketch_5.addArc(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionFuse_1_1/Modified_Face&Sketch_1/SketchArc_1_2]"))
 SketchArc_7 = Sketch_5.addArc(-45, 35, -45, 5, -25.41666666666737, 12.27351642784166, False)
 SketchConstraintCoincidence_25 = Sketch_5.setCoincident(SketchArc_6.result(), SketchArc_7.center())
 SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_26")
-SketchCircle_3 = Sketch_5.addCircle(model.selection("EDGE", "ExtrusionFuse_2_1/Modfied_5&ExtrusionFuse_2_1/To_Face_1"))
+SketchCircle_3 = Sketch_5.addCircle(model.selection("EDGE", "[ExtrusionFuse_2_1/Generated_Face&Sketch_4/SketchCircle_2_2][ExtrusionFuse_2_1/To_Face]"))
 SketchArc_8 = Sketch_5.addArc(-15, 35.00000000000001, -25.41666666666737, 12.27351642784166, -30.00000000000075, 14.99999999999944, True)
 SketchConstraintCoincidence_26 = Sketch_5.setCoincident(SketchCircle_3.result(), SketchArc_8.center())
 SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_27")
@@ -163,53 +162,53 @@ SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_33")
 SketchConstraintCoincidence_33 = Sketch_5.setCoincident(SketchArc_9.startPoint(), SketchLine_13.endPoint())
 SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_34")
 model.do()
-ExtrusionFuse_3 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_7_2f-SketchArc_8_2r-SketchLine_13r-SketchArc_9_2r")], model.selection(), 0, 8, [model.selection("SOLID", "ExtrusionFuse_2_1")])
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_3_1/Modfied_3"))
-SketchLine_14 = Sketch_6.addLine(model.selection("EDGE", "ExtrusionFuse_3_1/Modfied_3&Extrusion_1_1/Generated_Face_7"))
+ExtrusionFuse_3 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_7_2f-SketchArc_8_2r-SketchArc_9_2r-SketchLine_13r")], model.selection(), 0, 8, [model.selection("SOLID", "ExtrusionFuse_2_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_3_1/Modified_Face&Extrusion_1_1/To_Face"))
+SketchLine_14 = Sketch_6.addLine(model.selection("EDGE", "[ExtrusionFuse_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"))
 SketchArc_10 = Sketch_6.addArc(55, 35, 55, 15, 35, 35, True)
 SketchConstraintCoincidence_34 = Sketch_6.setCoincident(SketchLine_14.result(), SketchArc_10.center())
 SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_35")
 SketchConstraintCoincidence_35 = Sketch_6.setCoincident(SketchLine_14.result(), SketchArc_10.startPoint())
 SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_36")
-SketchLine_15 = Sketch_6.addLine(model.selection("EDGE", "ExtrusionFuse_3_1/Modfied_3&Extrusion_1_1/Generated_Face_8"))
-SketchConstraintDistance_8 = Sketch_6.setDistance(SketchArc_10.center(), SketchLine_15.result(), 35)
-SketchLine_16 = Sketch_6.addLine(35, 35, 35, 48)
+SketchLine_15 = Sketch_6.addLine(model.selection("EDGE", "[ExtrusionFuse_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4]"))
+SketchConstraintDistance_8 = Sketch_6.setDistance(SketchArc_10.center(), SketchLine_15.result(), 35, False)
+SketchLine_16 = Sketch_6.addLine(35, 35, 35, 47.99999999999999)
 SketchConstraintCoincidence_36 = Sketch_6.setCoincident(SketchArc_10.endPoint(), SketchLine_16.startPoint())
 SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_37")
-SketchLine_17 = Sketch_6.addLine(model.selection("EDGE", "ExtrusionFuse_3_1/Modfied_3&Extrusion_1_1/Generated_Face_6"))
+SketchLine_17 = Sketch_6.addLine(model.selection("EDGE", "[ExtrusionFuse_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"))
 SketchConstraintCoincidence_37 = Sketch_6.setCoincident(SketchLine_16.endPoint(), SketchLine_17.result())
 SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_38")
 SketchConstraintVertical_6 = Sketch_6.setVertical(SketchLine_16.result())
 SketchConstraintTangent_4 = Sketch_6.setTangent(SketchLine_16.result(), SketchArc_10.results()[1])
 SketchConstraintRadius_5 = Sketch_6.setRadius(SketchArc_10.results()[1], 20)
-SketchLine_18 = Sketch_6.addLine(55, 15, 55, 48)
+SketchLine_18 = Sketch_6.addLine(55, 15, 55, 47.99999999999999)
 SketchConstraintCoincidence_38 = Sketch_6.setCoincident(SketchArc_10.startPoint(), SketchLine_18.startPoint())
 SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_39")
 SketchConstraintCoincidence_39 = Sketch_6.setCoincident(SketchLine_14.endPoint(), SketchLine_18.endPoint())
 SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_40")
-SketchLine_19 = Sketch_6.addLine(35, 48, 55, 48)
+SketchLine_19 = Sketch_6.addLine(35, 47.99999999999999, 55, 47.99999999999999)
 SketchConstraintCoincidence_40 = Sketch_6.setCoincident(SketchLine_16.endPoint(), SketchLine_19.startPoint())
 SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_41")
 SketchConstraintCoincidence_41 = Sketch_6.setCoincident(SketchLine_14.endPoint(), SketchLine_19.endPoint())
 SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_42")
 model.do()
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchArc_10_2f-SketchLine_16r-SketchLine_18f-SketchLine_19r")], model.selection(), 0, 9, [model.selection("SOLID", "ExtrusionFuse_3_1")])
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/From_Face_1"))
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_6/Face-SketchArc_10_2f-SketchLine_18f-SketchLine_19r-SketchLine_16r_wire")], model.selection(), 0, 9, [model.selection("SOLID", "ExtrusionFuse_3_1")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/From_Face"))
 SketchCircle_4 = Sketch_7.addCircle(45, -35, 5)
-SketchLine_20 = Sketch_7.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/From_Face_1"))
-SketchConstraintDistance_9 = Sketch_7.setDistance(SketchCircle_4.center(), SketchLine_20.result(), 10)
+SketchLine_20 = Sketch_7.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_5][ExtrusionCut_2_1/From_Face]"))
+SketchConstraintDistance_9 = Sketch_7.setDistance(SketchCircle_4.center(), SketchLine_20.result(), 10, False)
 SketchConstraintRadius_6 = Sketch_7.setRadius(SketchCircle_4.results()[1], "10/2")
 SketchLine_21 = Sketch_7.addLine(35, -35, 45, -35)
 SketchLine_21.setAuxiliary(True)
-SketchPoint_5 = Sketch_7.addPoint(model.selection("VERTEX", "ExtrusionCut_2_1/Generated_Face_1&ExtrusionCut_2_1/Generated_Face_4&ExtrusionCut_2_1/From_Face_1"))
+SketchPoint_5 = Sketch_7.addPoint(model.selection("VERTEX", "[ExtrusionCut_2_1/Generated_Face&Sketch_6/SketchLine_16][ExtrusionCut_2_1/Generated_Face&Sketch_6/SketchArc_10_2][ExtrusionCut_2_1/From_Face]"))
 SketchConstraintCoincidence_42 = Sketch_7.setCoincident(SketchLine_21.startPoint(), SketchPoint_5.result())
 SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_43")
 SketchConstraintCoincidence_43 = Sketch_7.setCoincident(SketchCircle_4.center(), SketchLine_21.endPoint())
 SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_44")
 SketchConstraintHorizontal_4 = Sketch_7.setHorizontal(SketchLine_21.result())
 model.do()
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_7/Face-SketchCircle_4_2f")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/From_Face_1"), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"))
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_7/Face-SketchCircle_4_2r")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/From_Face"), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8"))
 SketchLine_22 = Sketch_8.addLine(55, 25, 5.000000000000002, 25)
 SketchLine_23 = Sketch_8.addLine(5.000000000000002, 25, 5.000000000000002, 13)
 SketchLine_24 = Sketch_8.addLine(5.000000000000002, 13, 55, 13)
@@ -228,26 +227,26 @@ SketchConstraintHorizontal_6 = Sketch_8.setHorizontal(SketchLine_24.result())
 SketchConstraintVertical_8 = Sketch_8.setVertical(SketchLine_25.result())
 SketchConstraintLength_2 = Sketch_8.setLength(SketchLine_22.result(), 50)
 SketchConstraintLength_3 = Sketch_8.setLength(SketchLine_25.result(), 12)
-SketchProjection_1 = Sketch_8.addProjection(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_1"))
+SketchProjection_1 = Sketch_8.addProjection(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_5][ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_6]"), False)
 SketchLine_26 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_48 = Sketch_8.setCoincident(SketchLine_22.startPoint(), SketchLine_26.result())
 SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_49")
-SketchLine_27 = Sketch_8.addLine(model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Extrusion_1_1/Generated_Face_4"))
+SketchLine_27 = Sketch_8.addLine(model.selection("EDGE", "[ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8]"))
 SketchConstraintCoincidence_49 = Sketch_8.setCoincident(SketchLine_22.startPoint(), SketchLine_27.result())
 SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_50")
 model.do()
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchLine_25f")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_8"), 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
-Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_1_1/Modfied_2"))
-SketchLine_28 = Sketch_9.addLine(25, -45, 18.44853578320836, -63)
-SketchLine_29 = Sketch_9.addLine(model.selection("EDGE", "ExtrusionFuse_1_1/Modfied_2&ExtrusionCut_4_1/Modfied_6"))
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_22r-SketchLine_23f-SketchLine_24f-SketchLine_25f")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
+Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_1_1/Modified_Face&Sketch_1/SketchLine_9"))
+SketchLine_28 = Sketch_9.addLine(25, -45, 18.44853578320833, -63)
+SketchLine_29 = Sketch_9.addLine(model.selection("EDGE", "[ExtrusionFuse_1_1/Modified_Face&Sketch_1/SketchLine_9][ExtrusionCut_4_1/Modified_Face&Sketch_1/SketchLine_8]"))
 SketchConstraintCoincidence_50 = Sketch_9.setCoincident(SketchLine_28.endPoint(), SketchLine_29.result())
 SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_51")
-SketchLine_30 = Sketch_9.addLine(model.selection("EDGE", "ExtrusionCut_4_1/Modfied_9&ExtrusionFuse_1_1/Modfied_2"))
+SketchLine_30 = Sketch_9.addLine(model.selection("EDGE", "[ExtrusionCut_4_1/Modified_Face&Extrusion_1_1/From_Face][ExtrusionFuse_1_1/Modified_Face&Sketch_1/SketchLine_9]"))
 SketchConstraintCoincidence_51 = Sketch_9.setCoincident(SketchLine_28.startPoint(), SketchLine_30.result())
 SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_52")
-SketchConstraintAngle_3 = Sketch_9.setAngle(SketchLine_28.result(), SketchLine_30.result(), 20)
-SketchConstraintDistance_10 = Sketch_9.setDistance(SketchLine_28.startPoint(), SketchLine_29.result(), 18)
-SketchLine_31 = Sketch_9.addLine(18.44853578320836, -63, 25, -63)
+SketchConstraintAngle_3 = Sketch_9.setAngle(SketchLine_28.result(), SketchLine_30.result(), 20.00000000000009)
+SketchConstraintDistance_10 = Sketch_9.setDistance(SketchLine_28.startPoint(), SketchLine_29.result(), 18, False)
+SketchLine_31 = Sketch_9.addLine(18.44853578320833, -63, 25, -63)
 SketchConstraintCoincidence_52 = Sketch_9.setCoincident(SketchLine_28.endPoint(), SketchLine_31.startPoint())
 SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_53")
 SketchConstraintCoincidence_53 = Sketch_9.setCoincident(SketchLine_29.startPoint(), SketchLine_31.endPoint())
@@ -258,16 +257,16 @@ SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_55")
 SketchConstraintCoincidence_55 = Sketch_9.setCoincident(SketchLine_28.startPoint(), SketchLine_32.endPoint())
 SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_56")
 model.do()
-ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchLine_28f-SketchLine_31f-SketchLine_32f")], model.selection(), model.selection(), 0, model.selection("FACE", "ExtrusionCut_4_1/Modfied_3"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
-Sketch_10 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_5_1/Modfied_1"))
+ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchLine_28r-SketchLine_31f-SketchLine_32f")], model.selection(), model.selection(), 0, model.selection("FACE", "ExtrusionCut_4_1/Modified_Face&Sketch_1/SketchLine_5"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
+Sketch_10 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_8"))
 SketchCircle_5 = Sketch_10.addCircle(-6.000000000000002, 4.999999999999997, 5)
-SketchLine_33 = Sketch_10.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_5_1/Modfied_1"))
-SketchConstraintDistance_11 = Sketch_10.setDistance(SketchCircle_5.center(), SketchLine_33.result(), 30)
-SketchLine_34 = Sketch_10.addLine(model.selection("EDGE", "ExtrusionCut_5_1/Modfied_2&ExtrusionCut_5_1/Modfied_1"))
-SketchConstraintDistance_12 = Sketch_10.setDistance(SketchCircle_5.result(), SketchLine_34.result(), 9)
+SketchLine_33 = Sketch_10.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_8]"))
+SketchConstraintDistance_11 = Sketch_10.setDistance(SketchCircle_5.center(), SketchLine_33.result(), 30, False)
+SketchLine_34 = Sketch_10.addLine(model.selection("EDGE", "[ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_9][ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_8]"))
+SketchConstraintDistance_12 = Sketch_10.setDistance(SketchCircle_5.result(), SketchLine_34.result(), 9, False)
 SketchConstraintRadius_7 = Sketch_10.setRadius(SketchCircle_5.results()[1], "10/2")
 model.do()
-ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_10/Face-SketchCircle_5_2f")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
+ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_10/Face-SketchCircle_5_2r")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
 model.do()
 
 # Test reexecution after parameter change
index 5a37ad7d3c84fffc18e3e81c3b41eeab2a0dcd10..a2008ae173180f59cacf456403e51ccdf2cc5b35 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -29,34 +28,34 @@ Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_1 = Sketch_1.addLine(50, 70, 50, 9.237604307034024)
 SketchLine_1.setName("SketchLine_10")
 SketchLine_1.result().setName("SketchLine_10")
-SketchLine_2 = Sketch_1.addLine(42, -4.618802153516998, -53.92304845413265, -59.99999999999996)
+SketchLine_2 = Sketch_1.addLine(42, -4.618802153516998, -53.92304845413265, -60)
 SketchLine_2.setName("SketchLine_11")
 SketchLine_2.result().setName("SketchLine_11")
 SketchLine_3 = Sketch_1.addLine(50, 70, 50, 0)
 SketchLine_3.setName("SketchLine_1")
 SketchLine_3.result().setName("SketchLine_1")
 SketchLine_3.setAuxiliary(True)
-SketchLine_4 = Sketch_1.addLine(50, 0, -53.92304845413265, -59.99999999999996)
+SketchLine_4 = Sketch_1.addLine(50, 0, -53.92304845413265, -60)
 SketchLine_4.setName("SketchLine_2")
 SketchLine_4.result().setName("SketchLine_2")
 SketchLine_4.setAuxiliary(True)
 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
-SketchLine_5 = Sketch_1.addLine(44, 9.237604307034019, 44, 70)
+SketchLine_5 = Sketch_1.addLine(44, 9.237604307034037, 44, 70)
 SketchLine_5.setName("SketchLine_8")
 SketchLine_5.result().setName("SketchLine_8")
-SketchLine_6 = Sketch_1.addLine(-53.92304845413265, -59.99999999999996, -56.92304845413265, -54.80384757729332)
+SketchLine_6 = Sketch_1.addLine(-53.92304845413265, -60, -56.92304845413265, -54.80384757729332)
 SketchLine_6.setName("SketchLine_3")
 SketchLine_6.result().setName("SketchLine_3")
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_6.startPoint())
-SketchLine_7 = Sketch_1.addLine(-56.92304845413265, -54.80384757729332, 38.99999999999999, 0.5773502691896226)
+SketchLine_7 = Sketch_1.addLine(-56.92304845413265, -54.80384757729332, 39, 0.5773502691896394)
 SketchLine_7.setName("SketchLine_9")
 SketchLine_7.result().setName("SketchLine_9")
-SketchLine_8 = Sketch_1.addLine(-56.92304845413265, -54.80384757729332, 44, 3.464101615137744)
+SketchLine_8 = Sketch_1.addLine(-56.92304845413265, -54.80384757729332, 44, 3.464101615137764)
 SketchLine_8.setName("SketchLine_4")
 SketchLine_8.result().setName("SketchLine_4")
 SketchLine_8.setAuxiliary(True)
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchLine_8.startPoint())
-SketchLine_9 = Sketch_1.addLine(44, 3.464101615137744, 44, 70)
+SketchLine_9 = Sketch_1.addLine(44, 3.464101615137764, 44, 70)
 SketchLine_9.setName("SketchLine_5")
 SketchLine_9.result().setName("SketchLine_5")
 SketchLine_9.setAuxiliary(True)
@@ -74,7 +73,7 @@ SketchLine_11 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OZ"))
 SketchLine_11.setName("SketchLine_7")
 SketchLine_11.result().setName("SketchLine_7")
 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.startPoint(), SketchLine_11.result(), 50, False)
-SketchArc_1 = Sketch_1.addArc(34, 9.237604307034017, 38.99999999999999, 0.5773502691896226, 44, 9.237604307034019, False)
+SketchArc_1 = Sketch_1.addArc(34, 9.237604307034037, 39, 0.5773502691896394, 44, 9.237604307034037, False)
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_7.endPoint())
 SketchConstraintCoincidence_8 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_5.startPoint())
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_5.result())
@@ -101,21 +100,17 @@ SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_4.startPoint(), Ske
 SketchLine_12 = Sketch_1.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchConstraintCoincidence_19 = Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_12.result())
 SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_2.results()[1], 16)
-SketchConstraintRadius_1.setName("SketchConstraintRadius_3")
 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_1.results()[1], 10)
-SketchConstraintRadius_2.setName("SketchConstraintRadius_4")
 model.do()
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_2.addCircle(0, 0, 17.5)
 SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchPoint_1.result())
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_1.results()[1], 17.5)
-SketchConstraintRadius_3.setName("SketchConstraintRadius_1")
 SketchCircle_2 = Sketch_2.addCircle(0, 0, 14.5)
 SketchConstraintCoincidence_21 = Sketch_2.setCoincident(SketchCircle_1.center(), SketchCircle_2.center())
 SketchConstraintCoincidence_22 = Sketch_2.setCoincident(SketchPoint_1.coordinates(), SketchCircle_2.center())
 SketchConstraintRadius_4 = Sketch_2.setRadius(SketchCircle_2.results()[1], 14.5)
-SketchConstraintRadius_4.setName("SketchConstraintRadius_2")
 model.do()
 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchLine_13 = Sketch_3.addLine(-22, 70, -22, -35.79571668975675)
@@ -129,7 +124,7 @@ SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_13.startPoint
 SketchConstraintHorizontal_2 = Sketch_3.setHorizontal(SketchLine_16.result())
 SketchConstraintVertical_3 = Sketch_3.setVertical(SketchLine_15.result())
 SketchConstraintVertical_4 = Sketch_3.setVertical(SketchLine_13.result())
-SketchLine_17 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"))
+SketchLine_17 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
 SketchConstraintParallel_2 = Sketch_3.setParallel(SketchLine_14.result(), SketchLine_17.result())
 SketchConstraintDistance_6 = Sketch_3.setDistance(SketchLine_14.endPoint(), SketchLine_17.result(), 1, False)
 SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OZ"))
@@ -138,11 +133,11 @@ SketchConstraintDistance_8 = Sketch_3.setDistance(SketchLine_13.startPoint(), Sk
 SketchLine_19 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchConstraintDistance_9 = Sketch_3.setDistance(SketchLine_15.endPoint(), SketchLine_19.result(), 70, False)
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection(), 75, 45)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r-SketchCircle_2_2r_wire")], model.selection(), 75, 45)
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection(), 22, 22)
 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
 Sketch_4 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
-SketchLine_20 = Sketch_4.addLine(-4, 38.00000000000001, -4, 21.26617031813674)
+SketchLine_20 = Sketch_4.addLine(-4, 38, -4, 21.26617031813674)
 SketchLine_20.setName("SketchLine_36")
 SketchLine_20.result().setName("SketchLine_36")
 SketchArc_3 = Sketch_4.addArc(0, 0, -8.5, 15.2970585407786, -7.446808510638298, 15.83650981137842, True)
@@ -153,58 +148,52 @@ SketchArc_4 = Sketch_4.addArc(0, 0, 7.446808510638299, 15.83650981137842, 8.5, 1
 SketchArc_4.setName("SketchArc_8")
 SketchArc_4.result().setName("SketchArc_8")
 SketchArc_4.results()[1].setName("SketchArc_8_2")
-SketchLine_21 = Sketch_4.addLine(4, 21.26617031813674, 4, 37.99999998819019)
+SketchLine_21 = Sketch_4.addLine(4, 21.26617031813674, 4, 38)
 SketchLine_21.setName("SketchLine_38")
 SketchLine_21.result().setName("SketchLine_38")
-SketchLine_22 = Sketch_4.addLine(-8.5, 15.2970585407786, -8.499999999999998, 12)
+SketchLine_22 = Sketch_4.addLine(-8.5, 15.2970585407786, -8.5, 12)
 SketchLine_22.setName("SketchLine_22")
 SketchLine_22.result().setName("SketchLine_22")
-SketchLine_23 = Sketch_4.addLine(-10.1, 44.00000000000001, -9.999999999999854, 44.00000000000001)
+SketchLine_23 = Sketch_4.addLine(-10.1, 44, -10, 44)
 SketchLine_23.setName("SketchLine_37")
 SketchLine_23.result().setName("SketchLine_37")
-SketchLine_24 = Sketch_4.addLine(9.99999999990029, 43.99999998819102, 10.1, 44)
+SketchLine_24 = Sketch_4.addLine(10, 44, 10.1, 44)
 SketchLine_24.setName("SketchLine_39")
 SketchLine_24.result().setName("SketchLine_39")
 SketchLine_25 = Sketch_4.addLine(8.5, 12, 8.5, 15.29705854077835)
 SketchLine_25.setName("SketchLine_24")
 SketchLine_25.result().setName("SketchLine_24")
-SketchLine_26 = Sketch_4.addLine(4, 44.00000000000001, 10.1, 44)
+SketchLine_26 = Sketch_4.addLine(4, 44, 10.1, 44)
 SketchLine_26.setName("SketchLine_26")
 SketchLine_26.result().setName("SketchLine_26")
 SketchLine_26.setAuxiliary(True)
-SketchLine_27 = Sketch_4.addLine(4, 17.03672503740084, 4, 44.00000000000001)
+SketchLine_27 = Sketch_4.addLine(4, 17.03672503740084, 4, 44)
 SketchLine_27.setName("SketchLine_27")
 SketchLine_27.result().setName("SketchLine_27")
 SketchLine_27.setAuxiliary(True)
 SketchConstraintCoincidence_27 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_26.startPoint())
-SketchConstraintCoincidence_27.setName("SketchConstraintCoincidence_33")
-SketchLine_28 = Sketch_4.addLine(10.1, 44, 10.1, 45.00000000000001)
+SketchLine_28 = Sketch_4.addLine(10.1, 44, 10.1, 45)
 SketchLine_28.setName("SketchLine_28")
 SketchLine_28.result().setName("SketchLine_28")
 SketchConstraintCoincidence_28 = Sketch_4.setCoincident(SketchLine_26.endPoint(), SketchLine_28.startPoint())
-SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_34")
-SketchLine_29 = Sketch_4.addLine(10.1, 45.00000000000001, -10.1, 45)
+SketchLine_29 = Sketch_4.addLine(10.1, 45, -10.1, 45)
 SketchLine_29.setName("SketchLine_29")
 SketchLine_29.result().setName("SketchLine_29")
 SketchConstraintCoincidence_29 = Sketch_4.setCoincident(SketchLine_28.endPoint(), SketchLine_29.startPoint())
-SketchConstraintCoincidence_29.setName("SketchConstraintCoincidence_35")
-SketchLine_30 = Sketch_4.addLine(-10.1, 45, -10.1, 44.00000000000001)
+SketchLine_30 = Sketch_4.addLine(-10.1, 45, -10.1, 44)
 SketchLine_30.setName("SketchLine_30")
 SketchLine_30.result().setName("SketchLine_30")
 SketchConstraintCoincidence_30 = Sketch_4.setCoincident(SketchLine_29.endPoint(), SketchLine_30.startPoint())
-SketchConstraintCoincidence_30.setName("SketchConstraintCoincidence_36")
-SketchLine_31 = Sketch_4.addLine(-10.1, 44.00000000000001, -4, 44.00000000000001)
+SketchLine_31 = Sketch_4.addLine(-10.1, 44, -4, 44)
 SketchLine_31.setName("SketchLine_31")
 SketchLine_31.result().setName("SketchLine_31")
 SketchLine_31.setAuxiliary(True)
 SketchConstraintCoincidence_31 = Sketch_4.setCoincident(SketchLine_30.endPoint(), SketchLine_31.startPoint())
-SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_37")
-SketchLine_32 = Sketch_4.addLine(-4, 44.00000000000001, -4.000000000000001, 17.03672503740078)
+SketchLine_32 = Sketch_4.addLine(-4, 44, -4, 17.03672503740078)
 SketchLine_32.setName("SketchLine_20")
 SketchLine_32.result().setName("SketchLine_20")
 SketchLine_32.setAuxiliary(True)
 SketchConstraintCoincidence_32 = Sketch_4.setCoincident(SketchLine_32.startPoint(), SketchLine_31.endPoint())
-SketchConstraintCoincidence_32.setName("SketchConstraintCoincidence_38")
 SketchConstraintVertical_5 = Sketch_4.setVertical(SketchLine_32.result())
 SketchConstraintVertical_6 = Sketch_4.setVertical(SketchLine_27.result())
 SketchConstraintHorizontal_3 = Sketch_4.setHorizontal(SketchLine_29.result())
@@ -218,156 +207,110 @@ SketchLine_33 = Sketch_4.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchLine_33.setName("SketchLine_32")
 SketchLine_33.result().setName("SketchLine_32")
 SketchConstraintDistance_10 = Sketch_4.setDistance(SketchLine_22.startPoint(), SketchLine_32.result(), 4.5, False)
-SketchConstraintDistance_10.setName("SketchConstraintDistance_13")
-SketchLine_34 = Sketch_4.addLine(-8.499999999999998, 12, 8.5, 12)
+SketchLine_34 = Sketch_4.addLine(-8.5, 12, 8.5, 12)
 SketchLine_34.setName("SketchLine_33")
 SketchLine_34.result().setName("SketchLine_33")
 SketchConstraintCoincidence_33 = Sketch_4.setCoincident(SketchLine_22.endPoint(), SketchLine_34.startPoint())
-SketchConstraintCoincidence_33.setName("SketchConstraintCoincidence_39")
 SketchConstraintHorizontal_6 = Sketch_4.setHorizontal(SketchLine_34.result())
 SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "PartSet/Origin"))
-SketchArc_5 = Sketch_4.addArc(-1.190531714553335e-011, 2.149585003540736e-011, -8.5, 15.2970585407786, -4.000000000000001, 17.03672503740078, True)
+SketchArc_5 = Sketch_4.addArc(0, 0, -8.5, 15.29705854, -4, 17.0367250374, True)
 SketchArc_5.setName("SketchArc_4")
 SketchArc_5.result().setName("SketchArc_4")
 SketchArc_5.results()[1].setName("SketchArc_4_2")
 SketchArc_5.setAuxiliary(True)
 SketchConstraintCoincidence_34 = Sketch_4.setCoincident(SketchLine_22.startPoint(), SketchArc_5.startPoint())
-SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_41")
-SketchArc_6 = Sketch_4.addArc(-2.234785556504386e-013, -4.022299956989981e-013, 4, 17.03672503740084, 8.5, 15.29705854077835, True)
+SketchArc_6 = Sketch_4.addArc(0, 0, 4, 17.0367250374, 8.5, 15.29705854, True)
 SketchArc_6.setName("SketchArc_5")
 SketchArc_6.result().setName("SketchArc_5")
 SketchArc_6.results()[1].setName("SketchArc_5_2")
 SketchArc_6.setAuxiliary(True)
 SketchConstraintCoincidence_35 = Sketch_4.setCoincident(SketchLine_25.endPoint(), SketchArc_6.endPoint())
-SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_42")
-SketchPoint_3 = Sketch_4.addPoint(-4.000000000000001, 17.03672503740078)
+SketchPoint_3 = Sketch_4.addPoint(-4, 17.03672503740078)
 SketchPoint_4 = Sketch_4.addPoint(4, 17.03672503740084)
 SketchConstraintCoincidence_36 = Sketch_4.setCoincident(SketchArc_5.endPoint(), SketchPoint_3.coordinates())
-SketchConstraintCoincidence_36.setName("SketchConstraintCoincidence_46")
 SketchConstraintCoincidence_37 = Sketch_4.setCoincident(SketchArc_6.startPoint(), SketchPoint_4.coordinates())
-SketchConstraintCoincidence_37.setName("SketchConstraintCoincidence_48")
 SketchConstraintCoincidence_38 = Sketch_4.setCoincident(SketchArc_5.endPoint(), SketchLine_32.endPoint())
-SketchConstraintCoincidence_38.setName("SketchConstraintCoincidence_40")
 SketchConstraintCoincidence_39 = Sketch_4.setCoincident(SketchPoint_4.coordinates(), SketchLine_27.startPoint())
-SketchConstraintCoincidence_39.setName("SketchConstraintCoincidence_43")
 SketchArc_7 = Sketch_4.addArc(-10, 21.26617031813674, -7.446808510638298, 15.83650981137842, -4, 21.26617031813674, False)
 SketchArc_7.setName("SketchArc_7")
 SketchArc_7.result().setName("SketchArc_7")
 SketchArc_7.results()[1].setName("SketchArc_7_2")
 SketchConstraintCoincidence_40 = Sketch_4.setCoincident(SketchArc_7.startPoint(), SketchArc_3.endPoint())
-SketchConstraintCoincidence_40.setName("SketchConstraintCoincidence_44")
-SketchLine_35 = Sketch_4.addLine(-4, 44.00000000000001, -4, 21.26617031813674)
+SketchLine_35 = Sketch_4.addLine(-4, 44, -4, 21.26617031813674)
 SketchLine_35.setName("SketchLine_34")
 SketchLine_35.result().setName("SketchLine_34")
 SketchLine_35.setAuxiliary(True)
 SketchConstraintCoincidence_41 = Sketch_4.setCoincident(SketchArc_7.endPoint(), SketchLine_35.endPoint())
-SketchConstraintCoincidence_41.setName("SketchConstraintCoincidence_45")
 SketchConstraintTangent_5 = Sketch_4.setTangent(SketchArc_7.results()[1], SketchLine_35.result())
 SketchConstraintTangent_6 = Sketch_4.setTangent(SketchArc_7.results()[1], SketchArc_3.results()[1])
 SketchConstraintCoincidence_42 = Sketch_4.setCoincident(SketchLine_32.startPoint(), SketchLine_35.startPoint())
-SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_47")
 SketchConstraintCoincidence_43 = Sketch_4.setCoincident(SketchArc_5.startPoint(), SketchArc_3.startPoint())
-SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_49")
 SketchConstraintTangent_7 = Sketch_4.setTangent(SketchArc_5.results()[1], SketchArc_3.results()[1])
 SketchConstraintCoincidence_44 = Sketch_4.setCoincident(SketchLine_35.endPoint(), SketchLine_32.result())
-SketchConstraintCoincidence_44.setName("SketchConstraintCoincidence_50")
 SketchConstraintCoincidence_45 = Sketch_4.setCoincident(SketchArc_3.endPoint(), SketchArc_5.results()[1])
-SketchConstraintCoincidence_45.setName("SketchConstraintCoincidence_51")
 SketchArc_8 = Sketch_4.addArc(10, 21.26617031813674, 4, 21.26617031813674, 7.446808510638299, 15.83650981137842, False)
 SketchArc_8.setName("SketchArc_9")
 SketchArc_8.result().setName("SketchArc_9")
 SketchArc_8.results()[1].setName("SketchArc_9_2")
-SketchLine_36 = Sketch_4.addLine(4, 21.26617031813674, 4, 44.00000000000001)
+SketchLine_36 = Sketch_4.addLine(4, 21.26617031813674, 4, 44)
 SketchLine_36.setName("SketchLine_35")
 SketchLine_36.result().setName("SketchLine_35")
 SketchLine_36.setAuxiliary(True)
 SketchConstraintCoincidence_46 = Sketch_4.setCoincident(SketchArc_8.startPoint(), SketchLine_36.startPoint())
-SketchConstraintCoincidence_46.setName("SketchConstraintCoincidence_52")
 SketchConstraintCoincidence_47 = Sketch_4.setCoincident(SketchArc_8.endPoint(), SketchArc_4.startPoint())
-SketchConstraintCoincidence_47.setName("SketchConstraintCoincidence_53")
 SketchConstraintTangent_8 = Sketch_4.setTangent(SketchArc_8.results()[1], SketchArc_4.results()[1])
 SketchConstraintTangent_9 = Sketch_4.setTangent(SketchArc_8.results()[1], SketchLine_36.result())
 SketchConstraintCoincidence_48 = Sketch_4.setCoincident(SketchArc_6.endPoint(), SketchArc_4.endPoint())
-SketchConstraintCoincidence_48.setName("SketchConstraintCoincidence_54")
 SketchConstraintCoincidence_49 = Sketch_4.setCoincident(SketchLine_27.endPoint(), SketchLine_36.endPoint())
-SketchConstraintCoincidence_49.setName("SketchConstraintCoincidence_55")
 SketchConstraintTangent_10 = Sketch_4.setTangent(SketchArc_6.results()[1], SketchArc_4.results()[1])
 SketchConstraintCoincidence_50 = Sketch_4.setCoincident(SketchArc_4.startPoint(), SketchArc_6.results()[1])
-SketchConstraintCoincidence_50.setName("SketchConstraintCoincidence_56")
 SketchConstraintCoincidence_51 = Sketch_4.setCoincident(SketchLine_36.startPoint(), SketchLine_27.result())
-SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_57")
 SketchConstraintCoincidence_52 = Sketch_4.setCoincident(SketchLine_25.startPoint(), SketchLine_34.endPoint())
-SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_58")
-SketchCircle_3 = Sketch_4.addCircle(model.selection("EDGE", "Sketch_2/Edge-SketchCircle_1_2"))
+SketchCircle_3 = Sketch_4.addCircle(model.selection("EDGE", "Sketch_2/SketchCircle_1_2"))
 SketchConstraintCoincidence_53 = Sketch_4.setCoincident(SketchLine_22.startPoint(), SketchCircle_3.results()[1])
-SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_59")
 SketchConstraintCoincidence_54 = Sketch_4.setCoincident(SketchArc_4.endPoint(), SketchCircle_3.results()[1])
-SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_60")
 SketchConstraintRadius_5 = Sketch_4.setRadius(SketchArc_7.results()[1], 6)
 SketchConstraintRadius_6 = Sketch_4.setRadius(SketchArc_8.results()[1], 6)
 SketchConstraintDistance_11 = Sketch_4.setDistance(SketchLine_25.endPoint(), SketchLine_36.result(), 4.5, False)
-SketchConstraintDistance_11.setName("SketchConstraintDistance_11")
 SketchConstraintDistance_12 = Sketch_4.setDistance(SketchArc_8.startPoint(), SketchLine_33.result(), 4, False)
-SketchConstraintDistance_12.setName("SketchConstraintDistance_12")
 SketchConstraintDistance_13 = Sketch_4.setDistance(SketchArc_7.endPoint(), SketchLine_33.result(), 4, False)
-SketchConstraintDistance_13.setName("SketchConstraintDistance_14")
-SketchArc_9 = Sketch_4.addArc(-10, 38.00000000000001, -4, 38.00000000000001, -9.999999999999854, 44.00000000000001, False)
+SketchArc_9 = Sketch_4.addArc(-10, 38, -4, 38, -10, 44, False)
 SketchArc_9.setName("SketchArc_10")
 SketchArc_9.result().setName("SketchArc_10")
 SketchArc_9.results()[1].setName("SketchArc_10_2")
 SketchConstraintCoincidence_55 = Sketch_4.setCoincident(SketchArc_9.startPoint(), SketchLine_20.startPoint())
-SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_61")
 SketchConstraintCoincidence_56 = Sketch_4.setCoincident(SketchArc_9.endPoint(), SketchLine_23.endPoint())
-SketchConstraintCoincidence_56.setName("SketchConstraintCoincidence_62")
 SketchConstraintTangent_11 = Sketch_4.setTangent(SketchArc_9.results()[1], SketchLine_20.result())
 SketchConstraintTangent_12 = Sketch_4.setTangent(SketchArc_9.results()[1], SketchLine_23.result())
 SketchConstraintCoincidence_57 = Sketch_4.setCoincident(SketchLine_35.endPoint(), SketchLine_20.endPoint())
-SketchConstraintCoincidence_57.setName("SketchConstraintCoincidence_63")
 SketchConstraintCoincidence_58 = Sketch_4.setCoincident(SketchLine_31.startPoint(), SketchLine_23.startPoint())
-SketchConstraintCoincidence_58.setName("SketchConstraintCoincidence_64")
 SketchConstraintCoincidence_59 = Sketch_4.setCoincident(SketchLine_20.startPoint(), SketchLine_35.result())
-SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_65")
 SketchConstraintCoincidence_60 = Sketch_4.setCoincident(SketchLine_23.endPoint(), SketchLine_31.result())
-SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_66")
-SketchArc_10 = Sketch_4.addArc(10, 37.99999999999996, 9.99999999990029, 43.99999998819102, 4, 37.99999998819019, False)
+SketchArc_10 = Sketch_4.addArc(10, 38, 10, 44, 4, 38, False)
 SketchArc_10.setName("SketchArc_11")
 SketchArc_10.result().setName("SketchArc_11")
 SketchArc_10.results()[1].setName("SketchArc_11_2")
 SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchArc_10.startPoint(), SketchLine_24.startPoint())
-SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_67")
 SketchConstraintCoincidence_62 = Sketch_4.setCoincident(SketchArc_10.endPoint(), SketchLine_21.endPoint())
-SketchConstraintCoincidence_62.setName("SketchConstraintCoincidence_68")
 SketchConstraintTangent_13 = Sketch_4.setTangent(SketchArc_10.results()[1], SketchLine_21.result())
 SketchConstraintTangent_14 = Sketch_4.setTangent(SketchArc_10.results()[1], SketchLine_24.result())
 SketchConstraintCoincidence_63 = Sketch_4.setCoincident(SketchLine_36.startPoint(), SketchLine_21.startPoint())
-SketchConstraintCoincidence_63.setName("SketchConstraintCoincidence_69")
 SketchConstraintCoincidence_64 = Sketch_4.setCoincident(SketchLine_26.endPoint(), SketchLine_24.endPoint())
-SketchConstraintCoincidence_64.setName("SketchConstraintCoincidence_70")
 SketchConstraintCoincidence_65 = Sketch_4.setCoincident(SketchLine_21.endPoint(), SketchLine_36.result())
-SketchConstraintCoincidence_65.setName("SketchConstraintCoincidence_71")
 SketchConstraintCoincidence_66 = Sketch_4.setCoincident(SketchLine_24.startPoint(), SketchLine_26.result())
-SketchConstraintCoincidence_66.setName("SketchConstraintCoincidence_72")
 SketchConstraintRadius_7 = Sketch_4.setRadius(SketchArc_9.results()[1], 6)
 SketchConstraintRadius_8 = Sketch_4.setRadius(SketchArc_10.results()[1], 6)
 SketchConstraintDistance_14 = Sketch_4.setDistance(SketchLine_23.startPoint(), SketchLine_29.result(), 1, False)
-SketchConstraintDistance_14.setName("SketchConstraintDistance_15")
 SketchConstraintDistance_15 = Sketch_4.setDistance(SketchLine_24.endPoint(), SketchLine_29.result(), 1, False)
-SketchConstraintDistance_15.setName("SketchConstraintDistance_16")
 SketchLine_37 = Sketch_4.addLine(model.selection("EDGE", "PartSet/OX"))
 SketchLine_37.setName("SketchLine_40")
 SketchLine_37.result().setName("SketchLine_40")
 SketchConstraintDistance_16 = Sketch_4.setDistance(SketchArc_10.startPoint(), SketchLine_37.result(), 44, False)
-SketchConstraintDistance_16.setName("SketchConstraintDistance_17")
 SketchConstraintDistance_17 = Sketch_4.setDistance(SketchLine_21.result(), SketchLine_24.endPoint(), 6.1, False)
-SketchConstraintDistance_17.setName("SketchConstraintDistance_18")
 SketchConstraintDistance_18 = Sketch_4.setDistance(SketchLine_30.endPoint(), SketchLine_20.result(), 6.1, False)
-SketchConstraintDistance_18.setName("SketchConstraintDistance_19")
 SketchConstraintCoincidence_67 = Sketch_4.setCoincident(SketchArc_3.center(), SketchCircle_3.center())
-SketchConstraintCoincidence_67.setName("SketchConstraintCoincidence_149")
 SketchConstraintCoincidence_68 = Sketch_4.setCoincident(SketchArc_4.center(), SketchArc_3.center())
-SketchConstraintCoincidence_68.setName("SketchConstraintCoincidence_150")
 SketchConstraintDistance_19 = Sketch_4.setDistance(SketchArc_4.center(), SketchLine_34.result(), 12, False)
-SketchConstraintDistance_19.setName("SketchConstraintDistance_43")
 model.do()
 Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), 50, 30)
 Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection(), 22, 22)
@@ -376,78 +319,68 @@ Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketc
 Extrusion_6 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 75, 40)
 Common_3 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_6_1")], [model.selection("SOLID", "Extrusion_5_1")])
 Sketch_5 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
-SketchLine_38 = Sketch_5.addLine(44, 3.464101615137744, 16.50000000000003, 51.09549882328188)
+SketchLine_38 = Sketch_5.addLine(44, 3.464101615137764, 16.5, 51.0954988232819)
 SketchLine_38.setName("SketchLine_41")
 SketchLine_38.result().setName("SketchLine_41")
-SketchPoint_5 = Sketch_5.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"))
+SketchPoint_5 = Sketch_5.addPoint(model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"))
 SketchConstraintCoincidence_69 = Sketch_5.setCoincident(SketchLine_38.startPoint(), SketchPoint_5.result())
-SketchConstraintCoincidence_69.setName("SketchConstraintCoincidence_73")
-SketchLine_39 = Sketch_5.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_4"))
+SketchLine_39 = Sketch_5.addLine(model.selection("EDGE", "Sketch_1/SketchLine_4"))
 SketchLine_39.setName("SketchLine_42")
 SketchLine_39.result().setName("SketchLine_42")
 SketchConstraintPerpendicular_2 = Sketch_5.setPerpendicular(SketchLine_38.result(), SketchLine_39.result())
 SketchConstraintLength_1 = Sketch_5.setLength(SketchLine_38.result(), 55)
-SketchConstraintLength_1.setName("SketchConstraintLength_6")
 model.do()
-Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_10r-SketchLine_11r-SketchLine_8r-SketchLine_3r-SketchLine_9r-SketchLine_6r-SketchArc_1_2r-SketchArc_2_2f"), model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_5s-SketchLine_4e"))
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Sketch_5/Vertex-SketchLine_41e"), False)
+Axis_4 = model.addAxis(Part_1_doc, model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_8r-SketchArc_1_2r-SketchLine_9r-SketchLine_3r-SketchLine_11r-SketchArc_2_2f-SketchLine_10r"), model.selection("VERTEX", "Sketch_1/SketchLine_4_EndVertex"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Sketch_5/SketchLine_41_EndVertex"), False)
 Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchLine_40 = Sketch_6.addLine(3.999999999999999, 13.00000000002605, 4, 12.89999999999998)
+SketchLine_40 = Sketch_6.addLine(4, 13, 4, 12.9)
 SketchLine_40.setName("SketchLine_55")
 SketchLine_40.result().setName("SketchLine_55")
-SketchLine_41 = Sketch_6.addLine(4, 12.89999999999998, -4, 12.89999999999998)
+SketchLine_41 = Sketch_6.addLine(4, 12.9, -4, 12.9)
 SketchLine_41.setName("SketchLine_44")
 SketchLine_41.result().setName("SketchLine_44")
-SketchLine_42 = Sketch_6.addLine(4, 19.00000000002614, 4, 12.89999999999998)
+SketchLine_42 = Sketch_6.addLine(4, 19, 4, 12.9)
 SketchLine_42.setName("SketchLine_43")
 SketchLine_42.result().setName("SketchLine_43")
 SketchLine_42.setAuxiliary(True)
 SketchConstraintCoincidence_70 = Sketch_6.setCoincident(SketchLine_42.endPoint(), SketchLine_41.startPoint())
-SketchConstraintCoincidence_70.setName("SketchConstraintCoincidence_74")
-SketchLine_43 = Sketch_6.addLine(-4, 12.89999999999998, -4.000000000000001, 13.00000000002612)
+SketchLine_43 = Sketch_6.addLine(-4, 12.9, -4, 13)
 SketchLine_43.setName("SketchLine_52")
 SketchLine_43.result().setName("SketchLine_52")
-SketchLine_44 = Sketch_6.addLine(-9.999999999999867, 19.00000000002614, -10.09999999999998, 19.00000000002614)
+SketchLine_44 = Sketch_6.addLine(-10, 19, -10.1, 19)
 SketchLine_44.setName("SketchLine_53")
 SketchLine_44.result().setName("SketchLine_53")
-SketchLine_45 = Sketch_6.addLine(-4, 12.89999999999998, -4, 19.00000000002614)
+SketchLine_45 = Sketch_6.addLine(-4, 12.9, -4, 19)
 SketchLine_45.setName("SketchLine_45")
 SketchLine_45.result().setName("SketchLine_45")
 SketchLine_45.setAuxiliary(True)
 SketchConstraintCoincidence_71 = Sketch_6.setCoincident(SketchLine_41.endPoint(), SketchLine_45.startPoint())
-SketchConstraintCoincidence_71.setName("SketchConstraintCoincidence_75")
-SketchLine_46 = Sketch_6.addLine(10.09999999999999, 19.00000000002614, 9.999999999999858, 19.00000000002614)
+SketchLine_46 = Sketch_6.addLine(10.1, 19, 10, 19)
 SketchLine_46.setName("SketchLine_54")
 SketchLine_46.result().setName("SketchLine_54")
-SketchLine_47 = Sketch_6.addLine(-4, 19.00000000002614, -10.09999999999998, 19.00000000002614)
+SketchLine_47 = Sketch_6.addLine(-4, 19, -10.1, 19)
 SketchLine_47.setName("SketchLine_46")
 SketchLine_47.result().setName("SketchLine_46")
 SketchLine_47.setAuxiliary(True)
 SketchConstraintCoincidence_72 = Sketch_6.setCoincident(SketchLine_45.endPoint(), SketchLine_47.startPoint())
-SketchConstraintCoincidence_72.setName("SketchConstraintCoincidence_76")
-SketchLine_48 = Sketch_6.addLine(-10.09999999999998, 19.00000000002614, -10.09999999999998, 19.80000000002615)
+SketchLine_48 = Sketch_6.addLine(-10.1, 19, -10.1, 19.8)
 SketchLine_48.setName("SketchLine_47")
 SketchLine_48.result().setName("SketchLine_47")
 SketchConstraintCoincidence_73 = Sketch_6.setCoincident(SketchLine_47.endPoint(), SketchLine_48.startPoint())
-SketchConstraintCoincidence_73.setName("SketchConstraintCoincidence_77")
-SketchLine_49 = Sketch_6.addLine(-10.09999999999998, 19.80000000002615, 10.09999999999999, 19.80000000002615)
+SketchLine_49 = Sketch_6.addLine(-10.1, 19.8, 10.1, 19.8)
 SketchLine_49.setName("SketchLine_48")
 SketchLine_49.result().setName("SketchLine_48")
 SketchConstraintCoincidence_74 = Sketch_6.setCoincident(SketchLine_48.endPoint(), SketchLine_49.startPoint())
-SketchConstraintCoincidence_74.setName("SketchConstraintCoincidence_78")
-SketchLine_50 = Sketch_6.addLine(10.09999999999999, 19.80000000002615, 10.09999999999999, 19.00000000002614)
+SketchLine_50 = Sketch_6.addLine(10.1, 19.8, 10.1, 19)
 SketchLine_50.setName("SketchLine_49")
 SketchLine_50.result().setName("SketchLine_49")
 SketchConstraintCoincidence_75 = Sketch_6.setCoincident(SketchLine_49.endPoint(), SketchLine_50.startPoint())
-SketchConstraintCoincidence_75.setName("SketchConstraintCoincidence_79")
-SketchLine_51 = Sketch_6.addLine(10.09999999999999, 19.00000000002614, 4, 19.00000000002614)
+SketchLine_51 = Sketch_6.addLine(10.1, 19, 4, 19)
 SketchLine_51.setName("SketchLine_50")
 SketchLine_51.result().setName("SketchLine_50")
 SketchLine_51.setAuxiliary(True)
 SketchConstraintCoincidence_76 = Sketch_6.setCoincident(SketchLine_50.endPoint(), SketchLine_51.startPoint())
-SketchConstraintCoincidence_76.setName("SketchConstraintCoincidence_80")
 SketchConstraintCoincidence_77 = Sketch_6.setCoincident(SketchLine_42.startPoint(), SketchLine_51.endPoint())
-SketchConstraintCoincidence_77.setName("SketchConstraintCoincidence_81")
 SketchConstraintVertical_11 = Sketch_6.setVertical(SketchLine_45.result())
 SketchConstraintVertical_12 = Sketch_6.setVertical(SketchLine_42.result())
 SketchConstraintHorizontal_7 = Sketch_6.setHorizontal(SketchLine_41.result())
@@ -456,87 +389,65 @@ SketchConstraintHorizontal_9 = Sketch_6.setHorizontal(SketchLine_51.result())
 SketchConstraintHorizontal_10 = Sketch_6.setHorizontal(SketchLine_49.result())
 SketchConstraintVertical_13 = Sketch_6.setVertical(SketchLine_50.result())
 SketchConstraintDistance_20 = Sketch_6.setDistance(SketchLine_48.startPoint(), SketchLine_49.result(), 0.8, False)
-SketchConstraintDistance_20.setName("SketchConstraintDistance_20")
 SketchConstraintDistance_21 = Sketch_6.setDistance(SketchLine_51.startPoint(), SketchLine_49.result(), 0.8, False)
-SketchConstraintDistance_21.setName("SketchConstraintDistance_21")
-SketchLine_52 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_41"))
+SketchLine_52 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/SketchLine_41"))
 SketchLine_52.setName("SketchLine_51")
 SketchLine_52.result().setName("SketchLine_51")
 SketchConstraintDistance_22 = Sketch_6.setDistance(SketchLine_45.startPoint(), SketchLine_52.result(), 4, False)
-SketchConstraintDistance_22.setName("SketchConstraintDistance_22")
 SketchConstraintDistance_23 = Sketch_6.setDistance(SketchLine_42.endPoint(), SketchLine_52.result(), 4, False)
-SketchConstraintDistance_23.setName("SketchConstraintDistance_23")
-SketchArc_11 = Sketch_6.addArc(-10, 13.00000000002614, -4.000000000000001, 13.00000000002612, -9.999999999999867, 19.00000000002614, False)
+SketchArc_11 = Sketch_6.addArc(-10, 13, -4, 13, -10, 19, False)
 SketchArc_11.setName("SketchArc_12")
 SketchArc_11.result().setName("SketchArc_12")
 SketchArc_11.results()[1].setName("SketchArc_12_2")
 SketchConstraintCoincidence_78 = Sketch_6.setCoincident(SketchArc_11.startPoint(), SketchLine_43.endPoint())
-SketchConstraintCoincidence_78.setName("SketchConstraintCoincidence_82")
 SketchConstraintCoincidence_79 = Sketch_6.setCoincident(SketchArc_11.endPoint(), SketchLine_44.startPoint())
-SketchConstraintCoincidence_79.setName("SketchConstraintCoincidence_83")
 SketchConstraintTangent_15 = Sketch_6.setTangent(SketchArc_11.results()[1], SketchLine_43.result())
 SketchConstraintTangent_16 = Sketch_6.setTangent(SketchArc_11.results()[1], SketchLine_44.result())
 SketchConstraintCoincidence_80 = Sketch_6.setCoincident(SketchLine_45.startPoint(), SketchLine_43.startPoint())
-SketchConstraintCoincidence_80.setName("SketchConstraintCoincidence_84")
 SketchConstraintCoincidence_81 = Sketch_6.setCoincident(SketchLine_47.endPoint(), SketchLine_44.endPoint())
-SketchConstraintCoincidence_81.setName("SketchConstraintCoincidence_85")
 SketchConstraintCoincidence_82 = Sketch_6.setCoincident(SketchLine_43.endPoint(), SketchLine_45.result())
-SketchConstraintCoincidence_82.setName("SketchConstraintCoincidence_86")
 SketchConstraintCoincidence_83 = Sketch_6.setCoincident(SketchLine_44.startPoint(), SketchLine_47.result())
-SketchConstraintCoincidence_83.setName("SketchConstraintCoincidence_87")
-SketchArc_12 = Sketch_6.addArc(9.999999999999998, 13.00000000002614, 9.999999999999858, 19.00000000002614, 3.999999999999999, 13.00000000002605, False)
+SketchArc_12 = Sketch_6.addArc(10, 13, 10, 19, 4, 13, False)
 SketchArc_12.setName("SketchArc_13")
 SketchArc_12.result().setName("SketchArc_13")
 SketchArc_12.results()[1].setName("SketchArc_13_2")
 SketchConstraintCoincidence_84 = Sketch_6.setCoincident(SketchArc_12.startPoint(), SketchLine_46.endPoint())
-SketchConstraintCoincidence_84.setName("SketchConstraintCoincidence_88")
 SketchConstraintCoincidence_85 = Sketch_6.setCoincident(SketchArc_12.endPoint(), SketchLine_40.startPoint())
-SketchConstraintCoincidence_85.setName("SketchConstraintCoincidence_89")
 SketchConstraintTangent_17 = Sketch_6.setTangent(SketchArc_12.results()[1], SketchLine_46.result())
 SketchConstraintTangent_18 = Sketch_6.setTangent(SketchArc_12.results()[1], SketchLine_40.result())
 SketchConstraintCoincidence_86 = Sketch_6.setCoincident(SketchLine_51.startPoint(), SketchLine_46.startPoint())
-SketchConstraintCoincidence_86.setName("SketchConstraintCoincidence_90")
 SketchConstraintCoincidence_87 = Sketch_6.setCoincident(SketchLine_42.endPoint(), SketchLine_40.endPoint())
-SketchConstraintCoincidence_87.setName("SketchConstraintCoincidence_91")
 SketchConstraintCoincidence_88 = Sketch_6.setCoincident(SketchLine_46.endPoint(), SketchLine_51.result())
-SketchConstraintCoincidence_88.setName("SketchConstraintCoincidence_92")
 SketchConstraintCoincidence_89 = Sketch_6.setCoincident(SketchLine_40.startPoint(), SketchLine_42.result())
-SketchConstraintCoincidence_89.setName("SketchConstraintCoincidence_93")
 SketchConstraintRadius_9 = Sketch_6.setRadius(SketchArc_11.results()[1], 6)
 SketchConstraintRadius_10 = Sketch_6.setRadius(SketchArc_12.results()[1], 6)
 SketchConstraintDistance_24 = Sketch_6.setDistance(SketchLine_40.result(), SketchLine_46.startPoint(), 6.1, False)
-SketchConstraintDistance_24.setName("SketchConstraintDistance_24")
 SketchConstraintDistance_25 = Sketch_6.setDistance(SketchLine_48.startPoint(), SketchLine_43.result(), 6.1, False)
-SketchConstraintDistance_25.setName("SketchConstraintDistance_25")
 SketchConstraintVertical_14 = Sketch_6.setVertical(SketchLine_48.result())
 SketchConstraintDistance_26 = Sketch_6.setDistance(SketchLine_41.result(), SketchArc_12.startPoint(), 6.1, False)
-SketchConstraintDistance_26.setName("SketchConstraintDistance_26")
 SketchLine_53 = Sketch_6.addLine(model.selection("EDGE", "Axis_1"))
 SketchLine_53.setName("SketchLine_56")
 SketchLine_53.result().setName("SketchLine_56")
 SketchConstraintCoincidence_90 = Sketch_6.setCoincident(SketchArc_12.startPoint(), SketchLine_53.result())
-SketchConstraintCoincidence_90.setName("SketchConstraintCoincidence_94")
 model.do()
-Extrusion_7 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchLine_55r-SketchLine_44r-SketchLine_52r-SketchLine_53r-SketchLine_54r-SketchLine_47r-SketchLine_48r-SketchLine_49r-SketchArc_12_2r-SketchArc_13_2r")], model.selection(), 0, 40)
+Extrusion_7 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchArc_13_2r-SketchLine_54r-SketchLine_49r-SketchLine_48r-SketchLine_47r-SketchLine_53r-SketchArc_12_2r-SketchLine_52r-SketchLine_44r-SketchLine_55r")], model.selection(), 0, 40)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Common_1_1")], [model.selection("SOLID", "Common_2_1")])
 Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Fuse_1_1")], [model.selection("SOLID", "Extrusion_7_1")])
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Fuse_2_1")], [model.selection("SOLID", "Common_3_1")])
-Extrusion_8 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_10r-SketchLine_11r-SketchLine_8r-SketchLine_3r-SketchLine_9r-SketchLine_6r-SketchArc_1_2r-SketchArc_2_2f")], model.selection(), 55, 55)
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_8_1/Generated_Face_1"))
+Extrusion_8 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_6r-SketchLine_8r-SketchArc_1_2r-SketchLine_9r-SketchLine_3r-SketchLine_11r-SketchArc_2_2f-SketchLine_10r_wire")], model.selection(), 55, 55)
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10"))
 SketchLine_54 = Sketch_7.addLine(55, -9.237604307034024, 55, -60)
 SketchLine_54.setName("SketchLine_66")
 SketchLine_54.result().setName("SketchLine_66")
-SketchPoint_6 = Sketch_7.addPoint(model.selection("VERTEX", "Extrusion_8_1/Generated_Face_2&Extrusion_8_1/Generated_Face_1&Extrusion_8_1/To_Face_1"))
+SketchPoint_6 = Sketch_7.addPoint(model.selection("VERTEX", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_8_1/To_Face]"))
 SketchLine_55 = Sketch_7.addLine(55, -9.237604307034024, 55, -70)
 SketchLine_55.setName("SketchLine_57")
 SketchLine_55.result().setName("SketchLine_57")
 SketchLine_55.setAuxiliary(True)
 SketchConstraintCoincidence_91 = Sketch_7.setCoincident(SketchLine_55.startPoint(), SketchPoint_6.result())
-SketchConstraintCoincidence_91.setName("SketchConstraintCoincidence_95")
-SketchPoint_7 = Sketch_7.addPoint(model.selection("VERTEX", "Extrusion_8_1/Generated_Face_8&Extrusion_8_1/Generated_Face_1&Extrusion_8_1/To_Face_1"))
+SketchPoint_7 = Sketch_7.addPoint(model.selection("VERTEX", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_8_1/To_Face]"))
 SketchConstraintCoincidence_92 = Sketch_7.setCoincident(SketchLine_55.endPoint(), SketchPoint_7.result())
-SketchConstraintCoincidence_92.setName("SketchConstraintCoincidence_96")
-SketchLine_56 = Sketch_7.addLine(45.00000000000001, -70, -45.00000000000001, -70)
+SketchLine_56 = Sketch_7.addLine(45, -70, -45, -70)
 SketchLine_56.setName("SketchLine_67")
 SketchLine_56.result().setName("SketchLine_67")
 SketchLine_57 = Sketch_7.addLine(55, -70, -55, -70)
@@ -544,11 +455,9 @@ SketchLine_57.setName("SketchLine_58")
 SketchLine_57.result().setName("SketchLine_58")
 SketchLine_57.setAuxiliary(True)
 SketchConstraintCoincidence_93 = Sketch_7.setCoincident(SketchLine_55.endPoint(), SketchLine_57.startPoint())
-SketchConstraintCoincidence_93.setName("SketchConstraintCoincidence_97")
-SketchPoint_8 = Sketch_7.addPoint(model.selection("VERTEX", "Extrusion_8_1/Generated_Face_8&Extrusion_8_1/Generated_Face_1&Extrusion_8_1/From_Face_1"))
+SketchPoint_8 = Sketch_7.addPoint(model.selection("VERTEX", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_8_1/From_Face]"))
 SketchConstraintCoincidence_94 = Sketch_7.setCoincident(SketchLine_57.endPoint(), SketchPoint_8.result())
-SketchConstraintCoincidence_94.setName("SketchConstraintCoincidence_98")
-SketchLine_58 = Sketch_7.addLine(-55.00000000000001, -59.99999999999999, -55, -9.237604307034024)
+SketchLine_58 = Sketch_7.addLine(-55, -60, -55, -9.237604307034024)
 SketchLine_58.setName("SketchLine_68")
 SketchLine_58.result().setName("SketchLine_68")
 SketchLine_59 = Sketch_7.addLine(-55, -70, -55, -9.237604307034024)
@@ -556,136 +465,103 @@ SketchLine_59.setName("SketchLine_59")
 SketchLine_59.result().setName("SketchLine_59")
 SketchLine_59.setAuxiliary(True)
 SketchConstraintCoincidence_95 = Sketch_7.setCoincident(SketchLine_57.endPoint(), SketchLine_59.startPoint())
-SketchConstraintCoincidence_95.setName("SketchConstraintCoincidence_99")
-SketchPoint_9 = Sketch_7.addPoint(model.selection("VERTEX", "Extrusion_8_1/Generated_Face_2&Extrusion_8_1/Generated_Face_1&Extrusion_8_1/From_Face_1"))
+SketchPoint_9 = Sketch_7.addPoint(model.selection("VERTEX", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_8_1/From_Face]"))
 SketchConstraintCoincidence_96 = Sketch_7.setCoincident(SketchLine_59.endPoint(), SketchPoint_9.result())
-SketchConstraintCoincidence_96.setName("SketchConstraintCoincidence_100")
-SketchLine_60 = Sketch_7.addLine(-55, -9.237604307034024, -60.00000000000001, -9.237604307034024)
+SketchLine_60 = Sketch_7.addLine(-55, -9.237604307034024, -60, -9.237604307034024)
 SketchLine_60.setName("SketchLine_60")
 SketchLine_60.result().setName("SketchLine_60")
 SketchConstraintCoincidence_97 = Sketch_7.setCoincident(SketchLine_59.endPoint(), SketchLine_60.startPoint())
-SketchConstraintCoincidence_97.setName("SketchConstraintCoincidence_101")
-SketchLine_61 = Sketch_7.addLine(-60.00000000000001, -9.237604307034024, -60.00000000000001, -79.23760430703402)
+SketchLine_61 = Sketch_7.addLine(-60, -9.237604307034024, -60, -79.23760430703402)
 SketchLine_61.setName("SketchLine_61")
 SketchLine_61.result().setName("SketchLine_61")
 SketchConstraintCoincidence_98 = Sketch_7.setCoincident(SketchLine_60.endPoint(), SketchLine_61.startPoint())
-SketchConstraintCoincidence_98.setName("SketchConstraintCoincidence_102")
-SketchLine_62 = Sketch_7.addLine(-60.00000000000001, -79.23760430703402, 60, -79.23760430703402)
+SketchLine_62 = Sketch_7.addLine(-60, -79.23760430703402, 60, -79.23760430703402)
 SketchLine_62.setName("SketchLine_62")
 SketchLine_62.result().setName("SketchLine_62")
 SketchConstraintCoincidence_99 = Sketch_7.setCoincident(SketchLine_61.endPoint(), SketchLine_62.startPoint())
-SketchConstraintCoincidence_99.setName("SketchConstraintCoincidence_103")
 SketchLine_63 = Sketch_7.addLine(60, -79.23760430703402, 60, -9.237604307034024)
 SketchLine_63.setName("SketchLine_63")
 SketchLine_63.result().setName("SketchLine_63")
 SketchConstraintCoincidence_100 = Sketch_7.setCoincident(SketchLine_62.endPoint(), SketchLine_63.startPoint())
-SketchConstraintCoincidence_100.setName("SketchConstraintCoincidence_104")
 SketchLine_64 = Sketch_7.addLine(60, -9.237604307034024, 55, -9.237604307034024)
 SketchLine_64.setName("SketchLine_64")
 SketchLine_64.result().setName("SketchLine_64")
 SketchConstraintCoincidence_101 = Sketch_7.setCoincident(SketchLine_63.endPoint(), SketchLine_64.startPoint())
-SketchConstraintCoincidence_101.setName("SketchConstraintCoincidence_105")
 SketchConstraintCoincidence_102 = Sketch_7.setCoincident(SketchLine_55.startPoint(), SketchLine_64.endPoint())
-SketchConstraintCoincidence_102.setName("SketchConstraintCoincidence_106")
 SketchConstraintCoincidence_103 = Sketch_7.setCoincident(SketchPoint_6.coordinates(), SketchLine_64.endPoint())
-SketchConstraintCoincidence_103.setName("SketchConstraintCoincidence_107")
 SketchConstraintHorizontal_11 = Sketch_7.setHorizontal(SketchLine_64.result())
 SketchConstraintHorizontal_12 = Sketch_7.setHorizontal(SketchLine_60.result())
 SketchConstraintHorizontal_13 = Sketch_7.setHorizontal(SketchLine_62.result())
 SketchConstraintVertical_15 = Sketch_7.setVertical(SketchLine_61.result())
 SketchConstraintVertical_16 = Sketch_7.setVertical(SketchLine_63.result())
-SketchArc_13 = Sketch_7.addArc(45, -60, 45.00000000000001, -70, 55, -60, False)
+SketchArc_13 = Sketch_7.addArc(45, -60, 45, -70, 55, -60, False)
 SketchArc_13.setName("SketchArc_14")
 SketchArc_13.result().setName("SketchArc_14")
 SketchArc_13.results()[1].setName("SketchArc_14_2")
-SketchLine_65 = Sketch_7.addLine(45.00000000000001, -70, -55, -70)
+SketchLine_65 = Sketch_7.addLine(45, -70, -55, -70)
 SketchLine_65.setName("SketchLine_65")
 SketchLine_65.result().setName("SketchLine_65")
 SketchLine_65.setAuxiliary(True)
 SketchConstraintCoincidence_104 = Sketch_7.setCoincident(SketchArc_13.startPoint(), SketchLine_65.startPoint())
-SketchConstraintCoincidence_104.setName("SketchConstraintCoincidence_108")
 SketchConstraintCoincidence_105 = Sketch_7.setCoincident(SketchArc_13.endPoint(), SketchLine_54.endPoint())
-SketchConstraintCoincidence_105.setName("SketchConstraintCoincidence_109")
 SketchConstraintTangent_19 = Sketch_7.setTangent(SketchArc_13.results()[1], SketchLine_65.result())
 SketchConstraintTangent_20 = Sketch_7.setTangent(SketchArc_13.results()[1], SketchLine_54.result())
 SketchConstraintCoincidence_106 = Sketch_7.setCoincident(SketchLine_57.endPoint(), SketchLine_65.endPoint())
-SketchConstraintCoincidence_106.setName("SketchConstraintCoincidence_110")
 SketchConstraintCoincidence_107 = Sketch_7.setCoincident(SketchLine_55.startPoint(), SketchLine_54.startPoint())
-SketchConstraintCoincidence_107.setName("SketchConstraintCoincidence_111")
 SketchConstraintCoincidence_108 = Sketch_7.setCoincident(SketchLine_65.startPoint(), SketchLine_57.result())
-SketchConstraintCoincidence_108.setName("SketchConstraintCoincidence_112")
 SketchConstraintCoincidence_109 = Sketch_7.setCoincident(SketchLine_54.endPoint(), SketchLine_55.result())
-SketchConstraintCoincidence_109.setName("SketchConstraintCoincidence_113")
-SketchArc_14 = Sketch_7.addArc(-45.00000000000001, -60.00000000000004, -55.00000000000001, -59.99999999999999, -45.00000000000001, -70, False)
+SketchArc_14 = Sketch_7.addArc(-45, -60, -55, -60, -45, -70, False)
 SketchArc_14.setName("SketchArc_15")
 SketchArc_14.result().setName("SketchArc_15")
 SketchArc_14.results()[1].setName("SketchArc_15_2")
 SketchConstraintCoincidence_110 = Sketch_7.setCoincident(SketchArc_14.startPoint(), SketchLine_58.startPoint())
-SketchConstraintCoincidence_110.setName("SketchConstraintCoincidence_114")
 SketchConstraintCoincidence_111 = Sketch_7.setCoincident(SketchArc_14.endPoint(), SketchLine_56.endPoint())
-SketchConstraintCoincidence_111.setName("SketchConstraintCoincidence_115")
 SketchConstraintTangent_21 = Sketch_7.setTangent(SketchArc_14.results()[1], SketchLine_56.result())
 SketchConstraintTangent_22 = Sketch_7.setTangent(SketchArc_14.results()[1], SketchLine_58.result())
 SketchConstraintCoincidence_112 = Sketch_7.setCoincident(SketchLine_65.startPoint(), SketchLine_56.startPoint())
-SketchConstraintCoincidence_112.setName("SketchConstraintCoincidence_116")
 SketchConstraintCoincidence_113 = Sketch_7.setCoincident(SketchLine_59.endPoint(), SketchLine_58.endPoint())
-SketchConstraintCoincidence_113.setName("SketchConstraintCoincidence_117")
 SketchConstraintCoincidence_114 = Sketch_7.setCoincident(SketchLine_56.endPoint(), SketchLine_65.result())
-SketchConstraintCoincidence_114.setName("SketchConstraintCoincidence_118")
 SketchConstraintCoincidence_115 = Sketch_7.setCoincident(SketchLine_58.startPoint(), SketchLine_59.result())
-SketchConstraintCoincidence_115.setName("SketchConstraintCoincidence_119")
 SketchConstraintRadius_11 = Sketch_7.setRadius(SketchArc_13.results()[1], 10)
 SketchConstraintRadius_12 = Sketch_7.setRadius(SketchArc_14.results()[1], 10)
 SketchCircle_4 = Sketch_7.addCircle(44, -59, 5)
-SketchCircle_5 = Sketch_7.addCircle(-43.99999999999999, -58.99999999999999, 5)
+SketchCircle_5 = Sketch_7.addCircle(-44, -59, 5)
 SketchConstraintRadius_13 = Sketch_7.setRadius(SketchCircle_4.results()[1], 5)
 SketchConstraintRadius_14 = Sketch_7.setRadius(SketchCircle_5.results()[1], 5)
 SketchConstraintDistance_27 = Sketch_7.setDistance(SketchCircle_4.center(), SketchLine_56.result(), 11, False)
-SketchConstraintDistance_27.setName("SketchConstraintDistance_27")
 SketchConstraintDistance_28 = Sketch_7.setDistance(SketchCircle_4.center(), SketchLine_54.result(), 11, False)
-SketchConstraintDistance_28.setName("SketchConstraintDistance_28")
 SketchConstraintDistance_29 = Sketch_7.setDistance(SketchCircle_5.center(), SketchLine_56.result(), 11, False)
-SketchConstraintDistance_29.setName("SketchConstraintDistance_29")
 SketchConstraintDistance_30 = Sketch_7.setDistance(SketchCircle_5.center(), SketchLine_58.result(), 11, False)
-SketchConstraintDistance_30.setName("SketchConstraintDistance_30")
 SketchCircle_6 = Sketch_7.addCircle(44, -20.23760430703402, 5)
 SketchConstraintRadius_15 = Sketch_7.setRadius(SketchCircle_6.results()[1], 5)
 SketchCircle_7 = Sketch_7.addCircle(-44, -20.23760430703402, 5)
 SketchConstraintRadius_16 = Sketch_7.setRadius(SketchCircle_7.results()[1], 5)
 SketchConstraintDistance_31 = Sketch_7.setDistance(SketchCircle_6.center(), SketchLine_54.result(), 11, False)
-SketchConstraintDistance_31.setName("SketchConstraintDistance_31")
-SketchLine_66 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_8_1/Generated_Face_2&Extrusion_8_1/Generated_Face_1"))
+SketchLine_66 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_10]"))
 SketchLine_66.setName("SketchLine_69")
 SketchLine_66.result().setName("SketchLine_69")
 SketchConstraintDistance_32 = Sketch_7.setDistance(SketchCircle_6.center(), SketchLine_66.result(), 11, False)
-SketchConstraintDistance_32.setName("SketchConstraintDistance_32")
 SketchConstraintDistance_33 = Sketch_7.setDistance(SketchCircle_7.center(), SketchLine_58.result(), 11, False)
-SketchConstraintDistance_33.setName("SketchConstraintDistance_33")
 SketchConstraintDistance_34 = Sketch_7.setDistance(SketchCircle_7.center(), SketchLine_66.result(), 11, False)
-SketchConstraintDistance_34.setName("SketchConstraintDistance_34")
 SketchConstraintLength_2 = Sketch_7.setLength(SketchLine_62.result(), 120)
-SketchConstraintLength_2.setName("SketchConstraintLength_7")
 SketchConstraintLength_3 = Sketch_7.setLength(SketchLine_61.result(), 70)
-SketchConstraintLength_3.setName("SketchConstraintLength_8")
 SketchConstraintDistanceHorizontal_1 = Sketch_7.setHorizontalDistance(SketchPoint_7.coordinates(), SketchLine_62.endPoint(), 5)
 model.do()
-ExtrusionCut_1_objects_1 = [model.selection("WIRE", "Sketch_7/Wire-SketchLine_66f-SketchLine_67f-SketchLine_68f-SketchLine_60f-SketchLine_61f-SketchLine_62f-SketchLine_63f-SketchLine_64f-SketchArc_14_2r-SketchArc_15_2r"), model.selection("FACE", "Sketch_7/Face-SketchCircle_4_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_7_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_6_2f")]
+ExtrusionCut_1_objects_1 = [model.selection("WIRE", "Sketch_7/Face-SketchLine_66r-SketchArc_14_2r-SketchLine_67f-SketchArc_15_2r-SketchLine_68f-SketchLine_60f-SketchLine_61f-SketchLine_62f-SketchLine_63f-SketchLine_64f_wire"), model.selection("FACE", "Sketch_7/Face-SketchCircle_4_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_5_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_7_2f"), model.selection("FACE", "Sketch_7/Face-SketchCircle_6_2f")]
 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_1_objects_1, model.selection(), 0, 10, [model.selection("SOLID", "Extrusion_8_1")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_8_1/Generated_Face_3"))
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11"))
 SketchLine_67 = Sketch_8.addLine(55, -34.06366588218793, 55, 66.69872981077805)
 SketchLine_67.setName("SketchLine_79")
 SketchLine_67.result().setName("SketchLine_79")
-SketchPoint_10 = Sketch_8.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_3&Extrusion_8_1/Generated_Face_3&ExtrusionCut_1_1/Modfied_13"))
+SketchPoint_10 = Sketch_8.addPoint(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_1_1/Generated_Face&Sketch_7/SketchLine_66)(Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_9)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3)]"))
 SketchLine_68 = Sketch_8.addLine(55, -34.06366588218793, 55, 76.69872981077803)
 SketchLine_68.setName("SketchLine_70")
 SketchLine_68.result().setName("SketchLine_70")
 SketchLine_68.setAuxiliary(True)
 SketchConstraintCoincidence_116 = Sketch_8.setCoincident(SketchLine_68.startPoint(), SketchPoint_10.result())
-SketchConstraintCoincidence_116.setName("SketchConstraintCoincidence_120")
-SketchPoint_11 = Sketch_8.addPoint(model.selection("VERTEX", "Extrusion_8_1/Generated_Face_3&ExtrusionCut_1_1/Modfied_13&Extrusion_8_1/Generated_Face_4"))
+SketchPoint_11 = Sketch_8.addPoint(model.selection("VERTEX", "[Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_1_1/Generated_Face&Sketch_7/SketchLine_66)(Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_9)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3)][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3]"))
 SketchConstraintCoincidence_117 = Sketch_8.setCoincident(SketchLine_68.endPoint(), SketchPoint_11.result())
-SketchConstraintCoincidence_117.setName("SketchConstraintCoincidence_121")
-SketchLine_69 = Sketch_8.addLine(45, 76.69872981077805, -44.9999999570576, 76.69872981077805)
+SketchLine_69 = Sketch_8.addLine(45, 76.69872981077805, -45, 76.69872981077805)
 SketchLine_69.setName("SketchLine_80")
 SketchLine_69.result().setName("SketchLine_80")
 SketchLine_70 = Sketch_8.addLine(55, 76.69872981077803, -55, 76.69872981077803)
@@ -693,10 +569,8 @@ SketchLine_70.setName("SketchLine_71")
 SketchLine_70.result().setName("SketchLine_71")
 SketchLine_70.setAuxiliary(True)
 SketchConstraintCoincidence_118 = Sketch_8.setCoincident(SketchLine_68.endPoint(), SketchLine_70.startPoint())
-SketchConstraintCoincidence_118.setName("SketchConstraintCoincidence_122")
-SketchPoint_12 = Sketch_8.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_1&Extrusion_8_1/Generated_Face_3&Extrusion_8_1/Generated_Face_4"))
+SketchPoint_12 = Sketch_8.addPoint(model.selection("VERTEX", "[(ExtrusionCut_1_1/Generated_Face&Sketch_7/SketchLine_68)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_9)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3)][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3]"))
 SketchConstraintCoincidence_119 = Sketch_8.setCoincident(SketchLine_70.endPoint(), SketchPoint_12.result())
-SketchConstraintCoincidence_119.setName("SketchConstraintCoincidence_123")
 SketchLine_71 = Sketch_8.addLine(-55, 66.69872976783566, -55, -34.06366588218793)
 SketchLine_71.setName("SketchLine_81")
 SketchLine_71.result().setName("SketchLine_81")
@@ -705,39 +579,30 @@ SketchLine_72.setName("SketchLine_72")
 SketchLine_72.result().setName("SketchLine_72")
 SketchLine_72.setAuxiliary(True)
 SketchConstraintCoincidence_120 = Sketch_8.setCoincident(SketchLine_70.endPoint(), SketchLine_72.startPoint())
-SketchConstraintCoincidence_120.setName("SketchConstraintCoincidence_124")
-SketchPoint_13 = Sketch_8.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_3&ExtrusionCut_1_1/Modfied_1&Extrusion_8_1/Generated_Face_3"))
+SketchPoint_13 = Sketch_8.addPoint(model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2][(ExtrusionCut_1_1/Generated_Face&Sketch_7/SketchLine_68)(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchArc_2_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchArc_1_2)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_9)(Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_3)][Extrusion_8_1/Generated_Face&Sketch_1/SketchLine_11]"))
 SketchConstraintCoincidence_121 = Sketch_8.setCoincident(SketchLine_72.endPoint(), SketchPoint_13.result())
-SketchConstraintCoincidence_121.setName("SketchConstraintCoincidence_125")
 SketchLine_73 = Sketch_8.addLine(-55, -34.06366588218793, -83.25521566485324, -34.06366588218793)
 SketchLine_73.setName("SketchLine_73")
 SketchLine_73.result().setName("SketchLine_73")
 SketchConstraintCoincidence_122 = Sketch_8.setCoincident(SketchLine_72.endPoint(), SketchLine_73.startPoint())
-SketchConstraintCoincidence_122.setName("SketchConstraintCoincidence_126")
 SketchLine_74 = Sketch_8.addLine(-83.25521566485324, -34.06366588218793, -83.25521566485298, 92.00148393088952)
 SketchLine_74.setName("SketchLine_74")
 SketchLine_74.result().setName("SketchLine_74")
 SketchConstraintCoincidence_123 = Sketch_8.setCoincident(SketchLine_73.endPoint(), SketchLine_74.startPoint())
-SketchConstraintCoincidence_123.setName("SketchConstraintCoincidence_127")
 SketchLine_75 = Sketch_8.addLine(-83.25521566485298, 92.00148393088952, 87.50975635635101, 92.00148393088952)
 SketchLine_75.setName("SketchLine_75")
 SketchLine_75.result().setName("SketchLine_75")
 SketchConstraintCoincidence_124 = Sketch_8.setCoincident(SketchLine_74.endPoint(), SketchLine_75.startPoint())
-SketchConstraintCoincidence_124.setName("SketchConstraintCoincidence_128")
 SketchLine_76 = Sketch_8.addLine(87.50975635635101, 92.00148393088952, 87.50975635635101, -34.06366588218793)
 SketchLine_76.setName("SketchLine_76")
 SketchLine_76.result().setName("SketchLine_76")
 SketchConstraintCoincidence_125 = Sketch_8.setCoincident(SketchLine_75.endPoint(), SketchLine_76.startPoint())
-SketchConstraintCoincidence_125.setName("SketchConstraintCoincidence_129")
 SketchLine_77 = Sketch_8.addLine(87.50975635635101, -34.06366588218793, 55, -34.06366588218793)
 SketchLine_77.setName("SketchLine_77")
 SketchLine_77.result().setName("SketchLine_77")
 SketchConstraintCoincidence_126 = Sketch_8.setCoincident(SketchLine_76.endPoint(), SketchLine_77.startPoint())
-SketchConstraintCoincidence_126.setName("SketchConstraintCoincidence_130")
 SketchConstraintCoincidence_127 = Sketch_8.setCoincident(SketchLine_68.startPoint(), SketchLine_77.endPoint())
-SketchConstraintCoincidence_127.setName("SketchConstraintCoincidence_131")
 SketchConstraintCoincidence_128 = Sketch_8.setCoincident(SketchPoint_10.coordinates(), SketchLine_77.endPoint())
-SketchConstraintCoincidence_128.setName("SketchConstraintCoincidence_132")
 SketchConstraintHorizontal_14 = Sketch_8.setHorizontal(SketchLine_77.result())
 SketchConstraintHorizontal_15 = Sketch_8.setHorizontal(SketchLine_73.result())
 SketchConstraintHorizontal_16 = Sketch_8.setHorizontal(SketchLine_75.result())
@@ -748,105 +613,72 @@ SketchArc_15.setName("SketchArc_16")
 SketchArc_15.result().setName("SketchArc_16")
 SketchArc_15.results()[1].setName("SketchArc_16_2")
 SketchConstraintCoincidence_129 = Sketch_8.setCoincident(SketchArc_15.startPoint(), SketchLine_67.endPoint())
-SketchConstraintCoincidence_129.setName("SketchConstraintCoincidence_133")
 SketchLine_78 = Sketch_8.addLine(45, 76.69872981077805, -55, 76.69872981077803)
 SketchLine_78.setName("SketchLine_78")
 SketchLine_78.result().setName("SketchLine_78")
 SketchLine_78.setAuxiliary(True)
 SketchConstraintCoincidence_130 = Sketch_8.setCoincident(SketchArc_15.endPoint(), SketchLine_78.startPoint())
-SketchConstraintCoincidence_130.setName("SketchConstraintCoincidence_134")
 SketchConstraintTangent_23 = Sketch_8.setTangent(SketchArc_15.results()[1], SketchLine_78.result())
 SketchConstraintTangent_24 = Sketch_8.setTangent(SketchArc_15.results()[1], SketchLine_67.result())
 SketchConstraintCoincidence_131 = Sketch_8.setCoincident(SketchLine_70.endPoint(), SketchLine_78.endPoint())
-SketchConstraintCoincidence_131.setName("SketchConstraintCoincidence_135")
 SketchConstraintCoincidence_132 = Sketch_8.setCoincident(SketchLine_68.startPoint(), SketchLine_67.startPoint())
-SketchConstraintCoincidence_132.setName("SketchConstraintCoincidence_136")
 SketchConstraintCoincidence_133 = Sketch_8.setCoincident(SketchLine_78.startPoint(), SketchLine_70.result())
-SketchConstraintCoincidence_133.setName("SketchConstraintCoincidence_137")
 SketchConstraintCoincidence_134 = Sketch_8.setCoincident(SketchLine_67.endPoint(), SketchLine_68.result())
-SketchConstraintCoincidence_134.setName("SketchConstraintCoincidence_138")
-SketchArc_16 = Sketch_8.addArc(-44.9999999570576, 66.69872976783566, -44.9999999570576, 76.69872981077805, -55, 66.69872976783566, False)
+SketchArc_16 = Sketch_8.addArc(-45, 66.69872976783566, -45, 76.69872981077805, -55, 66.69872976783566, False)
 SketchArc_16.setName("SketchArc_17")
 SketchArc_16.result().setName("SketchArc_17")
 SketchArc_16.results()[1].setName("SketchArc_17_2")
 SketchConstraintCoincidence_135 = Sketch_8.setCoincident(SketchArc_16.startPoint(), SketchLine_69.endPoint())
-SketchConstraintCoincidence_135.setName("SketchConstraintCoincidence_139")
 SketchConstraintCoincidence_136 = Sketch_8.setCoincident(SketchArc_16.endPoint(), SketchLine_71.startPoint())
-SketchConstraintCoincidence_136.setName("SketchConstraintCoincidence_140")
 SketchConstraintTangent_25 = Sketch_8.setTangent(SketchArc_16.results()[1], SketchLine_69.result())
 SketchConstraintTangent_26 = Sketch_8.setTangent(SketchArc_16.results()[1], SketchLine_71.result())
 SketchConstraintCoincidence_137 = Sketch_8.setCoincident(SketchLine_78.startPoint(), SketchLine_69.startPoint())
-SketchConstraintCoincidence_137.setName("SketchConstraintCoincidence_141")
 SketchConstraintCoincidence_138 = Sketch_8.setCoincident(SketchLine_72.endPoint(), SketchLine_71.endPoint())
-SketchConstraintCoincidence_138.setName("SketchConstraintCoincidence_142")
 SketchConstraintCoincidence_139 = Sketch_8.setCoincident(SketchLine_69.endPoint(), SketchLine_78.result())
-SketchConstraintCoincidence_139.setName("SketchConstraintCoincidence_143")
 SketchConstraintCoincidence_140 = Sketch_8.setCoincident(SketchLine_71.startPoint(), SketchLine_72.result())
-SketchConstraintCoincidence_140.setName("SketchConstraintCoincidence_144")
 SketchConstraintRadius_17 = Sketch_8.setRadius(SketchArc_15.results()[1], 10)
 SketchConstraintRadius_18 = Sketch_8.setRadius(SketchArc_16.results()[1], 10)
 SketchCircle_8 = Sketch_8.addCircle(-44, 51.69872981077802, 5)
 SketchConstraintRadius_19 = Sketch_8.setRadius(SketchCircle_8.results()[1], 5)
 SketchConstraintDistance_35 = Sketch_8.setDistance(SketchCircle_8.center(), SketchLine_69.result(), 25, False)
-SketchConstraintDistance_35.setName("SketchConstraintDistance_35")
 SketchConstraintDistance_36 = Sketch_8.setDistance(SketchCircle_8.center(), SketchLine_71.result(), 11, False)
-SketchConstraintDistance_36.setName("SketchConstraintDistance_36")
 SketchCircle_9 = Sketch_8.addCircle(-44, 16.69872981077805, 5)
 SketchConstraintRadius_20 = Sketch_8.setRadius(SketchCircle_9.results()[1], 5)
 SketchConstraintDistance_37 = Sketch_8.setDistance(SketchCircle_9.center(), SketchLine_71.result(), 11, False)
-SketchConstraintDistance_37.setName("SketchConstraintDistance_37")
 SketchConstraintDistance_38 = Sketch_8.setDistance(SketchCircle_9.center(), SketchLine_69.result(), 60, False)
-SketchConstraintDistance_38.setName("SketchConstraintDistance_38")
-SketchArc_17 = Sketch_8.addArc(44, 16.69872981077803, 49, 16.69872981077806, 39, 16.69872981077804, True)
+SketchArc_17 = Sketch_8.addArc(44, 16.69872981077805, 49, 16.69872981077805, 39, 16.69872981077805, True)
 SketchArc_17.setName("SketchArc_19")
 SketchArc_17.result().setName("SketchArc_19")
 SketchArc_17.results()[1].setName("SketchArc_19_2")
 SketchConstraintRadius_21 = Sketch_8.setRadius(SketchArc_17.results()[1], 5)
-SketchConstraintRadius_21.setName("SketchConstraintRadius_22")
 SketchConstraintDistance_39 = Sketch_8.setDistance(SketchArc_17.center(), SketchLine_69.result(), 60, False)
-SketchConstraintDistance_39.setName("SketchConstraintDistance_41")
-SketchArc_18 = Sketch_8.addArc(44, 51.69872981077805, 49, 51.69872981077805, 39.00000000000002, 51.69873025170988, False)
+SketchArc_18 = Sketch_8.addArc(44, 51.69872981077805, 49, 51.69872981077805, 39, 51.69872981077805, False)
 SketchArc_18.setName("SketchArc_18")
 SketchArc_18.result().setName("SketchArc_18")
 SketchArc_18.results()[1].setName("SketchArc_18_2")
-SketchLine_79 = Sketch_8.addLine(49, 16.69872981077806, 49, 51.69872981077805)
+SketchLine_79 = Sketch_8.addLine(49, 16.69872981077805, 49, 51.69872981077805)
 SketchLine_79.setName("SketchLine_82")
 SketchLine_79.result().setName("SketchLine_82")
 SketchConstraintCoincidence_141 = Sketch_8.setCoincident(SketchArc_18.startPoint(), SketchLine_79.endPoint())
-SketchConstraintCoincidence_141.setName("SketchConstraintCoincidence_145")
 SketchConstraintCoincidence_142 = Sketch_8.setCoincident(SketchLine_79.startPoint(), SketchArc_17.startPoint())
-SketchConstraintCoincidence_142.setName("SketchConstraintCoincidence_146")
-SketchLine_80 = Sketch_8.addLine(39, 16.69872981077804, 39.00000000000002, 51.69873025170988)
+SketchLine_80 = Sketch_8.addLine(39, 16.69872981077805, 39, 51.69872981077805)
 SketchLine_80.setName("SketchLine_83")
 SketchLine_80.result().setName("SketchLine_83")
 SketchConstraintCoincidence_143 = Sketch_8.setCoincident(SketchArc_17.endPoint(), SketchLine_80.startPoint())
-SketchConstraintCoincidence_143.setName("SketchConstraintCoincidence_147")
 SketchConstraintCoincidence_144 = Sketch_8.setCoincident(SketchArc_18.endPoint(), SketchLine_80.endPoint())
-SketchConstraintCoincidence_144.setName("SketchConstraintCoincidence_148")
 SketchConstraintDistance_40 = Sketch_8.setDistance(SketchArc_17.center(), SketchLine_67.result(), 11, False)
-SketchConstraintDistance_40.setName("SketchConstraintDistance_40")
 SketchConstraintDistance_41 = Sketch_8.setDistance(SketchLine_69.result(), SketchArc_18.center(), 25, False)
-SketchConstraintDistance_41.setName("SketchConstraintDistance_42")
 SketchConstraintDistance_42 = Sketch_8.setDistance(SketchArc_18.center(), SketchLine_67.result(), 11, False)
-SketchConstraintDistance_42.setName("SketchConstraintDistance_44")
 SketchConstraintRadius_22 = Sketch_8.setRadius(SketchArc_18.results()[1], 5)
-SketchConstraintRadius_22.setName("SketchConstraintRadius_23")
 SketchConstraintLength_4 = Sketch_8.setLength(SketchLine_80.result(), 35.000000440932)
-SketchConstraintLength_4.setName("SketchConstraintLength_1")
 SketchConstraintLength_5 = Sketch_8.setLength(SketchLine_79.result(), 35)
-SketchConstraintLength_5.setName("SketchConstraintLength_2")
 SketchConstraintLength_6 = Sketch_8.setLength(SketchLine_75.result(), 170.764972021204)
-SketchConstraintLength_6.setName("SketchConstraintLength_3")
 SketchConstraintLength_7 = Sketch_8.setLength(SketchLine_77.result(), 32.509756356351)
-SketchConstraintLength_7.setName("SketchConstraintLength_4")
 SketchConstraintLength_8 = Sketch_8.setLength(SketchLine_76.result(), 126.065149813077)
-SketchConstraintLength_8.setName("SketchConstraintLength_5")
 SketchConstraintDistance_43 = Sketch_8.setDistance(SketchArc_18.endPoint(), SketchLine_69.result(), 24.999999559068, False)
-SketchConstraintDistance_43.setName("SketchConstraintDistance_45")
 SketchConstraintDistance_44 = Sketch_8.setDistance(SketchArc_18.startPoint(), SketchLine_69.result(), 25, False)
-SketchConstraintDistance_44.setName("SketchConstraintDistance_46")
 model.do()
-ExtrusionCut_2_objects_1 = [model.selection("FACE", "Sketch_8/Face-SketchLine_79r-SketchLine_80r-SketchLine_81r-SketchLine_73r-SketchLine_74r-SketchLine_75r-SketchLine_76r-SketchLine_77r-SketchArc_16_2r-SketchArc_17_2r"), model.selection("WIRE", "Sketch_8/Wire-SketchCircle_8_2f"), model.selection("WIRE", "Sketch_8/Wire-SketchCircle_9_2f"), model.selection("WIRE", "Sketch_8/Wire-SketchArc_19_2f-SketchArc_18_2f-SketchLine_82f-SketchLine_83r")]
+ExtrusionCut_2_objects_1 = [model.selection("FACE", "Sketch_8/Face-SketchLine_77r-SketchLine_76r-SketchLine_75r-SketchLine_74r-SketchLine_73r-SketchLine_81r-SketchArc_17_2r-SketchLine_80r-SketchArc_16_2r-SketchLine_79r"), model.selection("WIRE", "Sketch_8/Face-SketchCircle_8_2f_wire"), model.selection("WIRE", "Sketch_8/Face-SketchCircle_9_2f_wire"), model.selection("WIRE", "Sketch_8/Face-SketchArc_19_2f-SketchLine_82f-SketchArc_18_2f-SketchLine_83r_wire")]
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_2_objects_1, model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_1_1")])
 Fuse_3 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "ExtrusionCut_2_1")])
 model.do()
@@ -864,8 +696,9 @@ model.testNbResults(Fuse_3, 1)
 model.testNbSubResults(Fuse_3, [0])
 model.testNbSubShapes(Fuse_3, GeomAPI_Shape.SOLID, [1])
 model.testNbSubShapes(Fuse_3, GeomAPI_Shape.FACE, [50])
-model.testNbSubShapes(Fuse_3, GeomAPI_Shape.EDGE, [266])
-model.testNbSubShapes(Fuse_3, GeomAPI_Shape.VERTEX, [532])
-model.testResultsVolumes(Fuse_3, [156999.209584889642428606748580933])
+# unstable numbers
+#model.testNbSubShapes(Fuse_3, GeomAPI_Shape.EDGE, [266])
+#model.testNbSubShapes(Fuse_3, GeomAPI_Shape.VERTEX, [532])
+model.testResultsVolumes(Fuse_3, [156999.196618517889874055981636])
 
 assert(model.checkPythonDump())
index 5a20aecd31e6bb88580ce41ec6c45385229da554..d0c253590e23438c50af542c73e6d98daeecd90e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -98,15 +97,15 @@ SketchLine_7.result().setName("SketchLine_30")
 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_7.result())
 SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_35")
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_4r-SketchArc_1_2f-SketchArc_2_2f-SketchLine_28r-SketchLine_29r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_2"))
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_2_2f-SketchArc_1_2f-SketchLine_4r-SketchLine_29r-SketchLine_28r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2"))
 SketchLine_8 = Sketch_2.addLine(0, 0, 25, 43.30127018922193)
 SketchLine_8.setName("SketchLine_5")
 SketchLine_8.result().setName("SketchLine_5")
 SketchLine_8.setAuxiliary(True)
 SketchPoint_3 = Sketch_2.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchPoint_3.result())
-SketchCircle_1 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1"))
+SketchCircle_1 = Sketch_2.addCircle(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]"))
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchCircle_1.results()[1])
 SketchLine_9 = Sketch_2.addLine(39.43375672974064, -43.30127018922192, 15.87711932209923, -2.499977343709401)
 SketchLine_9.setName("SketchLine_10")
@@ -116,7 +115,7 @@ SketchLine_10.setName("SketchLine_6")
 SketchLine_10.result().setName("SketchLine_6")
 SketchLine_10.setAuxiliary(True)
 SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchPoint_3.result())
-SketchCircle_2 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1"))
+SketchCircle_2 = Sketch_2.addCircle(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]"))
 SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchCircle_2.results()[1])
 SketchLine_11 = Sketch_2.addLine(15.87713238415337, 2.499999967850816, 39.43375672974065, 43.30127018922192)
 SketchLine_11.setName("SketchLine_11")
@@ -229,10 +228,10 @@ SketchLine_22.result().setName("SketchLine_19")
 SketchConstraintDistance_9 = Sketch_2.setDistance(SketchArc_9.center(), SketchPoint_3.coordinates(), 21)
 SketchConstraintDistance_9.setName("SketchConstraintDistance_8")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_10r-SketchLine_11r-SketchArc_3_2f-SketchArc_4_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchArc_7_2f-SketchLine_15r-SketchArc_8_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12r-SketchArc_5_2f-SketchLine_13r-SketchArc_6_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchArc_9_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchArc_11_2f")], model.selection(), model.selection(), 10, model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchArc_4_2f-SketchLine_11r-SketchArc_3_2f-SketchLine_10r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchArc_7_2f-SketchLine_15r-SketchArc_8_2f-SketchLine_14r_wire"), model.selection("FACE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_13r-SketchArc_6_2f-SketchLine_12r"), model.selection("FACE", "Sketch_2/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchArc_9_2f"), model.selection("WIRE", "Sketch_2/Face-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchArc_11_2f_wire")], model.selection(), model.selection(), 10, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_4"), 10)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_4"), model.selection("SOLID", "Extrusion_1_5")])
 Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3"), model.selection("SOLID", "Extrusion_1_6")])
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cut_2_1/Modified_Face_7"), model.selection("FACE", "Cut_2_1/Modified_Face_9"))
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cut_2_1/Modified_Face&Sketch_2/SketchLine_21"), model.selection("FACE", "Cut_2_1/Modified_Face&Sketch_2/SketchLine_19"))
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchCircle_3 = Sketch_3.addCircle(25, -10, 4)
 SketchCircle_4 = Sketch_3.addCircle(40, -10, 4)
@@ -245,7 +244,7 @@ SketchConstraintDistance_10 = Sketch_3.setDistance(SketchCircle_3.center(), Sket
 SketchConstraintDistance_10.setName("SketchConstraintDistance_9")
 SketchConstraintDistance_11 = Sketch_3.setDistance(SketchCircle_4.center(), SketchLine_28.result(), 40)
 SketchConstraintDistance_11.setName("SketchConstraintDistance_10")
-SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Cut_2_1/Modified_Face_divided_20_e_15_1"), False)
+SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Cut_2_1/Generated_Edge&Sketch_2/SketchLine_21&Sketch_1/SketchLine_2"), False)
 SketchLine_29 = SketchProjection_1.createdFeature()
 SketchLine_29.setName("SketchLine_26")
 SketchLine_29.result().setName("SketchLine_26")
@@ -254,7 +253,7 @@ SketchConstraintDistance_12.setName("SketchConstraintDistance_11")
 SketchConstraintDistance_13 = Sketch_3.setDistance(SketchCircle_3.center(), SketchLine_29.result(), 10)
 SketchConstraintDistance_13.setName("SketchConstraintDistance_12")
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f"), model.selection("WIRE", "Sketch_3/Wire-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Cut_1_1/Modified_Face_6"), 5, model.selection("FACE", "Cut_1_1/Modified_Face_8"), 5)
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2r"), model.selection("WIRE", "Sketch_3/Face-SketchCircle_4_2f_wire")], model.selection(), model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_2/SketchLine_11"), 5, model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_2/SketchLine_13"), 5)
 Cut_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_2_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
 Recover_1 = model.addRecover(Part_1_doc, Cut_3, [Extrusion_2.results()[1], Extrusion_2.result()])
 Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_1_1"), model.selection("SOLID", "Recover_1_2")], model.selection("EDGE", "PartSet/OZ"), 120)
@@ -496,15 +495,15 @@ SketchConstraintCoincidence_97 = Sketch_5.setCoincident(SketchLine_49.endPoint()
 SketchConstraintCoincidence_97.setName("SketchConstraintCoincidence_75")
 SketchConstraintDistance_19 = Sketch_5.setDistance(SketchLine_49.endPoint(), SketchLine_41.result(), 10)
 model.do()
-Face_1 = model.addFace(Part_2_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchArc_4_2f-SketchArc_5_2f-SketchArc_6_2f-SketchArc_7_2f-SketchArc_8_2f-SketchArc_9_2f-SketchArc_10_2f")])
-Axis_4 = model.addAxis(Part_2_doc, model.selection("FACE", "PartSet/XOZ"), model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_3-SketchLine_20s"))
+Face_1 = model.addFace(Part_2_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchArc_7_2f-SketchArc_8_2f-SketchArc_9_2f-SketchArc_10_2f-SketchArc_6_2f-SketchArc_5_2f-SketchArc_4_2f_wire")])
+Axis_4 = model.addAxis(Part_2_doc, model.selection("FACE", "PartSet/XOZ"), model.selection("VERTEX", "Sketch_2/SketchArc_3"))
 Rotation_3 = model.addRotation(Part_2_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "Axis_1"), -43.8752)
-Pipe_1 = model.addPipe(Part_2_doc, [model.selection("FACE", "Rotation_1_1")], model.selection("EDGE", "Sketch_2/Edge-SketchArc_3_2"))
-Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_2_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r-SketchLine_17r")], model.selection(), "Gap/2", "Gap/2")
+Pipe_1 = model.addPipe(Part_2_doc, [model.selection("FACE", "Rotation_1_1")], model.selection("EDGE", "Sketch_2/SketchArc_3_2"))
+Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_2_2f-SketchCircle_3_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchLine_17r-SketchLine_16r-SketchLine_15r-SketchLine_14r_wire")], model.selection(), "Gap/2", "Gap/2")
 Fuse_1 = model.addFuse(Part_2_doc, [model.selection("SOLID", "Pipe_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
 Extrusion_4 = model.addExtrusion(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), "Gap", "Gap")
 Cut_1 = model.addCut(Part_2_doc, [model.selection("SOLID", "Fuse_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
-Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Cut_1_1")], model.selection("VERTEX", "Sketch_2/Edge-SketchCircle_2_2__cc"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_21e"))
+Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Cut_1_1")], model.selection("VERTEX", "Sketch_2/SketchCircle_2_2__cc"), model.selection("VERTEX", "Sketch_2/SketchLine_21_EndVertex"))
 model.do()
 Part_3 = model.duplicatePart(Part_2)
 Part_3.setName("Arm 2")
@@ -547,11 +546,11 @@ SketchConstraintCoincidence_238 = Sketch_10.setCoincident(SketchPoint_7.coordina
 SketchLine_99 = Sketch_10.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchConstraintDistance_35 = Sketch_10.setDistance(SketchLine_98.endPoint(), SketchLine_99.result(), "Thickness")
 model.do()
-Revolution_2 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), 360, 0)
-Sketch_11 = model.addSketch(Part_5_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1"))
+Revolution_2 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "Sketch_1/SketchLine_6"), 360, 0)
+Sketch_11 = model.addSketch(Part_5_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1"))
 SketchCircle_14 = Sketch_11.addCircle(0, 0, 8.5)
 SketchCircle_14.setAuxiliary(True)
-SketchPoint_8 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_6e"))
+SketchPoint_8 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"))
 SketchConstraintCoincidence_239 = Sketch_11.setCoincident(SketchCircle_14.center(), SketchPoint_8.result())
 SketchConstraintRadius_18 = Sketch_11.setRadius(SketchCircle_14.results()[1], "(Rod+5)/2")
 SketchLine_100 = Sketch_11.addLine(-8.5, -4.907477288111821, -8.5, 4.907477288111821)
@@ -579,7 +578,7 @@ SketchConstraintEqual_8 = Sketch_11.setEqual(SketchLine_101.result(), SketchLine
 SketchConstraintEqual_9 = Sketch_11.setEqual(SketchLine_102.result(), SketchLine_103.result())
 SketchConstraintEqual_10 = Sketch_11.setEqual(SketchLine_103.result(), SketchLine_104.result())
 model.do()
-Extrusion_9 = model.addExtrusion(Part_5_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9r-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), 25, 0)
+Extrusion_9 = model.addExtrusion(Part_5_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r")], model.selection(), 25, 0)
 Sketch_12 = model.addSketch(Part_5_doc, model.standardPlane("YOZ"))
 SketchLine_106 = Sketch_12.addLine(9.814954576223595, 48.99999999999999, 9.814954576223595, 52.35726558990813)
 SketchLine_107 = Sketch_12.addLine(9.814954576223595, 52.35726558990813, 4, 52.35726558990813)
@@ -590,15 +589,15 @@ SketchConstraintCoincidence_248 = Sketch_12.setCoincident(SketchLine_106.startPo
 SketchConstraintHorizontal_20 = Sketch_12.setHorizontal(SketchLine_107.result())
 SketchConstraintVertical_20 = Sketch_12.setVertical(SketchLine_106.result())
 SketchConstraintAngle_8 = Sketch_12.setAngle(SketchLine_108.result(), SketchLine_107.result(), 30)
-SketchLine_109 = Sketch_12.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_3"))
+SketchLine_109 = Sketch_12.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_9]"))
 SketchConstraintCoincidence_249 = Sketch_12.setCoincident(SketchLine_108.endPoint(), SketchLine_109.result())
-SketchProjection_2 = Sketch_12.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"))
+SketchProjection_2 = Sketch_12.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10][Extrusion_1_1/To_Face]"), False)
 SketchLine_110 = SketchProjection_2.createdFeature()
 SketchConstraintDistance_36 = Sketch_12.setDistance(SketchLine_110.result(), SketchLine_108.endPoint(), 1)
 SketchLine_111 = Sketch_12.addLine(model.selection("EDGE", "PartSet/OZ"))
 SketchConstraintDistance_37 = Sketch_12.setDistance(SketchLine_108.startPoint(), SketchLine_111.result(), 4)
 model.do()
-Revolution_3 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_14f-SketchLine_15f-SketchLine_16f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_3 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_14r-SketchLine_15f-SketchLine_16f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Cut_12 = model.addCut(Part_5_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")])
 Cut_13 = model.addFuse(Part_5_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Revolution_1_1")], [])
 
index 1fade828ad5129607a1e9c72efa72e487c634b93..9231c178455959e20b347936c4198cac40905534 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -43,8 +42,8 @@ SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchPoint_1.coordinates
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), "h", 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_2 = SketchProjection_1.createdFeature()
 SketchCircle_2 = Sketch_2.addCircle(0, 0, 33.5)
 SketchConstraintRadius_2 = Sketch_2.setRadius(SketchCircle_2.results()[1], "R2")
@@ -53,16 +52,16 @@ SketchConstraintCoincidence_5.setName("SketchConstraintCoincidence_14")
 model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), "h2", 0)
 Extrusion_3 = model.addExtrusion(Part_1_doc, [], model.selection(), "h2*3", 0)
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_1"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face"))
 SketchCircle_3 = Sketch_3.addCircle(0, 0, 28.25)
 SketchConstraintRadius_3 = Sketch_3.setRadius(SketchCircle_3.results()[1], 28.25)
-SketchProjection_2 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchProjection_2 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_3 = SketchProjection_2.createdFeature()
 SketchConstraintCoincidence_6 = Sketch_3.setCoincident(SketchCircle_3.center(), SketchAPI_Line(SketchLine_3).startPoint())
 Extrusion_3.setNestedSketch(Sketch_3)
 Extrusion_4 = model.addExtrusion(Part_1_doc, [], model.selection(), "h2", 0)
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_3_1/To_Face_1"))
-SketchProjection_3 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_3_1/To_Face"))
+SketchProjection_3 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_4 = SketchProjection_3.createdFeature()
 SketchCircle_4 = Sketch_4.addCircle(0, 0, 25.9)
 SketchConstraintRadius_4 = Sketch_4.setRadius(SketchCircle_4.results()[1], "R3")
@@ -70,8 +69,8 @@ SketchConstraintCoincidence_7 = Sketch_4.setCoincident(SketchAPI_Line(SketchLine
 SketchConstraintCoincidence_7.setName("SketchConstraintCoincidence_15")
 Extrusion_4.setNestedSketch(Sketch_4)
 Extrusion_5 = model.addExtrusion(Part_1_doc, [], model.selection(), "h2", 0)
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_4_1/To_Face_1"))
-SketchProjection_4 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_4_1/To_Face"))
+SketchProjection_4 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_5 = SketchProjection_4.createdFeature()
 SketchCircle_5 = Sketch_5.addCircle(0, 0, 8)
 SketchConstraintRadius_5 = Sketch_5.setRadius(SketchCircle_5.results()[1], 8)
@@ -79,15 +78,15 @@ SketchConstraintCoincidence_8 = Sketch_5.setCoincident(SketchAPI_Line(SketchLine
 SketchConstraintCoincidence_8.setName("SketchConstraintCoincidence_16")
 Extrusion_5.setNestedSketch(Sketch_5)
 Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_4_1"), model.selection("SOLID", "Extrusion_5_1"), model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_3_1")], [])
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection("FACE", "Extrusion_5_1/To_Face_1"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")])
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face_1"))
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), model.selection("FACE", "Extrusion_5_1/To_Face"), 0, model.selection(), 0, [model.selection("SOLID", "Fuse_1_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/From_Face"))
 SketchCircle_6 = Sketch_6.addCircle(0, 0, 4.2)
 SketchConstraintRadius_6 = Sketch_6.setRadius(SketchCircle_6.results()[1], 4.2)
 SketchPoint_2 = Sketch_6.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchConstraintCoincidence_9 = Sketch_6.setCoincident(SketchPoint_2.coordinates(), SketchCircle_6.center())
 SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_17")
 ExtrusionCut_1.setNestedSketch(Sketch_6)
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_2"))
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face"))
 SketchCircle_7 = Sketch_7.addCircle(0, -85, 66)
 SketchLine_6 = Sketch_7.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchConstraintCoincidence_10 = Sketch_7.setCoincident(SketchCircle_7.center(), SketchLine_6.result())
@@ -96,8 +95,8 @@ SketchConstraintDistance_1 = Sketch_7.setDistance(SketchCircle_7.center(), Sketc
 SketchMultiRotation_1 = Sketch_7.addRotation([SketchCircle_7.results()[1]], SketchLine_6.startPoint(), 120, 3)
 [SketchCircle_8, SketchCircle_9] = SketchMultiRotation_1.rotated()
 model.do()
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_1"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/Modfied_1"))
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_5_1/To_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face"))
 SketchLine_7 = Sketch_8.addLine(-2.320957096353877e-016, 11.00000001704673, -7, 11.00000001704673)
 SketchConstraintHorizontal_1 = Sketch_8.setHorizontal(SketchLine_7.result())
 SketchLine_8 = Sketch_8.addLine(-7, 11.00000001704673, -6.329882773485103e-016, 30.00000001704673)
@@ -126,7 +125,8 @@ SketchLine_14.result().setName("SketchLine_13")
 SketchLine_13.setName("SketchLine_16")
 SketchLine_13.result().setName("SketchLine_16")
 model.do()
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_7r-SketchLine_8r-SketchLine_10f-SketchLine_11f"), model.selection("FACE", "Sketch_8/Face-SketchLine_16f-SketchLine_17f-SketchLine_18r-SketchLine_19r"), model.selection("FACE", "Sketch_8/Face-SketchLine_12f-SketchLine_13f-SketchLine_14r-SketchLine_15r")], model.selection(), model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+ExtrusionCut_3_objects_1 = [model.selection("FACE", "Sketch_8/Face-SketchLine_10f-SketchLine_11f-SketchLine_8r-SketchLine_7r"), model.selection("FACE", "Sketch_8/Face-SketchLine_16f-SketchLine_18r-SketchLine_19r-SketchLine_17f"), model.selection("FACE", "Sketch_8/Face-SketchLine_12f-SketchLine_14r-SketchLine_15r-SketchLine_13f")]
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_3_objects_1, model.selection(), model.selection("FACE", "ExtrusionCut_2_1/Modified_Face&Extrusion_4_1/To_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
 
 # Test reexecution after parameter change
 Parameter_R.setValue(50)
index de8e95449249c619e68918aa0d7faee55711bcef..76c6bac755244c6aace928ae6ca7d308861bf6de 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -389,7 +388,7 @@ SketchConstraintRadius_8 = Sketch_3.setRadius(SketchCircle_2.results()[1], "TDE/
 SketchConstraintRadius_8.setName("SketchConstraintRadius_2")
 SketchConstraintDistance_15 = Sketch_3.setDistance(SketchCircle_2.center(), SketchCircle_1.center(), 30)
 SketchConstraintDistance_15.setName("SketchConstraintDistance_9")
-SketchLine_36 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchLine_36 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_36.setName("SketchLine_25")
 SketchLine_36.result().setName("SketchLine_25")
 SketchConstraintDistance_16 = Sketch_3.setDistance(SketchCircle_1.center(), SketchLine_36.result(), 85)
@@ -398,10 +397,10 @@ model.do()
 Sketch_4 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchCircle_3 = Sketch_4.addCircle(0, 85, 7)
 SketchCircle_4 = Sketch_4.addCircle(0, 55, 7)
-SketchPoint_1 = Sketch_4.addPoint(model.selection("VERTEX", "Sketch_3/Edge-SketchCircle_1_2__cc"))
+SketchPoint_1 = Sketch_4.addPoint(model.selection("VERTEX", "Sketch_3/SketchCircle_1_2__cc"))
 SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchPoint_1.coordinates(), SketchCircle_3.center())
 SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_19")
-SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "Sketch_3/Edge-SketchCircle_2_2__cc"))
+SketchPoint_2 = Sketch_4.addPoint(model.selection("VERTEX", "Sketch_3/SketchCircle_2_2__cc"))
 SketchConstraintCoincidence_62 = Sketch_4.setCoincident(SketchPoint_2.coordinates(), SketchCircle_4.center())
 SketchConstraintCoincidence_62.setName("SketchConstraintCoincidence_20")
 SketchConstraintRadius_9 = Sketch_4.setRadius(SketchCircle_3.results()[1], "TDI/2")
@@ -436,7 +435,7 @@ SketchConstraintMirror_2.setName("SketchConstraintMirror_3")
 model.do()
 Sketch_6 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_9 = Sketch_6.addCircle(30, -41, 4)
-SketchPoint_3 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/Edge-SketchCircle_5_2__cc"))
+SketchPoint_3 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/SketchCircle_5_2__cc"))
 SketchConstraintCoincidence_63 = Sketch_6.setCoincident(SketchPoint_3.coordinates(), SketchCircle_9.center())
 SketchConstraintCoincidence_63.setName("SketchConstraintCoincidence_21")
 SketchConstraintRadius_12 = Sketch_6.setRadius(SketchCircle_9.results()[1], "BHD/2")
@@ -457,7 +456,7 @@ model.do()
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, False)
 Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_41 = Sketch_7.addLine(-41, 0, -41, 8)
-SketchPoint_4 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_5/Edge-SketchCircle_5_2__cc"))
+SketchPoint_4 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_5/SketchCircle_5_2__cc"))
 SketchConstraintCoincidence_64 = Sketch_7.setCoincident(SketchLine_41.startPoint(), SketchPoint_4.result())
 SketchConstraintCoincidence_64.setName("SketchConstraintCoincidence_34")
 SketchLine_42 = Sketch_7.addLine(-41, 8, -34, 8)
@@ -538,7 +537,7 @@ SketchConstraintCoincidence_77.setName("SketchConstraintCoincidence_47")
 SketchConstraintRadius_13 = Sketch_7.setRadius(SketchArc_7.results()[1], "BHPFR")
 SketchConstraintRadius_13.setName("SketchConstraintRadius_8")
 model.do()
-RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection("EDGE", "Sketch_7/Edge-SketchLine_41"), 360, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection("EDGE", "Sketch_7/SketchLine_41"), 360, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
 Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_49 = Sketch_8.addLine(32, 6, 32.50001476412091, 6.000000000000001)
 SketchLine_49.setName("SketchLine_55")
@@ -546,7 +545,7 @@ SketchLine_49.result().setName("SketchLine_55")
 SketchLine_50 = Sketch_8.addLine(32, 0, 41, 0)
 SketchLine_50.setName("SketchLine_49")
 SketchLine_50.result().setName("SketchLine_49")
-SketchPoint_5 = Sketch_8.addPoint(model.selection("VERTEX", "Sketch_6/Edge-SketchCircle_10_2__cc"))
+SketchPoint_5 = Sketch_8.addPoint(model.selection("VERTEX", "Sketch_6/SketchCircle_10_2__cc"))
 SketchConstraintCoincidence_78 = Sketch_8.setCoincident(SketchLine_50.endPoint(), SketchPoint_5.result())
 SketchConstraintCoincidence_78.setName("SketchConstraintCoincidence_50")
 SketchLine_51 = Sketch_8.addLine(41, 0, 41, 8)
@@ -634,7 +633,7 @@ SketchConstraintCoincidence_94.setName("SketchConstraintCoincidence_66")
 SketchConstraintRadius_14 = Sketch_8.setRadius(SketchArc_8.results()[1], 1.5)
 SketchConstraintRadius_14.setName("SketchConstraintRadius_9")
 model.do()
-RevolutionFuse_2 = model.addRevolutionFuse(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_55r-SketchLine_49f-SketchLine_50f-SketchLine_56r-SketchLine_52f-SketchLine_53f-SketchArc_7_2r")], model.selection("EDGE", "Sketch_8/Edge-SketchLine_50"), 360, 0, [model.selection("SOLID", "RevolutionFuse_1_1")])
+RevolutionFuse_2 = model.addRevolutionFuse(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_52f-SketchLine_49f-SketchLine_50f-SketchLine_53f-SketchLine_56r-SketchArc_7_2r-SketchLine_55r")], model.selection("EDGE", "Sketch_8/SketchLine_50"), 360, 0, [model.selection("SOLID", "RevolutionFuse_1_1")])
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 30, True)
 Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
 SketchLine_57 = Sketch_9.addLine(-32.50001494742042, 5.999999999999998, -32, 6)
@@ -643,7 +642,7 @@ SketchLine_57.result().setName("SketchLine_63")
 SketchLine_58 = Sketch_9.addLine(-32, 0, -41, 0)
 SketchLine_58.setName("SketchLine_57")
 SketchLine_58.result().setName("SketchLine_57")
-SketchPoint_8 = Sketch_9.addPoint(model.selection("VERTEX", "Sketch_6/Edge-SketchCircle_11_2__cc"))
+SketchPoint_8 = Sketch_9.addPoint(model.selection("VERTEX", "Sketch_6/SketchCircle_11_2__cc"))
 SketchConstraintCoincidence_95 = Sketch_9.setCoincident(SketchLine_58.endPoint(), SketchPoint_8.result())
 SketchConstraintCoincidence_95.setName("SketchConstraintCoincidence_67")
 SketchLine_59 = Sketch_9.addLine(-41, 0, -41, 7.999999999999999)
@@ -738,7 +737,7 @@ SketchLine_65.result().setName("SketchLine_71")
 SketchLine_66 = Sketch_10.addLine(32, 0, 41, 0)
 SketchLine_66.setName("SketchLine_65")
 SketchLine_66.result().setName("SketchLine_65")
-SketchPoint_11 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_6/Edge-SketchCircle_12_2__cc"))
+SketchPoint_11 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_6/SketchCircle_12_2__cc"))
 SketchConstraintCoincidence_112 = Sketch_10.setCoincident(SketchLine_66.endPoint(), SketchPoint_11.result())
 SketchConstraintCoincidence_112.setName("SketchConstraintCoincidence_84")
 SketchLine_67 = Sketch_10.addLine(41, 0, 41, 7.999999999999999)
@@ -826,9 +825,9 @@ SketchConstraintCoincidence_128.setName("SketchConstraintCoincidence_100")
 SketchConstraintRadius_16 = Sketch_10.setRadius(SketchArc_10.results()[1], 1.5)
 SketchConstraintRadius_16.setName("SketchConstraintRadius_11")
 model.do()
-RevolutionFuse_3 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection("EDGE", "Sketch_9/Edge-SketchLine_58"), 360, 0, [model.selection("SOLID", "RevolutionFuse_2_1")])
-RevolutionFuse_4 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_10")], model.selection("EDGE", "Sketch_10/Edge-SketchLine_66"), 360, 0, [model.selection("SOLID", "RevolutionFuse_3_1")])
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchCircle_11_2f"), model.selection("FACE", "Sketch_6/Face-SketchCircle_9_2f"), model.selection("WIRE", "Sketch_6/Wire-SketchCircle_10_2f"), model.selection("FACE", "Sketch_6/Face-SketchCircle_12_2f")], model.selection("EDGE", "PartSet/OZ"), "BPS+5", 5, [model.selection("SOLID", "RevolutionFuse_4_1")])
+RevolutionFuse_3 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection("EDGE", "Sketch_9/SketchLine_58"), 360, 0, [model.selection("SOLID", "RevolutionFuse_2_1")])
+RevolutionFuse_4 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_10")], model.selection("EDGE", "Sketch_10/SketchLine_66"), 360, 0, [model.selection("SOLID", "RevolutionFuse_3_1")])
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchCircle_11_2f"), model.selection("FACE", "Sketch_6/Face-SketchCircle_9_2r"), model.selection("WIRE", "Sketch_6/Face-SketchCircle_10_2f_wire"), model.selection("FACE", "Sketch_6/Face-SketchCircle_12_2f")], model.selection("EDGE", "PartSet/OZ"), "BPS+5", 5, [model.selection("SOLID", "RevolutionFuse_4_1")])
 
 # Test reexecution after parameter change
 Parameter_BPS.setValue(3)
index c3f15e14d3cbfec2b8143491fa3061e678a68028..902f5a8a1113d98a05635fc4b370c27f7007d0e0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -582,9 +581,9 @@ SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_55")
 SketchLine_379 = Sketch_3.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchConstraintDistance_13 = Sketch_3.setDistance(SketchCircle_4.center(), SketchLine_379.result(), 15)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_8f-SketchLine_9f-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_14f")], model.selection("EDGE", "PartSet/OX"), 360, 0)
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_1_2r-SketchLine_382f-SketchLine_383f-SketchLine_20f-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchLine_25f-SketchLine_26f-SketchLine_27f-SketchLine_28f-SketchLine_29f-SketchLine_30f-SketchLine_31f-SketchLine_32f-SketchLine_33f-SketchLine_34f-SketchLine_35f-SketchLine_36f-SketchLine_37f-SketchLine_38f-SketchLine_39f-SketchLine_40f-SketchLine_41f-SketchLine_42f-SketchLine_43f-SketchLine_44f-SketchLine_45f-SketchLine_46f-SketchLine_47f-SketchLine_48f-SketchLine_49f-SketchLine_50f-SketchLine_51f-SketchLine_52f-SketchLine_53f-SketchLine_54f-SketchLine_55f-SketchLine_56f-SketchLine_57f-SketchLine_58f-SketchLine_59f-SketchLine_60f-SketchLine_61f-SketchLine_62f-SketchLine_63f-SketchLine_64f-SketchLine_65f-SketchLine_66f-SketchLine_67f-SketchLine_68f-SketchLine_69f-SketchLine_70f-SketchLine_71f-SketchLine_72f-SketchLine_73f-SketchLine_74f-SketchLine_75f-SketchLine_76f-SketchLine_77f-SketchLine_78f-SketchLine_79f-SketchLine_80f-SketchLine_81f-SketchLine_82f-SketchLine_83f-SketchLine_84f-SketchLine_85f-SketchLine_86f-SketchLine_87f-SketchLine_88f-SketchLine_89f-SketchLine_90f-SketchLine_91f-SketchLine_92f-SketchLine_93f-SketchLine_94f-SketchLine_95f-SketchLine_96f-SketchLine_97f-SketchLine_98f-SketchLine_99f-SketchLine_100f-SketchLine_101f-SketchLine_102f-SketchLine_103f-SketchLine_104f-SketchLine_105f-SketchLine_106f-SketchLine_107f-SketchLine_108f-SketchLine_109f-SketchLine_110f-SketchLine_111f-SketchLine_112f-SketchLine_113f-SketchLine_114f-SketchLine_115f-SketchLine_116f-SketchLine_117f-SketchLine_118f-SketchLine_119f-SketchLine_120f-SketchLine_121f-SketchLine_122f-SketchLine_123f-SketchLine_124f-SketchLine_125f-SketchLine_126f-SketchLine_127f-SketchLine_128f-SketchLine_129f-SketchLine_130f-SketchLine_131f-SketchLine_132f-SketchLine_133f-SketchLine_134f-SketchLine_135f-SketchLine_136f-SketchLine_137f-SketchLine_138f-SketchLine_139f-SketchLine_140f-SketchLine_141f-SketchLine_142f-SketchLine_143f-SketchLine_144f-SketchLine_145f-SketchLine_146f-SketchLine_147f-SketchLine_148f-SketchLine_149f-SketchLine_150f-SketchLine_151f-SketchLine_152f-SketchLine_153f-SketchLine_154f-SketchLine_155f-SketchLine_156f-SketchLine_157f-SketchLine_158f-SketchLine_159f-SketchLine_160f-SketchLine_161f-SketchLine_162f-SketchLine_163f-SketchLine_164f-SketchLine_165f-SketchLine_166f-SketchLine_167f-SketchLine_168f-SketchLine_169f-SketchLine_170f-SketchLine_171f-SketchLine_172f-SketchLine_173f-SketchLine_174f-SketchLine_175f-SketchLine_176f-SketchLine_177f-SketchLine_178f-SketchLine_179f-SketchLine_180f-SketchLine_181f-SketchLine_182f-SketchLine_183f-SketchLine_184f-SketchLine_185f-SketchLine_186f-SketchLine_187f-SketchLine_188f-SketchLine_189f-SketchLine_190f-SketchLine_191f-SketchLine_192f-SketchLine_193f-SketchLine_194f-SketchLine_195f-SketchLine_196f-SketchLine_197f-SketchLine_198f-SketchLine_199f-SketchArc_2_2r-SketchArc_3_2r-SketchArc_4_2r-SketchArc_5_2r-SketchArc_6_2r-SketchArc_7_2r-SketchArc_8_2r-SketchArc_9_2r-SketchArc_10_2r-SketchArc_11_2r-SketchArc_12_2r-SketchArc_13_2r-SketchArc_14_2r-SketchArc_15_2r-SketchArc_16_2r-SketchArc_17_2r-SketchArc_18_2r-SketchArc_19_2r-SketchArc_20_2r-SketchArc_21_2r-SketchArc_22_2r-SketchArc_23_2r-SketchArc_24_2r-SketchArc_25_2r-SketchArc_26_2r-SketchArc_27_2r-SketchArc_28_2r-SketchArc_29_2r-SketchArc_30_2r-SketchArc_31_2r-SketchArc_32_2r-SketchArc_33_2r-SketchArc_34_2r-SketchArc_35_2r-SketchArc_36_2r-SketchArc_37_2r-SketchArc_38_2r-SketchArc_39_2r-SketchArc_40_2r-SketchArc_41_2r-SketchArc_42_2r-SketchArc_43_2r-SketchArc_44_2r-SketchArc_45_2r-SketchArc_46_2r-SketchArc_47_2r-SketchArc_48_2r-SketchArc_49_2r-SketchArc_50_2r-SketchArc_51_2r-SketchArc_52_2r-SketchArc_53_2r-SketchArc_54_2r-SketchArc_55_2r-SketchArc_56_2r-SketchArc_57_2r-SketchArc_58_2r-SketchArc_59_2r-SketchArc_60_2r-SketchArc_61_2r-SketchArc_62_2r-SketchArc_63_2r-SketchArc_64_2r-SketchArc_65_2r-SketchArc_66_2r-SketchArc_67_2r-SketchArc_68_2r-SketchArc_69_2r-SketchArc_70_2r-SketchArc_71_2r-SketchArc_72_2r-SketchArc_73_2r-SketchArc_74_2r-SketchArc_75_2r-SketchArc_76_2r-SketchArc_77_2r-SketchArc_78_2r-SketchArc_79_2r-SketchArc_80_2r-SketchArc_81_2r-SketchArc_82_2r-SketchArc_83_2r-SketchArc_84_2r-SketchArc_85_2r-SketchArc_86_2r-SketchArc_87_2r-SketchArc_88_2r-SketchArc_89_2r-SketchArc_90_2r-SketchArc_91_2r-SketchArc_92_2r-SketchArc_93_2r-SketchArc_94_2r-SketchArc_95_2r-SketchArc_96_2r-SketchArc_97_2r-SketchArc_98_2r-SketchArc_99_2r-SketchArc_100_2r-SketchArc_101_2r-SketchArc_102_2r-SketchArc_103_2r-SketchArc_104_2r-SketchArc_105_2r-SketchArc_106_2r-SketchArc_107_2r-SketchArc_108_2r-SketchArc_109_2r-SketchArc_110_2r-SketchArc_111_2r-SketchArc_112_2r-SketchArc_113_2r-SketchArc_114_2r-SketchArc_115_2r-SketchArc_116_2r-SketchArc_117_2r-SketchArc_118_2r-SketchArc_119_2r-SketchArc_120_2r-SketchArc_121_2r-SketchArc_122_2r-SketchArc_123_2r-SketchArc_124_2r-SketchArc_125_2r-SketchArc_126_2r-SketchArc_127_2r-SketchArc_128_2r-SketchArc_129_2r-SketchArc_130_2r-SketchArc_131_2r-SketchArc_132_2r-SketchArc_133_2r-SketchArc_134_2r-SketchArc_135_2r-SketchArc_136_2r-SketchArc_137_2r-SketchArc_138_2r-SketchArc_139_2r-SketchArc_140_2r-SketchArc_141_2r-SketchArc_142_2r-SketchArc_143_2r-SketchArc_144_2r-SketchArc_145_2r-SketchArc_146_2r-SketchArc_147_2r-SketchArc_148_2r-SketchArc_149_2r-SketchArc_150_2r-SketchArc_151_2r-SketchArc_152_2r-SketchArc_153_2r-SketchArc_154_2r-SketchArc_155_2r-SketchArc_156_2r-SketchArc_157_2r-SketchArc_158_2r-SketchArc_159_2r-SketchArc_160_2r-SketchArc_161_2r-SketchArc_162_2r-SketchArc_163_2r-SketchArc_164_2r-SketchArc_165_2r-SketchArc_166_2r-SketchArc_167_2r-SketchArc_168_2r-SketchArc_169_2r-SketchArc_170_2r-SketchArc_171_2r-SketchArc_172_2r-SketchArc_173_2r-SketchArc_174_2r-SketchArc_175_2r-SketchArc_176_2r-SketchArc_177_2r-SketchArc_178_2r-SketchArc_179_2r-SketchArc_180_2r-SketchLine_21f-SketchLine_200f-SketchLine_201f-SketchLine_202f-SketchLine_203f-SketchLine_204f-SketchLine_205f-SketchLine_206f-SketchLine_207f-SketchLine_208f-SketchLine_209f-SketchLine_210f-SketchLine_211f-SketchLine_212f-SketchLine_213f-SketchLine_214f-SketchLine_215f-SketchLine_216f-SketchLine_217f-SketchLine_218f-SketchLine_219f-SketchLine_220f-SketchLine_221f-SketchLine_222f-SketchLine_223f-SketchLine_224f-SketchLine_225f-SketchLine_226f-SketchLine_227f-SketchLine_228f-SketchLine_229f-SketchLine_230f-SketchLine_231f-SketchLine_232f-SketchLine_233f-SketchLine_234f-SketchLine_235f-SketchLine_236f-SketchLine_237f-SketchLine_238f-SketchLine_239f-SketchLine_240f-SketchLine_241f-SketchLine_242f-SketchLine_243f-SketchLine_244f-SketchLine_245f-SketchLine_246f-SketchLine_247f-SketchLine_248f-SketchLine_249f-SketchLine_250f-SketchLine_251f-SketchLine_252f-SketchLine_253f-SketchLine_254f-SketchLine_255f-SketchLine_256f-SketchLine_257f-SketchLine_258f-SketchLine_259f-SketchLine_260f-SketchLine_261f-SketchLine_262f-SketchLine_263f-SketchLine_264f-SketchLine_265f-SketchLine_266f-SketchLine_267f-SketchLine_268f-SketchLine_269f-SketchLine_270f-SketchLine_271f-SketchLine_272f-SketchLine_273f-SketchLine_274f-SketchLine_275f-SketchLine_276f-SketchLine_277f-SketchLine_278f-SketchLine_279f-SketchLine_280f-SketchLine_281f-SketchLine_282f-SketchLine_283f-SketchLine_284f-SketchLine_285f-SketchLine_286f-SketchLine_287f-SketchLine_288f-SketchLine_289f-SketchLine_290f-SketchLine_291f-SketchLine_292f-SketchLine_293f-SketchLine_294f-SketchLine_295f-SketchLine_296f-SketchLine_297f-SketchLine_298f-SketchLine_299f-SketchLine_300f-SketchLine_301f-SketchLine_302f-SketchLine_303f-SketchLine_304f-SketchLine_305f-SketchLine_306f-SketchLine_307f-SketchLine_308f-SketchLine_309f-SketchLine_310f-SketchLine_311f-SketchLine_312f-SketchLine_313f-SketchLine_314f-SketchLine_315f-SketchLine_316f-SketchLine_317f-SketchLine_318f-SketchLine_319f-SketchLine_320f-SketchLine_321f-SketchLine_322f-SketchLine_323f-SketchLine_324f-SketchLine_325f-SketchLine_326f-SketchLine_327f-SketchLine_328f-SketchLine_329f-SketchLine_330f-SketchLine_331f-SketchLine_332f-SketchLine_333f-SketchLine_334f-SketchLine_335f-SketchLine_336f-SketchLine_337f-SketchLine_338f-SketchLine_339f-SketchLine_340f-SketchLine_341f-SketchLine_342f-SketchLine_343f-SketchLine_344f-SketchLine_345f-SketchLine_346f-SketchLine_347f-SketchLine_348f-SketchLine_349f-SketchLine_350f-SketchLine_351f-SketchLine_352f-SketchLine_353f-SketchLine_354f-SketchLine_355f-SketchLine_356f-SketchLine_357f-SketchLine_358f-SketchLine_359f-SketchLine_360f-SketchLine_361f-SketchLine_362f-SketchLine_363f-SketchLine_364f-SketchLine_365f-SketchLine_366f-SketchLine_367f-SketchLine_368f-SketchLine_369f-SketchLine_370f-SketchLine_371f-SketchLine_372f-SketchLine_373f-SketchLine_374f-SketchLine_375f-SketchLine_376f-SketchLine_377f-SketchCircle_3_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_4_2f")], model.selection(), 30, 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f-SketchLine_12f-SketchLine_13f-SketchLine_14f-SketchLine_8f-SketchLine_9f-SketchLine_11f")], model.selection("EDGE", "PartSet/OX"), 360, 0)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f-SketchLine_383f-SketchLine_199f-SketchArc_180_2r-SketchLine_377f-SketchLine_198f-SketchArc_179_2r-SketchLine_376f-SketchLine_197f-SketchArc_178_2r-SketchLine_375f-SketchLine_196f-SketchArc_177_2r-SketchLine_374f-SketchLine_195f-SketchArc_176_2r-SketchLine_373f-SketchLine_194f-SketchArc_175_2r-SketchLine_372f-SketchLine_193f-SketchArc_174_2r-SketchLine_371f-SketchLine_192f-SketchArc_173_2r-SketchLine_370f-SketchLine_191f-SketchArc_172_2r-SketchLine_369f-SketchLine_190f-SketchArc_171_2r-SketchLine_368f-SketchLine_189f-SketchArc_170_2r-SketchLine_367f-SketchLine_188f-SketchArc_169_2r-SketchLine_366f-SketchLine_187f-SketchArc_168_2r-SketchLine_365f-SketchLine_186f-SketchArc_167_2r-SketchLine_364f-SketchLine_185f-SketchArc_166_2r-SketchLine_363f-SketchLine_184f-SketchArc_165_2r-SketchLine_362f-SketchLine_183f-SketchArc_164_2r-SketchLine_361f-SketchLine_182f-SketchArc_163_2r-SketchLine_360f-SketchLine_181f-SketchArc_162_2r-SketchLine_359f-SketchLine_180f-SketchArc_161_2r-SketchLine_358f-SketchLine_179f-SketchArc_160_2r-SketchLine_357f-SketchLine_178f-SketchArc_159_2r-SketchLine_356f-SketchLine_177f-SketchArc_158_2r-SketchLine_355f-SketchLine_176f-SketchArc_157_2r-SketchLine_354f-SketchLine_175f-SketchArc_156_2r-SketchLine_353f-SketchLine_174f-SketchArc_155_2r-SketchLine_352f-SketchLine_173f-SketchArc_154_2r-SketchLine_351f-SketchLine_172f-SketchArc_153_2r-SketchLine_350f-SketchLine_171f-SketchArc_152_2r-SketchLine_349f-SketchLine_170f-SketchArc_151_2r-SketchLine_348f-SketchLine_169f-SketchArc_150_2r-SketchLine_347f-SketchLine_168f-SketchArc_149_2r-SketchLine_346f-SketchLine_167f-SketchArc_148_2r-SketchLine_345f-SketchLine_166f-SketchArc_147_2r-SketchLine_344f-SketchLine_165f-SketchArc_146_2r-SketchLine_343f-SketchLine_164f-SketchArc_145_2r-SketchLine_342f-SketchLine_163f-SketchArc_144_2r-SketchLine_341f-SketchLine_162f-SketchArc_143_2r-SketchLine_340f-SketchLine_161f-SketchArc_142_2r-SketchLine_339f-SketchLine_160f-SketchArc_141_2r-SketchLine_338f-SketchLine_159f-SketchArc_140_2r-SketchLine_337f-SketchLine_158f-SketchArc_139_2r-SketchLine_336f-SketchLine_157f-SketchArc_138_2r-SketchLine_335f-SketchLine_156f-SketchArc_137_2r-SketchLine_334f-SketchLine_155f-SketchArc_136_2r-SketchLine_333f-SketchLine_154f-SketchArc_135_2r-SketchLine_332f-SketchLine_153f-SketchArc_134_2r-SketchLine_331f-SketchLine_152f-SketchArc_133_2r-SketchLine_330f-SketchLine_151f-SketchArc_132_2r-SketchLine_329f-SketchLine_150f-SketchArc_131_2r-SketchLine_328f-SketchLine_149f-SketchArc_130_2r-SketchLine_327f-SketchLine_148f-SketchArc_129_2r-SketchLine_326f-SketchLine_147f-SketchArc_128_2r-SketchLine_325f-SketchLine_146f-SketchArc_127_2r-SketchLine_324f-SketchLine_145f-SketchArc_126_2r-SketchLine_323f-SketchLine_144f-SketchArc_125_2r-SketchLine_322f-SketchLine_143f-SketchArc_124_2r-SketchLine_321f-SketchLine_142f-SketchArc_123_2r-SketchLine_320f-SketchLine_141f-SketchArc_122_2r-SketchLine_319f-SketchLine_140f-SketchArc_121_2r-SketchLine_318f-SketchLine_139f-SketchArc_120_2r-SketchLine_317f-SketchLine_138f-SketchArc_119_2r-SketchLine_316f-SketchLine_137f-SketchArc_118_2r-SketchLine_315f-SketchLine_136f-SketchArc_117_2r-SketchLine_314f-SketchLine_135f-SketchArc_116_2r-SketchLine_313f-SketchLine_134f-SketchArc_115_2r-SketchLine_312f-SketchLine_133f-SketchArc_114_2r-SketchLine_311f-SketchLine_132f-SketchArc_113_2r-SketchLine_310f-SketchLine_131f-SketchArc_112_2r-SketchLine_309f-SketchLine_130f-SketchArc_111_2r-SketchLine_308f-SketchLine_129f-SketchArc_110_2r-SketchLine_307f-SketchLine_128f-SketchArc_109_2r-SketchLine_306f-SketchLine_127f-SketchArc_108_2r-SketchLine_305f-SketchLine_126f-SketchArc_107_2r-SketchLine_304f-SketchLine_125f-SketchArc_106_2r-SketchLine_303f-SketchLine_124f-SketchArc_105_2r-SketchLine_302f-SketchLine_123f-SketchArc_104_2r-SketchLine_301f-SketchLine_122f-SketchArc_103_2r-SketchLine_300f-SketchLine_121f-SketchArc_102_2r-SketchLine_299f-SketchLine_120f-SketchArc_101_2r-SketchLine_298f-SketchLine_119f-SketchArc_100_2r-SketchLine_297f-SketchLine_118f-SketchArc_99_2r-SketchLine_296f-SketchLine_117f-SketchArc_98_2r-SketchLine_295f-SketchLine_116f-SketchArc_97_2r-SketchLine_294f-SketchLine_115f-SketchArc_96_2r-SketchLine_293f-SketchLine_114f-SketchArc_95_2r-SketchLine_292f-SketchLine_113f-SketchArc_94_2r-SketchLine_291f-SketchLine_112f-SketchArc_93_2r-SketchLine_290f-SketchLine_111f-SketchArc_92_2r-SketchLine_289f-SketchLine_110f-SketchArc_91_2r-SketchLine_288f-SketchLine_109f-SketchArc_90_2r-SketchLine_287f-SketchLine_108f-SketchArc_89_2r-SketchLine_286f-SketchLine_107f-SketchArc_88_2r-SketchLine_285f-SketchLine_106f-SketchArc_87_2r-SketchLine_284f-SketchLine_105f-SketchArc_86_2r-SketchLine_283f-SketchLine_104f-SketchArc_85_2r-SketchLine_282f-SketchLine_103f-SketchArc_84_2r-SketchLine_281f-SketchLine_102f-SketchArc_83_2r-SketchLine_280f-SketchLine_101f-SketchArc_82_2r-SketchLine_279f-SketchLine_100f-SketchArc_81_2r-SketchLine_278f-SketchLine_99f-SketchArc_80_2r-SketchLine_277f-SketchLine_98f-SketchArc_79_2r-SketchLine_276f-SketchLine_97f-SketchArc_78_2r-SketchLine_275f-SketchLine_96f-SketchArc_77_2r-SketchLine_274f-SketchLine_95f-SketchArc_76_2r-SketchLine_273f-SketchLine_94f-SketchArc_75_2r-SketchLine_272f-SketchLine_93f-SketchArc_74_2r-SketchLine_271f-SketchLine_92f-SketchArc_73_2r-SketchLine_270f-SketchLine_91f-SketchArc_72_2r-SketchLine_269f-SketchLine_90f-SketchArc_71_2r-SketchLine_268f-SketchLine_89f-SketchArc_70_2r-SketchLine_267f-SketchLine_88f-SketchArc_69_2r-SketchLine_266f-SketchLine_87f-SketchArc_68_2r-SketchLine_265f-SketchLine_86f-SketchArc_67_2r-SketchLine_264f-SketchLine_85f-SketchArc_66_2r-SketchLine_263f-SketchLine_84f-SketchArc_65_2r-SketchLine_262f-SketchLine_83f-SketchArc_64_2r-SketchLine_261f-SketchLine_82f-SketchArc_63_2r-SketchLine_260f-SketchLine_81f-SketchArc_62_2r-SketchLine_259f-SketchLine_80f-SketchArc_61_2r-SketchLine_258f-SketchLine_79f-SketchArc_60_2r-SketchLine_257f-SketchLine_78f-SketchArc_59_2r-SketchLine_256f-SketchLine_77f-SketchArc_58_2r-SketchLine_255f-SketchLine_76f-SketchArc_57_2r-SketchLine_254f-SketchLine_75f-SketchArc_56_2r-SketchLine_253f-SketchLine_74f-SketchArc_55_2r-SketchLine_252f-SketchLine_73f-SketchArc_54_2r-SketchLine_251f-SketchLine_72f-SketchArc_53_2r-SketchLine_250f-SketchLine_71f-SketchArc_52_2r-SketchLine_249f-SketchLine_70f-SketchArc_51_2r-SketchLine_248f-SketchLine_69f-SketchArc_50_2r-SketchLine_247f-SketchLine_68f-SketchArc_49_2r-SketchLine_246f-SketchLine_67f-SketchArc_48_2r-SketchLine_245f-SketchLine_66f-SketchArc_47_2r-SketchLine_244f-SketchLine_65f-SketchArc_46_2r-SketchLine_243f-SketchLine_64f-SketchArc_45_2r-SketchLine_242f-SketchLine_63f-SketchArc_44_2r-SketchLine_241f-SketchLine_62f-SketchArc_43_2r-SketchLine_240f-SketchLine_61f-SketchArc_42_2r-SketchLine_239f-SketchLine_60f-SketchArc_41_2r-SketchLine_238f-SketchLine_59f-SketchArc_40_2r-SketchLine_237f-SketchLine_58f-SketchArc_39_2r-SketchLine_236f-SketchLine_57f-SketchArc_38_2r-SketchLine_235f-SketchLine_56f-SketchArc_37_2r-SketchLine_234f-SketchLine_55f-SketchArc_36_2r-SketchLine_233f-SketchLine_54f-SketchArc_35_2r-SketchLine_232f-SketchLine_53f-SketchArc_34_2r-SketchLine_231f-SketchLine_52f-SketchArc_33_2r-SketchLine_230f-SketchLine_51f-SketchArc_32_2r-SketchLine_229f-SketchLine_50f-SketchArc_31_2r-SketchLine_228f-SketchLine_49f-SketchArc_30_2r-SketchLine_227f-SketchLine_48f-SketchArc_29_2r-SketchLine_226f-SketchLine_47f-SketchArc_28_2r-SketchLine_225f-SketchLine_46f-SketchArc_27_2r-SketchLine_224f-SketchLine_45f-SketchArc_26_2r-SketchLine_223f-SketchLine_44f-SketchArc_25_2r-SketchLine_222f-SketchLine_43f-SketchArc_24_2r-SketchLine_221f-SketchLine_42f-SketchArc_23_2r-SketchLine_220f-SketchLine_41f-SketchArc_22_2r-SketchLine_219f-SketchLine_40f-SketchArc_21_2r-SketchLine_218f-SketchLine_39f-SketchArc_20_2r-SketchLine_217f-SketchLine_38f-SketchArc_19_2r-SketchLine_216f-SketchLine_37f-SketchArc_18_2r-SketchLine_215f-SketchLine_36f-SketchArc_17_2r-SketchLine_214f-SketchLine_35f-SketchArc_16_2r-SketchLine_213f-SketchLine_34f-SketchArc_15_2r-SketchLine_212f-SketchLine_33f-SketchArc_14_2r-SketchLine_211f-SketchLine_32f-SketchArc_13_2r-SketchLine_210f-SketchLine_31f-SketchArc_12_2r-SketchLine_209f-SketchLine_30f-SketchArc_11_2r-SketchLine_208f-SketchLine_29f-SketchArc_10_2r-SketchLine_207f-SketchLine_28f-SketchArc_9_2r-SketchLine_206f-SketchLine_27f-SketchArc_8_2r-SketchLine_205f-SketchLine_26f-SketchArc_7_2r-SketchLine_204f-SketchLine_25f-SketchArc_6_2r-SketchLine_203f-SketchLine_24f-SketchArc_5_2r-SketchLine_202f-SketchLine_23f-SketchArc_4_2r-SketchLine_201f-SketchLine_22f-SketchArc_3_2r-SketchLine_200f-SketchLine_20f-SketchArc_2_2r-SketchLine_21f-SketchLine_382f-SketchArc_1_2r")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_13"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_4_2r")], model.selection(), 30, 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
 
 # Test reexecution after parameter change
 Parameter_H.setValue(14)
index 5db96a7f2679dbf0a1e8438310306d6bd2db7273..4a82bc62c8cbb14d9a8250f7750d2992e4c482e8 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -30,7 +29,7 @@ Parameter_R = model.addParameter(Part_1_doc, "R", "3")
 model.addParameter(Part_1_doc, "DBody", "65")
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), 89, False)
 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchLine_1 = Sketch_1.addLine(0, 20, 16.99998550401508, 20)
+SketchLine_1 = Sketch_1.addLine(0, 20, 17, 20)
 SketchLine_1.setName("SketchLine_7")
 SketchLine_1.result().setName("SketchLine_7")
 SketchLine_2 = Sketch_1.addLine(20, 0, 0, 0)
@@ -39,7 +38,7 @@ SketchLine_2.result().setName("SketchLine_1")
 SketchLine_3 = Sketch_1.addLine(0, 0, 0, 20)
 SketchLine_3.setName("SketchLine_2")
 SketchLine_3.result().setName("SketchLine_2")
-SketchLine_4 = Sketch_1.addLine(20, 16.99999846116062, 20, 0)
+SketchLine_4 = Sketch_1.addLine(20, 17, 20, 0)
 SketchLine_4.setName("SketchLine_8")
 SketchLine_4.result().setName("SketchLine_8")
 SketchLine_5 = Sketch_1.addLine(20, 20, 20, 0)
@@ -66,7 +65,7 @@ SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "PartSet/OY"
 SketchLine_8 = SketchProjection_2.createdFeature()
 SketchLine_8.setName("SketchLine_6")
 SketchLine_8.result().setName("SketchLine_6")
-SketchArc_1 = Sketch_1.addArc(17, 17, 20, 16.99999846116062, 16.99998550401508, 20, False)
+SketchArc_1 = Sketch_1.addArc(17, 17, 20, 17, 17, 20, False)
 SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchLine_4.startPoint())
 SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.endPoint(), SketchLine_1.endPoint())
 SketchConstraintTangent_1 = Sketch_1.setTangent(SketchArc_1.results()[1], SketchLine_1.result())
@@ -80,21 +79,21 @@ SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchLine_3.startPoint(
 SketchConstraintDistance_1 = Sketch_1.setDistance(SketchLine_2.startPoint(), SketchLine_3.result(), 20)
 SketchConstraintDistance_2 = Sketch_1.setDistance(SketchLine_3.endPoint(), SketchLine_2.result(), 20)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_1r-SketchLine_2r-SketchLine_8r-SketchArc_1_2f")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), 0, 180)
-ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_7r-SketchLine_1r-SketchLine_2r-SketchLine_8r-SketchArc_1_2f")], model.selection(), 0, 25, [model.selection("SOLID", "Revolution_1_1")])
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_1r-SketchLine_8r-SketchArc_1_2f-SketchLine_7r")], model.selection("EDGE", "Sketch_1/SketchLine_2"), 0, 180)
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchLine_1r-SketchLine_8r-SketchArc_1_2f-SketchLine_7r")], model.selection(), 0, 25, [model.selection("SOLID", "Revolution_1_1")])
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchLine_9 = Sketch_2.addLine(0, 20, -17.00000285538278, 20)
+SketchLine_9 = Sketch_2.addLine(0, 20, -17, 20)
 SketchLine_9.setName("SketchLine_13")
 SketchLine_9.result().setName("SketchLine_13")
 SketchLine_10 = Sketch_2.addLine(-20, 0, 0, 0)
 SketchLine_10.setName("SketchLine_9")
 SketchLine_10.result().setName("SketchLine_9")
-SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_2s-SketchProjection_1s-SketchLine_5s-SketchProjection_2s-SketchLine_6s-SketchLine_1e"))
+SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchLine_1_EndVertex"))
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchPoint_1.result())
 SketchLine_11 = Sketch_2.addLine(0, 0, 0, 20)
 SketchLine_11.setName("SketchLine_10")
 SketchLine_11.result().setName("SketchLine_10")
-SketchLine_12 = Sketch_2.addLine(-20, 17.00000633266883, -20, 0)
+SketchLine_12 = Sketch_2.addLine(-20, 17, -20, 0)
 SketchLine_12.setName("SketchLine_14")
 SketchLine_12.result().setName("SketchLine_14")
 SketchLine_13 = Sketch_2.addLine(-20, 20, -20, 0)
@@ -113,7 +112,7 @@ SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_10.result())
 SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_11.result())
 SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_14.result())
 SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_13.result())
-SketchArc_2 = Sketch_2.addArc(-17, 17, -17.00000285538278, 20, -20, 17.00000633266883, False)
+SketchArc_2 = Sketch_2.addArc(-17, 17, -17, 20, -20, 17, False)
 SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchArc_2.startPoint(), SketchLine_9.endPoint())
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchArc_2.endPoint(), SketchLine_12.startPoint())
 SketchConstraintTangent_3 = Sketch_2.setTangent(SketchArc_2.results()[1], SketchLine_9.result())
@@ -126,20 +125,20 @@ SketchConstraintRadius_2 = Sketch_2.setRadius(SketchArc_2.results()[1], 3)
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_10.startPoint(), SketchLine_11.result(), 20)
 SketchConstraintDistance_4 = Sketch_2.setDistance(SketchLine_11.endPoint(), SketchLine_10.result(), 20)
 model.do()
-ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13f-SketchLine_9f-SketchLine_10f-SketchLine_14f-SketchArc_2_2f")], model.selection(), 0, 25, [model.selection("SOLID", "ExtrusionFuse_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_2_1/Modfied_8"))
+ExtrusionFuse_2 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchArc_2_2f-SketchLine_14f-SketchLine_9f-SketchLine_10f")], model.selection(), 0, 25, [model.selection("SOLID", "ExtrusionFuse_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_2_1/From_Face"))
 SketchLine_15 = Sketch_3.addLine(0, -20, -17.00000002635728, -20)
 SketchLine_15.setName("SketchLine_19")
 SketchLine_15.result().setName("SketchLine_19")
 SketchLine_16 = Sketch_3.addLine(-20, 0, 0, 0)
 SketchLine_16.setName("SketchLine_15")
 SketchLine_16.result().setName("SketchLine_15")
-SketchPoint_2 = Sketch_3.addPoint(model.selection("VERTEX", "ExtrusionFuse_2_1/Modfied_9&ExtrusionFuse_2_1/Modfied_5&ExtrusionFuse_2_1/Modfied_8&ExtrusionFuse_2_1/Modfied_2"))
+SketchPoint_2 = Sketch_3.addPoint(model.selection("VERTEX", "[ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9][(ExtrusionFuse_2_1/Generated_Face&Sketch_2/SketchLine_9)(ExtrusionFuse_1_1/Generated_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face)][ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_2_1/From_Face][ExtrusionFuse_2_1/Modified_Face&ExtrusionFuse_1_1/From_Face]"))
 SketchConstraintCoincidence_23 = Sketch_3.setCoincident(SketchLine_16.endPoint(), SketchPoint_2.result())
 SketchLine_17 = Sketch_3.addLine(0, 0, 0, -20)
 SketchLine_17.setName("SketchLine_16")
 SketchLine_17.result().setName("SketchLine_16")
-SketchLine_18 = Sketch_3.addLine(-20, -16.99998301947517, -20, 0)
+SketchLine_18 = Sketch_3.addLine(-20, -17, -20, 0)
 SketchLine_18.setName("SketchLine_20")
 SketchLine_18.result().setName("SketchLine_20")
 SketchLine_19 = Sketch_3.addLine(-20, -20, -20, 0)
@@ -158,7 +157,7 @@ SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_16.result())
 SketchConstraintVertical_5 = Sketch_3.setVertical(SketchLine_17.result())
 SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_20.result())
 SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_19.result())
-SketchArc_3 = Sketch_3.addArc(-17, -17, -20, -16.99998301947517, -17.00000002635728, -20, False)
+SketchArc_3 = Sketch_3.addArc(-17, -17, -20, -17, -17.00000002635728, -20, False)
 SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchArc_3.startPoint(), SketchLine_18.startPoint())
 SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchLine_15.endPoint())
 SketchConstraintTangent_5 = Sketch_3.setTangent(SketchArc_3.results()[1], SketchLine_15.result())
@@ -174,9 +173,9 @@ SketchLine_21 = Sketch_3.addLine(-23, -0.01462093666115485, -23, -19.98755081419
 SketchConstraintParallel_1 = Sketch_3.setParallel(SketchLine_17.result(), SketchLine_21.result())
 SketchConstraintDistance_7 = Sketch_3.setDistance(SketchLine_21.startPoint(), SketchLine_18.result(), 3)
 model.do()
-RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "Sketch_3/Edge-SketchLine_21"), 71, 0, [model.selection("SOLID", "ExtrusionFuse_2_1")])
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "RevolutionFuse_1_1/Modfied_4"))
-SketchLine_22 = Sketch_4.addLine(-3, -20, 17.00000452949485, -20)
+RevolutionFuse_1 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "Sketch_3/SketchLine_21"), 71, 0, [model.selection("SOLID", "ExtrusionFuse_2_1")])
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "RevolutionFuse_1_1/Modified_Face&ExtrusionFuse_1_1/From_Face"))
+SketchLine_22 = Sketch_4.addLine(-3, -20, 17, -20)
 SketchLine_22.setName("SketchLine_26")
 SketchLine_22.result().setName("SketchLine_26")
 SketchLine_23 = Sketch_4.addLine(20, 0, -3, 0)
@@ -185,7 +184,7 @@ SketchLine_23.result().setName("SketchLine_22")
 SketchLine_24 = Sketch_4.addLine(-3, 0, -3, -20)
 SketchLine_24.setName("SketchLine_23")
 SketchLine_24.result().setName("SketchLine_23")
-SketchLine_25 = Sketch_4.addLine(20, -17.00001580618423, 20, 0)
+SketchLine_25 = Sketch_4.addLine(20, -17, 20, 0)
 SketchLine_25.setName("SketchLine_27")
 SketchLine_25.result().setName("SketchLine_27")
 SketchLine_26 = Sketch_4.addLine(20, -20, 20, 0)
@@ -204,7 +203,7 @@ SketchConstraintHorizontal_7 = Sketch_4.setHorizontal(SketchLine_23.result())
 SketchConstraintVertical_7 = Sketch_4.setVertical(SketchLine_24.result())
 SketchConstraintHorizontal_8 = Sketch_4.setHorizontal(SketchLine_27.result())
 SketchConstraintVertical_8 = Sketch_4.setVertical(SketchLine_26.result())
-SketchArc_4 = Sketch_4.addArc(17, -17, 17.00000452949485, -20, 20, -17.00001580618423, False)
+SketchArc_4 = Sketch_4.addArc(17, -17, 17, -20, 20, -17, False)
 SketchConstraintCoincidence_38 = Sketch_4.setCoincident(SketchArc_4.startPoint(), SketchLine_22.endPoint())
 SketchConstraintCoincidence_39 = Sketch_4.setCoincident(SketchArc_4.endPoint(), SketchLine_25.startPoint())
 SketchConstraintTangent_7 = Sketch_4.setTangent(SketchArc_4.results()[1], SketchLine_22.result())
@@ -214,7 +213,7 @@ SketchConstraintCoincidence_41 = Sketch_4.setCoincident(SketchLine_26.endPoint()
 SketchConstraintCoincidence_42 = Sketch_4.setCoincident(SketchLine_22.endPoint(), SketchLine_27.result())
 SketchConstraintCoincidence_43 = Sketch_4.setCoincident(SketchLine_25.startPoint(), SketchLine_26.result())
 SketchConstraintRadius_4 = Sketch_4.setRadius(SketchArc_4.results()[1], 3)
-SketchLine_28 = Sketch_4.addLine(model.selection("EDGE", "Sketch_3/Edge-SketchLine_15"))
+SketchLine_28 = Sketch_4.addLine(model.selection("EDGE", "Sketch_3/SketchLine_15"))
 SketchConstraintCoincidence_44 = Sketch_4.setCoincident(SketchLine_24.startPoint(), SketchLine_28.result())
 SketchConstraintDistance_8 = Sketch_4.setDistance(SketchLine_22.endPoint(), SketchLine_23.result(), 20)
 SketchConstraintDistance_9 = Sketch_4.setDistance(SketchLine_28.endPoint(), SketchLine_25.result(), 20)
@@ -223,12 +222,12 @@ SketchLine_29 = Sketch_4.addLine(23, -0.2448405100241045, 23, -19.61338093143246
 SketchConstraintParallel_2 = Sketch_4.setParallel(SketchLine_25.result(), SketchLine_29.result())
 SketchConstraintDistance_11 = Sketch_4.setDistance(SketchLine_23.startPoint(), SketchLine_29.result(), 3)
 model.do()
-RevolutionFuse_2 = model.addRevolutionFuse(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_26f-SketchLine_22f-SketchLine_23f-SketchLine_27f-SketchArc_4_2f")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_29"), 0, 71, [model.selection("SOLID", "RevolutionFuse_1_1")])
+RevolutionFuse_2 = model.addRevolutionFuse(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_26r-SketchArc_4_2f-SketchLine_27f-SketchLine_22f-SketchLine_23f")], model.selection("EDGE", "Sketch_4/SketchLine_29"), 0, 71, [model.selection("SOLID", "RevolutionFuse_1_1")])
 Sketch_5 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_30 = Sketch_5.addLine(0, 0, 0, 82)
 SketchLine_31 = Sketch_5.addLine(model.selection("EDGE", "PartSet/OZ"))
 SketchConstraintCoincidence_45 = Sketch_5.setCoincident(SketchLine_30.endPoint(), SketchLine_31.result())
-SketchLine_32 = Sketch_5.addLine(27.41618692363446, 77.00000000000001, 58.99998109391454, 77.00000000000001)
+SketchLine_32 = Sketch_5.addLine(27.41618692363446, 77, 58.99998109391454, 77)
 SketchLine_32.setName("SketchLine_39")
 SketchLine_32.result().setName("SketchLine_39")
 SketchLine_33 = Sketch_5.addLine(0, 82, 20, 82)
@@ -238,7 +237,7 @@ SketchConstraintCoincidence_46 = Sketch_5.setCoincident(SketchLine_30.endPoint()
 SketchLine_34 = Sketch_5.addLine(65, 70.99999917134223, 65, 0)
 SketchLine_34.setName("SketchLine_40")
 SketchLine_34.result().setName("SketchLine_40")
-SketchLine_35 = Sketch_5.addLine(27.41618692363446, 77.00000000000001, 65, 77.00000000000001)
+SketchLine_35 = Sketch_5.addLine(27.41618692363446, 77, 65, 77)
 SketchLine_35.setName("SketchLine_34")
 SketchLine_35.result().setName("SketchLine_34")
 SketchLine_35.setAuxiliary(True)
@@ -263,7 +262,7 @@ SketchConstraintDistance_12 = Sketch_5.setDistance(SketchLine_33.endPoint(), Ske
 SketchConstraintDistance_12.setName("SketchConstraintDistance_14")
 SketchConstraintDistance_13 = Sketch_5.setDistance(SketchLine_30.endPoint(), SketchLine_37.result(), 82)
 SketchConstraintDistance_13.setName("SketchConstraintDistance_15")
-SketchArc_5 = Sketch_5.addArc(59, 70.99999999999999, 65, 70.99999917134223, 58.99998109391454, 77.00000000000001, False)
+SketchArc_5 = Sketch_5.addArc(59, 70.99999999999999, 65, 70.99999917134223, 58.99998109391454, 77, False)
 SketchArc_5.setName("SketchArc_6")
 SketchArc_5.result().setName("SketchArc_6")
 SketchArc_5.results()[1].setName("SketchArc_6_2")
@@ -285,7 +284,7 @@ SketchConstraintCoincidence_55 = Sketch_5.setCoincident(SketchLine_34.startPoint
 SketchConstraintCoincidence_55.setName("SketchConstraintCoincidence_62")
 SketchConstraintRadius_5 = Sketch_5.setRadius(SketchArc_5.results()[1], 6)
 SketchConstraintRadius_5.setName("SketchConstraintRadius_6")
-SketchArc_6 = Sketch_5.addArc(27.41619848709567, 84.99999999999999, 27.41618692363446, 77.00000000000001, 20, 82, True)
+SketchArc_6 = Sketch_5.addArc(27.41619848709567, 84.99999999999999, 27.41618692363446, 77, 20, 82, True)
 SketchArc_6.setName("SketchArc_7")
 SketchArc_6.result().setName("SketchArc_7")
 SketchArc_6.results()[1].setName("SketchArc_7_2")
@@ -304,7 +303,7 @@ SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_66")
 SketchConstraintDistance_15 = Sketch_5.setDistance(SketchLine_37.startPoint(), SketchLine_30.result(), "DBody")
 SketchConstraintDistance_15.setName("SketchConstraintDistance_16")
 model.do()
-RevolutionFuse_3 = model.addRevolutionFuse(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_30r-SketchLine_39r-SketchLine_32r-SketchLine_40r-SketchLine_38r-SketchArc_6_2f-SketchArc_7_2r")], model.selection("EDGE", "PartSet/OZ"), 45, 315, [model.selection("SOLID", "RevolutionFuse_2_1")])
+RevolutionFuse_3 = model.addRevolutionFuse(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_38r-SketchLine_40r-SketchArc_6_2f-SketchLine_39r-SketchArc_7_2r-SketchLine_32r-SketchLine_30r_wire")], model.selection("EDGE", "PartSet/OZ"), 45, 315, [model.selection("SOLID", "RevolutionFuse_2_1")])
 Sketch_6 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchLine_38 = Sketch_6.addLine(19.99999999999999, 60, -20, 60)
 SketchLine_38.setName("SketchLine_48")
@@ -318,11 +317,11 @@ SketchLine_40.result().setName("SketchLine_51")
 SketchLine_41 = Sketch_6.addLine(20, 30, 19.99999999999999, 60)
 SketchLine_41.setName("SketchLine_50")
 SketchLine_41.result().setName("SketchLine_50")
-SketchLine_43 = Sketch_6.addLine(-19.99999999999998, 30.00000000000001, 20, 30.00000000000001)
+SketchLine_43 = Sketch_6.addLine(-20, 30, 20, 30)
 SketchLine_43.setName("SketchLine_41")
 SketchLine_43.result().setName("SketchLine_41")
 SketchLine_43.setAuxiliary(True)
-SketchLine_42 = Sketch_6.addLine(-19.99999999999999, 60, -19.99999999999998, 30.00000000000001)
+SketchLine_42 = Sketch_6.addLine(-20, 60, -20, 30)
 SketchLine_42.setName("SketchLine_44")
 SketchLine_42.result().setName("SketchLine_44")
 SketchLine_42.setAuxiliary(True)
@@ -394,7 +393,7 @@ SketchConstraintCoincidence_78 = Sketch_6.setCoincident(SketchLine_40.endPoint()
 SketchConstraintCoincidence_78.setName("SketchConstraintCoincidence_93")
 SketchConstraintCoincidence_79 = Sketch_6.setCoincident(SketchLine_39.startPoint(), SketchLine_49.result())
 SketchConstraintCoincidence_79.setName("SketchConstraintCoincidence_94")
-SketchPoint_3 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/Vertex-SketchLine_30s-SketchLine_31s-SketchLine_38e"))
+SketchPoint_3 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/SketchLine_30_StartVertex"))
 SketchConstraintDistance_16 = Sketch_6.setDistance(SketchLine_40.result(), SketchPoint_3.coordinates(), 20)
 SketchConstraintDistance_16.setName("SketchConstraintDistance_18")
 SketchConstraintDistance_17 = Sketch_6.setDistance(SketchPoint_3.coordinates(), SketchLine_41.result(), 20)
@@ -417,7 +416,7 @@ Sketch_7 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchLine_50 = Sketch_7.addLine(65, 23.09999999999939, 65, 23.00000523211526)
 SketchLine_50.setName("SketchLine_61")
 SketchLine_50.result().setName("SketchLine_61")
-SketchLine_51 = Sketch_7.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_35"))
+SketchLine_51 = Sketch_7.addLine(model.selection("EDGE", "Sketch_5/SketchLine_35"))
 SketchLine_51.setName("SketchLine_54")
 SketchLine_51.result().setName("SketchLine_54")
 SketchLine_52 = Sketch_7.addLine(65, 23.09999999999939, 65, 20)
@@ -435,7 +434,7 @@ SketchLine_54.result().setName("SketchLine_55")
 SketchLine_54.setAuxiliary(True)
 SketchConstraintCoincidence_86 = Sketch_7.setCoincident(SketchLine_52.endPoint(), SketchLine_54.startPoint())
 SketchConstraintCoincidence_86.setName("SketchConstraintCoincidence_96")
-SketchLine_55 = Sketch_7.addLine(model.selection("EDGE", "RevolutionFuse_3_1/Modfied_6&RevolutionFuse_3_1/Modfied_5"))
+SketchLine_55 = Sketch_7.addLine(model.selection("EDGE", "[RevolutionFuse_3_1/Modified_Face&Sketch_2/SketchLine_13][RevolutionFuse_3_1/Modified_Face&Sketch_1/SketchLine_7]"))
 SketchLine_55.setName("SketchLine_56")
 SketchLine_55.result().setName("SketchLine_56")
 SketchConstraintCoincidence_87 = Sketch_7.setCoincident(SketchLine_54.endPoint(), SketchLine_55.result())
@@ -498,12 +497,12 @@ model.do()
 RevolutionFuse_4 = model.addRevolutionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection("EDGE", "PartSet/OZ"), 14.4, 14.4, [model.selection("SOLID", "ExtrusionCut_1_1")])
 Sketch_8 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchCircle_1 = Sketch_8.addCircle(0, 45, 12.5)
-SketchLine_60 = Sketch_8.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_30"))
+SketchLine_60 = Sketch_8.addLine(model.selection("EDGE", "Sketch_5/SketchLine_30"))
 SketchLine_60.setName("SketchLine_63")
 SketchLine_60.result().setName("SketchLine_63")
 SketchConstraintCoincidence_99 = Sketch_8.setCoincident(SketchCircle_1.center(), SketchLine_60.result())
 SketchConstraintCoincidence_99.setName("SketchConstraintCoincidence_109")
-SketchLine_61 = Sketch_8.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_38"))
+SketchLine_61 = Sketch_8.addLine(model.selection("EDGE", "Sketch_5/SketchLine_38"))
 SketchLine_61.setName("SketchLine_64")
 SketchLine_61.result().setName("SketchLine_64")
 SketchConstraintDistance_22 = Sketch_8.setDistance(SketchCircle_1.center(), SketchLine_61.result(), 45)
@@ -511,7 +510,7 @@ SketchConstraintDistance_22.setName("SketchConstraintDistance_24")
 SketchConstraintRadius_8 = Sketch_8.setRadius(SketchCircle_1.results()[1], 12.5)
 SketchConstraintRadius_8.setName("SketchConstraintRadius_13")
 model.do()
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchCircle_1_2f")], model.selection(), 100, 100, [model.selection("SOLID", "RevolutionFuse_4_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchCircle_1_2r")], model.selection(), 100, 100, [model.selection("SOLID", "RevolutionFuse_4_1")])
 Sketch_9 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchLine_62 = Sketch_9.addLine(0, 84, 0, -2)
 SketchLine_62.setName("SketchLine_65")
@@ -596,7 +595,7 @@ SketchConstraintDistance_26 = Sketch_9.setDistance(SketchLine_71.endPoint(), Ske
 SketchConstraintDistance_26.setName("SketchConstraintDistance_28")
 SketchConstraintDistance_27 = Sketch_9.setDistance(SketchLine_72.endPoint(), SketchLine_63.result(), 15)
 SketchConstraintDistance_27.setName("SketchConstraintDistance_29")
-SketchLine_76 = Sketch_9.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_32"))
+SketchLine_76 = Sketch_9.addLine(model.selection("EDGE", "Sketch_5/SketchLine_32"))
 SketchLine_76.setName("SketchLine_75")
 SketchLine_76.result().setName("SketchLine_75")
 SketchConstraintDistance_28 = Sketch_9.setDistance(SketchLine_62.startPoint(), SketchLine_76.result(), 2)
@@ -652,22 +651,22 @@ Sketch_10 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_77 = Sketch_10.addLine(64, 20, 89, 20)
 SketchLine_77.setName("SketchLine_76")
 SketchLine_77.result().setName("SketchLine_76")
-SketchPoint_4 = Sketch_10.addPoint(model.selection("VERTEX", "RevolutionFuse_3_1/Modfied_9&RevolutionFuse_2_1/Modfied_6&RevolutionFuse_3_1/Modfied_divided_22_1&RevolutionFuse_2_1/Modfied_11"))
+SketchPoint_4 = Sketch_10.addPoint(model.selection("VERTEX", "[(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)2(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchArc_1_2)2(RevolutionFuse_2_1/Generated_Face&Sketch_4/SketchLine_27)2(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_2_1/From_Face)2_ExtrusionCut_2_1][RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8][(RevolutionFuse_2_1/Generated_Face&Sketch_4/SketchLine_27)(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_2_1/From_Face)(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_3_1/Modified_Face&Sketch_4/SketchArc_4_2)2(ExtrusionCut_2_1/Modified_Face&Sketch_5/SketchLine_40)2][RevolutionFuse_2_1/Generated_Face&Sketch_4/SketchLine_27]"))
 SketchConstraintCoincidence_122 = Sketch_10.setCoincident(SketchLine_77.startPoint(), SketchPoint_4.result())
 SketchConstraintCoincidence_122.setName("SketchConstraintCoincidence_120")
-SketchPoint_5 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_8e-SketchLine_4e"))
+SketchPoint_5 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex"))
 SketchConstraintCoincidence_123 = Sketch_10.setCoincident(SketchLine_77.endPoint(), SketchPoint_5.result())
 SketchConstraintCoincidence_123.setName("SketchConstraintCoincidence_121")
 SketchLine_78 = Sketch_10.addLine(64, -20, 89, -20)
 SketchLine_78.setName("SketchLine_77")
 SketchLine_78.result().setName("SketchLine_77")
-SketchPoint_6 = Sketch_10.addPoint(model.selection("VERTEX", "RevolutionFuse_3_1/Modfied_10&RevolutionFuse_1_1/Modfied_5&RevolutionFuse_3_1/Modfied_divided_21_1&RevolutionFuse_1_1/Modfied_10"))
+SketchPoint_6 = Sketch_10.addPoint(model.selection("VERTEX", "[(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchArc_2_2)2(RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20)2(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_1_1/To_Face)2_ExtrusionCut_2_1][RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14][(RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20)(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_1_1/To_Face)(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)2(RevolutionFuse_3_1/Modified_Face&Sketch_3/SketchArc_3_2)2(ExtrusionCut_2_1/Modified_Face&Sketch_5/SketchLine_40)2][RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20]"))
 SketchConstraintCoincidence_124 = Sketch_10.setCoincident(SketchLine_78.startPoint(), SketchPoint_6.result())
 SketchConstraintCoincidence_124.setName("SketchConstraintCoincidence_122")
-SketchPoint_7 = Sketch_10.addPoint(model.selection("VERTEX", "ExtrusionFuse_2_1/Modfied_7&ExtrusionFuse_2_1/Modfied_6&RevolutionFuse_3_1/Modfied_10&RevolutionFuse_1_1/Modfied_5"))
+SketchPoint_7 = Sketch_10.addPoint(model.selection("VERTEX", "[(ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)(ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchArc_1_2)2(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)2(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2_ExtrusionCut_2_1][ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8][(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)(ExtrusionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchArc_2_2)2(RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20)2(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_1_1/To_Face)2_ExtrusionCut_2_1][RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14]"))
 SketchConstraintCoincidence_125 = Sketch_10.setCoincident(SketchLine_78.endPoint(), SketchPoint_7.result())
 SketchConstraintCoincidence_125.setName("SketchConstraintCoincidence_123")
-SketchArc_10 = Sketch_10.addArc(89.00000104846708, 1.669244441022778e-015, 89, -20, 89, 20, False)
+SketchArc_10 = Sketch_10.addArc(89, 0, 89, -20, 89, 20, False)
 SketchArc_10.setName("SketchArc_13")
 SketchArc_10.result().setName("SketchArc_13")
 SketchArc_10.results()[1].setName("SketchArc_13_2")
@@ -687,7 +686,7 @@ SketchConstraintCoincidence_129 = Sketch_10.setCoincident(SketchArc_11.startPoin
 SketchConstraintCoincidence_129.setName("SketchConstraintCoincidence_127")
 SketchConstraintTangent_19 = Sketch_10.setTangent(SketchArc_11.results()[1], SketchLine_78.result())
 SketchConstraintTangent_19.setName("SketchConstraintTangent_24")
-SketchPoint_8 = Sketch_10.addPoint(model.selection("VERTEX", "RevolutionFuse_3_1/Modfied_divided_21_1&RevolutionFuse_1_1/Modfied_10&RevolutionFuse_3_1/Modfied_8"))
+SketchPoint_8 = Sketch_10.addPoint(model.selection("VERTEX", "[(RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20)(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_1_1/To_Face)(RevolutionFuse_1_1/Modified_Face&Sketch_2/SketchLine_14)2(RevolutionFuse_3_1/Modified_Face&Sketch_3/SketchArc_3_2)2(ExtrusionCut_2_1/Modified_Face&Sketch_5/SketchLine_40)2][RevolutionFuse_1_1/Generated_Face&Sketch_3/SketchLine_20][RevolutionFuse_3_1/Modified_Face&RevolutionFuse_1_1/To_Face]"))
 SketchConstraintCoincidence_130 = Sketch_10.setCoincident(SketchArc_11.endPoint(), SketchPoint_8.result())
 SketchConstraintCoincidence_130.setName("SketchConstraintCoincidence_128")
 SketchArc_12 = Sketch_10.addArc(64.00001789135865, 23.01137360115889, 64, 20, 61.15622559702543, 22.02080994708722, True)
@@ -698,7 +697,7 @@ SketchConstraintCoincidence_131 = Sketch_10.setCoincident(SketchArc_12.startPoin
 SketchConstraintCoincidence_131.setName("SketchConstraintCoincidence_129")
 SketchConstraintTangent_20 = Sketch_10.setTangent(SketchArc_12.results()[1], SketchLine_77.result())
 SketchConstraintTangent_20.setName("SketchConstraintTangent_25")
-SketchPoint_9 = Sketch_10.addPoint(model.selection("VERTEX", "RevolutionFuse_3_1/Modfied_divided_22_1&RevolutionFuse_2_1/Modfied_11&RevolutionFuse_3_1/Modfied_7"))
+SketchPoint_9 = Sketch_10.addPoint(model.selection("VERTEX", "[(RevolutionFuse_2_1/Generated_Face&Sketch_4/SketchLine_27)(RevolutionFuse_3_1/Modified_Face&RevolutionFuse_2_1/From_Face)(RevolutionFuse_2_1/Modified_Face&Sketch_1/SketchLine_8)2(RevolutionFuse_3_1/Modified_Face&Sketch_4/SketchArc_4_2)2(ExtrusionCut_2_1/Modified_Face&Sketch_5/SketchLine_40)2][RevolutionFuse_2_1/Generated_Face&Sketch_4/SketchLine_27][RevolutionFuse_3_1/Modified_Face&RevolutionFuse_2_1/From_Face]"))
 SketchConstraintCoincidence_132 = Sketch_10.setCoincident(SketchArc_12.endPoint(), SketchPoint_9.result())
 SketchConstraintCoincidence_132.setName("SketchConstraintCoincidence_130")
 SketchLine_79 = Sketch_10.addLine(61.15622559702543, 22.02080994708722, 59.81204392543111, 22.0208099470871)
@@ -725,7 +724,7 @@ SketchConstraintCoincidence_138.setName("SketchConstraintCoincidence_136")
 SketchConstraintParallel_3 = Sketch_10.setParallel(SketchLine_78.result(), SketchLine_81.result())
 SketchConstraintParallel_4 = Sketch_10.setParallel(SketchLine_77.result(), SketchLine_79.result())
 SketchConstraintPerpendicular_1 = Sketch_10.setPerpendicular(SketchLine_80.result(), SketchLine_77.result())
-SketchPoint_10 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_6/Vertex-SketchPoint_3"))
+SketchPoint_10 = Sketch_10.addPoint(model.selection("VERTEX", "Sketch_6/SketchPoint_3"))
 SketchMultiRotation_1_objects = [SketchArc_10.results()[1], SketchLine_77.result(), SketchLine_78.result(), SketchArc_12.results()[1], SketchLine_79.result(), SketchLine_80.result(), SketchLine_81.result(), SketchArc_11.results()[1]]
 SketchMultiRotation_1 = Sketch_10.addRotation(SketchMultiRotation_1_objects, SketchPoint_10.coordinates(), 120, 3)
 [SketchArc_13, SketchArc_14, SketchLine_82, SketchLine_83, SketchLine_84, SketchLine_85, SketchArc_15, SketchArc_16, SketchLine_86, SketchLine_87, SketchLine_88, SketchLine_89, SketchLine_90, SketchLine_91, SketchArc_17, SketchArc_18] = SketchMultiRotation_1.rotated()
@@ -768,10 +767,10 @@ SketchArc_13.setName("SketchArc_16")
 SketchArc_13.result().setName("SketchArc_16")
 SketchArc_13.results()[1].setName("SketchArc_16_2")
 model.do()
-ExtrusionFuse_3 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_10/Face-SketchArc_16_2f-SketchLine_81r-SketchLine_82f-SketchArc_17_2r-SketchLine_83f-SketchLine_84f-SketchLine_85r-SketchArc_18_2r"), model.selection("FACE", "Sketch_10/Face-SketchArc_19_2f-SketchLine_86r-SketchLine_87f-SketchArc_20_2r-SketchLine_88f-SketchLine_89f-SketchLine_90r-SketchArc_21_2r")], model.selection(), 20, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+ExtrusionFuse_3 = model.addExtrusionFuse(Part_1_doc, [model.selection("FACE", "Sketch_10/Face-SketchArc_16_2f-SketchLine_81r-SketchArc_17_2r-SketchLine_83f-SketchLine_84f-SketchLine_85r-SketchArc_18_2r-SketchLine_82f"), model.selection("FACE", "Sketch_10/Face-SketchArc_19_2f-SketchLine_86r-SketchArc_20_2r-SketchLine_88f-SketchLine_89f-SketchLine_90r-SketchArc_21_2r-SketchLine_87f")], model.selection(), 20, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
 Sketch_11 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchCircle_2 = Sketch_11.addCircle(89, 0, 6)
-SketchPoint_11 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_2/Vertex-SketchPoint_1-SketchLine_10s-SketchLine_9e"))
+SketchPoint_11 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_2/SketchLine_9_EndVertex"))
 SketchConstraintCoincidence_139 = Sketch_11.setCoincident(SketchCircle_2.center(), SketchPoint_11.result())
 SketchConstraintCoincidence_139.setName("SketchConstraintCoincidence_137")
 SketchConstraintRadius_11 = Sketch_11.setRadius(SketchCircle_2.results()[1], 6)
@@ -788,8 +787,10 @@ SketchMultiRotation_2 = Sketch_11.addRotation([SketchCircle_3.results()[1], Sket
 [SketchCircle_4, SketchCircle_5, SketchCircle_6, SketchCircle_7] = SketchMultiRotation_2.rotated()
 model.do()
 RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection("EDGE", "PartSet/OZ"), 0, 360, [model.selection("SOLID", "ExtrusionFuse_3_1")])
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_11/Wire-SketchCircle_4_2f"), model.selection("WIRE", "Sketch_11/Wire-SketchCircle_3_2f"), model.selection("WIRE", "Sketch_11/Wire-SketchCircle_5_2f")], model.selection(), 30, -15, [model.selection("SOLID", "RevolutionCut_1_1")])
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_11/Wire-SketchCircle_2_2f"), model.selection("FACE", "Sketch_11/Face-SketchCircle_6_2f"), model.selection("WIRE", "Sketch_11/Wire-SketchCircle_7_2f")], model.selection(), 30, 2, [model.selection("SOLID", "ExtrusionCut_3_1")])
+ExtrusionCut_3_objects_1 = [model.selection("WIRE", "Sketch_11/Face-SketchCircle_4_2f-SketchCircle_6_2r_wire"), model.selection("WIRE", "Sketch_11/Face-SketchCircle_3_2f-SketchCircle_2_2r_wire"), model.selection("WIRE", "Sketch_11/Face-SketchCircle_5_2f-SketchCircle_7_2r_wire")]
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_3_objects_1, model.selection(), 30, -15, [model.selection("SOLID", "RevolutionCut_1_1")])
+ExtrusionCut_4_objects_1 = [model.selection("WIRE", "Sketch_11/Face-SketchCircle_2_2r_wire"), model.selection("FACE", "Sketch_11/Face-SketchCircle_6_2f"), model.selection("WIRE", "Sketch_11/Face-SketchCircle_7_2f_wire")]
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_4_objects_1, model.selection(), 30, 2, [model.selection("SOLID", "ExtrusionCut_3_1")])
 
 # Test reexecution after parameter change
 Parameter_R.setValue(5)
index f69307ae2dc8c60964a7d60e3823d10a103914b7..602fd9ccde7d078b9ecda9c523be7a379b6eedee 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -133,20 +132,20 @@ SketchConstraintHorizontal_4.setName("SketchConstraintHorizontal_9")
 SketchConstraintDistance_7 = Sketch_1.setDistance(SketchLine_5.startPoint(), SketchLine_2.result(), 32, False)
 SketchConstraintDistance_7.setName("SketchConstraintDistance_9")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_14r-SketchArc_2_2r")], model.selection(), 12, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_14r-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchArc_2_2r-SketchLine_12r-SketchLine_11r-SketchLine_10r_wire")], model.selection(), 12, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOZ"))
 SketchArc_3 = Sketch_2.addArc(54, 6, 54, 12, 54, 0, True)
-SketchLine_13 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_13&Extrusion_1_1/To_Face_1"))
+SketchLine_13 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
 SketchLine_13.setName("SketchLine_15")
 SketchLine_13.result().setName("SketchLine_15")
 SketchConstraintCoincidence_19 = Sketch_2.setCoincident(SketchArc_3.startPoint(), SketchLine_13.result())
 SketchConstraintCoincidence_19.setName("SketchConstraintCoincidence_23")
-SketchLine_14 = Sketch_2.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchLine_14 = Sketch_2.addLine(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_14.setName("SketchLine_16")
 SketchLine_14.result().setName("SketchLine_16")
 SketchConstraintCoincidence_20 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_14.result())
 SketchConstraintCoincidence_20.setName("SketchConstraintCoincidence_24")
-SketchLine_15 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_13&Extrusion_1_1/Generated_Face_12"))
+SketchLine_15 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]"))
 SketchLine_15.setName("SketchLine_17")
 SketchLine_15.result().setName("SketchLine_17")
 SketchConstraintTangent_1 = Sketch_2.setTangent(SketchArc_3.results()[1], SketchLine_15.result())
@@ -180,13 +179,13 @@ SketchConstraintCoincidence_25.setName("SketchConstraintCoincidence_29")
 SketchConstraintCoincidence_26 = Sketch_2.setCoincident(SketchArc_3.endPoint(), SketchLine_20.endPoint())
 SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_30")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_3_2r-SketchLine_18r-SketchLine_19r-SketchLine_20r-SketchLine_21r-SketchLine_22r")], model.selection(), 7, 15, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_9"))
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_22r-SketchLine_21r-SketchLine_20r-SketchLine_19r-SketchLine_18r-SketchArc_3_2r")], model.selection(), 7, 15, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14"))
 SketchLine_21 = Sketch_3.addLine(28, -6, -4.270492394552598, -6)
 SketchLine_21.setName("SketchLine_23")
 SketchLine_21.result().setName("SketchLine_23")
 SketchLine_21.setAuxiliary(True)
-SketchLine_22 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_9"))
+SketchLine_22 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14]"))
 SketchLine_22.setName("SketchLine_24")
 SketchLine_22.result().setName("SketchLine_24")
 SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_21.startPoint(), SketchLine_22.result())
@@ -304,26 +303,26 @@ SketchConstraintCoincidence_51.setName("SketchConstraintCoincidence_55")
 SketchConstraintMiddle_2 = Sketch_3.setMiddlePoint(SketchLine_34.result(), SketchPoint_4.coordinates())
 SketchConstraintCoincidence_52 = Sketch_3.setCoincident(SketchPoint_4.coordinates(), SketchLine_21.result())
 SketchConstraintCoincidence_52.setName("SketchConstraintCoincidence_56")
-SketchLine_35 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&ExtrusionCut_1_1/Modfied_3"))
+SketchLine_35 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_5]"))
 SketchLine_35.setName("SketchLine_37")
 SketchLine_35.result().setName("SketchLine_37")
 SketchConstraintCoincidence_53 = Sketch_3.setCoincident(SketchLine_25.startPoint(), SketchLine_35.result())
 SketchConstraintCoincidence_53.setName("SketchConstraintCoincidence_57")
 SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_24.result(), 31)
 SketchConstraintLength_10.setName("SketchConstraintLength_11")
-SketchLine_36 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_5"))
+SketchLine_36 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9]"))
 SketchLine_36.setName("SketchLine_38")
 SketchLine_36.result().setName("SketchLine_38")
 SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_30.startPoint(), SketchLine_36.result())
 SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_58")
 SketchConstraintEqual_2 = Sketch_3.setEqual(SketchLine_30.result(), SketchLine_25.result())
 model.do()
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_32f-SketchLine_33f-SketchLine_34f-SketchLine_35f"), model.selection("FACE", "Sketch_3/Face-SketchLine_26f-SketchLine_27f-SketchLine_28f-SketchLine_29f")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_1"))
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_32f-SketchLine_33f-SketchLine_34f-SketchLine_35f"), model.selection("FACE", "Sketch_3/Face-SketchLine_26f-SketchLine_27f-SketchLine_28f-SketchLine_29f")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_4"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchLine_37 = Sketch_4.addLine(0.4324637622511017, 3.581086955422081, 1.55585595716119, 2.812450190483599)
 SketchLine_37.setName("SketchLine_39")
 SketchLine_37.result().setName("SketchLine_39")
-SketchLine_38 = Sketch_4.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&Extrusion_1_1/Generated_Face_2"))
+SketchLine_38 = Sketch_4.addLine(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_11]"))
 SketchLine_38.setName("SketchLine_40")
 SketchLine_38.result().setName("SketchLine_40")
 SketchConstraintCoincidence_55 = Sketch_4.setCoincident(SketchLine_37.startPoint(), SketchLine_38.result())
@@ -369,8 +368,8 @@ SketchLine_42.result().setName("SketchLine_44")
 SketchLine_41.setName("SketchLine_43")
 SketchLine_41.result().setName("SketchLine_43")
 model.do()
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_2"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_5&ExtrusionCut_3_1/Modfied_3&Extrusion_1_1/Generated_Face_1"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_3&Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_7"), model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_5&ExtrusionCut_2_1/Modfied_5&ExtrusionCut_3_1/Modfied_3"))
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Plane_4 = model.addPlane(Part_1_doc, model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_4&ExtrusionCut_2_1/To_Face_2)][ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face]"))
 Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchArc_4 = Sketch_5.addArc(25, -7.50002056854448, 22, -7.5, 28, -7.5, True)
 SketchPoint_5 = Sketch_5.addPoint(22, -7.5)
@@ -410,11 +409,11 @@ SketchConstraintVertical_11 = Sketch_5.setVertical(SketchLine_52.result())
 SketchConstraintHorizontal_11 = Sketch_5.setHorizontal(SketchLine_51.result())
 SketchConstraintHorizontal_11.setName("SketchConstraintHorizontal_12")
 model.do()
-Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), 6, True)
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face"), 6, True)
 Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_2"), 3, True)
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2f-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), 3, 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
-ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2f-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), model.selection("FACE", "Plane_3"), 0, model.selection("FACE", "Plane_2"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_4_1/Modfied_6"))
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2r-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), 3, 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
+ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2r-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), model.selection("FACE", "Plane_3"), 0, model.selection("FACE", "Plane_2"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_4_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchArc_5 = Sketch_6.addArc(46, 0, 45.5, 0, 46.5, 0, False)
 SketchLine_53 = Sketch_6.addLine(0, 0, 54, 0)
 SketchLine_53.setName("SketchLine_55")
@@ -464,8 +463,8 @@ SketchLine_57.result().setName("SketchLine_59")
 SketchLine_56.setName("SketchLine_58")
 SketchLine_56.result().setName("SketchLine_58")
 model.do()
-ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_14r-SketchArc_2_2r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"))
+ExtrusionFuse_1 = model.addExtrusionFuse(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_14r-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchArc_2_2r-SketchLine_12r-SketchLine_11r-SketchLine_10r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_27)(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_26)(ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_4&ExtrusionCut_2_1/To_Face_2)(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_28)_ExtrusionFuse_1_1"))
 SketchLine_64 = Sketch_7.addLine(50.25, -4.5, 31.25, -4.5)
 SketchLine_64.setName("SketchLine_76")
 SketchLine_64.result().setName("SketchLine_76")
@@ -639,7 +638,7 @@ SketchConstraintRadius_7 = Sketch_7.setRadius(SketchArc_17.results()[1], 0.25)
 SketchConstraintRadius_7.setName("SketchConstraintRadius_10")
 model.do()
 ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection(), 0, 20, [model.selection("SOLID", "ExtrusionFuse_1_1")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_6_1/Modfied_10"))
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "(ExtrusionFuse_1_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_76)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchArc_15_2)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_80)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchArc_17_2)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_79)(ExtrusionFuse_1_1/Modified_Face&Extrusion_1_1/To_Face)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10)"))
 SketchPoint_12 = Sketch_8.addPoint(54, 0)
 SketchPoint_13 = Sketch_8.addPoint(54, 0)
 SketchConstraintRigid_7 = Sketch_8.setFixed(SketchPoint_13.result())
@@ -788,7 +787,7 @@ SketchConstraintCoincidence_142 = Sketch_8.setCoincident(SketchPoint_21.coordina
 SketchConstraintCoincidence_142.setName("SketchConstraintCoincidence_145")
 model.do()
 ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_8")], model.selection(), 10, 0, [model.selection("SOLID", "ExtrusionCut_6_1")])
-Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_7_1/Modfied_14"))
+Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_7_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchLine_94 = Sketch_9.addLine(21, 4.163450069699051, 21, 0)
 SketchLine_94.setName("SketchLine_107")
 SketchLine_94.result().setName("SketchLine_107")
@@ -931,7 +930,7 @@ model.do()
 Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_2"), 4, False)
 Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_2"), 4, True)
 ExtrusionCut_8 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection(), model.selection("FACE", "Plane_5"), 0, model.selection("FACE", "Plane_4"), 0, [model.selection("SOLID", "ExtrusionCut_7_1")])
-Sketch_10 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_8_1/Modfied_5"))
+Sketch_10 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_8_1/Modified_Face&Sketch_1/SketchLine_1"))
 SketchCircle_1 = Sketch_10.addCircle(12, 6, 1)
 SketchConstraintRadius_9 = Sketch_10.setRadius(SketchCircle_1.results()[1], 1)
 SketchPoint_24 = Sketch_10.addPoint(0, 6)
@@ -956,7 +955,7 @@ SketchConstraintCoincidence_174 = Sketch_10.setCoincident(SketchCircle_1.center(
 SketchConstraintCoincidence_174.setName("SketchConstraintCoincidence_178")
 SketchConstraintDistance_17 = Sketch_10.setDistance(SketchLine_105.result(), SketchCircle_1.center(), 12, False)
 model.do()
-ExtrusionCut_9 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_10/Wire-SketchCircle_1_2f")], model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_8_1")])
+ExtrusionCut_9 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_10/Face-SketchCircle_1_2r_wire")], model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_8_1")])
 model.do()
 Part_2 = model.addPart(partSet)
 Part_2_doc = Part_2.document()
@@ -1068,20 +1067,20 @@ SketchConstraintHorizontal_26.setName("SketchConstraintHorizontal_9")
 SketchConstraintDistance_24 = Sketch_11.setDistance(SketchLine_111.startPoint(), SketchLine_108.result(), 32, False)
 SketchConstraintDistance_24.setName("SketchConstraintDistance_9")
 model.do()
-Extrusion_2 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_14r-SketchArc_2_2r")], model.selection(), 12, 0)
+Extrusion_2 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_14r-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchArc_2_2r-SketchLine_12r-SketchLine_11r-SketchLine_10r_wire")], model.selection(), 12, 0)
 Sketch_12 = model.addSketch(Part_2_doc, model.standardPlane("XOZ"))
 SketchArc_26 = Sketch_12.addArc(54, 6, 54, 12, 54, 0, True)
-SketchLine_119 = Sketch_12.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_13&Extrusion_1_1/To_Face_1"))
+SketchLine_119 = Sketch_12.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
 SketchLine_119.setName("SketchLine_15")
 SketchLine_119.result().setName("SketchLine_15")
 SketchConstraintCoincidence_193 = Sketch_12.setCoincident(SketchArc_26.startPoint(), SketchLine_119.result())
 SketchConstraintCoincidence_193.setName("SketchConstraintCoincidence_23")
-SketchLine_120 = Sketch_12.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"))
+SketchLine_120 = Sketch_12.addLine(model.selection("EDGE", "Sketch_1/SketchLine_1"))
 SketchLine_120.setName("SketchLine_16")
 SketchLine_120.result().setName("SketchLine_16")
 SketchConstraintCoincidence_194 = Sketch_12.setCoincident(SketchArc_26.endPoint(), SketchLine_120.result())
 SketchConstraintCoincidence_194.setName("SketchConstraintCoincidence_24")
-SketchLine_121 = Sketch_12.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_13&Extrusion_1_1/Generated_Face_12"))
+SketchLine_121 = Sketch_12.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]"))
 SketchLine_121.setName("SketchLine_17")
 SketchLine_121.result().setName("SketchLine_17")
 SketchConstraintTangent_16 = Sketch_12.setTangent(SketchArc_26.results()[1], SketchLine_121.result())
@@ -1115,13 +1114,13 @@ SketchConstraintCoincidence_199.setName("SketchConstraintCoincidence_29")
 SketchConstraintCoincidence_200 = Sketch_12.setCoincident(SketchArc_26.endPoint(), SketchLine_126.endPoint())
 SketchConstraintCoincidence_200.setName("SketchConstraintCoincidence_30")
 model.do()
-ExtrusionCut_10 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_3_2r-SketchLine_18r-SketchLine_19r-SketchLine_20r-SketchLine_21r-SketchLine_22r")], model.selection(), 7, 15, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_13 = model.addSketch(Part_2_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_9"))
+ExtrusionCut_10 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_22r-SketchLine_21r-SketchLine_20r-SketchLine_19r-SketchLine_18r-SketchArc_3_2r")], model.selection(), 7, 15, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_13 = model.addSketch(Part_2_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14"))
 SketchLine_127 = Sketch_13.addLine(28, -6, -4.270492394552598, -6)
 SketchLine_127.setName("SketchLine_23")
 SketchLine_127.result().setName("SketchLine_23")
 SketchLine_127.setAuxiliary(True)
-SketchLine_128 = Sketch_13.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_9"))
+SketchLine_128 = Sketch_13.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14]"))
 SketchLine_128.setName("SketchLine_24")
 SketchLine_128.result().setName("SketchLine_24")
 SketchConstraintCoincidence_201 = Sketch_13.setCoincident(SketchLine_127.startPoint(), SketchLine_128.result())
@@ -1239,26 +1238,26 @@ SketchConstraintCoincidence_225.setName("SketchConstraintCoincidence_55")
 SketchConstraintMiddle_10 = Sketch_13.setMiddlePoint(SketchLine_140.result(), SketchPoint_28.coordinates())
 SketchConstraintCoincidence_226 = Sketch_13.setCoincident(SketchPoint_28.coordinates(), SketchLine_127.result())
 SketchConstraintCoincidence_226.setName("SketchConstraintCoincidence_56")
-SketchLine_141 = Sketch_13.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_9&ExtrusionCut_1_1/Modfied_3"))
+SketchLine_141 = Sketch_13.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_14][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_5]"))
 SketchLine_141.setName("SketchLine_37")
 SketchLine_141.result().setName("SketchLine_37")
 SketchConstraintCoincidence_227 = Sketch_13.setCoincident(SketchLine_131.startPoint(), SketchLine_141.result())
 SketchConstraintCoincidence_227.setName("SketchConstraintCoincidence_57")
 SketchConstraintLength_27 = Sketch_13.setLength(SketchLine_130.result(), 31)
 SketchConstraintLength_27.setName("SketchConstraintLength_11")
-SketchLine_142 = Sketch_13.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_5"))
+SketchLine_142 = Sketch_13.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9]"))
 SketchLine_142.setName("SketchLine_38")
 SketchLine_142.result().setName("SketchLine_38")
 SketchConstraintCoincidence_228 = Sketch_13.setCoincident(SketchLine_136.startPoint(), SketchLine_142.result())
 SketchConstraintCoincidence_228.setName("SketchConstraintCoincidence_58")
 SketchConstraintEqual_5 = Sketch_13.setEqual(SketchLine_136.result(), SketchLine_131.result())
 model.do()
-ExtrusionCut_11 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_32f-SketchLine_33f-SketchLine_34f-SketchLine_35f"), model.selection("FACE", "Sketch_3/Face-SketchLine_26f-SketchLine_27f-SketchLine_28f-SketchLine_29f")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Sketch_14 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_1"))
+ExtrusionCut_11 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_32f-SketchLine_33f-SketchLine_34f-SketchLine_35f"), model.selection("FACE", "Sketch_3/Face-SketchLine_26f-SketchLine_27f-SketchLine_28f-SketchLine_29f")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_4"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Sketch_14 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchLine_143 = Sketch_14.addLine(0.4324637622511017, 3.581086955422081, 1.55585595716119, 2.812450190483599)
 SketchLine_143.setName("SketchLine_39")
 SketchLine_143.result().setName("SketchLine_39")
-SketchLine_144 = Sketch_14.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&Extrusion_1_1/Generated_Face_2"))
+SketchLine_144 = Sketch_14.addLine(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_11]"))
 SketchLine_144.setName("SketchLine_40")
 SketchLine_144.result().setName("SketchLine_40")
 SketchConstraintCoincidence_229 = Sketch_14.setCoincident(SketchLine_143.startPoint(), SketchLine_144.result())
@@ -1304,8 +1303,8 @@ SketchLine_148.result().setName("SketchLine_44")
 SketchLine_147.setName("SketchLine_43")
 SketchLine_147.result().setName("SketchLine_43")
 model.do()
-ExtrusionCut_12 = model.addExtrusionCut(Part_2_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_2"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-Plane_9 = model.addPlane(Part_2_doc, model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_5&ExtrusionCut_3_1/Modfied_3&Extrusion_1_1/Generated_Face_1"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_3&Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_7"), model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_5&ExtrusionCut_2_1/Modfied_5&ExtrusionCut_3_1/Modfied_3"))
+ExtrusionCut_12 = model.addExtrusionCut(Part_2_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/From_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Plane_9 = model.addPlane(Part_2_doc, model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10]"), model.selection("VERTEX", "[ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"), model.selection("VERTEX", "[ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1][(ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_1)(ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face)(ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_4&ExtrusionCut_2_1/To_Face_2)][ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face]"))
 Sketch_15 = model.addSketch(Part_2_doc, model.selection("FACE", "Plane_1"))
 SketchArc_27 = Sketch_15.addArc(25, -7.50002056854448, 22, -7.5, 28, -7.5, True)
 SketchPoint_29 = Sketch_15.addPoint(22, -7.5)
@@ -1345,11 +1344,11 @@ SketchConstraintVertical_30 = Sketch_15.setVertical(SketchLine_158.result())
 SketchConstraintHorizontal_33 = Sketch_15.setHorizontal(SketchLine_157.result())
 SketchConstraintHorizontal_33.setName("SketchConstraintHorizontal_12")
 model.do()
-Plane_10 = model.addPlane(Part_2_doc, model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), 6, True)
+Plane_10 = model.addPlane(Part_2_doc, model.selection("FACE", "ExtrusionCut_3_1/Modified_Face&Extrusion_1_1/To_Face"), 6, True)
 Plane_11 = model.addPlane(Part_2_doc, model.selection("FACE", "Plane_2"), 3, True)
-ExtrusionCut_13 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2f-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), 3, 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
-ExtrusionCut_14 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2f-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), model.selection("FACE", "Plane_3"), 0, model.selection("FACE", "Plane_2"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
-Sketch_16 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_4_1/Modfied_6"))
+ExtrusionCut_13 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2r-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), 3, 0, [model.selection("SOLID", "ExtrusionCut_3_1")])
+ExtrusionCut_14 = model.addExtrusionCut(Part_2_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_4_2r-SketchLine_52f-SketchLine_53f-SketchLine_54f")], model.selection(), model.selection("FACE", "Plane_3"), 0, model.selection("FACE", "Plane_2"), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
+Sketch_16 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_4_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchArc_28 = Sketch_16.addArc(46, 0, 45.5, 0, 46.5, 0, False)
 SketchLine_159 = Sketch_16.addLine(0, 0, 54, 0)
 SketchLine_159.setName("SketchLine_55")
@@ -1399,8 +1398,8 @@ SketchLine_163.result().setName("SketchLine_59")
 SketchLine_162.setName("SketchLine_58")
 SketchLine_162.result().setName("SketchLine_58")
 model.do()
-ExtrusionFuse_2 = model.addExtrusionFuse(Part_2_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_14r-SketchArc_2_2r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
-Sketch_17 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"))
+ExtrusionFuse_2 = model.addExtrusionFuse(Part_2_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_14r-SketchLine_7f-SketchArc_1_2f-SketchLine_8f-SketchLine_9f-SketchArc_2_2r-SketchLine_12r-SketchLine_11r-SketchLine_10r"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_5_1")])
+Sketch_17 = model.addSketch(Part_2_doc, model.selection("FACE", "(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_27)(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_26)(ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_4&ExtrusionCut_2_1/To_Face_2)(ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_28)_ExtrusionFuse_1_1"))
 SketchLine_170 = Sketch_17.addLine(50.25, -4.5, 31.25, -4.5)
 SketchLine_170.setName("SketchLine_76")
 SketchLine_170.result().setName("SketchLine_76")
@@ -1574,7 +1573,7 @@ SketchConstraintRadius_16 = Sketch_17.setRadius(SketchArc_40.results()[1], 0.25)
 SketchConstraintRadius_16.setName("SketchConstraintRadius_10")
 model.do()
 ExtrusionCut_15 = model.addExtrusionCut(Part_2_doc, [model.selection("COMPOUND", "Sketch_7")], model.selection(), 0, 20, [model.selection("SOLID", "ExtrusionFuse_1_1")])
-Sketch_18 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_6_1/Modfied_10"))
+Sketch_18 = model.addSketch(Part_2_doc, model.selection("FACE", "(ExtrusionFuse_1_1/Modified_Face&Extrusion_1_1/From_Face)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_76)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchArc_15_2)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_80)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchArc_17_2)(ExtrusionCut_6_1/Generated_Face&Sketch_7/SketchLine_79)(ExtrusionFuse_1_1/Modified_Face&Extrusion_1_1/To_Face)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10)"))
 SketchPoint_36 = Sketch_18.addPoint(54, 0)
 SketchPoint_37 = Sketch_18.addPoint(54, 0)
 SketchConstraintRigid_20 = Sketch_18.setFixed(SketchPoint_37.result())
@@ -1723,7 +1722,7 @@ SketchConstraintCoincidence_316 = Sketch_18.setCoincident(SketchPoint_45.coordin
 SketchConstraintCoincidence_316.setName("SketchConstraintCoincidence_145")
 model.do()
 ExtrusionCut_16 = model.addExtrusionCut(Part_2_doc, [model.selection("COMPOUND", "Sketch_8")], model.selection(), 10, 0, [model.selection("SOLID", "ExtrusionCut_6_1")])
-Sketch_19 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_7_1/Modfied_14"))
+Sketch_19 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_7_1/Modified_Face&Extrusion_1_1/To_Face"))
 SketchLine_200 = Sketch_19.addLine(21, 4.163450069699051, 21, 0)
 SketchLine_200.setName("SketchLine_107")
 SketchLine_200.result().setName("SketchLine_107")
@@ -1866,7 +1865,7 @@ model.do()
 Plane_12 = model.addPlane(Part_2_doc, model.selection("FACE", "Plane_2"), 4, False)
 Plane_13 = model.addPlane(Part_2_doc, model.selection("FACE", "Plane_2"), 4, True)
 ExtrusionCut_17 = model.addExtrusionCut(Part_2_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection(), model.selection("FACE", "Plane_5"), 0, model.selection("FACE", "Plane_4"), 0, [model.selection("SOLID", "ExtrusionCut_7_1")])
-Sketch_20 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_8_1/Modfied_5"))
+Sketch_20 = model.addSketch(Part_2_doc, model.selection("FACE", "ExtrusionCut_8_1/Modified_Face&Sketch_1/SketchLine_1"))
 SketchCircle_2 = Sketch_20.addCircle(12, 6, 1)
 SketchConstraintRadius_18 = Sketch_20.setRadius(SketchCircle_2.results()[1], 1)
 SketchPoint_48 = Sketch_20.addPoint(0, 6)
@@ -1891,11 +1890,11 @@ SketchConstraintCoincidence_348 = Sketch_20.setCoincident(SketchCircle_2.center(
 SketchConstraintCoincidence_348.setName("SketchConstraintCoincidence_178")
 SketchConstraintDistance_34 = Sketch_20.setDistance(SketchLine_211.result(), SketchCircle_2.center(), 12, False)
 model.do()
-ExtrusionCut_18 = model.addExtrusionCut(Part_2_doc, [model.selection("WIRE", "Sketch_10/Wire-SketchCircle_1_2f")], model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_8_1")])
+ExtrusionCut_18 = model.addExtrusionCut(Part_2_doc, [model.selection("WIRE", "Sketch_10/Face-SketchCircle_1_2r_wire")], model.selection(), 0, 0.75, [model.selection("SOLID", "ExtrusionCut_8_1")])
 model.do()
-Rotation_1 = model.addRotation(partSet, [model.selection("COMPOUND", "Part_2/")], model.selection("EDGE", "Part_1/ExtrusionCut_9_1/Modfied_1&ExtrusionCut_7_1/Modfied_19"), 180)
-Placement_1 = model.addPlacement(partSet, [model.selection("COMPOUND", "Rotation_1/")], model.selection("FACE", "Rotation_1/ExtrusionCut_5_1/Modfied_5"), model.selection("FACE", "Part_1/ExtrusionCut_5_1/Modfied_5"), False, True)
-Rotation_2 = model.addRotation(partSet, [model.selection("COMPOUND", "Placement_1/")], model.selection("EDGE", "Part_1/ExtrusionCut_5_1/Modfied_5&ExtrusionCut_8_1/Modfied_3"), 7)
+Rotation_1 = model.addRotation(partSet, [model.selection("COMPOUND", "Part_2/")], model.selection("EDGE", "Part_1/[ExtrusionCut_9_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_7_1/Modified_Face&Extrusion_1_1/From_Face]"), 180)
+Placement_1 = model.addPlacement(partSet, [model.selection("COMPOUND", "Rotation_1/")], model.selection("FACE", "Rotation_1/ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_9"), model.selection("FACE", "Part_1/ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_9"), False, True)
+Rotation_2 = model.addRotation(partSet, [model.selection("COMPOUND", "Placement_1/")], model.selection("EDGE", "Part_1/[ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_9][ExtrusionCut_8_1/Modified_Face&Sketch_3/SketchLine_35]"), 7)
 Rotation_2.result().setColor(255, 85, 0)
 model.end()
 
index 1a0dc5ac09075c39b010914b4e2f810bf8045d8b..05c60d0b16f8803b49128a29f4246aedab7d747d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -115,12 +114,12 @@ SketchConstraintRadius_1 = Sketch_1.setRadius(SketchArc_1.results()[1], 2)
 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], 2.3)
 SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_5.result(), SketchLine_9.startPoint())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchLine_10f-SketchLine_11f-SketchLine_12f-SketchLine_13f-SketchLine_4f-SketchLine_8f-SketchLine_9f-SketchArc_1_2r-SketchArc_2_2f")], model.selection(), "307/2.", "307/2.")
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchLine_10f-SketchArc_1_2r-SketchLine_11f-SketchLine_4f-SketchLine_13f-SketchArc_2_2f-SketchLine_12f-SketchLine_8f-SketchLine_9f_wire")], model.selection(), "307/2.", "307/2.")
 Extrusion_1.setName("Profil")
 Extrusion_1.result().setName("Extrusion_1_1")
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12"))
 SketchLine_14 = Sketch_2.addLine(149.5, -2.3, 153.5, -2.3)
-SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"))
+SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12][Extrusion_1_1/To_Face]"))
 SketchConstraintCoincidence_24 = Sketch_2.setCoincident(SketchLine_14.endPoint(), SketchPoint_1.result())
 SketchLine_15 = Sketch_2.addLine(153.5, -2.3, 153.5, 7.7)
 SketchLine_16 = Sketch_2.addLine(153.5, 7.7, 149.5, 7.7)
@@ -150,25 +149,25 @@ SketchConstraintLength_5 = Sketch_2.setLength(SketchLine_21.result(), 10)
 SketchConstraintLength_5.setName("SketchConstraintLength_6")
 SketchConstraintDistance_2 = Sketch_2.setDistance(SketchLine_16.endPoint(), SketchLine_21.result(), 299)
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchLine_16.result(), SketchLine_20.result())
-SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"))
+SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12][Extrusion_1_1/From_Face]"))
 SketchPoint_2.setName("SketchPoint_4")
 SketchPoint_2.result().setName("SketchPoint_4")
 SketchConstraintCoincidence_34 = Sketch_2.setCoincident(SketchLine_19.startPoint(), SketchPoint_2.coordinates())
 SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_39")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_6"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
 ExtrusionCut_1.setName("Decoupe_Angle")
 ExtrusionCut_1.result().setName("ExtrusionCut_1_1")
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_2"))
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8"))
 SketchLine_22 = Sketch_3.addLine(153.5, -10.3, 153.5, -8.3)
 SketchLine_22.setName("SketchLine_29")
 SketchLine_22.result().setName("SketchLine_29")
-SketchPoint_3 = Sketch_3.addPoint(model.selection("VERTEX", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_1_1/Modfied_1&Extrusion_1_1/Generated_Face_2"))
+SketchPoint_3 = Sketch_3.addPoint(model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9][ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8]"))
 SketchPoint_3.setName("SketchPoint_5")
 SketchPoint_3.result().setName("SketchPoint_5")
 SketchConstraintCoincidence_35 = Sketch_3.setCoincident(SketchLine_22.startPoint(), SketchPoint_3.result())
 SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_40")
-SketchLine_23 = Sketch_3.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_1&Extrusion_1_1/Generated_Face_2"))
+SketchLine_23 = Sketch_3.addLine(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8]"))
 SketchLine_23.setName("SketchLine_30")
 SketchLine_23.result().setName("SketchLine_30")
 SketchConstraintCoincidence_36 = Sketch_3.setCoincident(SketchLine_22.endPoint(), SketchLine_23.result())
@@ -193,7 +192,7 @@ SketchConstraintLength_6 = Sketch_3.setLength(SketchLine_25.result(), 2)
 SketchConstraintLength_6.setName("SketchConstraintLength_8")
 SketchConstraintAngle_1 = Sketch_3.setAngleBackward(SketchLine_24.result(), SketchLine_25.result(), 45)
 SketchConstraintAngle_1.setName("SketchConstraintAngle_2")
-SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_8"))
+SketchLine_26 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_8"))
 SketchLine_26.setName("SketchLine_34")
 SketchLine_26.result().setName("SketchLine_34")
 SketchConstraintMirror_1_objects = [SketchLine_22.result(), SketchLine_25.result(), SketchLine_24.result()]
@@ -207,16 +206,16 @@ Sketch_3.result().setName("Sketch_4")
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_1_1")])
 ExtrusionCut_2.setName("Chamfrein_1")
 ExtrusionCut_2.result().setName("ExtrusionCut_2_1")
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_13"))
 SketchLine_30 = Sketch_4.addLine(-149.5, 10.3, -149.5, 8.3)
 SketchLine_30.setName("SketchLine_35")
 SketchLine_30.result().setName("SketchLine_35")
-SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_11&ExtrusionCut_1_1/Modfied_5&ExtrusionCut_1_1/Modfied_6"))
+SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_21][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_13][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_4]"))
 SketchPoint_4.setName("SketchPoint_6")
 SketchPoint_4.result().setName("SketchPoint_6")
 SketchConstraintCoincidence_42 = Sketch_4.setCoincident(SketchLine_30.startPoint(), SketchPoint_4.result())
 SketchConstraintCoincidence_42.setName("SketchConstraintCoincidence_43")
-SketchLine_31 = Sketch_4.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_11&ExtrusionCut_1_1/Modfied_5"))
+SketchLine_31 = Sketch_4.addLine(model.selection("EDGE", "[ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchLine_21][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_13]"))
 SketchLine_31.setName("SketchLine_36")
 SketchLine_31.result().setName("SketchLine_36")
 SketchConstraintCoincidence_43 = Sketch_4.setCoincident(SketchLine_30.endPoint(), SketchLine_31.result())
@@ -260,7 +259,7 @@ SketchLine_38.setName("SketchLine_43")
 SketchLine_38.result().setName("SketchLine_43")
 SketchLine_38.setAuxiliary(True)
 SketchConstraintHorizontal_10 = Sketch_4.setHorizontal(SketchLine_38.result())
-SketchProjection_1 = Sketch_4.addProjection(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_2"))
+SketchProjection_1 = Sketch_4.addProjection(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face]"), False)
 SketchLine_39 = SketchProjection_1.createdFeature()
 SketchLine_39.setName("SketchLine_44")
 SketchLine_39.result().setName("SketchLine_44")
@@ -291,15 +290,15 @@ SketchConstraintCoincidence_54.setName("SketchConstraintCoincidence_59")
 model.do()
 Sketch_4.setName("Sketch_5")
 Sketch_4.result().setName("Sketch_5")
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_5")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_7"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"))
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_5")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_11"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_12"))
 SketchLine_40 = Sketch_5.addLine(152.2999838762584, -21.04999053274691, 153.5, -21.04999053274714)
 SketchLine_40.setName("SketchLine_58")
 SketchLine_40.result().setName("SketchLine_58")
 SketchLine_41 = Sketch_5.addLine(152.2999838292651, -45.04999053274704, 153.5, -45.04999053274702)
 SketchLine_41.setName("SketchLine_57")
 SketchLine_41.result().setName("SketchLine_57")
-SketchLine_42 = Sketch_5.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"))
+SketchLine_42 = Sketch_5.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_12]"))
 SketchLine_42.setName("SketchLine_46")
 SketchLine_42.result().setName("SketchLine_46")
 SketchLine_43 = Sketch_5.addLine(150.8, -45.04999053274702, 153.5, -45.04999053274702)
@@ -385,7 +384,7 @@ SketchLine_55.result().setName("SketchLine_54")
 SketchLine_55.setAuxiliary(True)
 SketchConstraintCoincidence_66 = Sketch_5.setCoincident(SketchPoint_5.coordinates(), SketchLine_55.startPoint())
 SketchConstraintCoincidence_66.setName("SketchConstraintCoincidence_71")
-SketchLine_56 = Sketch_5.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_1_1/Modfied_9"))
+SketchLine_56 = Sketch_5.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchLine_10]"))
 SketchLine_56.setName("SketchLine_55")
 SketchLine_56.result().setName("SketchLine_55")
 SketchConstraintCoincidence_67 = Sketch_5.setCoincident(SketchLine_55.endPoint(), SketchLine_56.result())
@@ -509,8 +508,9 @@ SketchLine_68.result().setName("SketchLine_73")
 model.do()
 Sketch_5.setName("Sketch_6")
 Sketch_5.result().setName("Sketch_6")
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_6/Wire-SketchArc_9_2f-SketchArc_10_2f-SketchLine_73r-SketchLine_74r-SketchLine_75r-SketchLine_76r"), model.selection("WIRE", "Sketch_6/Wire-SketchLine_58f-SketchLine_61f-SketchLine_60f-SketchLine_51f-SketchArc_4_2f-SketchArc_5_2f"), model.selection("WIRE", "Sketch_6/Wire-SketchLine_57f-SketchLine_47f-SketchLine_62f-SketchLine_63f-SketchArc_3_2f-SketchArc_6_2f")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_3_1")])
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_4_1/Modfied_1"))
+ExtrusionCut_4_objects_1 = [model.selection("WIRE", "Sketch_6/Face-SketchArc_9_2f-SketchLine_74r-SketchArc_10_2f-SketchLine_75r-SketchLine_73r-SketchLine_76r_wire"), model.selection("WIRE", "Sketch_6/Face-SketchLine_58r-SketchLine_51f-SketchLine_60f-SketchArc_5_2f-SketchLine_61f-SketchArc_4_2f_wire"), model.selection("WIRE", "Sketch_6/Face-SketchLine_57f-SketchLine_47f-SketchLine_62f-SketchArc_6_2f-SketchLine_63f-SketchArc_3_2f_wire")]
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_4_objects_1, model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_3_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_4_1/Modified_Face&Sketch_1/SketchLine_12"))
 SketchArc_11 = Sketch_6.addArc(44.89, -23.55, 43.89, -23.55, 44.89, -22.55, False)
 SketchArc_12 = Sketch_6.addArc(44.89, -13.55, 44.89, -14.55, 43.89, -13.55, False)
 SketchArc_13 = Sketch_6.addArc(5.89, -13.55, 6.89, -13.55, 5.89, -14.55, False)
@@ -567,7 +567,7 @@ SketchLine_80 = Sketch_6.addLine(model.selection("EDGE", "PartSet/OY"))
 SketchLine_80.setName("SketchLine_85")
 SketchLine_80.result().setName("SketchLine_85")
 SketchConstraintDistance_12 = Sketch_6.setDistance(SketchLine_79.startPoint(), SketchLine_80.result(), 5.89)
-SketchLine_81 = Sketch_6.addLine(model.selection("EDGE", "Sketch_6/Edge-SketchLine_54"))
+SketchLine_81 = Sketch_6.addLine(model.selection("EDGE", "Sketch_6/SketchLine_54"))
 SketchLine_81.setName("SketchLine_86")
 SketchLine_81.result().setName("SketchLine_86")
 SketchConstraintDistance_13 = Sketch_6.setDistance(SketchLine_76.endPoint(), SketchLine_81.result(), 5.3)
@@ -845,15 +845,16 @@ SketchArc_35.results()[1].setName("SketchArc_36_2")
 model.do()
 Sketch_6.setName("Sketch_7")
 Sketch_6.result().setName("Sketch_7")
-ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchArc_20_2f-SketchArc_21_2f-SketchArc_22_2f-SketchArc_23_2f-SketchLine_91r-SketchLine_92f-SketchLine_93r-SketchLine_94f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_52_2f-SketchArc_53_2f-SketchArc_56_2f-SketchArc_57_2f-SketchLine_114r-SketchLine_115f-SketchLine_116r-SketchLine_121f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_44_2f-SketchArc_45_2f-SketchArc_48_2f-SketchArc_49_2f-SketchLine_107f-SketchLine_113f-SketchLine_117r-SketchLine_123r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_16_2f-SketchArc_17_2f-SketchArc_18_2f-SketchArc_19_2f-SketchLine_87f-SketchLine_88f-SketchLine_89r-SketchLine_90r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_11_2f-SketchArc_12_2f-SketchArc_14_2f-SketchLine_81f-SketchLine_82r-SketchLine_83f-SketchLine_84r-SketchArc_15_2f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_36_2f-SketchArc_38_2f-SketchArc_40_2f-SketchArc_41_2f-SketchLine_108r-SketchLine_119r-SketchLine_127f-SketchLine_129f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_37_2f-SketchArc_39_2f-SketchArc_42_2f-SketchArc_43_2f-SketchLine_118r-SketchLine_120f-SketchLine_122r-SketchLine_130f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_24_2f-SketchArc_25_2f-SketchArc_26_2f-SketchArc_27_2f-SketchLine_98f-SketchLine_100r-SketchLine_101f-SketchLine_103r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_30_2f-SketchArc_31_2f-SketchArc_34_2f-SketchArc_35_2f-SketchLine_95f-SketchLine_96r-SketchLine_97f-SketchLine_105r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_46_2f-SketchArc_47_2f-SketchArc_50_2f-SketchArc_51_2f-SketchLine_124f-SketchLine_125r-SketchLine_126f-SketchLine_128r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_54_2f-SketchArc_55_2f-SketchArc_58_2f-SketchArc_59_2f-SketchLine_109f-SketchLine_110r-SketchLine_111r-SketchLine_112f"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_28_2f-SketchArc_29_2f-SketchArc_32_2f-SketchArc_33_2f-SketchLine_99r-SketchLine_102f-SketchLine_104f-SketchLine_106r")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_4_1")])
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_5_1/Modfied_1"))
+ExtrusionCut_5_objects_1 = [model.selection("WIRE", "Sketch_7/Face-SketchArc_20_2f-SketchLine_93r-SketchArc_21_2f-SketchLine_91r-SketchArc_23_2f-SketchLine_94f-SketchArc_22_2f-SketchLine_92f_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_52_2f-SketchLine_116r-SketchArc_53_2f-SketchLine_115f-SketchArc_57_2f-SketchLine_121f-SketchArc_56_2f-SketchLine_114r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_44_2f-SketchLine_117r-SketchArc_45_2f-SketchLine_113f-SketchArc_49_2f-SketchLine_107f-SketchArc_48_2f-SketchLine_123r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_16_2f-SketchLine_90r-SketchArc_17_2f-SketchLine_88f-SketchArc_19_2f-SketchLine_87f-SketchArc_18_2f-SketchLine_89r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_11_2r-SketchLine_83f-SketchArc_12_2f-SketchLine_82r-SketchArc_14_2f-SketchLine_84r-SketchArc_15_2f-SketchLine_81f_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_36_2f-SketchLine_119r-SketchArc_38_2f-SketchLine_129f-SketchArc_41_2f-SketchLine_127f-SketchArc_40_2f-SketchLine_108r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_37_2f-SketchLine_130f-SketchArc_42_2f-SketchLine_122r-SketchArc_43_2f-SketchLine_118r-SketchArc_39_2f-SketchLine_120f_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_24_2f-SketchLine_103r-SketchArc_26_2f-SketchLine_98f-SketchArc_27_2f-SketchLine_101f-SketchArc_25_2f-SketchLine_100r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_30_2f-SketchLine_105r-SketchArc_34_2f-SketchLine_97f-SketchArc_35_2f-SketchLine_95f-SketchArc_31_2f-SketchLine_96r_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_46_2f-SketchLine_124f-SketchArc_50_2f-SketchLine_125r-SketchArc_51_2f-SketchLine_128r-SketchArc_47_2f-SketchLine_126f_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_54_2f-SketchLine_112f-SketchArc_58_2f-SketchLine_110r-SketchArc_59_2f-SketchLine_111r-SketchArc_55_2f-SketchLine_109f_wire"), model.selection("WIRE", "Sketch_7/Face-SketchArc_28_2f-SketchLine_102f-SketchArc_29_2f-SketchLine_104f-SketchArc_33_2f-SketchLine_99r-SketchArc_32_2f-SketchLine_106r_wire")]
+ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_5_objects_1, model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_4_1")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_5_1/Modified_Face&Sketch_1/SketchLine_12"))
 SketchLine_126 = Sketch_7.addLine(-153.5, -37.05, -152.3, -37.05)
 SketchLine_126.setName("SketchLine_135")
 SketchLine_126.result().setName("SketchLine_135")
 SketchLine_127 = Sketch_7.addLine(-150.8, -38.55, -150.8, -43.55)
 SketchLine_127.setName("SketchLine_138")
 SketchLine_127.result().setName("SketchLine_138")
-SketchPoint_10 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_6/Vertex-SketchLine_67s-SketchLine_68e-SketchLine_69e"))
+SketchPoint_10 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_6/SketchLine_67_StartVertex"))
 SketchPoint_10.setName("SketchPoint_12")
 SketchPoint_10.result().setName("SketchPoint_12")
 SketchLine_128 = Sketch_7.addLine(-150.8, -45.05, -153.5, -45.05)
@@ -888,7 +889,7 @@ SketchConstraintHorizontal_18 = Sketch_7.setHorizontal(SketchLine_128.result())
 SketchConstraintVertical_15 = Sketch_7.setVertical(SketchLine_129.result())
 SketchConstraintHorizontal_19 = Sketch_7.setHorizontal(SketchLine_132.result())
 SketchConstraintVertical_16 = Sketch_7.setVertical(SketchLine_131.result())
-SketchPoint_11 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_6/Vertex-SketchLine_70s-SketchLine_72s-SketchLine_71e"))
+SketchPoint_11 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_6/SketchLine_70_StartVertex"))
 SketchPoint_11.setName("SketchPoint_13")
 SketchPoint_11.result().setName("SketchPoint_13")
 SketchConstraintCoincidence_118 = Sketch_7.setCoincident(SketchLine_132.endPoint(), SketchPoint_11.result())
@@ -939,7 +940,7 @@ model.do()
 Sketch_7.setName("Sketch_8")
 Sketch_7.result().setName("Sketch_8")
 ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_8")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_5_1")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_6_1/Modfied_2"))
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_6_1/Modified_Face&Sketch_1/SketchLine_10"))
 SketchLine_134 = Sketch_8.addLine(0.85, 50.75, -0.85, 50.75)
 SketchLine_134.setName("SketchLine_139")
 SketchLine_134.result().setName("SketchLine_139")
@@ -1019,7 +1020,7 @@ SketchConstraintCoincidence_148.setName("SketchConstraintCoincidence_158")
 SketchConstraintCoincidence_149 = Sketch_8.setCoincident(SketchArc_62.startPoint(), SketchLine_134.endPoint())
 SketchConstraintCoincidence_149.setName("SketchConstraintCoincidence_159")
 SketchConstraintCoincidence_150 = Sketch_8.setCoincident(SketchArc_62.center(), SketchLine_137.result())
-SketchLine_140 = Sketch_8.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_6_1/Modfied_2"))
+SketchLine_140 = Sketch_8.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_1/SketchLine_1][ExtrusionCut_6_1/Modified_Face&Sketch_1/SketchLine_10]"))
 SketchLine_140.setName("SketchLine_145")
 SketchLine_140.result().setName("SketchLine_145")
 SketchConstraintDistance_18 = Sketch_8.setDistance(SketchLine_140.result(), SketchPoint_12.coordinates(), 6)
@@ -1061,7 +1062,7 @@ SketchArc_65.results()[1].setName("SketchArc_66_2")
 model.do()
 Sketch_8.setName("Sketch_9")
 Sketch_8.result().setName("Sketch_9")
-ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchLine_147f-SketchLine_148f-SketchArc_64_2f-SketchArc_65_2f"), model.selection("FACE", "Sketch_9/Face-SketchLine_139f-SketchLine_141f-SketchArc_63_2f-SketchArc_62_2f"), model.selection("FACE", "Sketch_9/Face-SketchArc_66_2f-SketchArc_67_2f-SketchLine_149r-SketchLine_150r")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_6_1")])
+ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchLine_147f-SketchArc_65_2f-SketchLine_148f-SketchArc_64_2f"), model.selection("FACE", "Sketch_9/Face-SketchLine_139r-SketchArc_62_2f-SketchLine_141f-SketchArc_63_2f"), model.selection("FACE", "Sketch_9/Face-SketchArc_66_2f-SketchLine_150r-SketchArc_67_2f-SketchLine_149r")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_6_1")])
 model.do()
 
 # Test reexecution after parameter change
index bf7d9362d22089748f75a6cce33a0715b7450e94..de12176511de77d3d0744d1a145d6fd7bdca91c6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -65,7 +64,7 @@ SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_1.result(), SketchConst
 [SketchArc_5, SketchArc_6, SketchLine_6, SketchLine_7, SketchLine_8, SketchArc_7, SketchArc_8] = SketchConstraintMirror_1.mirrored()
 SketchConstraintRadius_2 = Sketch_1.setRadius(SketchArc_2.results()[1], "dint/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchArc_2_2r-SketchArc_3_2r-SketchArc_4_2f-SketchArc_5_2r-SketchArc_6_2f-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchArc_7_2r-SketchArc_8_2f")], model.selection(), 35, 35)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_1_2f-SketchArc_3_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchArc_4_2f-SketchArc_2_2r-SketchArc_5_2r-SketchArc_6_2f-SketchLine_6r-SketchLine_7r-SketchLine_8r-SketchArc_7_2r-SketchArc_8_2f")], model.selection(), 35, 35)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchArc_9 = Sketch_2.addArc(0, 106, 0, 78, 0, 134, True)
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchArc_9.results()[1], 28)
@@ -79,7 +78,7 @@ SketchLine_11 = Sketch_2.addLine(0, 78, 0, 134)
 SketchConstraintCoincidence_16 = Sketch_2.setCoincident(SketchArc_9.startPoint(), SketchLine_11.startPoint())
 SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchArc_9.endPoint(), SketchLine_11.endPoint())
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_9_2f-SketchLine_11f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_9_2r-SketchLine_11f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ"))
 SketchLine_12 = Sketch_3.addLine(0, 106, -4, 106)
@@ -110,9 +109,9 @@ SketchLine_16.setName("SketchLine_17")
 SketchLine_16.result().setName("SketchLine_17")
 SketchConstraintCoincidence_22 = Sketch_3.setCoincident(SketchArc_10.endPoint(), SketchLine_16.result())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_12f-SketchLine_13f-SketchArc_10_2f-SketchLine_17r-SketchLine_18r")], model.selection(), "172/2", "172/2")
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_12r-SketchLine_13f-SketchArc_10_2f-SketchLine_17r-SketchLine_18r_wire")], model.selection(), "172/2", "172/2")
 Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_10"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"))
 SketchLine_18 = Sketch_4.addLine(-65, 16, -65, -16)
 SketchLine_18.setName("SketchLine_19")
 SketchLine_18.result().setName("SketchLine_19")
@@ -149,8 +148,8 @@ SketchConstraintTangent_5 = Sketch_4.setTangent(SketchLine_20.result(), SketchAr
 SketchConstraintTangent_6 = Sketch_4.setTangent(SketchLine_21.result(), SketchArc_11.results()[1])
 SketchConstraintTangent_7 = Sketch_4.setTangent(SketchArc_12.results()[1], SketchLine_20.result())
 model.do()
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Wire-SketchArc_11_2f-SketchArc_12_2f-SketchLine_21f-SketchLine_22r")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face_12"), 0)
-MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], model.selection("EDGE", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_12"), -130, 2)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Face-SketchArc_11_2f-SketchLine_21f-SketchArc_12_2f-SketchLine_22r_wire")], model.selection(), model.selection(), 0, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3"), 0)
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], model.selection("EDGE", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]"), -130, 2)
 Cut_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_2_1")], [model.selection("COMPOUND", "LinearCopy_1_1")])
 model.do()
 
index 217e25a83edf60e96a938dc7054cccacd692e710..202410366b461f5a02376a8bfaa8d2912bae0181 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -162,8 +161,8 @@ SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_83.result())
 SketchConstraintLength_9 = Sketch_3.setLength(SketchLine_84.result(), "2*R_fillet")
 SketchConstraintLength_10 = Sketch_3.setLength(SketchLine_83.result(), "2*R_fillet")
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "PartSet/Sketch_1")], model.selection("EDGE", "PartSet/Sketch_1/Edge-SketchLine_1"), 360, 0)
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1"))
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "PartSet/Sketch_1")], model.selection("EDGE", "PartSet/Sketch_1/SketchLine_1"), 360, 0)
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_8"))
 SketchPoint_4 = Sketch_4.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchLine_86 = Sketch_4.addLine(0, -13.49999999999519, 3.1, -13.49999999999519)
 SketchLine_87 = Sketch_4.addLine(model.selection("EDGE", "PartSet/OZ"))
@@ -195,7 +194,7 @@ SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchPoint_6.coordinate
 SketchConstraintCoincidence_62 = Sketch_4.setCoincident(SketchPoint_6.coordinates(), SketchLine_89.result())
 SketchConstraintDistance_6 = Sketch_4.setDistance(SketchPoint_6.coordinates(), SketchLine_86.result(), 24.5)
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face&PartSet/Sketch_1/SketchLine_3"), 0, model.selection(), 0, [model.selection("SOLID", "Revolution_1_1")])
 RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection("EDGE", "PartSet/OX"), 0, 360, [model.selection("SOLID", "ExtrusionCut_1_1")])
 ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection(), 0, 5, [model.selection("SOLID", "RevolutionCut_1_1")])
 model.do()
index c00585ba777ab899e24095e55e8ba488f3c820f0..a7e95ffdae26eba66a6f32355110f2ed155bd72a 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -131,13 +130,13 @@ SketchConstraintRadius_10 = Sketch_1.setRadius(SketchArc_16.results()[1], 6.25)
 SketchConstraintRadius_11 = Sketch_1.setRadius(SketchArc_13.results()[1], 6.25)
 SketchConstraintTangent_14 = Sketch_1.setTangent(SketchLine_6.result(), SketchArc_8.results()[1])
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_2_2r-SketchArc_3_2f-SketchArc_4_2r-SketchArc_5_2r-SketchArc_6_2r-SketchLine_3r-SketchLine_4f-SketchArc_7_2r-SketchCircle_1_2r-SketchCircle_2_2r-SketchArc_8_2f-SketchArc_9_2f-SketchArc_10_2r-SketchLine_6r-SketchArc_11_2f-SketchLine_7f-SketchArc_12_2f-SketchArc_13_2r-SketchArc_14_2f-SketchArc_15_2f-SketchArc_16_2r")], model.selection(), 0, 2)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_8_2f-SketchLine_7f-SketchArc_11_2f-SketchArc_13_2r-SketchArc_12_2f-SketchArc_14_2f-SketchArc_15_2f-SketchArc_16_2r-SketchArc_9_2f-SketchArc_10_2r-SketchLine_6r-SketchCircle_1_2r-SketchArc_3_2f-SketchArc_5_2r-SketchArc_4_2r-SketchArc_2_2r-SketchLine_3r-SketchArc_7_2r-SketchLine_4f-SketchArc_6_2r-SketchCircle_2_2r")], model.selection(), 0, 2)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
-SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_7"))
+SketchPoint_1 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchArc_7"))
 SketchArc_17 = Sketch_2.addArc(-24.92, -4.314010717669617e-016, -24.92, 7.500000000006299, -24.92, -7.500000000006299, True)
 SketchConstraintCoincidence_41 = Sketch_2.setCoincident(SketchPoint_1.result(), SketchArc_17.center())
-SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_8_2s-SketchLine_6s"))
-SketchPoint_3 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchArc_6-SketchArc_8"))
+SketchPoint_2 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchArc_8_2_StartVertex"))
+SketchPoint_3 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchArc_6"))
 SketchArc_18 = Sketch_2.addArc(-34.92, 0, -34.91999999999937, 7.500000000006299, -34.92003434105975, -7.500000000006299, False)
 SketchConstraintCoincidence_42 = Sketch_2.setCoincident(SketchPoint_3.result(), SketchArc_18.center())
 SketchConstraintCoincidence_43 = Sketch_2.setCoincident(SketchPoint_2.result(), SketchArc_18.startPoint())
@@ -151,19 +150,19 @@ SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result())
 SketchConstraintHorizontal_5 = Sketch_2.setHorizontal(SketchLine_9.result())
 SketchConstraintTangent_15 = Sketch_2.setTangent(SketchLine_8.result(), SketchArc_17.results()[1])
 SketchConstraintTangent_16 = Sketch_2.setTangent(SketchArc_17.results()[1], SketchLine_9.result())
-SketchPoint_4 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Edge-SketchCircle_2_2__cc"))
+SketchPoint_4 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchCircle_2_2__cc"))
 SketchCircle_3 = Sketch_2.addCircle(-7.5, 18.75, 8.125)
 SketchConstraintCoincidence_48 = Sketch_2.setCoincident(SketchPoint_4.result(), SketchCircle_3.center())
-SketchArc_19 = Sketch_2.addArc(model.selection("EDGE", "Sketch_1/Edge-SketchArc_9_2"))
+SketchArc_19 = Sketch_2.addArc(model.selection("EDGE", "Sketch_1/SketchArc_9_2"))
 SketchConstraintEqual_1 = Sketch_2.setEqual(SketchCircle_3.results()[1], SketchArc_19.results()[1])
-SketchPoint_5 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/Edge-SketchCircle_1_2__cc"))
+SketchPoint_5 = Sketch_2.addPoint(model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"))
 SketchCircle_4 = Sketch_2.addCircle(0, 0, 8.75)
 SketchConstraintCoincidence_49 = Sketch_2.setCoincident(SketchPoint_5.result(), SketchCircle_4.center())
 SketchConstraintRadius_12 = Sketch_2.setRadius(SketchCircle_4.results()[1], "17.5/2")
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_8"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_17_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"), model.selection("EDGE", "Sketch_2/Edge-SketchArc_18_2"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_6_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_1/Edge-SketchArc_7_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_4")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2")])
-Face_3 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchCircle_4_2"), model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchLine_8"), model.selection("EDGE", "Sketch_2/SketchArc_17_2"), model.selection("EDGE", "Sketch_2/SketchLine_9"), model.selection("EDGE", "Sketch_2/SketchArc_18_2"), model.selection("EDGE", "Sketch_1/SketchArc_6_2"), model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchArc_7_2"), model.selection("EDGE", "Sketch_1/SketchLine_4")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_3_2"), model.selection("EDGE", "Sketch_1/SketchCircle_2_2")])
+Face_3 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/SketchCircle_4_2"), model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Face_1_1"), model.selection("FACE", "Face_2_1"), model.selection("FACE", "Face_3_1")], model.selection(), 2, 0)
 Boolean_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2"), model.selection("SOLID", "Extrusion_2_3")], [])
 model.do()
index 95025acd1dc4e519f76da729a1ddf9019a66a713..95dca78ae0aff283f3d5a277f375c8a5fbc76db8 100644 (file)
@@ -1,24 +1,23 @@
 # -*- coding: utf-8 -*-
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -70,28 +69,28 @@ SketchConstraintLength_1 = Sketch_1.setLength(SketchLine_1.result(), 36)
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_5.result(), 32)
 SketchConstraintTangent_8 = Sketch_1.setTangent(SketchArc_4.results()[1], SketchLine_6.result())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_3f-SketchLine_5r-SketchLine_6r-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2f-SketchArc_4_2f")], model.selection(), 76, 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchLine_7 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_3_2f-SketchLine_3f-SketchArc_4_2f-SketchLine_6r-SketchArc_2_2f-SketchLine_5r-SketchArc_1_2f-SketchLine_1r")], model.selection(), 76, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchLine_7 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/To_Face]"))
 SketchLine_7.setName("SketchLine_8")
 SketchLine_7.result().setName("SketchLine_8")
 SketchLine_8 = Sketch_2.addLine(21, 45.99999999998655, 20.99999999998684, 0)
 SketchLine_8.setName("SketchLine_9")
 SketchLine_8.result().setName("SketchLine_9")
 SketchLine_8.setAuxiliary(True)
-SketchLine_9 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1"))
+SketchLine_9 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/To_Face]"))
 SketchLine_9.setName("SketchLine_10")
 SketchLine_9.result().setName("SketchLine_10")
 SketchConstraintCoincidence_17 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchLine_9.result())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_18")
-SketchLine_10 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/To_Face_1"))
+SketchLine_10 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"))
 SketchLine_10.setName("SketchLine_11")
 SketchLine_10.result().setName("SketchLine_11")
 SketchConstraintCoincidence_18 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_10.result())
 SketchConstraintCoincidence_18.setName("SketchConstraintCoincidence_19")
 SketchConstraintMiddle_1 = Sketch_2.setMiddlePoint(SketchLine_8.startPoint(), SketchLine_9.result())
 SketchConstraintMiddle_2 = Sketch_2.setMiddlePoint(SketchLine_8.endPoint(), SketchLine_10.result())
-SketchLine_11 = Sketch_2.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"))
+SketchLine_11 = Sketch_2.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/To_Face]"))
 SketchLine_11.setName("SketchLine_12")
 SketchLine_11.result().setName("SketchLine_12")
 SketchPoint_1 = Sketch_2.addPoint(20.99999999999342, 22.99999999999327)
@@ -128,8 +127,8 @@ SketchConstraintMiddle_4 = Sketch_2.setMiddlePoint(SketchLine_12.endPoint(), Ske
 SketchConstraintRadius_3 = Sketch_2.setRadius(SketchCircle_2.results()[1], 2.5)
 SketchConstraintDistance_3 = Sketch_2.setDistance(SketchLine_12.result(), SketchCircle_4.center(), 8)
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_2_2r"), model.selection("WIRE", "Sketch_2/Wire-SketchCircle_3_2f")], model.selection(), 0, 15, [model.selection("SOLID", "Extrusion_1_1")])
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Extrusion_1_1/From_Face_1"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2f-SketchCircle_2_2r-SketchCircle_3_2r-SketchCircle_4_2r_wire_2"), model.selection("WIRE", "Sketch_2/Face-SketchCircle_3_2f_wire")], model.selection(), 0, 15, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Extrusion_1_1/From_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
 Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
 SketchCircle_5 = Sketch_3.addCircle(20.99999999999342, 22.99999999999327, 19)
 SketchConstraintRadius_4 = Sketch_3.setRadius(SketchCircle_5.results()[1], 19)
@@ -137,12 +136,12 @@ SketchLine_13 = Sketch_3.addLine(41.99999999999999, 22.99999999998655, 0, 22.999
 SketchLine_13.setName("SketchLine_14")
 SketchLine_13.result().setName("SketchLine_14")
 SketchLine_13.setAuxiliary(True)
-SketchLine_14 = Sketch_3.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&Extrusion_1_1/Generated_Face_5"))
+SketchLine_14 = Sketch_3.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"))
 SketchLine_14.setName("SketchLine_15")
 SketchLine_14.result().setName("SketchLine_15")
 SketchConstraintCoincidence_26 = Sketch_3.setCoincident(SketchLine_13.startPoint(), SketchLine_14.result())
 SketchConstraintCoincidence_26.setName("SketchConstraintCoincidence_27")
-SketchLine_15 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_2_1/Modfied_2"))
+SketchLine_15 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face]"))
 SketchLine_15.setName("SketchLine_16")
 SketchLine_15.result().setName("SketchLine_16")
 SketchConstraintCoincidence_27 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_15.result())
@@ -151,12 +150,12 @@ SketchLine_16 = Sketch_3.addLine(21, 45.99999999998655, 20.99999999998684, 0)
 SketchLine_16.setName("SketchLine_17")
 SketchLine_16.result().setName("SketchLine_17")
 SketchLine_16.setAuxiliary(True)
-SketchLine_17 = Sketch_3.addLine(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&Extrusion_1_1/Generated_Face_3"))
+SketchLine_17 = Sketch_3.addLine(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"))
 SketchLine_17.setName("SketchLine_18")
 SketchLine_17.result().setName("SketchLine_18")
 SketchConstraintCoincidence_28 = Sketch_3.setCoincident(SketchLine_16.startPoint(), SketchLine_17.result())
 SketchConstraintCoincidence_28.setName("SketchConstraintCoincidence_29")
-SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_3"))
+SketchLine_18 = Sketch_3.addLine(model.selection("EDGE", "Sketch_1/SketchLine_3"))
 SketchLine_18.setName("SketchLine_19")
 SketchLine_18.result().setName("SketchLine_19")
 SketchConstraintCoincidence_29 = Sketch_3.setCoincident(SketchLine_16.endPoint(), SketchLine_18.result())
@@ -182,26 +181,26 @@ SketchConstraintRadius_5 = Sketch_3.setRadius(SketchCircle_7.results()[1], 2.5)
 SketchConstraintDistance_4 = Sketch_3.setDistance(SketchCircle_6.center(), SketchCircle_7.center(), 16)
 SketchConstraintDistance_5 = Sketch_3.setDistance(SketchCircle_6.center(), SketchLine_16.result(), 8)
 model.do()
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_5_2f-SketchCircle_6_2r-SketchCircle_7_2r")], model.selection(), 15, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_5_2r-SketchCircle_7_2r-SketchCircle_6_2r")], model.selection(), 15, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
 ExtrusionCut_3.result().setName("ExtrusionCut_3_1")
-Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"))
-SketchProjection_1 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&Extrusion_1_1/Generated_Face_2"))
+Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"))
+SketchProjection_1 = Sketch_4.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2]"), False)
 SketchLine_19 = SketchProjection_1.createdFeature()
 SketchLine_19.setName("SketchLine_20")
 SketchLine_19.result().setName("SketchLine_20")
-SketchProjection_2 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4"))
+SketchProjection_2 = Sketch_4.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"), False)
 SketchLine_20 = SketchProjection_2.createdFeature()
 SketchLine_20.setName("SketchLine_21")
 SketchLine_20.result().setName("SketchLine_21")
 SketchLine_21 = Sketch_4.addLine(4.999999999999999, -28, 37, -28)
 SketchLine_21.setName("SketchLine_22")
 SketchLine_21.result().setName("SketchLine_22")
-SketchLine_22 = Sketch_4.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_3"))
+SketchLine_22 = Sketch_4.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5]"))
 SketchLine_22.setName("SketchLine_23")
 SketchLine_22.result().setName("SketchLine_23")
 SketchConstraintCoincidence_34 = Sketch_4.setCoincident(SketchLine_21.startPoint(), SketchLine_22.result())
 SketchConstraintCoincidence_34.setName("SketchConstraintCoincidence_35")
-SketchLine_23 = Sketch_4.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"))
+SketchLine_23 = Sketch_4.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_2_2]"))
 SketchLine_23.setName("SketchLine_24")
 SketchLine_23.result().setName("SketchLine_24")
 SketchConstraintCoincidence_35 = Sketch_4.setCoincident(SketchLine_21.endPoint(), SketchLine_23.result())
@@ -266,8 +265,8 @@ SketchConstraintMiddle_10 = Sketch_4.setMiddlePoint(SketchLine_27.endPoint(), Sk
 SketchConstraintMiddle_11 = Sketch_4.setMiddlePoint(SketchLine_27.startPoint(), SketchLine_19.result())
 SketchConstraintMiddle_12 = Sketch_4.setMiddlePoint(SketchLine_25.result(), SketchLine_27.startPoint())
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_22r-SketchLine_25f-SketchLine_26f-SketchLine_27r-SketchArc_5_2f-SketchArc_6_2f-SketchArc_7_2f-SketchArc_8_2f")], model.selection(), 2, 17)
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face_1"))
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_5_2f-SketchLine_26f-SketchArc_6_2f-SketchLine_25f-SketchArc_8_2f-SketchLine_27r-SketchArc_7_2f-SketchLine_22r")], model.selection(), 2, 17)
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/To_Face"))
 SketchLine_28 = Sketch_5.addLine(5.000000000000001, -46, 37.00000000000001, -46)
 SketchLine_28.setName("SketchLine_29")
 SketchLine_28.result().setName("SketchLine_29")
@@ -286,19 +285,19 @@ SketchConstraintVertical_2 = Sketch_5.setVertical(SketchLine_30.result())
 SketchConstraintVertical_3 = Sketch_5.setVertical(SketchLine_31.result())
 SketchConstraintEqual_8 = Sketch_5.setEqual(SketchLine_29.result(), SketchLine_28.result())
 SketchConstraintEqual_9 = Sketch_5.setEqual(SketchLine_31.result(), SketchLine_30.result())
-SketchLine_32 = Sketch_5.addLine(model.selection("EDGE", "Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_1"))
+SketchLine_32 = Sketch_5.addLine(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_4/SketchLine_26][Extrusion_2_1/To_Face]"))
 SketchLine_32.setName("SketchLine_33")
 SketchLine_32.result().setName("SketchLine_33")
 SketchConstraintDistance_7 = Sketch_5.setDistance(SketchLine_30.endPoint(), SketchLine_32.result(), 2)
-SketchLine_33 = Sketch_5.addLine(model.selection("EDGE", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/To_Face_1"))
+SketchLine_33 = Sketch_5.addLine(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_4/SketchLine_27][Extrusion_2_1/To_Face]"))
 SketchLine_33.setName("SketchLine_34")
 SketchLine_33.result().setName("SketchLine_34")
 SketchConstraintDistance_8 = Sketch_5.setDistance(SketchLine_31.startPoint(), SketchLine_33.result(), 2)
-SketchLine_34 = Sketch_5.addLine(model.selection("EDGE", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_1"))
+SketchLine_34 = Sketch_5.addLine(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_4/SketchLine_22][Extrusion_2_1/To_Face]"))
 SketchLine_34.setName("SketchLine_35")
 SketchLine_34.result().setName("SketchLine_35")
 SketchConstraintDistance_9 = Sketch_5.setDistance(SketchLine_29.startPoint(), SketchLine_34.result(), 2)
-SketchLine_35 = Sketch_5.addLine(model.selection("EDGE", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/To_Face_1"))
+SketchLine_35 = Sketch_5.addLine(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_4/SketchLine_25][Extrusion_2_1/To_Face]"))
 SketchLine_35.setName("SketchLine_36")
 SketchLine_35.result().setName("SketchLine_36")
 SketchConstraintDistance_10 = Sketch_5.setDistance(SketchLine_28.startPoint(), SketchLine_35.result(), 2)
@@ -363,7 +362,7 @@ SketchConstraintMiddle_15 = Sketch_5.setMiddlePoint(SketchLine_37.startPoint(),
 SketchConstraintMiddle_16 = Sketch_5.setMiddlePoint(SketchLine_37.endPoint(), SketchLine_35.result())
 SketchConstraintDistance_12 = Sketch_5.setDistance(SketchCircle_8.center(), SketchLine_37.result(), 8)
 model.do()
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_5/Wire-SketchLine_29f-SketchLine_30r-SketchLine_31r-SketchLine_32r-SketchArc_9_2f-SketchArc_10_2f-SketchArc_11_2f-SketchArc_12_2f")], model.selection(), 0, 15, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "ExtrusionCut_3_1")])
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_5/Face-SketchLine_29r-SketchArc_12_2f-SketchLine_32r-SketchArc_11_2f-SketchLine_30r-SketchArc_9_2f-SketchLine_31r-SketchArc_10_2f-SketchCircle_9_2r-SketchCircle_8_2r_wire")], model.selection(), 0, 15, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "ExtrusionCut_3_1")])
 ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchCircle_8_2f"), model.selection("FACE", "Sketch_5/Face-SketchCircle_9_2f")], model.selection(), 0, 20, [model.selection("SOLID", "ExtrusionCut_4_1"), model.selection("SOLID", "ExtrusionCut_4_2")])
 Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "PartSet/YOZ"))
 SketchLine_38 = Sketch_6.addLine(-59, 44, -59, 2)
@@ -420,33 +419,33 @@ SketchConstraintLength_3 = Sketch_6.setLength(SketchLine_38.result(), 42)
 SketchConstraintLength_4 = Sketch_6.setLength(SketchLine_43.result(), 20)
 SketchConstraintLength_5 = Sketch_6.setLength(SketchLine_44.result(), 15)
 SketchConstraintLength_6 = Sketch_6.setLength(SketchLine_39.result(), 42)
-SketchProjection_3 = Sketch_6.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"))
+SketchProjection_3 = Sketch_6.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2]"), False)
 SketchLine_46 = SketchProjection_3.createdFeature()
 SketchLine_46.setName("SketchLine_47")
 SketchLine_46.result().setName("SketchLine_47")
-SketchProjection_4 = Sketch_6.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_1_1/Modfied_1"))
+SketchProjection_4 = Sketch_6.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_1_1/Generated_Face&Sketch_2/SketchCircle_1_2)_ExtrusionCut_5_2]"), False)
 SketchLine_47 = SketchProjection_4.createdFeature()
 SketchLine_47.setName("SketchLine_48")
 SketchLine_47.result().setName("SketchLine_48")
-SketchProjection_5 = Sketch_6.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"))
+SketchProjection_5 = Sketch_6.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2]"), False)
 SketchLine_48 = SketchProjection_5.createdFeature()
 SketchLine_48.setName("SketchLine_49")
 SketchLine_48.result().setName("SketchLine_49")
 SketchConstraintDistance_13 = Sketch_6.setDistance(SketchLine_38.endPoint(), SketchLine_46.result(), 2)
 SketchConstraintDistance_14 = Sketch_6.setDistance(SketchLine_38.startPoint(), SketchLine_47.result(), 17)
 model.do()
-ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_5"), -2, model.selection(), -2, [model.selection("SOLID", "ExtrusionCut_5_2")])
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"))
+ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_6")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"), -2, model.selection(), -2, [model.selection("SOLID", "ExtrusionCut_5_2")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"))
 SketchLine_49 = Sketch_7.addLine(0, -22.99999999998656, -76, -22.99999999998655)
 SketchLine_49.setName("SketchLine_50")
 SketchLine_49.result().setName("SketchLine_50")
 SketchLine_49.setAuxiliary(True)
-SketchLine_50 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_3_1/Modfied_2"))
+SketchLine_50 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_3_1/Generated_Face&Sketch_3/SketchCircle_5_2)_ExtrusionCut_6_1]"))
 SketchLine_50.setName("SketchLine_51")
 SketchLine_50.result().setName("SketchLine_51")
 SketchConstraintCoincidence_74 = Sketch_7.setCoincident(SketchLine_49.startPoint(), SketchLine_50.result())
 SketchConstraintCoincidence_74.setName("SketchConstraintCoincidence_75")
-SketchPoint_3 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_13s"))
+SketchPoint_3 = Sketch_7.addPoint(model.selection("VERTEX", "Sketch_2/SketchLine_13_StartVertex"))
 SketchConstraintCoincidence_75 = Sketch_7.setCoincident(SketchLine_49.endPoint(), SketchPoint_3.result())
 SketchConstraintCoincidence_75.setName("SketchConstraintCoincidence_76")
 SketchConstraintMiddle_17 = Sketch_7.setMiddlePoint(SketchLine_49.startPoint(), SketchLine_50.result())
@@ -454,12 +453,12 @@ SketchLine_51 = Sketch_7.addLine(-38, -40.99999999998656, -38, -4.99999999998656
 SketchLine_51.setName("SketchLine_52")
 SketchLine_51.result().setName("SketchLine_52")
 SketchLine_51.setAuxiliary(True)
-SketchLine_52 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_4_2/Modfied_3"))
+SketchLine_52 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2]"))
 SketchLine_52.setName("SketchLine_53")
 SketchLine_52.result().setName("SketchLine_53")
 SketchConstraintCoincidence_76 = Sketch_7.setCoincident(SketchLine_51.startPoint(), SketchLine_52.result())
 SketchConstraintCoincidence_76.setName("SketchConstraintCoincidence_77")
-SketchLine_53 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_1"))
+SketchLine_53 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"))
 SketchLine_53.setName("SketchLine_54")
 SketchLine_53.result().setName("SketchLine_54")
 SketchConstraintCoincidence_77 = Sketch_7.setCoincident(SketchLine_51.endPoint(), SketchLine_53.result())
@@ -475,13 +474,13 @@ SketchConstraintCoincidence_79 = Sketch_7.setCoincident(SketchPoint_4.coordinate
 SketchConstraintCoincidence_79.setName("SketchConstraintCoincidence_80")
 SketchConstraintRadius_8 = Sketch_7.setRadius(SketchCircle_10.results()[1], 17)
 model.do()
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchCircle_10_2f")], model.selection(), 16, 0)
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_3_1/To_Face_1"))
-SketchProjection_6 = Sketch_8.addProjection(model.selection("EDGE", "Sketch_2/Edge-SketchLine_9"))
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_7/Face-SketchCircle_10_2f_wire")], model.selection(), 16, 0)
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_3_1/To_Face"))
+SketchProjection_6 = Sketch_8.addProjection(model.selection("EDGE", "Sketch_2/SketchLine_9"), False)
 SketchLine_54 = SketchProjection_6.createdFeature()
 SketchLine_54.setName("SketchLine_55")
 SketchLine_54.result().setName("SketchLine_55")
-SketchProjection_7 = Sketch_8.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_3_1/Modfied_2"))
+SketchProjection_7 = Sketch_8.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_3_1/Generated_Face&Sketch_3/SketchCircle_5_2)_ExtrusionCut_6_1]"), False)
 SketchLine_55 = SketchProjection_7.createdFeature()
 SketchLine_55.setName("SketchLine_56")
 SketchLine_55.result().setName("SketchLine_56")
@@ -506,11 +505,11 @@ SketchConstraintMiddle_23 = Sketch_8.setMiddlePoint(SketchLine_56.result(), Sket
 SketchConstraintCoincidence_83 = Sketch_8.setCoincident(SketchLine_57.result(), SketchPoint_5.coordinates())
 SketchConstraintCoincidence_83.setName("SketchConstraintCoincidence_84")
 SketchConstraintPerpendicular_1 = Sketch_8.setPerpendicular(SketchLine_57.result(), SketchLine_56.result())
-SketchProjection_8 = Sketch_8.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_1&ExtrusionCut_4_2/Modfied_3"))
+SketchProjection_8 = Sketch_8.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2]"), False)
 SketchLine_58 = SketchProjection_8.createdFeature()
 SketchLine_58.setName("SketchLine_59")
 SketchLine_58.result().setName("SketchLine_59")
-SketchProjection_9 = Sketch_8.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/Generated_Face_1"))
+SketchProjection_9 = Sketch_8.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"), False)
 SketchLine_59 = SketchProjection_9.createdFeature()
 SketchLine_59.setName("SketchLine_60")
 SketchLine_59.result().setName("SketchLine_60")
@@ -530,7 +529,7 @@ SketchConstraintDistance_15 = Sketch_8.setDistance(SketchCircle_11.center(), Ske
 SketchConstraintDistance_16 = Sketch_8.setDistance(SketchCircle_11.center(), SketchCircle_12.center(), 16)
 model.do()
 Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchCircle_11_2f"), model.selection("FACE", "Sketch_8/Face-SketchCircle_12_2f")], model.selection(), 17, 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), 38, True)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_3_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_1_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2)(Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6)(ExtrusionCut_4_2/Modified_Face&Sketch_1/SketchArc_2_2)(ExtrusionCut_3_1/Generated_Face&Sketch_3/SketchCircle_5_2)_ExtrusionCut_6_1"), 38, True)
 Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchLine_60 = Sketch_9.addLine(-14, -36.99999999998992, 0, -36.99999999998992)
 SketchLine_60.setName("SketchLine_61")
@@ -562,19 +561,19 @@ SketchLine_64 = Sketch_9.addLine(-5.662490896925754, -22.99999999998992, -60.521
 SketchLine_64.setName("SketchLine_65")
 SketchLine_64.result().setName("SketchLine_65")
 SketchLine_64.setAuxiliary(True)
-SketchPoint_6 = Sketch_9.addPoint(model.selection("VERTEX", "Sketch_8/Vertex-SketchPoint_5"))
+SketchPoint_6 = Sketch_9.addPoint(model.selection("VERTEX", "Sketch_8/SketchPoint_5"))
 SketchConstraintCoincidence_92 = Sketch_9.setCoincident(SketchLine_64.result(), SketchPoint_6.coordinates())
 SketchConstraintCoincidence_92.setName("SketchConstraintCoincidence_93")
 SketchConstraintHorizontal_13 = Sketch_9.setHorizontal(SketchLine_64.result())
 SketchConstraintCoincidence_93 = Sketch_9.setCoincident(SketchLine_62.startPoint(), SketchLine_64.result())
 SketchConstraintCoincidence_93.setName("SketchConstraintCoincidence_94")
-SketchLine_65 = Sketch_9.addLine(model.selection("EDGE", "Sketch_7/Edge-SketchLine_52"))
+SketchLine_65 = Sketch_9.addLine(model.selection("EDGE", "Sketch_7/SketchLine_52"))
 SketchLine_65.setName("SketchLine_66")
 SketchLine_65.result().setName("SketchLine_66")
 SketchConstraintCoincidence_94 = Sketch_9.setCoincident(SketchLine_60.endPoint(), SketchLine_65.result())
 SketchConstraintCoincidence_94.setName("SketchConstraintCoincidence_95")
 model.do()
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection("EDGE", "Sketch_9/Edge-SketchLine_65"), 360, 0, [model.selection("SOLID", "Extrusion_3_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("COMPOUND", "Sketch_9")], model.selection("EDGE", "Sketch_9/SketchLine_65"), 360, 0, [model.selection("SOLID", "Extrusion_3_1")])
 model.do()
 
 from GeomAPI import  GeomAPI_Shape
index 99e22b96c4a2ac7fe205f2acc76e588c865d8b50..647f89dad48f521d928a9bae0dfae84518f1c665 100644 (file)
@@ -1,24 +1,23 @@
 # -*- coding: utf-8 -*-
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 
@@ -147,12 +146,12 @@ SketchConstraintDistance_5 = Sketch_1.setDistance(SketchArc_2.center(), SketchAr
 SketchConstraintDistance_6 = Sketch_1.setDistance(SketchLine_1.result(), SketchArc_6.endPoint(), "(h4-d_diff)*coeff")
 SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_10.result(), "d1*coeff")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchLine_1f-SketchArc_1_2f-SketchLine_3f-SketchArc_2_2r-SketchLine_4f-SketchArc_3_2r-SketchLine_5f-SketchArc_4_2f-SketchLine_6f-SketchLine_7r-SketchLine_8r-SketchArc_5_2r-SketchLine_9r-SketchArc_6_2f-SketchLine_10r-SketchArc_7_2f-SketchLine_11r-SketchArc_8_2r-SketchLine_12r-SketchLine_13r")], model.selection(), "epaisseur_plat*coeff", 0)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), "d2*coeff", True)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchLine_1r-SketchArc_1_2f-SketchLine_3f-SketchArc_2_2r-SketchLine_4f-SketchArc_3_2r-SketchLine_5f-SketchArc_4_2f-SketchLine_6f-SketchLine_13r-SketchLine_12r-SketchArc_8_2r-SketchLine_11r-SketchArc_7_2f-SketchLine_10r-SketchArc_6_2f-SketchLine_9r-SketchArc_5_2r-SketchLine_8r-SketchLine_7r_wire")], model.selection(), "epaisseur_plat*coeff", 0)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7"), "d2*coeff", True)
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_7&Extrusion_1_1/Generated_Face_6"), False)
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_7_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10]"), False)
 SketchLine_14 = SketchProjection_1.createdFeature()
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_8&Extrusion_1_1/To_Face_1"), False)
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_11][Extrusion_1_1/To_Face]"), False)
 SketchLine_15 = SketchProjection_2.createdFeature()
 SketchLine_16 = Sketch_2.addLine(-24.99999999999999, -35.00000000000001, -31.24999999999999, -35.00000000000001)
 SketchConstraintCoincidence_25 = Sketch_2.setCoincident(SketchAPI_Line(SketchLine_14).endPoint(), SketchLine_16.startPoint())
@@ -208,10 +207,10 @@ SketchConstraintEqual_10 = Sketch_2.setEqual(SketchArc_11.results()[1], SketchAr
 SketchConstraintRadius_4 = Sketch_2.setRadius(SketchArc_12.results()[1], "r3*coeff")
 SketchConstraintDistance_13 = Sketch_2.setDistance(SketchArc_10.startPoint(), SketchLine_19.result(), "d8*coeff")
 model.do()
-Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_16r-SketchArc_9_2f-SketchLine_17r-SketchArc_10_2f-SketchLine_18r-SketchLine_19r-SketchLine_20r-SketchArc_11_2r-SketchLine_21r-SketchArc_12_2r-SketchLine_22r-SketchLine_23f")], model.selection(), "d6*coeff", 0)
-Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/Generated_Face_3"))
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchLine_23f-SketchLine_22r-SketchArc_12_2r-SketchLine_21r-SketchArc_11_2r-SketchLine_20r-SketchLine_19r-SketchLine_18r-SketchArc_10_2f-SketchLine_17r-SketchArc_9_2f-SketchLine_16r_wire")], model.selection(), "d6*coeff", 0)
+Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_17"))
 SketchLine_24 = Sketch_3.addLine(46.25, 22.91561885925604, 51.3, 20.00000000000001)
-SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/To_Face_1"))
+SketchLine_25 = Sketch_3.addLine(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_17][Extrusion_2_1/To_Face]"))
 SketchLine_26 = Sketch_3.addLine(51.3, 20.00000000000001, 62.50000000000001, 20.00000000000001)
 SketchConstraintCoincidence_42 = Sketch_3.setCoincident(SketchLine_24.endPoint(), SketchLine_26.startPoint())
 SketchLine_27 = Sketch_3.addLine(62.50000000000001, 20.00000000000001, 62.5, -4.999999999999999)
@@ -238,9 +237,9 @@ SketchConstraintVertical_12 = Sketch_3.setVertical(SketchLine_27.result())
 SketchConstraintVertical_13 = Sketch_3.setVertical(SketchLine_33.result())
 SketchConstraintVertical_14 = Sketch_3.setVertical(SketchLine_31.result())
 SketchConstraintAngle_1 = Sketch_3.setAngleComplementary(SketchLine_26.result(), SketchLine_24.result(), "angle")
-SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_4"))
+SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_18][Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_10_2]"), False)
 SketchLine_34 = SketchProjection_3.createdFeature()
-SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_1"))
+SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_9_2][Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_16]"), False)
 SketchLine_35 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_51 = Sketch_3.setCoincident(SketchLine_28.endPoint(), SketchLine_34.result())
 SketchConstraintDistance_15 = Sketch_3.setDistance(SketchLine_31.result(), SketchLine_33.endPoint(), "(d6-d5)*coeff")
@@ -252,15 +251,15 @@ SketchConstraintCoincidence_54 = Sketch_3.setCoincident(SketchLine_29.endPoint()
 SketchConstraintDistance_17 = Sketch_3.setDistance(SketchLine_26.result(), SketchAPI_Line(SketchLine_35).startPoint(), "h2*coeff")
 SketchConstraintLength_4 = Sketch_3.setLength(SketchLine_26.result(), "d7*coeff")
 model.do()
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_24r-SketchLine_26r-SketchLine_27r-SketchLine_28r-SketchLine_29r")], model.selection(), model.selection("FACE", "Extrusion_2_1/Generated_Face_6"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_2_1")])
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_30r-SketchLine_31r-SketchLine_32r-SketchLine_33r")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face_1"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
-Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), "d3*coeff", True)
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_29r-SketchLine_28r-SketchLine_27r-SketchLine_26r-SketchLine_24r")], model.selection(), model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchLine_19"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_2_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_33r-SketchLine_32r-SketchLine_31r-SketchLine_30r")], model.selection(), model.selection("FACE", "Extrusion_1_1/To_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7"), "d3*coeff", True)
 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
-SketchProjection_5 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"))
+SketchProjection_5 = Sketch_4.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_9][Extrusion_1_1/To_Face]"), False)
 SketchLine_36 = SketchProjection_5.createdFeature()
-SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "ExtrusionCut_2_1/Modfied_8&ExtrusionCut_2_1/Modfied_9"))
+SketchProjection_6 = Sketch_4.addProjection(model.selection("EDGE", "[ExtrusionCut_2_1/Modified_Face&Sketch_2/SketchLine_23][ExtrusionCut_2_1/Generated_Face&Sketch_3/SketchLine_31]"), False)
 SketchLine_37 = SketchProjection_6.createdFeature()
-SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5"))
+SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_6_2]"), False)
 SketchLine_38 = SketchProjection_7.createdFeature()
 SketchLine_39 = Sketch_4.addLine(-25, -35.00000000000001, -31.24999999999999, -35.00000000000001)
 SketchConstraintCoincidence_55 = Sketch_4.setCoincident(SketchAPI_Line(SketchLine_37).startPoint(), SketchLine_39.startPoint())
@@ -295,39 +294,39 @@ SketchConstraintRadius_6 = Sketch_4.setRadius(SketchArc_14.results()[1], "r3*coe
 SketchConstraintDistance_19 = Sketch_4.setDistance(SketchLine_41.endPoint(), SketchLine_40.result(), "epaisseur*coeff")
 SketchConstraintDistance_20 = Sketch_4.setDistance(SketchLine_41.startPoint(), SketchLine_39.result(), "h2")
 model.do()
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Wire-SketchLine_39r-SketchArc_13_2f-SketchLine_40r-SketchLine_41r-SketchLine_42r-SketchArc_14_2r-SketchLine_43r-SketchLine_44f")], model.selection(), 0, "e1*coeff")
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"))
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Face-SketchLine_44f-SketchLine_43r-SketchArc_14_2r-SketchLine_42r-SketchLine_41r-SketchLine_40r-SketchArc_13_2f-SketchLine_39r_wire")], model.selection(), 0, "e1*coeff")
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchLine_18"))
 SketchCircle_1 = Sketch_5.addCircle(70, 17.5, 3.125)
-SketchLine_45 = Sketch_5.addLine(model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&ExtrusionCut_1_1/Modfied_4"))
+SketchLine_45 = Sketch_5.addLine(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchLine_19][ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchLine_18]"))
 SketchConstraintDistance_21 = Sketch_5.setDistance(SketchCircle_1.center(), SketchLine_45.result(), "d9*coeff")
-SketchProjection_8 = Sketch_5.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_12&Extrusion_1_1/Generated_Face_11"))
+SketchProjection_8 = Sketch_5.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_13]"))
 SketchLine_46 = SketchProjection_8.createdFeature()
-SketchProjection_9 = Sketch_5.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_20&Extrusion_1_1/Generated_Face_1"))
+SketchProjection_9 = Sketch_5.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7]"), False)
 SketchLine_47 = SketchProjection_9.createdFeature()
 SketchConstraintDistance_22 = Sketch_5.setDistance(SketchCircle_1.center(), SketchLine_47.result(), "d1*coeff")
 SketchConstraintRadius_7 = Sketch_5.setRadius(SketchCircle_1.results()[1], "r_trou")
 model.do()
-ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchCircle_1_2f")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
-Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_6"))
+ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchCircle_1_2r")], model.selection(), model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Sketch_2/SketchLine_20"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+Sketch_6 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10"))
 SketchCircle_2 = Sketch_6.addCircle(70, -17.5, 5)
-SketchLine_48 = Sketch_6.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/To_Face_1"))
-SketchProjection_10 = Sketch_6.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"))
+SketchLine_48 = Sketch_6.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10][Extrusion_1_1/To_Face]"))
+SketchProjection_10 = Sketch_6.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_8][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7]"), False)
 SketchLine_49 = SketchProjection_10.createdFeature()
 SketchConstraintDistance_23 = Sketch_6.setDistance(SketchCircle_2.center(), SketchLine_49.result(), "d1*coeff")
 SketchConstraintDistance_23.setName("SketchConstraintDistance_24")
 SketchConstraintRadius_8 = Sketch_6.setRadius(SketchCircle_2.results()[1], "r_trou2")
-SketchLine_50 = Sketch_6.addLine(model.selection("EDGE", "Sketch_1/Edge-SketchLine_10"))
+SketchLine_50 = Sketch_6.addLine(model.selection("EDGE", "Sketch_1/SketchLine_10"))
 SketchConstraintDistance_24 = Sketch_6.setDistance(SketchCircle_2.center(), SketchLine_50.result(), "d_trou")
 SketchConstraintDistance_24.setName("SketchConstraintDistance_25")
 model.do()
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchCircle_2_2f")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_16"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_12"))
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchCircle_2_2r")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"))
 SketchLine_51 = Sketch_7.addLine(110, 21.46600893000899, 110, 7.22841614740048)
 SketchLine_51.setAuxiliary(True)
-SketchLine_52 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_12&Extrusion_1_1/Generated_Face_11"))
+SketchLine_52 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_13]"))
 SketchConstraintCoincidence_65 = Sketch_7.setCoincident(SketchLine_51.startPoint(), SketchLine_52.result())
 SketchConstraintCoincidence_66 = Sketch_7.setCoincident(SketchLine_51.endPoint(), SketchLine_52.result())
-SketchLine_53 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_12"))
+SketchLine_53 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"))
 SketchArc_15 = Sketch_7.addArc(102.5, 7.22841614740048, 110, 7.22841614740048, 104.5, 0, True)
 SketchConstraintCoincidence_67 = Sketch_7.setCoincident(SketchLine_51.endPoint(), SketchArc_15.startPoint())
 SketchConstraintTangent_29 = Sketch_7.setTangent(SketchLine_51.result(), SketchArc_15.results()[1])
@@ -344,11 +343,11 @@ SketchConstraintLength_5 = Sketch_7.setLength(SketchLine_54.result(), "5.5*coeff
 SketchLine_56 = Sketch_7.addLine(110, 12.5, 0, 12.5)
 SketchLine_56.setAuxiliary(True)
 SketchConstraintCoincidence_73 = Sketch_7.setCoincident(SketchLine_56.startPoint(), SketchLine_52.result())
-SketchLine_57 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_20&Extrusion_1_1/Generated_Face_1"))
+SketchLine_57 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_7]"))
 SketchConstraintCoincidence_74 = Sketch_7.setCoincident(SketchLine_56.endPoint(), SketchLine_57.result())
 SketchConstraintMiddle_1 = Sketch_7.setMiddlePoint(SketchLine_56.endPoint(), SketchLine_57.result())
 SketchConstraintMiddle_2 = Sketch_7.setMiddlePoint(SketchLine_56.startPoint(), SketchLine_52.result())
-SketchProjection_11 = Sketch_7.addProjection(model.selection("EDGE", "Extrusion_1_1/To_Face_1&ExtrusionCut_4_1/Modfied_2"))
+SketchProjection_11 = Sketch_7.addProjection(model.selection("EDGE", "[Extrusion_1_1/To_Face][ExtrusionCut_4_1/Modified_Face&Sketch_1/SketchLine_4]"), False)
 SketchLine_58 = SketchProjection_11.createdFeature()
 SketchLine_59 = Sketch_7.addLine(55.00000000000002, 0, 55.00000000000002, 25)
 SketchLine_59.setAuxiliary(True)
@@ -364,7 +363,7 @@ SketchConstraintMirror_2_objects = [SketchArc_15.results()[1], SketchLine_55.res
 SketchConstraintMirror_2 = Sketch_7.addMirror(SketchLine_59.result(), SketchConstraintMirror_2_objects)
 [SketchArc_17, SketchLine_63, SketchLine_64, SketchArc_18, SketchLine_65, SketchLine_66] = SketchConstraintMirror_2.mirrored()
 model.do()
-ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchArc_16_2r-SketchLine_61f-SketchLine_62r"), model.selection("FACE", "Sketch_7/Face-SketchArc_18_2r-SketchLine_65f-SketchLine_66r"), model.selection("FACE", "Sketch_7/Face-SketchArc_17_2r-SketchLine_64r-SketchLine_66r"), model.selection("WIRE", "Sketch_7/Wire-SketchArc_15_2r-SketchLine_54f-SketchLine_55r")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_10"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
+ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_7/Face-SketchLine_61f-SketchLine_62r-SketchArc_16_2r_wire"), model.selection("FACE", "Sketch_7/Face-SketchLine_65f-SketchLine_66r-SketchArc_18_2r"), model.selection("FACE", "Sketch_7/Face-SketchLine_63f-SketchLine_64r-SketchArc_17_2r"), model.selection("WIRE", "Sketch_7/Face-SketchLine_54f-SketchLine_55r-SketchArc_15_2r_wire")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_12"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_4_1")])
 Boolean_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_5_1")], [model.selection("SOLID", "Extrusion_3_1"), model.selection("SOLID", "ExtrusionCut_3_1")])
 model.do()
 
index 05c3b5107c30ed51b01caa00932b50a4d658ed83..8b748499879edb84ae498200c2a5280b64c5ee73 100644 (file)
@@ -1,24 +1,23 @@
 # -*- coding: utf-8 -*-
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from GeomAPI import *
 from SketchAPI import *
@@ -106,13 +105,13 @@ SketchConstraintCoincidence_9.setName("SketchConstraintCoincidence_10")
 SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchCircle_2.center(), SketchLine_3.result())
 SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_11")
 SketchConstraintEqual_1 = Sketch_1.setEqual(SketchArc_1.results()[1], SketchArc_2.results()[1])
-SketchArc_3 = Sketch_1.addArc(9.077705920073647e-31, -3.860574861749558e-31, 15.46247221747307, -11.0413745939477, 18.89444362769119, -2, False)
+SketchArc_3 = Sketch_1.addArc(0, 0, 15.46247221747307, -11.0413745939477, 18.89444362769119, -2, False)
 SketchArc_3.setName("SketchArc_7")
 SketchArc_3.result().setName("SketchArc_7")
 SketchArc_3.results()[1].setName("SketchArc_7_2")
 SketchConstraintCoincidence_11 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchArc_3.center())
 SketchConstraintCoincidence_11.setName("SketchConstraintCoincidence_54")
-SketchArc_4 = Sketch_1.addArc(3.497294868556922e-32, 3.186289860391258e-33, 18.89444362769119, 2, 15.46247221747308, 11.04137459394768, False)
+SketchArc_4 = Sketch_1.addArc(0, 0, 18.89444362769119, 2, 15.46247221747308, 11.04137459394768, False)
 SketchArc_4.setName("SketchArc_8")
 SketchArc_4.result().setName("SketchArc_8")
 SketchArc_4.results()[1].setName("SketchArc_8_2")
@@ -134,7 +133,7 @@ SketchArc_6.results()[1].setName("SketchArc_10_2")
 SketchConstraintCoincidence_14 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchArc_6.startPoint())
 SketchConstraintCoincidence_14.setName("SketchConstraintCoincidence_57")
 SketchConstraintTangent_2 = Sketch_1.setTangent(SketchArc_3.results()[1], SketchArc_6.results()[1])
-SketchLine_4 = Sketch_1.addLine(17.5, 15, 37.99999999999999, 15)
+SketchLine_4 = Sketch_1.addLine(17.5, 15, 38, 15)
 SketchLine_4.setName("SketchLine_42")
 SketchLine_4.result().setName("SketchLine_42")
 SketchConstraintCoincidence_15 = Sketch_1.setCoincident(SketchArc_5.endPoint(), SketchLine_4.startPoint())
@@ -149,7 +148,7 @@ SketchLine_6.setName("SketchLine_45")
 SketchLine_6.result().setName("SketchLine_45")
 SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_4.startPoint(), SketchLine_6.startPoint())
 SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_61")
-SketchLine_7 = Sketch_1.addLine(37.99999999999999, 15, 38.00000000000001, 5.505556372308819)
+SketchLine_7 = Sketch_1.addLine(38, 15, 38, 5.505556372308819)
 SketchLine_7.setName("SketchLine_46")
 SketchLine_7.result().setName("SketchLine_46")
 SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_7.startPoint())
@@ -166,7 +165,7 @@ SketchConstraintHorizontal_5 = Sketch_1.setHorizontal(SketchLine_5.result())
 SketchConstraintHorizontal_5.setName("SketchConstraintHorizontal_14")
 SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_7.result())
 SketchConstraintVertical_1.setName("SketchConstraintVertical_7")
-SketchLine_8 = Sketch_1.addLine(40, 17, 40, -17.00000000000001)
+SketchLine_8 = Sketch_1.addLine(40, 17, 40, -17)
 SketchLine_8.setName("SketchLine_47")
 SketchLine_8.result().setName("SketchLine_47")
 SketchLine_8.setAuxiliary(True)
@@ -193,7 +192,7 @@ SketchConstraintRadius_6 = Sketch_1.setRadius(SketchArc_4.results()[1], "(r4+4)*
 SketchConstraintRadius_6.setName("SketchConstraintRadius_13")
 SketchConstraintDistance_6 = Sketch_1.setDistance(SketchLine_4.endPoint(), SketchLine_8.result(), "2*coeff")
 SketchConstraintDistance_6.setName("SketchConstraintDistance_19")
-SketchArc_7 = Sketch_1.addArc(40, 2.220450266386716e-15, 34.49444362769118, 2, 38.00000000000001, 5.505556372308819, True)
+SketchArc_7 = Sketch_1.addArc(40, 0, 34.49444362769118, 2, 38, 5.505556372308819, True)
 SketchArc_7.setName("SketchArc_11")
 SketchArc_7.result().setName("SketchArc_11")
 SketchArc_7.results()[1].setName("SketchArc_11_2")
@@ -201,7 +200,7 @@ SketchConstraintCoincidence_22 = Sketch_1.setCoincident(SketchPoint_2.coordinate
 SketchConstraintCoincidence_22.setName("SketchConstraintCoincidence_66")
 SketchConstraintCoincidence_23 = Sketch_1.setCoincident(SketchLine_6.endPoint(), SketchArc_7.startPoint())
 SketchConstraintCoincidence_23.setName("SketchConstraintCoincidence_67")
-SketchArc_8 = Sketch_1.addArc(40.00000000000001, -2.652239435709897e-15, 34.49444362769118, -2, 37.95784774655168, -5.490060577298436, False)
+SketchArc_8 = Sketch_1.addArc(40, 0, 34.49444362769118, -2, 37.95784774655168, -5.490060577298436, False)
 SketchArc_8.setName("SketchArc_12")
 SketchArc_8.result().setName("SketchArc_12")
 SketchArc_8.results()[1].setName("SketchArc_12_2")
@@ -241,12 +240,12 @@ SketchConstraintRadius_8 = Sketch_1.setRadius(SketchArc_9.results()[1], "(2.5+2)
 SketchConstraintRadius_8.setName("SketchConstraintRadius_15")
 SketchConstraintDistance_8 = Sketch_1.setDistance(SketchCircle_5.center(), SketchLine_2.result(), "4*coeff")
 SketchConstraintDistance_8.setName("SketchConstraintDistance_22")
-SketchLine_10 = Sketch_1.addLine(17.5, -15, 34.00000000000001, -15)
+SketchLine_10 = Sketch_1.addLine(17.5, -15, 34, -15)
 SketchLine_10.setName("SketchLine_43")
 SketchLine_10.result().setName("SketchLine_43")
 SketchConstraintCoincidence_31 = Sketch_1.setCoincident(SketchArc_6.endPoint(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_31.setName("SketchConstraintCoincidence_73")
-SketchArc_10 = Sketch_1.addArc(34.00000000000001, -13.48076923076937, 34.00000000000001, -15, 35.51437699680511, -13.35942492012782, False)
+SketchArc_10 = Sketch_1.addArc(34, -13.48076923076937, 34, -15, 35.51437699680511, -13.35942492012782, False)
 SketchArc_10.setName("SketchArc_14")
 SketchArc_10.result().setName("SketchArc_14")
 SketchArc_10.results()[1].setName("SketchArc_14_2")
@@ -320,14 +319,14 @@ SketchArc_11.results()[1].setName("SketchArc_15_2")
 SketchLine_12.setName("SketchLine_50")
 SketchLine_12.result().setName("SketchLine_50")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_4_2f-SketchLine_6r-SketchLine_10f-SketchArc_2_2f")], model.selection(), "h_p*coeff", 0)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
-SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchCircle_2_2"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_4_2f-SketchLine_10f-SketchArc_2_2f-SketchLine_6r-SketchArc_8_2f-SketchArc_9_2r-SketchLine_42f-SketchLine_46f-SketchArc_11_2f-SketchLine_45r-SketchArc_15_2r-SketchArc_16_2f-SketchLine_51f-SketchArc_17_2f-SketchLine_52r-SketchLine_50r-SketchCircle_11_2r-SketchArc_22_2f-SketchArc_21_2r-SketchLine_55f-SketchArc_20_2r-SketchArc_19_2f-SketchLine_54r-SketchArc_18_2f-SketchLine_53r-SketchArc_7_2f-SketchLine_44f-SketchArc_12_2f-SketchLine_48f-SketchArc_13_2f-SketchArc_14_2r-SketchLine_43r-SketchArc_10_2r-SketchCircle_1_2r-SketchCircle_2_2r_wire")], model.selection(), "h_p*coeff", 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
+SketchProjection_1 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchCircle_2_2"))
 SketchCircle_6 = SketchProjection_1.createdFeature()
 SketchCircle_6.setName("SketchCircle_5")
 SketchCircle_6.result().setName("SketchCircle_5")
 SketchCircle_6.results()[1].setName("SketchCircle_5_2")
-SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchCircle_4_2"))
+SketchProjection_2 = Sketch_2.addProjection(model.selection("EDGE", "Sketch_1/SketchCircle_4_2"))
 SketchCircle_7 = SketchProjection_2.createdFeature()
 SketchCircle_7.setName("SketchCircle_6")
 SketchCircle_7.result().setName("SketchCircle_6")
@@ -342,18 +341,18 @@ SketchConstraintRadius_9 = Sketch_2.setRadius(SketchCircle_8.results()[1], "r2*c
 SketchConstraintRadius_9.setName("SketchConstraintRadius_6")
 model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_2")], model.selection(), "10*coeff", 0)
-ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_3_2f")], model.selection(), "p_trou1*coeff", 0, [model.selection("SOLID", "Extrusion_1_1")])
-ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2r")], model.selection(), "p2_trou1*coeff", 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
+ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchCircle_3_2f_wire")], model.selection(), "p_trou1*coeff", 0, [model.selection("SOLID", "Extrusion_1_1")])
+ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_4_2f-SketchLine_10f-SketchArc_2_2f-SketchLine_6r-SketchArc_8_2f-SketchArc_9_2r-SketchLine_42f-SketchLine_46f-SketchArc_11_2f-SketchLine_45r-SketchArc_15_2r-SketchArc_16_2f-SketchLine_51f-SketchArc_17_2f-SketchLine_52r-SketchLine_50r-SketchCircle_11_2r-SketchArc_22_2f-SketchArc_21_2r-SketchLine_55f-SketchArc_20_2r-SketchArc_19_2f-SketchLine_54r-SketchArc_18_2f-SketchLine_53r-SketchArc_7_2f-SketchLine_44f-SketchArc_12_2f-SketchLine_48f-SketchArc_13_2f-SketchArc_14_2r-SketchLine_43r-SketchArc_10_2r-SketchCircle_1_2r-SketchCircle_2_2r_wire_7")], model.selection(), "p2_trou1*coeff", 0, [model.selection("SOLID", "ExtrusionCut_1_1")])
 ExtrusionCut_3 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_4_2f")], model.selection(), "p_trou2*coeff", 0, [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "ExtrusionCut_2_1")])
-ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_2_2r")], model.selection(), "p2_trou*coeff", 0, [model.selection("SOLID", "ExtrusionCut_3_2")])
+ExtrusionCut_4 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_4_2f-SketchLine_10f-SketchArc_2_2f-SketchLine_6r-SketchArc_8_2f-SketchArc_9_2r-SketchLine_42f-SketchLine_46f-SketchArc_11_2f-SketchLine_45r-SketchArc_15_2r-SketchArc_16_2f-SketchLine_51f-SketchArc_17_2f-SketchLine_52r-SketchLine_50r-SketchCircle_11_2r-SketchArc_22_2f-SketchArc_21_2r-SketchLine_55f-SketchArc_20_2r-SketchArc_19_2f-SketchLine_54r-SketchArc_18_2f-SketchLine_53r-SketchArc_7_2f-SketchLine_44f-SketchArc_12_2f-SketchLine_48f-SketchArc_13_2f-SketchArc_14_2r-SketchLine_43r-SketchArc_10_2r-SketchCircle_1_2r-SketchCircle_2_2r_wire_8")], model.selection(), "p2_trou*coeff", 0, [model.selection("SOLID", "ExtrusionCut_3_2")])
 Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), "22.5*coeff", False)
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "45*coeff", True)
 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_2"))
-SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_1"))
+SketchProjection_3 = Sketch_3.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchArc_4_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]"), False)
 SketchLine_18 = SketchProjection_3.createdFeature()
 SketchLine_18.setName("SketchLine_4")
 SketchLine_18.result().setName("SketchLine_4")
-SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"))
+SketchProjection_4 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_6"))
 SketchLine_19 = SketchProjection_4.createdFeature()
 SketchLine_19.setName("SketchLine_5")
 SketchLine_19.result().setName("SketchLine_5")
@@ -430,9 +429,9 @@ SketchConstraintDistance_13.setName("SketchConstraintDistance_11")
 SketchConstraintDistance_14 = Sketch_3.setDistance(SketchLine_23.result(), SketchLine_25.startPoint(), "2.5*coeff")
 SketchConstraintDistance_14.setName("SketchConstraintDistance_12")
 model.do()
-Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchLine_9r-SketchLine_12r-SketchLine_14r-SketchLine_26r-SketchLine_27r-SketchLine_28r")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), 0, model.selection(), 0)
+Extrusion_3 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchLine_14r-SketchLine_27r-SketchLine_26r-SketchLine_28r-SketchLine_12r-SketchLine_9r-SketchCircle_8_2r_wire")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_10"), 0, model.selection(), 0)
 Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_3_1")], [model.selection("SOLID", "ExtrusionCut_4_1")])
-ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Wire-SketchCircle_8_2f")], model.selection(), 10, 0, [model.selection("SOLID", "Smash_1_1_1")])
+ExtrusionCut_5 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_3/Face-SketchCircle_8_2f_wire")], model.selection(), 10, 0, [model.selection("SOLID", "Smash_1_1_1")])
 ExtrusionCut_6 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_8_2f")], model.selection(), 10, 0, [model.selection("SOLID", "ExtrusionCut_5_1_1")])
 Sketch_4 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
 SketchProjection_7 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OY"))
@@ -516,11 +515,11 @@ SketchConstraintDistance_16.setName("SketchConstraintDistance_10")
 SketchConstraintLength_10 = Sketch_4.setLength(SketchLine_36.result(), 12.975642079145)
 SketchConstraintLength_10.setName("SketchConstraintLength_7")
 model.do()
-Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Wire-SketchLine_19f-SketchLine_20f-SketchLine_24f-SketchLine_21f-SketchLine_22f-SketchLine_23f")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), 0, model.selection(), 0)
+Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_4/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchCircle_9_2r_wire")], model.selection(), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6"), 0, model.selection(), 0)
 Smash_2 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_4_1")], [model.selection("COMPSOLID", "ExtrusionCut_6_1")])
 ExtrusionCut_7 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_9_2f")], model.selection(), 0, 10, [model.selection("SOLID", "Smash_2_1_3")])
 ExtrusionCut_8 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchCircle_9_2f")], model.selection(), 0, 10, [model.selection("SOLID", "ExtrusionCut_7_1_1")])
-Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Smash_2_1_3/Modified_Face_1"))
+Sketch_5 = model.addSketch(Part_1_doc, model.selection("FACE", "Smash_2_1_3/Modified_Face&Extrusion_1_1/From_Face"))
 SketchPoint_3 = Sketch_5.addPoint(model.selection("VERTEX", "PartSet/Origin"))
 SketchPoint_3.setName("SketchPoint_2")
 SketchPoint_3.result().setName("SketchPoint_2")
@@ -539,7 +538,7 @@ SketchLine_39.setName("SketchLine_31")
 SketchLine_39.result().setName("SketchLine_31")
 SketchConstraintDistance_17 = Sketch_5.setDistance(SketchLine_37.result(), SketchLine_38.startPoint(), "epaisseur*coeff")
 SketchConstraintDistance_17.setName("SketchConstraintDistance_13")
-SketchArc_19 = Sketch_5.addArc(2.175718373563154e-31, -6.039735315912772e-31, -13.96424004376904, 17, -13.964240043769, -17, False)
+SketchArc_19 = Sketch_5.addArc(0, 0, -13.964240043769, 17, -13.964240043769, -17, False)
 SketchArc_19.setName("SketchArc_5")
 SketchArc_19.result().setName("SketchArc_5")
 SketchArc_19.results()[1].setName("SketchArc_5_2")
@@ -567,7 +566,7 @@ SketchConstraintDistance_19.setName("SketchConstraintDistance_15")
 SketchConstraintCoincidence_59 = Sketch_5.setCoincident(SketchArc_19.endPoint(), SketchLine_37.startPoint())
 SketchConstraintCoincidence_59.setName("SketchConstraintCoincidence_40")
 model.do()
-Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchLine_29r-SketchLine_30r-SketchArc_5_2r-SketchLine_32r")], model.selection(), 0, "22*coeff")
+Extrusion_5 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_5/Face-SketchArc_5_2r-SketchLine_30r-SketchLine_32r-SketchLine_29r")], model.selection(), 0, "22*coeff")
 Sketch_6_origin = GeomAPI_Pnt(0, 0, 0)
 Sketch_6_norm = GeomAPI_Dir(0, 1, 0)
 Sketch_6_dirx = GeomAPI_Dir(1, 0, 0)
@@ -575,23 +574,23 @@ Sketch_6 = model.addSketch(Part_1_doc, GeomAPI_Ax3(Sketch_6_origin, Sketch_6_dir
 SketchLine_41 = Sketch_6.addLine(-32, -17, -32, 17)
 SketchLine_41.setName("SketchLine_33")
 SketchLine_41.result().setName("SketchLine_33")
-SketchPoint_4 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/Vertex-SketchLine_32s-SketchLine_29e"))
+SketchPoint_4 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/SketchLine_29_EndVertex"))
 SketchPoint_4.setName("SketchPoint_3")
 SketchPoint_4.result().setName("SketchPoint_3")
 SketchConstraintCoincidence_60 = Sketch_6.setCoincident(SketchLine_41.startPoint(), SketchPoint_4.result())
 SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_41")
-SketchPoint_5 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/Vertex-SketchLine_30s-SketchLine_32e"))
+SketchPoint_5 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/SketchLine_30_StartVertex"))
 SketchPoint_5.setName("SketchPoint_4")
 SketchPoint_5.result().setName("SketchPoint_4")
 SketchConstraintCoincidence_61 = Sketch_6.setCoincident(SketchLine_41.endPoint(), SketchPoint_5.result())
 SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_42")
-SketchPoint_6 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/Vertex-SketchPoint_2-SketchArc_5-SketchLine_31s"))
+SketchPoint_6 = Sketch_6.addPoint(model.selection("VERTEX", "Sketch_5/SketchPoint_2"))
 SketchPoint_6.setName("SketchPoint_5")
 SketchPoint_6.result().setName("SketchPoint_5")
-SketchLine_42 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_30"))
+SketchLine_42 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/SketchLine_30"))
 SketchLine_42.setName("SketchLine_34")
 SketchLine_42.result().setName("SketchLine_34")
-SketchLine_43 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/Edge-SketchLine_29"))
+SketchLine_43 = Sketch_6.addLine(model.selection("EDGE", "Sketch_5/SketchLine_29"))
 SketchLine_43.setName("SketchLine_35")
 SketchLine_43.result().setName("SketchLine_35")
 SketchArc_20 = Sketch_6.addArc(0, 0, -20.32855135026245, 17, -20.32855135026245, -17, False)
@@ -621,18 +620,18 @@ SketchConstraintCoincidence_68.setName("SketchConstraintCoincidence_49")
 SketchConstraintRadius_13 = Sketch_6.setRadius(SketchArc_20.results()[1], "r1*coeff")
 SketchConstraintRadius_13.setName("SketchConstraintRadius_10")
 model.do()
-Extrusion_6 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchLine_33r-SketchArc_6_2r-SketchLine_36r-SketchLine_37f")], model.selection(), "77*coeff-h_p*coeff", 0)
-Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_6_1/Generated_Face_1"))
+Extrusion_6 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_6/Face-SketchLine_36r-SketchArc_6_2r-SketchLine_37f-SketchLine_33r")], model.selection(), "77*coeff-h_p*coeff", 0)
+Sketch_7 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_6_1/Generated_Face&Sketch_6/SketchLine_33"))
 SketchLine_46 = Sketch_7.addLine(37, -8.881784197001252e-16, -22, 1.665334536937735e-15)
 SketchLine_46.setName("SketchLine_38")
 SketchLine_46.result().setName("SketchLine_38")
 SketchLine_46.setAuxiliary(True)
-SketchLine_47 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_6_1/Generated_Face_1&Extrusion_6_1/To_Face_1"))
+SketchLine_47 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_6_1/Generated_Face&Sketch_6/SketchLine_33][Extrusion_6_1/To_Face]"))
 SketchLine_47.setName("SketchLine_39")
 SketchLine_47.result().setName("SketchLine_39")
 SketchConstraintCoincidence_69 = Sketch_7.setCoincident(SketchLine_46.startPoint(), SketchLine_47.result())
 SketchConstraintCoincidence_69.setName("SketchConstraintCoincidence_50")
-SketchLine_48 = Sketch_7.addLine(model.selection("EDGE", "Extrusion_5_1/Generated_Face_2&Extrusion_5_1/From_Face_1"))
+SketchLine_48 = Sketch_7.addLine(model.selection("EDGE", "[Extrusion_5_1/Generated_Face&Sketch_5/SketchLine_32][Extrusion_5_1/From_Face]"))
 SketchLine_48.setName("SketchLine_40")
 SketchLine_48.result().setName("SketchLine_40")
 SketchConstraintCoincidence_70 = Sketch_7.setCoincident(SketchLine_46.endPoint(), SketchLine_48.result())
@@ -661,24 +660,25 @@ SketchConstraintCoincidence_72.setName("SketchConstraintCoincidence_53")
 SketchConstraintRadius_14 = Sketch_7.setRadius(SketchCircle_11.results()[1], "r3")
 SketchConstraintRadius_14.setName("SketchConstraintRadius_12")
 model.do()
-ExtrusionCut_9 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-SketchCircle_10_2f")], model.selection(), 0, "10*coeff", [model.selection("SOLID", "Extrusion_6_1")])
-ExtrusionCut_10 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_7_2r-SketchArc_10_2f-SketchLine_44r-SketchArc_12_2r-SketchArc_13_2r-SketchLine_48r-SketchLine_43f-SketchArc_14_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_1/Wire-SketchLine_50f-SketchArc_15_2f-SketchArc_16_2r-SketchLine_51r-SketchArc_17_2r-SketchLine_52f"), model.selection("FACE", "Sketch_1/Face-SketchLine_53f-SketchArc_18_2r-SketchLine_54f-SketchArc_19_2r-SketchArc_20_2f-SketchLine_55r-SketchArc_21_2f-SketchArc_22_2r"), model.selection("FACE", "Sketch_1/Face-SketchArc_8_2r-SketchArc_9_2f-SketchLine_42r-SketchLine_45f-SketchLine_46r-SketchArc_11_2r")], model.selection(), model.selection("FACE", "ExtrusionCut_3_2/Modfied_1"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_8_1_2")])
-Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_9_1/Modfied_1"))
+ExtrusionCut_9 = model.addExtrusionCut(Part_1_doc, [model.selection("WIRE", "Sketch_7/Face-SketchCircle_10_2f_wire")], model.selection(), 0, "10*coeff", [model.selection("SOLID", "Extrusion_6_1")])
+ExtrusionCut_10_objects_1 = [model.selection("WIRE", "Sketch_1/Face-SketchArc_10_2f-SketchLine_43f-SketchArc_14_2f-SketchArc_13_2r-SketchLine_48r-SketchArc_12_2r-SketchLine_44r-SketchArc_7_2r_wire"), model.selection("FACE", "Sketch_1/Face-SketchCircle_11_2f"), model.selection("WIRE", "Sketch_1/Face-SketchLine_50f-SketchLine_52f-SketchArc_17_2r-SketchLine_51r-SketchArc_16_2r-SketchArc_15_2f_wire"), model.selection("FACE", "Sketch_1/Face-SketchLine_53f-SketchArc_18_2r-SketchLine_54f-SketchArc_19_2r-SketchArc_20_2f-SketchLine_55r-SketchArc_21_2f-SketchArc_22_2r"), model.selection("FACE", "Sketch_1/Face-SketchLine_45f-SketchArc_11_2r-SketchLine_46r-SketchLine_42r-SketchArc_9_2f-SketchArc_8_2r")]
+ExtrusionCut_10 = model.addExtrusionCut(Part_1_doc, ExtrusionCut_10_objects_1, model.selection(), model.selection("FACE", "ExtrusionCut_3_2/Modified_Face&Extrusion_1_1/To_Face"), 0, model.selection(), 0, [model.selection("SOLID", "ExtrusionCut_8_1_2")])
+Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_9_1/Modified_Face&Sketch_6/SketchLine_33"))
 SketchLine_50 = Sketch_8.addLine(37, 14.80042035331162, 37, -14)
 SketchLine_50.setName("SketchLine_56")
 SketchLine_50.result().setName("SketchLine_56")
 SketchLine_50.setAuxiliary(True)
-SketchLine_51 = Sketch_8.addLine(model.selection("EDGE", "ExtrusionCut_9_1/Modfied_1&Extrusion_6_1/To_Face_1"))
+SketchLine_51 = Sketch_8.addLine(model.selection("EDGE", "[ExtrusionCut_9_1/Modified_Face&Sketch_6/SketchLine_33][Extrusion_6_1/To_Face]"))
 SketchLine_51.setName("SketchLine_57")
 SketchLine_51.result().setName("SketchLine_57")
 SketchConstraintCoincidence_73 = Sketch_8.setCoincident(SketchLine_50.startPoint(), SketchLine_51.result())
 SketchConstraintCoincidence_73.setName("SketchConstraintCoincidence_81")
 SketchConstraintCoincidence_74 = Sketch_8.setCoincident(SketchLine_50.endPoint(), SketchLine_51.result())
 SketchConstraintCoincidence_74.setName("SketchConstraintCoincidence_82")
-SketchLine_52 = Sketch_8.addLine(model.selection("EDGE", "Extrusion_6_1/Generated_Face_4&ExtrusionCut_9_1/Modfied_1"))
+SketchLine_52 = Sketch_8.addLine(model.selection("EDGE", "[Extrusion_6_1/Generated_Face&Sketch_6/SketchLine_36][ExtrusionCut_9_1/Modified_Face&Sketch_6/SketchLine_33]"))
 SketchLine_52.setName("SketchLine_58")
 SketchLine_52.result().setName("SketchLine_58")
-SketchArc_21 = Sketch_8.addArc(34, -14, 37, -14, 34.00000001126211, -17, True)
+SketchArc_21 = Sketch_8.addArc(34, -14, 37, -14, 33.9999999583228, -17, True)
 SketchArc_21.setName("SketchArc_23")
 SketchArc_21.result().setName("SketchArc_23")
 SketchArc_21.results()[1].setName("SketchArc_23_2")
@@ -688,7 +688,7 @@ SketchConstraintTangent_6 = Sketch_8.setTangent(SketchLine_50.result(), SketchAr
 SketchConstraintCoincidence_76 = Sketch_8.setCoincident(SketchLine_52.result(), SketchArc_21.endPoint())
 SketchConstraintCoincidence_76.setName("SketchConstraintCoincidence_84")
 SketchConstraintTangent_7 = Sketch_8.setTangent(SketchArc_21.results()[1], SketchLine_52.result())
-SketchLine_53 = Sketch_8.addLine(34.00000002238511, -17, 37, -17)
+SketchLine_53 = Sketch_8.addLine(34, -17, 37, -17)
 SketchLine_53.setName("SketchLine_59")
 SketchLine_53.result().setName("SketchLine_59")
 SketchConstraintCoincidence_77 = Sketch_8.setCoincident(SketchArc_21.endPoint(), SketchLine_53.startPoint())
@@ -704,7 +704,7 @@ SketchConstraintCoincidence_80 = Sketch_8.setCoincident(SketchLine_51.startPoint
 SketchConstraintCoincidence_80.setName("SketchConstraintCoincidence_88")
 SketchConstraintRadius_15 = Sketch_8.setRadius(SketchArc_21.results()[1], "3*coeff")
 SketchConstraintRadius_15.setName("SketchConstraintRadius_16")
-SketchLine_55 = Sketch_8.addLine(model.selection("EDGE", "Sketch_7/Edge-SketchLine_38"))
+SketchLine_55 = Sketch_8.addLine(model.selection("EDGE", "Sketch_7/SketchLine_38"))
 SketchLine_55.setName("SketchLine_61")
 SketchLine_55.result().setName("SketchLine_61")
 SketchConstraintMirror_2_objects = [SketchArc_21.results()[1], SketchLine_54.result(), SketchLine_53.result()]
@@ -718,20 +718,20 @@ SketchArc_22.setName("SketchArc_24")
 SketchArc_22.result().setName("SketchArc_24")
 SketchArc_22.results()[1].setName("SketchArc_24_2")
 model.do()
-ExtrusionCut_11 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchArc_23_2r-SketchLine_59f-SketchLine_60r"), model.selection("WIRE", "Sketch_8/Wire-SketchArc_24_2r-SketchLine_62f-SketchLine_63r")], model.selection(), 0, "100*coeff", [model.selection("SOLID", "ExtrusionCut_9_1")])
-Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_5_1/Generated_Face_1"))
+ExtrusionCut_11 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_8/Face-SketchLine_59f-SketchLine_60r-SketchArc_23_2r"), model.selection("WIRE", "Sketch_8/Face-SketchLine_62f-SketchLine_63r-SketchArc_24_2r_wire")], model.selection(), 0, "100*coeff", [model.selection("SOLID", "ExtrusionCut_9_1")])
+Sketch_9 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_5_1/Generated_Face&Sketch_5/SketchLine_29"))
 SketchLine_58 = Sketch_9.addLine(-32, -19, -32, -3.575047476349699)
 SketchLine_58.setName("SketchLine_64")
 SketchLine_58.result().setName("SketchLine_64")
 SketchLine_58.setAuxiliary(True)
-SketchLine_59 = Sketch_9.addLine(model.selection("EDGE", "Extrusion_5_1/Generated_Face_1&Extrusion_5_1/Generated_Face_2"))
+SketchLine_59 = Sketch_9.addLine(model.selection("EDGE", "[Extrusion_5_1/Generated_Face&Sketch_5/SketchLine_32][Extrusion_5_1/Generated_Face&Sketch_5/SketchLine_29]"))
 SketchLine_59.setName("SketchLine_65")
 SketchLine_59.result().setName("SketchLine_65")
 SketchConstraintCoincidence_81 = Sketch_9.setCoincident(SketchLine_58.startPoint(), SketchLine_59.result())
 SketchConstraintCoincidence_81.setName("SketchConstraintCoincidence_89")
 SketchConstraintCoincidence_82 = Sketch_9.setCoincident(SketchLine_58.endPoint(), SketchLine_59.result())
 SketchConstraintCoincidence_82.setName("SketchConstraintCoincidence_90")
-SketchLine_60 = Sketch_9.addLine(model.selection("EDGE", "Extrusion_5_1/Generated_Face_1&Extrusion_5_1/From_Face_1"))
+SketchLine_60 = Sketch_9.addLine(model.selection("EDGE", "[Extrusion_5_1/Generated_Face&Sketch_5/SketchLine_29][Extrusion_5_1/From_Face]"))
 SketchLine_60.setName("SketchLine_66")
 SketchLine_60.result().setName("SketchLine_66")
 SketchArc_23 = Sketch_9.addArc(-29, -19, -32, -19, -29.00002201340376, -22, False)
@@ -761,7 +761,7 @@ SketchConstraintCoincidence_88.setName("SketchConstraintCoincidence_96")
 SketchConstraintRadius_16 = Sketch_9.setRadius(SketchArc_23.results()[1], "3*coeff")
 SketchConstraintRadius_16.setName("SketchConstraintRadius_17")
 model.do()
-ExtrusionCut_12 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchArc_25_2r-SketchLine_67f-SketchLine_68f")], model.selection(), 0, "100*coeff", [model.selection("SOLID", "Extrusion_5_1")])
+ExtrusionCut_12 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_9/Face-SketchLine_67f-SketchLine_68f-SketchArc_25_2r")], model.selection(), 0, "100*coeff", [model.selection("SOLID", "Extrusion_5_1")])
 model.do()
 
 from GeomAPI import  GeomAPI_Shape
@@ -777,7 +777,7 @@ model.testResultsVolumes(Part_1, [118190.673218984])
 # checking for parametric update
 Parameter_Epaisseur.setValue(33.9)
 model.do()
-model.testResultsVolumes(Part_1, [118105.9369682])
+model.testResultsVolumes(Part_1, [122133.938213185])
 Parameter_Epaisseur.setValue(34)
 model.do()
 model.testResultsVolumes(Part_1, [118190.673218984])
index 37ce6db8bd1490caff41cccf08aed498ae88b9c3..60a80ffc1a8d9dba640d33a6681aae4196c2fcd4 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
+
 from SketchAPI import *
 from GeomAPI import GeomAPI_Shape
 
@@ -191,12 +210,12 @@ model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [114])
 model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [228])
 model.testResultsVolumes(Revolution_1, [29055.346994571114919381216168404])
 
-Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), True)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), True)
 
 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
-SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2"), False)
+SketchProjection_3 = Sketch_2.addProjection(model.selection("VERTEX", "Sketch_1/SketchPoint_2"), False)
 SketchPoint_3 = SketchProjection_3.createdFeature()
-SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "Revolution_1_1/Generated_Face_28"), False)
+SketchProjection_4 = Sketch_2.addProjection(model.selection("EDGE", "([Revolution_1_1/Generated_Face&Sketch_1/SketchArc_1_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7])([Revolution_1_1/Generated_Face&Sketch_1/SketchLine_7][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_8])"), False)
 SketchLine_36 = SketchProjection_4.createdFeature()
 SketchCircle_1 = Sketch_2.addCircle(14.5, 0, 2.25)
 SketchConstraintCoincidence_38 = Sketch_2.setCoincident(SketchPoint_3.result(), SketchCircle_1.center())
@@ -215,7 +234,7 @@ model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [132])
 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [264])
 model.testResultsVolumes(ExtrusionCut_1, [28943.115000463178148493170738220])
 
-Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Revolution_1_1/Generated_Face_14&Revolution_1_1/Generated_Face_15")], "Fillet1")
+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
 model.testNbResults(Fillet_1, 1)
 model.testNbSubResults(Fillet_1, [0])
@@ -225,7 +244,7 @@ model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [136])
 model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [272])
 model.testResultsVolumes(Fillet_1, [28340.280766451105591841042041779])
 
-Fillet_2 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "Revolution_1_1/Generated_Face_6"), model.selection("FACE", "Revolution_1_1/Generated_Face_8"), model.selection("FACE", "Revolution_1_1/Generated_Face_10")], "Fillet2")
+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
 model.testNbResults(Fillet_2, 1)
 model.testNbSubResults(Fillet_2, [0])
@@ -235,7 +254,7 @@ model.testNbSubShapes(Fillet_2, GeomAPI_Shape.EDGE, [168])
 model.testNbSubShapes(Fillet_2, GeomAPI_Shape.VERTEX, [336])
 model.testResultsVolumes(Fillet_2, [28339.715350479829794494435191154])
 
-Fillet_3 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_16")], "Fillet3")
+Fillet_3 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_19")], "Fillet3")
 # check Fillet_3
 model.testNbResults(Fillet_3, 1)
 model.testNbSubResults(Fillet_3, [0])
@@ -245,7 +264,7 @@ model.testNbSubShapes(Fillet_3, GeomAPI_Shape.EDGE, [176])
 model.testNbSubShapes(Fillet_3, GeomAPI_Shape.VERTEX, [352])
 model.testResultsVolumes(Fillet_3, [28338.609830057110229972749948502])
 
-Fillet_4 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_24")], "Fillet3")
+Fillet_4 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_11")], "Fillet3")
 # check Fillet_4
 model.testNbResults(Fillet_4, 1)
 model.testNbSubResults(Fillet_4, [0])
@@ -255,7 +274,7 @@ model.testNbSubShapes(Fillet_4, GeomAPI_Shape.EDGE, [184])
 model.testNbSubShapes(Fillet_4, GeomAPI_Shape.VERTEX, [368])
 model.testResultsVolumes(Fillet_4, [28347.280717884430487174540758133])
 
-Fillet_5 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face_26")], "Fillet2")
+Fillet_5 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_9")], "Fillet2")
 # check Fillet_5
 model.testNbResults(Fillet_5, 1)
 model.testNbSubResults(Fillet_5, [0])
@@ -281,17 +300,17 @@ SketchConstraintCoincidence_43 = Sketch_3.setCoincident(SketchLine_41.endPoint()
 SketchConstraintCoincidence_44 = Sketch_3.setCoincident(SketchLine_42.endPoint(), SketchLine_37.startPoint())
 SketchProjection_5 = Sketch_3.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_43 = SketchProjection_5.createdFeature()
-SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_33"), False)
+SketchProjection_6 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_33"), False)
 SketchLine_44 = SketchProjection_6.createdFeature()
-SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_33"), False)
+SketchProjection_7 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_33"), False)
 SketchLine_45 = SketchProjection_7.createdFeature()
-SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_33"), False)
+SketchProjection_8 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_33"), False)
 SketchLine_46 = SketchProjection_8.createdFeature()
-SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_32"), False)
+SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_32"), False)
 SketchLine_47 = SketchProjection_9.createdFeature()
-SketchProjection_10 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_32"), False)
+SketchProjection_10 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_32"), False)
 SketchLine_48 = SketchProjection_10.createdFeature()
-SketchProjection_11 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_32"), False)
+SketchProjection_11 = Sketch_3.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_32"), False)
 SketchLine_49 = SketchProjection_11.createdFeature()
 SketchConstraintVertical_13 = Sketch_3.setVertical(SketchLine_37.result())
 SketchConstraintVertical_14 = Sketch_3.setVertical(SketchLine_39.result())
@@ -347,11 +366,11 @@ SketchConstraintVertical_15 = Sketch_4.setVertical(SketchLine_52.result())
 SketchConstraintVertical_16 = Sketch_4.setVertical(SketchLine_55.result())
 SketchConstraintVertical_17 = Sketch_4.setVertical(SketchLine_58.result())
 SketchConstraintHorizontal_11 = Sketch_4.setHorizontal(SketchLine_56.result())
-SketchProjection_13 = Sketch_4.addProjection(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_24s-SketchLine_23e"), False)
+SketchProjection_13 = Sketch_4.addProjection(model.selection("VERTEX", "Sketch_1/SketchLine_23_EndVertex"), False)
 SketchPoint_4 = SketchProjection_13.createdFeature()
 SketchConstraintDistanceHorizontal_17 = Sketch_4.setHorizontalDistance(SketchAPI_Point(SketchPoint_4).coordinates(), SketchLine_52.endPoint(), "Drill2_Loc")
 SketchConstraintDistanceHorizontal_18 = Sketch_4.setHorizontalDistance(SketchLine_54.startPoint(), SketchLine_54.endPoint(), "Drill2_InnerRadius")
-SketchProjection_14 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_20"), False)
+SketchProjection_14 = Sketch_4.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_20"), False)
 SketchLine_59 = SketchProjection_14.createdFeature()
 SketchConstraintAngle_6 = Sketch_4.setAngle(SketchLine_57.result(), SketchLine_56.result(), 45)
 SketchConstraintMirror_2 = Sketch_4.addMirror(SketchLine_53.result(), [SketchLine_59.result()])
@@ -370,7 +389,7 @@ model.do()
 # check Sketch_4
 model.checkSketch(Sketch_4, 0)
 
-RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_52r-SketchLine_54r-SketchLine_55r-SketchLine_56f-SketchLine_57f-SketchLine_58f-SketchArc_2_2f")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_52"), 360, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
+RevolutionCut_1 = model.addRevolutionCut(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchLine_56f-SketchLine_57f-SketchLine_58f-SketchArc_2_2f-SketchLine_55r-SketchLine_54r-SketchLine_52r")], model.selection("EDGE", "Sketch_4/SketchLine_52"), 360, 0, [model.selection("SOLID", "ExtrusionCut_2_1")])
 # check RevolutionCut_1
 model.testNbResults(RevolutionCut_1, 1)
 model.testNbSubResults(RevolutionCut_1, [0])
@@ -384,7 +403,7 @@ RevolutionCut_2 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE",
 Sketch_5 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
 SketchLine_61 = Sketch_5.addLine(63.5, 10.5, 64, 10.5)
 SketchLine_61.setAuxiliary(True)
-SketchProjection_15 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/Edge-SketchLine_7"), False)
+SketchProjection_15 = Sketch_5.addProjection(model.selection("EDGE", "Sketch_1/SketchLine_7"), False)
 SketchLine_62 = SketchProjection_15.createdFeature()
 SketchConstraintCoincidence_58 = Sketch_5.setCoincident(SketchLine_61.startPoint(), SketchLine_62.result())
 SketchConstraintCoincidence_59 = Sketch_5.setCoincident(SketchAPI_Line(SketchLine_62).endPoint(), SketchLine_61.endPoint())
@@ -437,11 +456,6 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
 model.testResultsVolumes(Result, [14144.443128843522572424262762070])
 
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Plug/Modified_Face_27_1"), model.selection("FACE", "Plug/Modified_Face_26_1"), model.selection("FACE", "Plug/Modified_Face_28_1"), model.selection("FACE", "Plug/Modified_Face_32_1")])
-Group_1.result().setColor(68, 68, 68)
-# check Group_1
-model.checkGroup(Group_1, GeomAPI_Shape.FACE)
-
 model.do()
 
 # change parameters of the model
@@ -519,8 +533,6 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
 model.testResultsVolumes(Result, [23373.503259112552768783643841743])
 
-model.checkGroup(Group_1, GeomAPI_Shape.FACE)
-
 model.end()
 
 assert(model.checkPythonDump())
index 30c174ab240fe6f0dd557fa18ee16024ef5036bd..7b30baf66a7efc57d1f1667392431a31ba009b73 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from SketchAPI import *
 from GeomAPI import GeomAPI_Shape
@@ -114,7 +113,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [1080])
 model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [2160])
 model.testResultsVolumes(Extrusion_1, [10398.453966298400700907222926617])
 
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchCircle_3 = Sketch_2.addCircle(0, 0, 4.5)
 SketchLine_125 = Sketch_2.addLine(0, 0, -24.375, 0)
 SketchLine_125.setAuxiliary(True)
index a55623b166210e1a2318b96a8e7f7625b3fb2230..abbb444c768d57f7f04270c9e89d8ab52aa71518 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 from salome.shaper import model
 
@@ -187,7 +186,7 @@ SketchConstraintDistance_4 = Sketch_1.setDistance(SketchLine_10.startPoint(), Sk
 SketchConstraintDistance_5 = Sketch_1.setDistance(SketchLine_10.startPoint(), SketchLine_22.result(), 1, True)
 SketchConstraintRadius_4 = Sketch_1.setRadius(SketchArc_6.results()[1], 15)
 model.do()
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2r-SketchArc_1_2r-SketchLine_3r-SketchArc_2_2r-SketchArc_3_2f-SketchLine_8f-SketchLine_10f-SketchArc_5_2f-SketchLine_12f-SketchArc_6_2r-SketchLine_14r-SketchLine_16r-SketchArc_7_2r-SketchLine_17r-SketchLine_18r-SketchLine_20f-SketchArc_8_2f-SketchLine_23r-SketchArc_10_2f-SketchLine_24r")], model.selection("EDGE", "PartSet/OX"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_8f-SketchLine_10f-SketchLine_24r-SketchLine_23r-SketchArc_8_2f-SketchLine_19r-SketchLine_18r-SketchLine_17r-SketchArc_7_2r-SketchLine_16r-SketchArc_10_2f-SketchLine_12f-SketchArc_5_2f-SketchArc_6_2r-SketchLine_14r-SketchArc_3_2f-SketchArc_2_2r-SketchLine_3r-SketchArc_1_2r-SketchLine_2r")], model.selection("EDGE", "PartSet/OX"), 360, 0)
 Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
 SketchCircle_1 = Sketch_2.addCircle(0, 120, 7.5)
 SketchLine_24 = Sketch_2.addLine(model.selection("EDGE", "PartSet/OZ"))
index 8293599ab726ea91c7516211d0db9e4b4201b1f3..cd6f8ac1c5603172c6f7626e2e1043b4a71d2c59 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import filecmp
 import os
index 34de048117978d40e7f683dcfd6ca131a5beb809..9a36c2fe9d9207ffd4fed3ed8040bf1ad50f03ba 100644 (file)
@@ -1,24 +1,3 @@
-<!--
-Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-
-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<mailto:webmaster.salome@opencascade.com>
--->
-
 <!DOCTYPE document>
 <!--
 This file is automatically created by SALOME application.
diff --git a/test.squish/shared/testdata/exchange/xao b/test.squish/shared/testdata/exchange/xao
deleted file mode 120000 (symlink)
index 60fca1f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../../src/XAO/tests/data
\ No newline at end of file
index 1d9ee381dea907d496be34a0dd2b7b209212dc87..029e16d32ad0009ccd898f7cf3c1ff740d766b80 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #[tested functionality] 1. Add parameter 2. Use wrong parameter name 3. Error notification in header 3. Error notification in widget
 
index 961bef0f9de0d493d05e1491dd349c250ceb12a2..8c7f45baa232d8943307e2ece7bf8ec50ad0b72c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index cc2bcdcbede97dd4aa39f4b477db178cb67f7120..4aef4cdeade940b7e583da6527a68c8dda7cbcf1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 0804a6b51cfd7ef1b0fde529c4edd70c287c0289..37386d4fde6403dca0ba2782a356b8a00489b88e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 17346cc2187e9e684d7b34bca1eb04f0869949ea..245acc6bf5f6aedf84185a087cb23f5c0492e4e2 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 587031704c0794623a60eb9718cb845618b32cab..6ba29d9e1a11381fc0adb2801d5bbd9c61e2933f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] NewGEOM
index e0b69699dbb66e1a37f1396aeba6502d708b9fa2..2fbe48dec78892f1293cbe767ac1a03d695d2097 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] NewGEOM
index d0455d8e359274e31fbbcde11069c9760e6cc0d6..da8a6269d861ef693202fc9732336ea845152225 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 7f1baa8c64fad6e2c9d018ac32c4a7a2f44a8f8b..01b9eef3612027faabb5abd8eedb62d9a788d632 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 75ff0df5e9a94f017b16453a58592294202a871b..21f88bcdd9813a50a412d35a268885390d1297ff 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 9fef5adfe941cf8fa8dd28ff02934708e2811df3..1beed67de549e71a38136d40f8cb02ca196c0ce4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 4729a05dac87c36e127a87a411ab504a47c6c1e0..a13c51481fdab669f7b85b57b5f061f3e5a5f8a3 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 93d49269c0570d8593077807664f16bc9be9697c..c5fad6fdf5c304c104d5f893e887f5e670d78a9f 100644 (file)
@@ -1,24 +1,23 @@
 # -*- coding: utf-8 -*-
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # This file contains hook functions to run as the .feature file is executed.
 #
index 77b413af51da8fe868c67311c19cadf2a653ba3f..710a27287492da0209607b03d76104ec374bb7c3 100644 (file)
@@ -1,24 +1,23 @@
 # -*- coding: utf-8 -*-
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 # A quick introduction to implementing scripts for BDD tests:
 #
index ba07d1891bef8601e7b145927efca79378fce274..87a460d9781a0126f468efdb62f550255fefd722 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 source(findFile('scripts', 'python/bdd.py'))
 
index ba07d1891bef8601e7b145927efca79378fce274..87a460d9781a0126f468efdb62f550255fefd722 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 source(findFile('scripts', 'python/bdd.py'))
 
index 75005bacbf6384b8cfb2a5403ef88c7035eae2f1..191d6ac00adee79aa197a251018fdfb9aec13d19 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #[tested functionality] 1. Add parameter 2. Calculate parameter 3. Delete parameter
 
index 2474380d2dae7a71bd1b89058fccc9f75a5ee4a4..35d86635bfd35a918a7194ebd2fd3c99373d2145 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #[tested functionality] 1. Add parameter 2. Rename parameter
 
index 82cb19937646d26369b51fe36953d687cdb34e4b..5ea4af776567b6460584f1e6397054c6a5939577 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #[tested functionality] Add parameter
 #[tested functionality] Use wrong parameter name
index d31a2b95f33d8aeaddd6f5dec1a2be45b7559ae2..b79145ab0ecda944d7f91af2991a62c9804373c7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index cd6d3e33892ebbee621017b799df3528e49a50c4..b4a0cf47c086fc61ce6a7f5d22c8ec58bada8654 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 1b43c77042192c37866276d23a5ec7570ed5a774..42ae9f573dfce247435f76bbe6d821f96e22b1a0 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 3b2628eb83aa51e10a22156339b5f527841d8e66..b0f2b8aa9ed8b8ac875a85d0012f688b46c7a089 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 73ba75ba0e13f365d9261ca59f63c1ae1e25c4c4..3a2a12626804144f31314180c9ef97499bb0fcc1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index bb902f3a3f46defcf12f4299e90056ed689f41c9..9eaeb3714bebcfe7afe4193c22cfac6452a7569d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     # [project] SHAPER
index 5aa453e1e2fb6e4f62c0e6e23a163ee334d862a9..074f6237b29f77f6716bcbc545b361b0927b6b1c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     #[step] Click 'Create sketch' toolbar button
index cf50036a0ed3f858ebd3a03d60917a812c39831e..032328133400978bc79903074d9fc3278dd81d88 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     #[step] Click 'Create sketch' toolbar button
index 083116fa92eeb43c0927b5ffd01b74fb3d670018..ebc2df935a256d143f6047f4ad1455add62a348d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     circle_create_in_view((302, 221), (436, 287))
index 885ca35c879ab715b9246ac3e436279123dfe3d8..2ef6e5e58652d1b8db66ad4cb6c802f26257b7b4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import os
 
index b5fa003120b1a5e26c18a2ab48b4a9833a1466ff..250980e2960739075b449341356ac1c6435778e6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     #[step] Click 'Create sketch' toolbar button
index 9ff686153e3432215085f62ca7971a3338104849..f458022abdc8c87d93291fd6e85b78ef2da1cdcc 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 171059a936c8e1155288b813d5d7ae8623f20df0..2e3c11bbbfad8aca5f75ba360886de039f304f95 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 511aea4f9f6f6ebbb120fd92ca58e1383efb12af..2f016741d03d188eb095fc332f37395ba27c4bb1 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     #[step] Click 'Create sketch' toolbar button
index 06d33de89d90ccd3654241a4f12c8bb81023a49f..a38e280f9bd3da7f0df9b396d41582209822faea 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 8f94547b8397880631eb1b1df71e94ce24df9222..4996e4566c39a3a73f0598840ec8099c89f2458e 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 8e3aa1c59092a966d68114ddbcaf5ae754b6cbe9..204980a933ec5c378ca96bb64f9a2351d42ca182 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 283a4c2ccfa9cf2dd93661a7bc45f7e9181b1982..1c2d0623b5da0cb39933917f3f5bc4b9d8edf984 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index a71ab8d1ee6fd76eb3179471b5853b71858329ab..7d2874eeb6dcffc0e47c0ac660bed623859f26f4 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index ad7763e4d4a02260638246e98e841eeb679a7123..dccb5ac6f48723aace3d50a4bc93e0fd5a586c2d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index c97df84d19c0fb603e4434e7991fdb71196eecb2..07eea38eeb4005153c4df8f61644c96f0701675d 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index dc21b33a7d4986e85bc96c58f25b6a208f7ab8a0..640603f0f884ca71cfdaef4fc05c1be9ce852c2c 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 532ca61ca8fd7996887c82ea7ad8bc167daca51e..5609546bd61c893cd8a2c23dec993c1701cbe5de 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 20b4b11753b678f5bed7f015c1e3f1201b85bf02..56c8a18adf480be63db793d15142f6329a7d16e6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     #[project] SHAPER
index 82cfd06a759a3f3c869730400feab3bd82bbbfa2..b6b954d36d593a35c8c337599fd836e655097ba9 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch_circle():
     circle_create((0, 0), 300)
index d9418df10fa9990d17fe058a57781df64512a12a..2e0964a38a938a61a219efbb40b78e49b9e50f93 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 #[tested functionality]
 
index f57766521d67d324916d73dcdd57dbd1e9caa651..694e88e2f6d90f0d4d3e0e817f117a0141b9b83f 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def set_parameter_value(name, value):
     openContextMenu(waitForObject(":Parameters.%s = _QModelIndex" % name), 10, 10, 0)
index ee9e42b01011a3b6184b652cf8738c8d25d8dda4..44aabdf247adffd3555603aaf484135929f00b51 100644 (file)
@@ -1,3 +1,21 @@
+# Copyright (C) 2015-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 testSettings.logScreenshotOnError = True
 testSettings.logScreenshotOnFail = True
 
index ff25e14d88953d7a831f86a85d00b776b6812aff..2f45359a1fa3c4958a2e71736ebac436fd19ff12 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     clickButton(waitForObject(":Basic.Line_AppElements_Button"))
index 70ca2813f9515eaa6b077736deddd2d1ea459ebd..d4f3a40275c5ca71d42b11886d8b05a7dc017cdb 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import re
 
index a5b248ad33cd21f2f835255998649424e1b4f5ec..6ca2be59eeb24a8dabb645b726478b827d1312df 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     source(findFile("scripts", "common.py"))
index b8a626db7692573d0a4e98c4bba91d73ca76ab1f..17290cd46ff7be82f307fb8448894a7884142af7 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     line_create((0, 0), (100, 0))
index f33266213ab21aa3be8cd4ead1cda38a43bb27c4..bed4098089215cfe2a80379f4ef4473441a63ac6 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     line_create((244, 279), (226, 282))
index dd11d896286f9be5748a4756a670e023a31cafab..e28daab9134e55f37107bb6109c52d45239b0c33 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     #[step] Create lines [vp VP_SKETCH]
index 22bfc7a99fd1fe2146c5a164e6e68ce6f3b334e4..156b75d5105bad340cd6c451b55ead10008c5477 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     line_create((145, 205), (305, 118))
index c6c9c00924ba5d220c0ff6dd138fda5b1fe5a95b..262f2bd0787114f6dedee64fd11d15d0329b8405 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
     circle_center = (300, 400)
index 2939fe0027ab5ec4770c2511f9fef68581e88fa6..2ec9c559bdefa4ea16f2d4f6fba4370a3cefd650 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     source(findFile("scripts", "common.py"))
index 80654389972248bdb9b0361bfbea353521e9099d..471de8bf1b6c7bb9995324e4dfa81e483bf41474 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def sketch():
 
index 5d1bceeb852e60a2cf511a762ad0617887b0c27c..e8a24dd85487ffc20db4bd3803ca7e8ddc37af71 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 def main():
     source(findFile("scripts", "common.py"))
index 5e811fd40c9e91bfc9b5cc858ec088e0c20f6ad3..d8155ff702d5c46449a8f1ea5df9ce9f2be825ec 100644 (file)
--- a/utils.py
+++ b/utils.py
@@ -1,24 +1,23 @@
 # coding: utf-8
 
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# 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
+#
 
 import os, os.path