# -*- 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.
from Extensions.parametre import ITEM_PARAMETRE
from Formatage import Formatage
from generator_python import PythonGenerator
-from Editeur.widgets import showerror
+#from Editeur.widgets import showerror
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,
}
"BARRE", "CABLE", "CARA", "COQUE", "EPAIS",
"EXCENTREMENT", "GROUP_MA", "ORIENTATION",
"POUTRE", "SECTION", "VALE", "VARI_SECT",
- "GRILLE", "ANGL_REP",
+ "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"}
self.dict_suite_com={"RECTANGLE":"Rectangle","GENERALE":"Generale",
"CERCLE":"Cercle"}
- self.dict_traduit={"VARI_SECT":"extrusion","EXCENTREMENT":"Excentre","EPAIS":"Epais"}
+ self.dict_traduit={"VARI_SECT":"extrusion","EXCENTREMENT":"Excentre","EPAIS":"Epais","VECTEUR":"Vecteur"}
self.init_ligne()
self.commande = ""
self.dict_attributs = {}
- def gener(self,node):
+ def gener(self,node,config=None):
"""
"""
self.node=node
self.list_commandes=[];
self.generator(self.node.object)
+ #print self.list_commandes
return self.list_commandes
def generator(self,obj):
"""
"""
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)
def generMCSIMP(self,obj) :
"""
"""
- #print "MCSIMP : ", obj.nom
if obj.nom in dir(self) :
suite = self.__class__.__dict__[obj.nom](self,obj)
else :
clef=self.dict_traduit[obj.nom]
- self.dict_attributs[clef]=obj.val
+ # Traitement des parametres
+ try :
+ self.dict_attributs[clef]=obj.val.eval()
+ except :
+ self.dict_attributs[clef]=obj.val
+
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()
self.commande=self.dict_deb_com[obj.nom]
- print self.commande
for v in obj.mc_liste:
self.generator(v)
- #print self.commande
- #print self.dict_attributs
if self.boolGpMa == 1:
self.list_commandes.append((self.commande,self.dict_attributs))
else :
- showerror("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
+ #showerror("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
+ print ("Elements ne portant pas sur un Groupe de Maille","Salome ne sait pas montrer ce type d' element")
+ pass
def generMCList(self,obj):
"""
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__
self.dict_attributs["axeX"]=alpha
self.dict_attributs["axeY"]=beta
self.dict_attributs["axeZ"]=gamma
-