From: GERALD NICOLAS Date: Thu, 17 Jun 2021 13:43:39 +0000 (+0200) Subject: piping -> pipeNetwork X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a32204a3fcbdc6a781f6496173aeddfaa23c5cb;p=modules%2Fshaper.git piping -> pipeNetwork --- diff --git a/src/PythonAddons/Test/TestpipeNetwork.py b/src/PythonAddons/Test/TestpipeNetwork.py new file mode 100755 index 000000000..ec796f8f6 --- /dev/null +++ b/src/PythonAddons/Test/TestpipeNetwork.py @@ -0,0 +1,47 @@ +# Copyright (C) 2014-2021 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 +from ModelAPI import * + +import os + +aSession = ModelAPI_Session.get() + +def getFilePath(fileName): + path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "pipeNetwork") + return os.path.join(path, fileName) + +theFile = getFilePath("pipeNetwork.txt") + +aSession.startOperation("Create part for import") +aPartFeature = aSession.moduleDocument().addFeature("Part") +aSession.finishOperation() +aPart = aSession.activeDocument() + +aSession.startOperation("Import file") +aFeatureKind = "pipeNetwork" +anImportFeature = aPart.addFeature(aFeatureKind) +aFieldName = "file_path" +aFile = anImportFeature.string(aFieldName) +aFile.setValue(theFile) +aSession.finishOperation() + +assert(model.checkPythonDump()) diff --git a/src/PythonAddons/Test/Testpiping.py b/src/PythonAddons/Test/Testpiping.py deleted file mode 100755 index ec796f8f6..000000000 --- a/src/PythonAddons/Test/Testpiping.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2014-2021 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# 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 -from ModelAPI import * - -import os - -aSession = ModelAPI_Session.get() - -def getFilePath(fileName): - path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "pipeNetwork") - return os.path.join(path, fileName) - -theFile = getFilePath("pipeNetwork.txt") - -aSession.startOperation("Create part for import") -aPartFeature = aSession.moduleDocument().addFeature("Part") -aSession.finishOperation() -aPart = aSession.activeDocument() - -aSession.startOperation("Import file") -aFeatureKind = "pipeNetwork" -anImportFeature = aPart.addFeature(aFeatureKind) -aFieldName = "file_path" -aFile = anImportFeature.string(aFieldName) -aFile.setValue(theFile) -aSession.finishOperation() - -assert(model.checkPythonDump()) diff --git a/src/PythonAddons/doc/pipeNetworkFeature.rst b/src/PythonAddons/doc/pipeNetworkFeature.rst new file mode 100644 index 000000000..262cc3f2c --- /dev/null +++ b/src/PythonAddons/doc/pipeNetworkFeature.rst @@ -0,0 +1,37 @@ +.. _pipeNetwork: +.. |compoundVertices.icon| image:: images/compound.png + +Piping +====== + +Compound Vertices is a feature and can be edited after execution. +It allows creation of several points basing on XYZ coords file. + +.. warning:: + Please note that it is better to limit yourself to create a maximum of 100 points. + +These set of points will be grouped in a compound and can be used for others features. + +To add a new set of points: + +#. select in the Main Menu *Macros - > Points set* item or +#. click |compoundVertices.icon| **Points set** button in Macros toolbar: + +The following property panel appears: + +.. figure:: images/compoundVerticesPanel.png + :align: center + + set of Points + +Select your points file and define a separator if it's different that " " in your points file + +Result +"""""" + +A resulting compound will contain the points + +.. figure:: images/compoundVertices.png + :align: center + + Points diff --git a/src/PythonAddons/doc/pipingFeature.rst b/src/PythonAddons/doc/pipingFeature.rst deleted file mode 100644 index 262cc3f2c..000000000 --- a/src/PythonAddons/doc/pipingFeature.rst +++ /dev/null @@ -1,37 +0,0 @@ -.. _pipeNetwork: -.. |compoundVertices.icon| image:: images/compound.png - -Piping -====== - -Compound Vertices is a feature and can be edited after execution. -It allows creation of several points basing on XYZ coords file. - -.. warning:: - Please note that it is better to limit yourself to create a maximum of 100 points. - -These set of points will be grouped in a compound and can be used for others features. - -To add a new set of points: - -#. select in the Main Menu *Macros - > Points set* item or -#. click |compoundVertices.icon| **Points set** button in Macros toolbar: - -The following property panel appears: - -.. figure:: images/compoundVerticesPanel.png - :align: center - - set of Points - -Select your points file and define a separator if it's different that " " in your points file - -Result -"""""" - -A resulting compound will contain the points - -.. figure:: images/compoundVertices.png - :align: center - - Points diff --git a/src/PythonAddons/macros/pipeNetwork/icons/pipeNetwork.png b/src/PythonAddons/macros/pipeNetwork/icons/pipeNetwork.png new file mode 100644 index 000000000..7b265be40 Binary files /dev/null and b/src/PythonAddons/macros/pipeNetwork/icons/pipeNetwork.png differ diff --git a/src/PythonAddons/macros/pipeNetwork/icons/piping.png b/src/PythonAddons/macros/pipeNetwork/icons/piping.png deleted file mode 100644 index 7b265be40..000000000 Binary files a/src/PythonAddons/macros/pipeNetwork/icons/piping.png and /dev/null differ diff --git a/src/PythonAddons/macros/pipeNetwork/pipeNetwork.txt b/src/PythonAddons/macros/pipeNetwork/pipeNetwork.txt new file mode 100644 index 000000000..b569485a2 --- /dev/null +++ b/src/PythonAddons/macros/pipeNetwork/pipeNetwork.txt @@ -0,0 +1,10 @@ +21 16 224.00000000000003 1 +33 21 224.00000000000003 1 +35 0 224.00000000000003 1.1 +40 43 224.00000000000003 1 +53 43 224.00000000000003 1.2 +69 29 224.00000000000003 1 +97 58 224.00000000000003 1 +64 100 224.00000000000003 1.2 +100 127 224.00000000000003 1 +88 115 224.00000000000003 1.2 diff --git a/src/PythonAddons/macros/pipeNetwork/piping.txt b/src/PythonAddons/macros/pipeNetwork/piping.txt deleted file mode 100644 index b569485a2..000000000 --- a/src/PythonAddons/macros/pipeNetwork/piping.txt +++ /dev/null @@ -1,10 +0,0 @@ -21 16 224.00000000000003 1 -33 21 224.00000000000003 1 -35 0 224.00000000000003 1.1 -40 43 224.00000000000003 1 -53 43 224.00000000000003 1.2 -69 29 224.00000000000003 1 -97 58 224.00000000000003 1 -64 100 224.00000000000003 1.2 -100 127 224.00000000000003 1 -88 115 224.00000000000003 1.2