X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FYACS_geomesh0.py;h=acf0b0619640b9e3ea2e0cf19b1c8a55ac19052b;hb=70eb9c09d00f9c4b0e48d5aba70676e45e779f9c;hp=5847399348148e45db2057588cdf9e53fafeaaeb;hpb=5fb78e091383ef5194bf088e5b38ee95912bb3b8;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/YACS_geomesh0.py b/src/SMESH_SWIG/YACS_geomesh0.py index 584739934..acf0b0619 100644 --- a/src/SMESH_SWIG/YACS_geomesh0.py +++ b/src/SMESH_SWIG/YACS_geomesh0.py @@ -1,4 +1,22 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# 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 +# # test used in YACS, ForEachLoop @@ -82,8 +100,15 @@ def geomesh(l0, r0, h0, d0, d1, my_container, direc): #geompy.addToStudyInFather( barre, f1, 'f1' ) #geompy.addToStudyInFather( barre, f2, 'f2' ) + smesh.SetEnablePublish( False ) + isTetra = False barre_1 = smesh.Mesh(barre) + # SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(barre_1.GetMesh())) + # if SO: + # print ("_______",SO.GetID(),SO.GetName()) + # else: + # print ("_______NO_SO!!!") if (isTetra): NETGEN_1D_2D_3D = barre_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) NETGEN_3D_Parameters_1 = NETGEN_1D_2D_3D.Parameters() @@ -139,14 +164,15 @@ def geomesh(l0, r0, h0, d0, d1, my_container, direc): def clearMesh(theMesh, theStudy, aName): theMesh.Clear() aMesh = theMesh.GetMesh() - aStudyBuilder = theStudy.NewBuilder() - SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(aMesh)) - objects_to_unpublish = [SO] - refs = theStudy.FindDependances(SO) - objects_to_unpublish += refs - for o in objects_to_unpublish: - if o is not None: - aStudyBuilder.RemoveObjectWithChildren(o) + aMesh.UnRegister() + # aStudyBuilder = theStudy.NewBuilder() + # SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(aMesh)) + # objects_to_unpublish = [SO] + # refs = theStudy.FindDependances(SO) + # objects_to_unpublish += refs + # for o in objects_to_unpublish: + # if o is not None: + # aStudyBuilder.RemoveObjectWithChildren(o) print("clearMesh done:", aName) def genere(r0, h0, my_container, direc): @@ -164,4 +190,3 @@ def genere2(r0h0, my_container, direc): d1 = d0/2. res = geomesh(l0, r0, h0, d0, d1, my_container, direc) return res - \ No newline at end of file