From bb7dc217165025db02ea2cd7d0b4b60d6583ea40 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sun, 10 Jan 2016 18:23:44 +0100 Subject: [PATCH] t_shape available in salome.geom Pythonpath, test as a function --- src/Tools/geom_plugins.py | 4 ++-- src/Tools/t_shape/CMakeLists.txt | 4 ++-- src/Tools/t_shape/t_shape_builder.py | 21 ++++++++++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Tools/geom_plugins.py b/src/Tools/geom_plugins.py index a1f6ab394..d9ed81f41 100644 --- a/src/Tools/geom_plugins.py +++ b/src/Tools/geom_plugins.py @@ -22,8 +22,8 @@ import salome_pluginsmanager def t_shape_fluid(context): - from t_shape import t_shape_builder - from t_shape import t_shape_dialog + from salome.geom.t_shape import t_shape_builder + from salome.geom.t_shape import t_shape_dialog import xalome from PyQt4.QtGui import QMessageBox activeStudy = context.study diff --git a/src/Tools/t_shape/CMakeLists.txt b/src/Tools/t_shape/CMakeLists.txt index 4701fc26d..98f580077 100644 --- a/src/Tools/t_shape/CMakeLists.txt +++ b/src/Tools/t_shape/CMakeLists.txt @@ -40,5 +40,5 @@ PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_GEOM_INSTALL_PLUGINS}/t_shape) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_GEOM_INSTALL_PLUGINS}/t_shape) \ No newline at end of file +SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom/t_shape) +SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom/t_shape) \ No newline at end of file diff --git a/src/Tools/t_shape/t_shape_builder.py b/src/Tools/t_shape/t_shape_builder.py index 7e9ab3e34..d4230cf23 100644 --- a/src/Tools/t_shape/t_shape_builder.py +++ b/src/Tools/t_shape/t_shape_builder.py @@ -327,16 +327,23 @@ def jonction(study, r1, r2, h1, h2, a1): return faci, sect45, arc1, l1, lord90, lord45, edges, arcextru -if __name__=="__main__": +def test_t_shape_builder(): """For testing purpose""" salome.salome_init() theStudy = salome.myStudy geompy = geomBuilder.New(theStudy) - for r1 in [1, 100, 10000]: - for r2 in [0.75*r1, 0.3*r1, 0.1*r1]: - for thickness in [(r1-r2)/10.0, (r1-r2) /2.0, 0.75*(r1-r2)]: - h1 = r1 * 1.5 + for r1 in [1., 100.]: + for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]: + for thickness in [r1/100., r1/10., r1/2.]: + print r1, r2, thickness + h1 = r1 * 2.0 h2 = h1 - res = build_shape(theStudy, r1, r2, h1, h2, thickness) - geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness)) + try: + res = build_shape(theStudy, r1, r2, h1, h2, thickness) + geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness)) + except: + print "problem with res_%f_%f_%f"%(r1,r2, thickness) +if __name__=="__main__": + """For testing purpose""" + test_t_shape_builder() -- 2.39.2