X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2Fsmesh.py;h=251e7d36b08e63ad08399940f35d73fcff55228c;hp=36f34541af5506808c9b2f6e4673f0574bfd31e5;hb=30310d58ad574246b7a220002e3b6758e47e340c;hpb=22496e8ddca45c3f0307628bf2c6661c212d11fd diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index 36f34541a..251e7d36b 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -1,4 +1,8 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +#! /usr/bin/python +# -*- coding: iso-8859-1 -*- +# 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,448 +19,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 - -# Public variables -# ---------------- +from salome import * -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 -# ----------------- - -def GetName(obj): - ior = salome.orb.object_to_string(obj) - sobj = salome.myStudy.FindObjectIOR(ior) - 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 = 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