self.smesh=None
self._d = SalomePyQt.SalomePyQt().getDesktop()
self.get_maillages()
- self.listeDejaTraites= []
- self.Liste_Shape = {}
self.correspondanceNomIOR = {}
self.name="CL"
dict_CL[myShapeName] = CL()
return dict_CL[myShapeName]
- def chercheAtraiter(self):
- atraiter=-1
- curseur=0
- print dict_CL.keys()
- print self.listeDejaTraites
- while curseur < len(dict_CL):
- GEOMIor=self.Liste_Shape[curseur]
- if GEOMIor not in self.listeDejaTraites:
- atraiter=curseur
- break
- curseur=curseur+1
- return atraiter
def traiteCL(self):
# Récupere tous les Mesh
- if self.Liste_Shape == {}:
- self.Liste_Shape = dict_CL.keys()
- atraiter=self.chercheAtraiter()
- if atraiter >= 0:
- Choix=MonChoixMaillage.MonChoixMaillage(self,atraiter,self._d)
+ if len(dict_CL) > 0:
+ Choix=MonChoixMaillage.MonChoixMaillage(self,0,self._d)
salome.sg.updateObjBrowser(0)
def traiteMaillage(self,indiceIOR,NomMaillage):
MeshIOR = self.correspondanceNomIOR[str(NomMaillage)]
Mesh = salome.orb.string_to_object(MeshIOR)
- GEOMIor =self.Liste_Shape[indiceIOR]
+ GEOMIor = dict_CL.keys()[indiceIOR]
for monIOR in dict_CL[GEOMIor].CLOnNode.keys():
GEOMShape = salome.orb.string_to_object(monIOR)
aShapeSO = salome.myStudy.FindObjectIOR(monIOR)
anAttr = attrName._narrow(SALOMEDS.AttributeName)
Name = anAttr.Value()
Mesh.CreateGroupFromGEOM(SMESH.FACE,Name,GEOMShape)
- self.listeDejaTraites.append(GEOMIor)
+ del dict_CL[GEOMIor]
def traiteNewMaillage(self,indiceIOR,NomMaillage):
- GEOMIor =self.Liste_Shape[indiceIOR]
- print GEOMIor
- print dict_CL[GEOMIor].CLOnNode.keys()
- print dict_CL[GEOMIor].CLOnCell.keys()
+ GEOMIor = dict_CL.keys()[indiceIOR]
shape = salome.orb.string_to_object(GEOMIor)
if self.smesh == None :
self.smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
anAttr = attrName._narrow(SALOMEDS.AttributeName)
Name = anAttr.Value()
newMesh.CreateGroupFromGEOM(SMESH.FACE,Name,GEOMShape)
- self.listeDejaTraites.append(GEOMIor)
+ del dict_CL[GEOMIor]
def NomShape(self,numero):
- GEOMIor=self.Liste_Shape[numero]
+ GEOMIor = dict_CL.keys()[numero]
aShapeSO = salome.myStudy.FindObjectIOR(GEOMIor)
attrName = aShapeSO.FindAttribute("AttributeName")[1]
anAttr = attrName._narrow(SALOMEDS.AttributeName)
# NodeorCell = 1 on traite des mailles
def Possibles(self,numero):
- GEOMIor=self.Liste_Shape[numero]
+ GEOMIor = dict_CL.keys()[numero]
liste=[]
- for MeshIor in self.Liste_maillages[GEOMIor]:
+ if GEOMIor in self.Liste_maillages.keys():
+ for MeshIor in self.Liste_maillages[GEOMIor]:
aMeshSO = salome.myStudy.FindObjectIOR(MeshIor)
attrName = aMeshSO.FindAttribute("AttributeName")[1]
anAttr = attrName._narrow(SALOMEDS.AttributeName)
def SetIdAsCL(self,CLName,nodeOrCell):
if (nodeOrCell == 0) :
+ print "NOEUD"
if self.CLOnNode.has_key(CLName):
self.CLOnNode[CLName] = self.CLOnNode[CLName] + 1
else :
self.CLOnNode[CLName] = 1
if (nodeOrCell == 1) :
+ print "FFFFFACCE"
if self.CLOnCell.has_key(CLName):
self.CLOnCell[CLName] = self.CLOnCell[CLName] + 1
else :