INSTALL(DIRECTORY macros/rectangle/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons)
INSTALL(DIRECTORY macros/compoundVertices/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons)
INSTALL(DIRECTORY macros/importParameters/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons)
-INSTALL(DIRECTORY macros/piping/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons)
+INSTALL(DIRECTORY macros/pipeNetwork/icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Addons)
INSTALL(FILES ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
INCLUDE(UnitTest)
if(${HAVE_SALOME})
enable_testing()
set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/PythonAddons")
-
+
install(FILES CTestTestfileInstall.cmake
DESTINATION ${TEST_INSTALL_DIRECTORY}
RENAME CTestTestfile.cmake)
install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
-
+
set(TMP_TESTS_NAMES)
foreach(tfile ${TEST_NAMES})
list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
endforeach(tfile ${TEST_NAMES})
-
+
install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
endif(${HAVE_SALOME})
aSession = ModelAPI_Session.get()
def getFilePath(fileName):
- path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "piping")
+ path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "pipeNetwork")
return os.path.join(path, fileName)
-theFile = getFilePath("piping.txt")
+theFile = getFilePath("pipeNetwork.txt")
aSession.startOperation("Create part for import")
aPartFeature = aSession.moduleDocument().addFeature("Part")
aPart = aSession.activeDocument()
aSession.startOperation("Import file")
-aFeatureKind = "piping"
+aFeatureKind = "pipeNetwork"
anImportFeature = aPart.addFeature(aFeatureKind)
aFieldName = "file_path"
aFile = anImportFeature.string(aFieldName)
from macros.rectangle.feature import SketchPlugin_Rectangle
from macros.compoundVertices.feature import compoundVertices
from macros.importParameters.feature import importParameters
-from macros.piping.feature import piping
+from macros.pipeNetwork.feature import pipeNetwork
class PythonFeaturesPlugin(ModelAPI.ModelAPI_Plugin):
aFeature = compoundVertices().__disown__()
elif theFeatureID == importParameters.ID():
aFeature = importParameters().__disown__()
- elif theFeatureID == piping.ID():
- aFeature = piping().__disown__()
+ elif theFeatureID == pipeNetwork.ID():
+ aFeature = pipeNetwork().__disown__()
else:
raise Exception("No such feature %s" % theFeatureID)
<source path="@ADDONS_FOLDER_PATH@/macros/rectangle/widget.xml"/>
<source path="@ADDONS_FOLDER_PATH@/macros/compoundVertices/widget.xml"/>
<source path="@ADDONS_FOLDER_PATH@/macros/importParameters/widget.xml"/>
- <source path="@ADDONS_FOLDER_PATH@/macros/piping/widget.xml"/>
+ <source path="@ADDONS_FOLDER_PATH@/macros/pipeNetwork/widget.xml"/>
</plugin>
- widget.xml with a description of the property panel,
- __init__.py,
-- feature.py with python commands,
+- feature.py with python commands,
- icon.png with image of button in the toolbar (the file is located at sub-folder /icons).
Some examples of already created custom features are:
rectangleFeature.rst
compoundVerticesFeature.rst
importParametersFeature.rst
- pipingFeature.rst
+ pipeNetworkFeature.rst
-.. _piping:
+.. _pipeNetwork:
.. |compoundVertices.icon| image:: images/compound.png
Piping
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-"""piping Feature
+"""pipeNetwork Feature
Author: Nathalie Gore
"""
import ParametersAPI
from GeomAPI import *
-class piping(model.Feature):
+class pipeNetwork(model.Feature):
"""Import of Construction points
"""
lfeatures = list()
@staticmethod
def ID():
"""Return Id of the Feature."""
- return "piping"
+ return "pipeNetwork"
@staticmethod
def FILE_ID():
def getKind(self):
"""Override Feature.getKind()"""
- return piping.ID()
+ return pipeNetwork.ID()
# Initialization of the dialog panel
from os.path import basename
filename = basename(filepath)
- nameRes = "piping_" + filename
+ nameRes = "pipeNetwork_" + filename
# Creating the construction points in the current document
lFeatures = []
self.infoPoints[id_noeud]["plane"] = plane.result()
- # Création des paths pour le piping
+ # Création des paths pour le pipeNetwork
print("========================= Création des paths =========================")
for key, value in self.connectivities.items():
print("================================================================================= key = ", key, value['chainage'], value['fillet'])
copy = model.addCopy(part, [model.selection(copy.defaultResult())], 1); copy.execute(True); self.lfeatures.append(copy)
- # Création des sketchs pour le piping
+ # Création des sketchs pour le pipeNetwork
print("========================= Création des sketchs =========================")
for key, value in self.connectivities.items():
print("================================================================================= key = ", key)
"""Override Feature.initAttributes().
F.isMacro() -> True
- piping feature is macro: removes itself on the creation transaction
+ pipeNetwork feature is macro: removes itself on the creation transaction
finish.
"""
return False
<workbench id="Macros" document="Part">
<group id="Samples">
<feature
- id="piping"
+ id="pipeNetwork"
title="Piping"
tooltip="Import a set of pipes"
- icon="icons/Addons/piping.png"
- helpfile="pipingFeature.html">
+ icon="icons/Addons/pipeNetwork.png"
+ helpfile="pipeNetworkFeature.html">
<file_selector id="file_path" title="Import txt file (pipe)" path="">
</file_selector>
<boolvalue id="blocking" label="for hexa meshes" default="false" tooltip="To partition CAD for hexa meshes" obligatory="0"/>
TestRectangleCentered.py
TestcompoundVertices.py
TestimportParameters.py
- Testpiping.py
+ TestpipeNetwork.py
)