]> SALOME platform Git repositories - tools/eficas.git/blobdiff - generator/generator_vers3DSalome.py
Salome HOME
onItem=Deplie
[tools/eficas.git] / generator / generator_vers3DSalome.py
index 59496b1523ce877bd82cfbb991c9fec1f9a3ede1..dc5931cbb2b5226d5015e3cbfe07c9d2af3560ee 100644 (file)
@@ -1,23 +1,22 @@
 # -*- coding: utf-8 -*-
-#            CONFIGURATION MANAGEMENT OF EDF VERSION
-# ======================================================================
-# COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
-# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
-# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
-# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
-# (AT YOUR OPTION) ANY LATER VERSION.
+# Copyright (C) 2007-2013   EDF R&D
 #
-# THIS PROGRAM 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
-# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+# 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.
 #
-# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
-# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
-#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+# 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
 #
-# ======================================================================
 """
     Ce module contient le plugin generateur de fichier au format 
     python pour EFICAS.
@@ -39,14 +38,14 @@ from generator_python import PythonGenerator
 
 def entryPoint():
    """
-       Retourne les informations nécessaires pour le chargeur de plugins
+       Retourne les informations nécessaires pour le chargeur de plugins
 
-       Ces informations sont retournées dans un dictionnaire
+       Ces informations sont retournées dans un dictionnaire
    """
    return {
         # Le nom du plugin
           'name' : 'vers3DSalome',
-        # La factory pour créer une instance du plugin
+        # La factory pour créer une instance du plugin
           'factory' : vers3DSalomeGenerator,
           }
 
@@ -69,7 +68,7 @@ class vers3DSalomeGenerator(PythonGenerator):
                             "POUTRE", "SECTION", "VALE", "VARI_SECT",
                             "GRILLE", "ANGL_REP", "VECTEUR",
                              "b_constant", "b_homothetique", 
-                            "b_rectangle", "b_affine", "b_cercle" )
+                            "b_rectangle", "b_affine", "b_cercle", "b_generale" )
       self.dict_deb_com={"POUTRE":"VisuPoutre", "CABLE" : "VisuCable",
                          "COQUE" : "VisuCoque", "GRILLE" : "VisuGrille",
                          "ORIENTATION" : "Orientation", "BARRE" : "VisuBarre"}
@@ -120,7 +119,16 @@ class vers3DSalomeGenerator(PythonGenerator):
       """
       """
       if obj.isvalid() == 0 :
-         #showerror("Element non valide","Salome ne sait pas traiter les élements non valides")
+         #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
+         return
+      for v in obj.mc_liste:
+         liste=self.generator(v)
+
+   def generMACRO_ETAPE(self,obj):
+      """
+      """
+      if obj.isvalid() == 0 :
+         #showerror("Element non valide","Salome ne sait pas traiter les elements non valides")
          return
       for v in obj.mc_liste:
          liste=self.generator(v)
@@ -142,7 +150,7 @@ class vers3DSalomeGenerator(PythonGenerator):
 
    def generMCFACT(self,obj):
       """
-          Convertit un objet MCFACT en une liste de chaines de caractères à la
+          Convertit un objet MCFACT en une liste de chaines de caractères à la
           syntaxe python
       """
       self.init_ligne()
@@ -193,6 +201,8 @@ class vers3DSalomeGenerator(PythonGenerator):
        for k in range(len(atraiter)) :
            clef=self.clefs[k]
            val =atraiter[k] 
+           if isinstance(val, (types.TupleType, types.ListType)) and len(val) == 1:
+               val = val[0]
            if isinstance (val, Extensions.parametre.PARAMETRE):
               val=val.valeur
               print val.__class__