From 0890e4ddcd7f2e5ca3ab85fab458ed937254d1d1 Mon Sep 17 00:00:00 2001 From: salome <> Date: Thu, 3 Feb 2005 08:50:19 +0000 Subject: [PATCH] =?utf8?q?PN.=20version=20interm=C3=A9diaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/EFICASGUI/eficasCL.py | 41 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/EFICASGUI/eficasCL.py b/src/EFICASGUI/eficasCL.py index dfe51325..8442bd90 100644 --- a/src/EFICASGUI/eficasCL.py +++ b/src/EFICASGUI/eficasCL.py @@ -12,8 +12,6 @@ class CLinit: self.smesh=None self._d = SalomePyQt.SalomePyQt().getDesktop() self.get_maillages() - self.listeDejaTraites= [] - self.Liste_Shape = {} self.correspondanceNomIOR = {} self.name="CL" @@ -22,32 +20,17 @@ class CLinit: 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) @@ -62,14 +45,11 @@ class CLinit: 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") @@ -91,10 +71,10 @@ class CLinit: 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) @@ -105,9 +85,10 @@ class CLinit: # 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) @@ -167,11 +148,13 @@ class CL: 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 : -- 2.39.2