<x>0</x>
<y>0</y>
<width>526</width>
- <height>252</height>
+ <height>398</height>
</rect>
</property>
<property name="caption">
</property>
<widget class="QLabel">
<property name="name">
- <cstring>TextLabel1</cstring>
+ <cstring>TextLabel1_2</cstring>
</property>
<property name="geometry">
<rect>
- <x>10</x>
- <y>190</y>
+ <x>20</x>
+ <y>10</y>
+ <width>120</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Géométrie traitée :</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>NomShape</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>140</x>
+ <y>10</y>
<width>191</width>
- <height>40</height>
+ <height>21</height>
</rect>
</property>
<property name="text">
- <string>Nom du nouveau maillage</string>
+ <string>TextLabel2</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>TextLabel2</cstring>
+ <cstring>TextLabel2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
- <y>70</y>
+ <y>50</y>
<width>181</width>
<height>31</height>
</rect>
</property>
<property name="text">
- <string>Maillage sélectionné</string>
+ <string>Shape selectionnée</string>
</property>
</widget>
<widget class="QListBox">
<property name="name">
- <cstring>Maillage</cstring>
+ <cstring>MainShape</cstring>
</property>
<property name="geometry">
<rect>
<x>210</x>
- <y>70</y>
+ <y>50</y>
<width>281</width>
<height>90</height>
</rect>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>TextLabel1_2</cstring>
+ <cstring>TextLabel2</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
- <y>10</y>
- <width>120</width>
- <height>20</height>
+ <y>160</y>
+ <width>181</width>
+ <height>31</height>
</rect>
</property>
<property name="text">
- <string>Géométrie traitée :</string>
+ <string>Maillage sélectionné</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>NomShape</cstring>
+ <cstring>TextLabel1</cstring>
</property>
<property name="geometry">
<rect>
- <x>140</x>
- <y>10</y>
+ <x>10</x>
+ <y>280</y>
<width>191</width>
- <height>21</height>
+ <height>40</height>
</rect>
</property>
<property name="text">
- <string>TextLabel2</string>
+ <string>Nom du nouveau maillage</string>
</property>
</widget>
<widget class="QLineEdit">
<property name="geometry">
<rect>
<x>210</x>
- <y>200</y>
+ <y>290</y>
<width>280</width>
<height>24</height>
</rect>
</property>
</widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>Maillage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>210</x>
+ <y>160</y>
+ <width>281</width>
+ <height>90</height>
+ </rect>
+ </property>
+ </widget>
</widget>
<connections>
<connection>
<receiver>ChoixMaillage</receiver>
<slot>NouveauMesh_returnPressed()</slot>
</connection>
+ <connection>
+ <sender>MainShape</sender>
+ <signal>clicked(QListBoxItem*)</signal>
+ <receiver>ChoixMaillage</receiver>
+ <slot>Geometrie_clicked(QListBoxItem*)</slot>
+ </connection>
</connections>
-<includes>
- <include location="local" impldecl="in implementation">ChoixMaillage.ui.h</include>
-</includes>
<slots>
+ <slot>Geometrie_clicked(QListBoxItem *)</slot>
<slot>Maillage_clicked( QListBoxItem * )</slot>
<slot>NouveauMesh_returnPressed()</slot>
</slots>
import notifqt
#import Tkinter
-#root=Tkinter.Tk()
#root.withdraw()
def g():
print "lastWindowClosed()"
+ import Tkinter
+ root=Tkinter.Tk()
root.destroy()
qt.QObject.connect(qt.qApp,qt.SIGNAL("lastWindowClosed()"),g)
code = "ASTER"
else :
boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
- code = "HOMARD"
+ code = "HOMARD"
eficasSalome.runEficas(ws,code,attr)
# Partie applicative
ChoixMaillage.ChoixMaillage.__init__(self,parent,name,modal,fl)
self._CL=CL
self._numero=monNum
- self.recupere_info()
+ self._GeomChoisie=None
- self.NomShape.setText(self._nomShape)
- for item in self._listeMesh:
- self.Maillage.insertItem(item)
+ self.NomShape.setText(self._CL.NomShape(self._numero))
+ self.recupere_mainId()
self.show()
- def recupere_info(self):
- self._nomShape = self._CL.NomShape(self._numero)
- self._listeMesh= self._CL.Possibles(self._numero)
+ def Geometrie_clicked(self,item):
+ self.Maillage.clear()
+ if item == None :
+ return
+ self._GeomChoisie=item.text()
+ self._listeMesh= self._CL.Possibles(self._numero,self._GeomChoisie)
+ for item in self._listeMesh:
+ self.Maillage.insertItem(item)
+
+ def recupere_mainId(self):
+ self._listeGeom= self._CL.MainShapes(self._numero)
+ self.MainShape.clear()
+ for item in self._listeGeom :
+ self.MainShape.insertItem(item)
def Maillage_clicked(self,item) :
+ if item == None :
+ return
self._CL.traiteMaillage(self._numero,item.text())
self._CL.traiteCL()
self.close()
def NouveauMesh_returnPressed(self):
- self._CL.traiteNewMaillage(self._numero,str(self.NouveauMesh.text()))
+ self._CL.traiteNewMaillage(self._numero,self._GeomChoisie,str(self.NouveauMesh.text()))
self._CL.traiteCL()
self.close()
# Modules Python
import Tkinter
+import sys
# Modules Eficas
#import import_code
from Editeur import splash
from Editeur import eficas
+from Editeur import session
def init(top,code="ASTER",fichier=None):
def contexte(self):
self.salome=MaRef
- print code
- moi=MyEficas(top,code=code,fichier=fichier)
+ if fichier != None :
+ options=session.parse(sys.argv+[fichier])
+ else :
+ options=session.parse(sys.argv)
+ moi=MyEficas(top,code=code)
moi.contexte()
import salome
import SALOMEDS
import SMESH
+import GEOM
import SalomePyQt
import MonChoixMaillage
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
self.GroupOp = geom.GetIGroupOperations(salome.myStudyId)
self.smesh=None
+ self.geomcompID=None
self._d = SalomePyQt.SalomePyQt().getDesktop()
- self.get_maillages()
self.correspondanceNomIOR = {}
+ self.correspondanceNomIORshape = {}
self.name="CL"
+ print "fin init"
def GetOrCreateCL(self,myShapeName):
if not (dict_CL.has_key(myShapeName)):
def traiteCL(self):
+ print "traiteCL"
+ self.get_geoms()
+ print "self.get_geoms"
+ self.get_maillages()
+ print "self.get_maillages"
# Récupere tous les Mesh
if len(dict_CL) > 0:
Choix=MonChoixMaillage.MonChoixMaillage(self,0,self._d)
anAttr = attrName._narrow(SALOMEDS.AttributeName)
Name = anAttr.Value()
#_CS_cbo: ajout de la determination de la dimension de la geometrie
- type = self.getShapeType(GEOMShape)
+ #type = self.getShapeType(GEOMShape)
+ type = SMESH.NODE
Mesh.CreateGroupFromGEOM(type,Name,GEOMShape)
del dict_CL[GEOMIor]
- def traiteNewMaillage(self,indiceIOR,NomMaillage):
- GEOMIor = dict_CL.keys()[indiceIOR]
- shape = salome.orb.string_to_object(GEOMIor)
+ def traiteNewMaillage(self,numero,indiceIOR,NomMaillage):
+ GEOMIor=dict_CL.keys()[numero]
+ GEOMShapeIor=self.correspondanceNomIORshape[str(indiceIOR)]
+ shape = salome.orb.string_to_object(GEOMShapeIor)
if self.smesh == None :
self.smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
self.smesh.SetCurrentStudy(salome.myStudy)
anAttr = attrName._narrow(SALOMEDS.AttributeName)
Name = anAttr.Value()
#_CS_cbo: ajout de la determination de la dimension de la geometrie
- type = self.getShapeType(GEOMShape)
+ #type = self.getShapeType(GEOMShape)
+ type = SMESH.NODE
newMesh.CreateGroupFromGEOM(type,Name,GEOMShape)
del dict_CL[GEOMIor]
# NodeorCell = 0 on traite des noeuds
# NodeorCell = 1 on traite des mailles
- def Possibles(self,numero):
- GEOMIor = dict_CL.keys()[numero]
+ def Possibles(self,numero,GeomChoisie):
+ GEOMIor=self.correspondanceNomIORshape[str(GeomChoisie)]
liste=[]
if GEOMIor in self.Liste_maillages.keys():
for MeshIor in self.Liste_maillages[GEOMIor]:
liste.append(Name)
return liste
+
+ def MainShapes(self,numero):
+ GEOMIor = dict_CL.keys()[numero]
+ listeNoms=[]
+ for MainID in self.Liste_geoms[GEOMIor]:
+ aSO = salome.myStudy.FindObjectID(MainID)
+ if aSO==None:
+ print "pb dans MainShapes"
+ return listeNoms
+ attrName = aSO.FindAttribute("AttributeName")[1]
+ anAttr = attrName._narrow(SALOMEDS.AttributeName)
+ Name = anAttr.Value()
+ listeNoms.append(Name)
+ IORAttr = aSO.FindAttribute("AttributeIOR")[1]
+ anAttr = IORAttr._narrow(SALOMEDS.AttributeIOR)
+ GEOMShapeIOR = anAttr.Value()
+ self.correspondanceNomIORshape[Name]=GEOMShapeIOR
+ return listeNoms
+
+
def getShapeType(self,GEOMShape):
"""
Determination du type de geometrie pour les conditions aux limites.
self.smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
self.smesh.SetCurrentStudy(salome.myStudy)
stringIOR=salome.orb.object_to_string(self.smesh)
+ print stringIOR
SO_smesh=salome.myStudy.FindObjectIOR(stringIOR)
if SO_smesh != None:
+ print salome.myStudy
ChildIterator = salome.myStudy.NewChildIterator(SO_smesh)
while ChildIterator.More() :
aSObj = ChildIterator.Value()
else :
self.Liste_maillages[GEOMShapeIOR]=[MeshIOR]
+ def get_geoms(self):
+ self.Liste_geoms={}
+ for GeomCLIOR in dict_CL.keys():
+ self.Liste_geoms[GeomCLIOR]=[]
+ self.chercheMain(GeomCLIOR,GeomCLIOR)
+
+ def chercheMain(self,GEOMIor,GeomCLIOR):
+ print "debut chercheMain pour "
+ print GEOMIor
+ print GeomCLIOR
+
+
+ sobj = salome.myStudy.FindObjectIOR(GEOMIor)
+ if sobj == None :
+ print "objet nul dans chercheMain"
+ return
+
+ # On cherche les dépendances et
+ # on ajoute l objet lui-même à la liste
+ Listedep=salome.myStudy.FindDependances(sobj)
+ Listedep.append(sobj)
+
+ ListeAtraiter=[]
+ for sobj in Listedep :
+ # tant que l objet est une reference
+ # on cherche son pere
+ current=sobj
+ boo,iorso = sobj.FindAttribute("AttributeIOR")
+ while ( boo==0 ) :
+ current=current.GetFather()
+ boo,iorso = current.FindAttribute("AttributeIOR")
+ iorString = iorso.Value()
+ shapeobj=salome.orb.string_to_object(iorString)
+ Shape=shapeobj._narrow(GEOM.GEOM_Object)
+ if Shape != None :
+ if self.geomcompID == None:
+ self.geomcompID = current.GetFatherComponent().GetID()
+ ListeAtraiter.append(current)
+
+ for sobj in ListeAtraiter:
+ current=sobj
+ while ( current.GetFather().GetID() != self.geomcompID):
+ current=current.GetFather()
+ MainID=current.GetID()
+ if (MainID not in self.Liste_geoms[GeomCLIOR]):
+ self.Liste_geoms[GeomCLIOR].append(MainID)
+ Attr = current.FindAttribute("AttributeIOR")[1]
+ if (Attr != None):
+ MainIORAttr = Attr._narrow(SALOMEDS.AttributeIOR)
+ MainIor = MainIORAttr.Value()
+ self.chercheMain(MainIor,GeomCLIOR)
+ print "fin chercheMain"
+
def SetName(self,Entry, Name):
SO = salome.myStudy.FindObjectID( Entry )
if SO != None :
# Author : Pascale NOYRET, EDF
# Project : SALOME
# Copyright : EDF 2003
-# $Header: /home/salome/PlateFormePAL/Bases_CVS_EDF/Modules_EDF/EFICAS_SRC/src/EFICASGUI/eficasEtude.py,v 1.1.1.1 2004/09/28 09:41:16 salome Exp $
+# $Header: /home/salome/PlateFormePAL/Bases_CVS_EDF/Modules_EDF/EFICAS_SRC/src/EFICASGUI/eficasEtude.py,v 1.2 2005/01/06 11:12:12 salome Exp $
#=============================================================================
import salome
self.liste_deja_la.append(fichier)
Nom=re.split("/",fichier)[-1]
+
self.commId=aGuiDS.createItemInStudy(self.fatherId,Nom)
- aGuiDS.setExternalFileAttribute(self.commId,"FICHIER_EFICAS_"+self.code+suf,fichier)
- salome.sg.updateObjBrowser(0)
+ if self.commId != None:
+ aGuiDS.setExternalFileAttribute(self.commId,"FICHIER_EFICAS_"+self.code+suf,fichier)
+ salome.sg.updateObjBrowser(0)
def creeConfigTxt(self,fichier,dico):
sauvegarde = asksaveasfilename(title="fichier config.txt",
def exit(ier):
print "appel de exit: ",ier
-sys.exit=exit
+#sys.exit=exit
# Fin remplacement
initialised=0