X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fsmesh.py;h=dc22bc389d3ca1b078d48737e865a738ad4735e3;hb=bd5c3ea6d246657604eb3df7118f012158be90b4;hp=ea7c6d1312ad3c4cccdbd31ffa33b2ca28efd3b1;hpb=c87dcc36c2504ee743ce84618e66952673b96d90;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index ea7c6d131..dc22bc389 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -1,4 +1,6 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# Copyright (C) 2007-2008 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 # # This library is free software; you can redistribute it and/or @@ -15,478 +17,29 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # File : smesh.py # Author : Francis KLOSS, OCC # Module : SMESH - -""" - \namespace smesh +# +"""@package smesh \brief Module smesh """ import salome -import geompy -import StdMeshers -import SMESH +from salome import * -# Public variables -# ---------------- - -REGULAR = 1 -PYTHON = 2 - -NETGEN = 3 -GHS3D = 4 +import geompy +import smeshDC +from smeshDC import * smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -# Private functions -# ----------------- - -NO_NAME = "NoName" - -def GetName(obj): - ior = salome.orb.object_to_string(obj) - sobj = salome.myStudy.FindObjectIOR(ior) - if sobj is None: - return NO_NAME - else: - attr = sobj.FindAttribute("AttributeName")[1] - return attr.Value() - -def SetName(obj, name): - ior = salome.orb.object_to_string(obj) - sobj = salome.myStudy.FindObjectIOR(ior) - attr = sobj.FindAttribute("AttributeName")[1] - attr.SetValue(name) - -# Algorithms and hypothesis -# ========================= - -# Private class: Mesh_Algorithm -# ----------------------------- - -class Mesh_Algorithm: - """ - Mother class to define algorithm, recommended to don't use directly - """ - - mesh = 0 - geom = 0 - subm = 0 - - def GetSubMesh(self): - """ - If the algorithm is global, return 0 - else return the submesh associated to this algorithm - """ - return self.subm - - def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"): - """ - Private method - """ - self.mesh = mesh - piece = mesh.geom - if geom==0: - self.geom = piece - name = GetName(piece) - else: - self.geom = geom - name = GetName(geom) - if name==NO_NAME: - name = geompy.SubShapeName(geom, piece) - geompy.addToStudyInFather(piece, geom, name) - self.subm = mesh.mesh.GetSubMesh(geom, hypo) - - algo = smesh.CreateHypothesis(hypo, so) - SetName(algo, name + "/" + hypo) - mesh.mesh.AddHypothesis(self.geom, algo) - - def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"): - """ - Private method - """ - hypo = smesh.CreateHypothesis(hyp, so) - a = "" - s = "=" - i = 0 - n = len(args) - while i